Jpp  18.2.1-ARCA-DF-PATCH
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
examples/JReconstruction/compare-detector.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 
3 if [ -z $JPP_DIR ]; then
4  echo "Variable JPP_DIR undefined."
5  exit
6 fi
7 
8 source $JPP_DIR/setenv.sh $JPP_DIR
9 
10 zmodload zsh/mathfunc
11 
14 set_variable: PRECISION RECONSTRUCTION_PRECISION 1.0
15 set_variable: FORMAT GRAPHICS_FORMAT gif
16 set_variable+ BATCH GRAPHICS_BATCH -B
17 
18 if do_usage $*; then
19  usage "$script <detector file> <detector file>"
20 fi
21 
22 if (( $# != 2 )); then
23  fatal "Wrong number of arguments."
24 fi
25 
27 
28 JConvertDetectorFormat \
29  -a $DETECTOR[2] \
30  -o $WORKDIR/detector.datx
31 
32 # correct global time offset
33 
34 let "T = 0.0"
35 
36 for (( i = 0; $i != 2; ++i )); do
37 
38  JCompareDetector \
39  -a $DETECTOR[1] \
40  -b $WORKDIR/detector.datx \
41  -o $WORKDIR/compare.root \
42  -d0 >& /dev/null
43 
44  JPrintResult -f $WORKDIR/compare.root:T2 -F "GetMinimum" | read ZMIN
45  JPrintResult -f $WORKDIR/compare.root:T2 -F "GetMaximum" | read ZMAX
46 
47  let "Z = 0.5 * ($ZMIN + $ZMAX)"
48  let "T += $Z"
49 
50  JEditDetector \
51  -a $WORKDIR/detector.datx \
52  -o $WORKDIR/detector.datx \
53  -s "-1 add $Z" \
54  -d 0 >& /dev/null
55 done
56 
57 printf "Correct global time offset %9.6f [ns].\n" $T
58 printf "Test with precision %9.6f [ns].\n" $PRECISION
59 
60 JCompareDetector \
61  -a $DETECTOR[1] \
62  -b $WORKDIR/detector.datx \
63  -o $WORKDIR/compare.root \
64  -p "tcal = $PRECISION" \
65  -d1
66 
67 JPlot2D \
68  -w 1200x600 \
69  -f $WORKDIR/compare.root:T2 \
70  -\> "string" \
71  -\< "floor" \
72  -O COLZ \
73  -T "#Deltat [ns]" \
74  -o detector.$FORMAT $BATCH
data_type w[N+1][M+1]
Definition: JPolint.hh:867
then usage $script< detector identifier >< startdate\"YYYY-MM-DDHH:MM:SS\"><finaldate\"YYYY-MM-DDHH:MM:SS\"><QA/QCfile> fi case set_variable QAQC_TXT $argv[4]
Definition: JDataMonitor.sh:24
std::istream & read(std::istream &in, JTestSummary &summary, const char delimiter= ' ')
Read test summary.
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
usr share Modules init zsh export TMPDIR
exit
Definition: JPizza.sh:36
then
Definition: datalogs.sh:31
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable
Definition: JAcoustics.sh:21
then JCalibrateToT a
Definition: JTuneHV.sh:113
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR &dev null set_variable DEBUG set_variable WORKDIR
Definition: JLegolas.sh:20
then awk F
* usage
fi set_variable FILENAME $WORKDIR
Definition: datalogs.sh:34
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then set_variable MODULE getModule a $DETECTOR L $STRING $FLOOR JEditDetector a $DETECTOR M $MODULE add $X o $DETECTOR else echo No update of detector $DETECTOR
do echo n Creating graphics for string $STRING for((FLOOR=$FIRST_FLOOR;$FLOOR<=$LAST_FLOOR;FLOOR+=1))
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
then echo
Definition: JQAQC.sh:90
static JNullStream null
Null I/O stream.
Definition: JNullStream.hh:51
esac done
Definition: JAddHDE.sh:21
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62
do alias $i