Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JARCAMuonReconstruction.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author bofearraigh
4 #
5 script=${0##*/}
6 
7 # ------------------------------------------------------------------------------------------
8 #
9 # Script to run the JPP Track Reconstruction Chain for ARCA.
10 #
11 # ------------------------------------------------------------------------------------------
12 
13 if [ -z $JPP_DIR ]; then
14  echo "Variable JPP_DIR undefined."
15  exit
16 fi
17 
18 source $JPP_DIR/setenv.sh $JPP_DIR
19 source $JPP_DIR/externals/km3net-dataformat/definitions/reconstruction.sh
20 
21 set_variable: DEBUG RECONSTRUCTION_DEBUG 1
22 set_variable: PDF RECONSTRUCTION_PDF $JPP_DATA/J%p.dat
23 set_variable: SUFFIX RECONSTRUCTION_SUFFIX jmuon
24 set_variable: ENERGY_CORRECTION RECONSTRUCTION_ENERGY_CORRECTION energy_correction_arca.txt
25 set_variable: NUMBER_OF_EVENTS RECONSTRUCTION_NUMBER_OF_EVENTS $((2**31))
26 set_variable+ OVERWRITE RECONSTRUCTION_OVERWRITE 1
27 set_variable: TMAX_S RECONSTRUCTION_TMAX_S 100
28 
29 if do_usage $*; then
30  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
31 fi
32 
33 if (( $# < 4 )); then
34  fatal "Wrong number of arguments."
35 fi
36 
41 set_array CALIBRATION $argv[5,-1]
42 
43 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
44  fatal "The output file must have the wildcard % in the name, e.g. %.root"
45 fi
46 
47 typeset -A PARAMETERS
48 typeset -a APPLICATIONS
49 
51 
52 
53 if [[ "$OVERWRITE" == 1 ]]; then
54  rm -vf \
55  ${OUTPUT_FILE/\%/jprefit} \
56  ${OUTPUT_FILE/\%/jsimplex} \
57  ${OUTPUT_FILE/\%/jgandalf} \
58  ${OUTPUT_FILE/\%/jstart} \
59  ${OUTPUT_FILE/\%/jenergy} \
60  ${OUTPUT_FILE/\%/jhistory} \
61  ${OUTPUT_FILE/\%/${SUFFIX}} \
62  ${OUTPUT_FILE/\%/${SUFFIX}.aanet}
63 fi
64 
65 
66 # ------------------------------------------------------------------------------------------
67 # JMuonPrefit
68 # ------------------------------------------------------------------------------------------
69 
70 PARAMETERS=(
71  sigma_ns 5
72  gridAngle_deg 1
73  useL0 0
74  numberOfOutliers 3
75  numberOfPrefits 50
76  DZMax 0.0
77  numberOfDZMax 1
78  TMaxLocal_ns 18
79  ctMin 0.0
80  roadWidth_m 200.0)
81 
83 
84 eval JMuonPrefit \
85  -a $DETECTOR \
86  -+${^CALIBRATION} \
87  -T $TMAX_S \
88  -f $INPUT_FILE \
89  -o ${OUTPUT_FILE/\%/jprefit} \
90  -n ${NUMBER_OF_EVENTS} \
91  -@ `make_equation PARAMETERS` \
92  -d $DEBUG --!
93 
94 CHECK_EXIT_CODE
95 
96 APPLICATIONS+=$JMUONPREFIT
97 
98 timer_stop
99 timer_print
100 
101 
102 # ------------------------------------------------------------------------------------------
103 # JMuonSimplex
104 # ------------------------------------------------------------------------------------------
105 
106 PARAMETERS=(
107  sigma_ns 3
108  TMaxLocal_ns 15.0
109  ctMin 0.0
110  roadWidth_m 200.0
111  numberOfPrefits 0)
112 
114 
115 eval JMuonSimplex \
116  -a $DETECTOR \
117  -+${^CALIBRATION} \
118  -T $TMAX_S \
119  -f ${OUTPUT_FILE/\%/jprefit} \
120  -o ${OUTPUT_FILE/\%/jsimplex} \
121  -@ `make_equation PARAMETERS` \
122  -d ${DEBUG} --!
123 
124 CHECK_EXIT_CODE
125 
126 rm -vf ${OUTPUT_FILE/\%/jprefit}
127 
128 APPLICATIONS+=$JMUONSIMPLEX
129 
130 timer_stop
131 timer_print
132 
133 
134 # ------------------------------------------------------------------------------------------
135 # JMuonGandalf
136 # ------------------------------------------------------------------------------------------
137 
138 PARAMETERS=(
139  TTS_ns 2
140  E_GeV 1.0e3
141  TMin_ns -50.0
142  TMax_ns +450.0
143  R_Hz 6.0e3
144  roadWidth_m 175.0
145  numberOfPrefits 0)
146 
148 
149 eval JMuonGandalf \
150  -a $DETECTOR \
151  -+${^CALIBRATION} \
152  -T $TMAX_S \
153  -f ${OUTPUT_FILE/\%/jsimplex} \
154  -o ${OUTPUT_FILE/\%/jgandalf} \
155  -P $PDF \
156  -@ `make_equation PARAMETERS` \
157  -d $DEBUG --!
158 
159 CHECK_EXIT_CODE
160 
161 rm -vf ${OUTPUT_FILE/\%/jsimplex}
162 
163 APPLICATIONS+=$JMUONGANDALF
164 
165 timer_stop
166 timer_print
167 
168 
169 # ------------------------------------------------------------------------------------------
170 # JMuonStart
171 # ------------------------------------------------------------------------------------------
172 
173 PARAMETERS=(
174  roadWidth_m 160.0
175  R_Hz 6.0e3
176  TMin_ns -25.0
177  TMax_ns +75.0
178  Pmin1 1.0e-3
179  Pmin2 1.0e-2
180  numberOfPrefits 1)
181 
183 
184 eval JMuonStart \
185  -a $DETECTOR \
186  -+${^CALIBRATION} \
187  -T $TMAX_S \
188  -f ${OUTPUT_FILE/\%/jgandalf} \
189  -o ${OUTPUT_FILE/\%/jstart} \
190  -P $PDF \
191  -@ `make_equation PARAMETERS` \
192  -d $DEBUG --!
193 
194 CHECK_EXIT_CODE
195 
196 rm -vf ${OUTPUT_FILE/\%/jgandalf}
197 
198 APPLICATIONS+=$JMUONSTART
199 
200 timer_stop
201 timer_print
202 
203 
204 # ------------------------------------------------------------------------------------------
205 # JMuonEnergy
206 # ------------------------------------------------------------------------------------------
207 
208 PARAMETERS=(
209  roadWidth_m 200.0
210  R_Hz 6.0e3
211  EMin_log 0.0
212  EMax_log 8.0
213  TMin_ns -50.0
214  TMax_ns +450.0
215  mestimator 1
216  numberOfPrefits 1)
217 
219 
220 eval JMuonEnergy \
221  -a $DETECTOR \
222  -+${^CALIBRATION} \
223  -T $TMAX_S \
224  -f ${OUTPUT_FILE/\%/jstart} \
225  -o ${OUTPUT_FILE/\%/jenergy} \
226  -P $PDF \
227  -E $ENERGY_CORRECTION \
228  -@ `make_equation PARAMETERS` \
229  -d $DEBUG --!
230 
231 CHECK_EXIT_CODE
232 
233 rm -vf ${OUTPUT_FILE/\%/jstart}
234 
235 APPLICATIONS+=$JMUONENERGY
236 
237 timer_stop
238 timer_print
239 
240 
241 # ------------------------------------------------------------------------------------------
242 # JHistory
243 # ------------------------------------------------------------------------------------------
244 
246 
247 JHistory \
248  -f ${OUTPUT_FILE/\%/jenergy} \
249  -o ${OUTPUT_FILE/\%/jhistory} \
250  -A "$APPLICATIONS[*]" \
251  -d $DEBUG --!
252 
253 CHECK_EXIT_CODE
254 
255 rm -vf ${OUTPUT_FILE/\%/jenergy}
256 
257 timer_stop
258 timer_print
259 
260 
261 # ------------------------------------------------------------------------------------------
262 # rename outputfile and remove intermediate files
263 # ------------------------------------------------------------------------------------------
264 
266 
267 mv -v \
268  ${OUTPUT_FILE/\%/jhistory} \
269  ${OUTPUT_FILE/\%/${SUFFIX}}
270 
271 timer_stop
272 timer_print
273 
274 
275 # ------------------------------------------------------------------------------------------
276 # JConvertEvt
277 # ------------------------------------------------------------------------------------------
278 
280 
281 JConvertEvt \
282  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
283  -o ${OUTPUT_FILE/\%/${SUFFIX}.aanet} \
284  -a $DETECTOR \
285  -+${^CALIBRATION} \
286  -T $TMAX_S \
287  -P $PMT \
288  -d $DEBUG --!
289 
290 timer_stop
291 timer_print
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
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable PDF $JPP_DATA J p dat set_variable HISTOGRAM if do_usage *then usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
then usage $script< input_file >< detector_file >< output_file(.root)> fi set_variable NUMBER_OF_TIMESLICES set_variable NUMBER_OF_SUMMARYSLICES set_variable NUMBER_OF_EVENTS set_variable ALL_PLOTS case set_variable NUMBER_OF_EVENTS
Definition: JRunAnalyzer.sh:18
then usage E
Definition: JMuonPostfit.sh:35
then usage $script[< detector identifier >< run range >]< QA/QCfile > nExample script to produce data quality plots nWhen a detector identifier and run range are data are downloaded from the database nand subsequently stored in the given QA QC file
Definition: JDataQuality.sh:19
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
o $QUALITY_ROOT d $DEBUG!CHECK_EXIT_CODE JPlot1D f
Definition: JDataQuality.sh:76
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Definition: diff-Tuna.sh:38
exit
Definition: JPizza.sh:36
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
set_variable SUFFIX
then echo
const int n
Definition: JPolint.hh:697
then timer_start(JRandomTimesliceWriter-a ${DETECTOR}-o ${PIPE}-n ${NUMBER_OF_SLICES}-P ${PMT_FILE}-d ${DEBUG}-S ${SEED}-B"$BACKGROUND_HZ"-N"$RECYCLING"--!&&for((i=0;$i!=10;++i));do;echo 'EOF' > $PIPE;usleep 100000;done &&rm-f $PIPE)&JTimesliceReprocessor-a $
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:116
do set_variable OUTPUT_DIRECTORY $WORKDIR T
* usage
then fatal The output file must have the wildcard in the e g root fi typeset A PARAMETERS typeset a APPLICATIONS APPLICATIONS
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
&set_variable OUTPUT_FILE
set_variable INPUT_FILE
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable TRIPOD $argv[2] set_variable TX $argv[3] set_variable TY $argv[4] if[[!-f $DETECTOR]]
Definition: JFootprint.sh:28
JFIT::JHistory JHistory
Definition: JHistory.hh:354
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:47
then echo Variable JPP_DIR undefined exit fi source $JPP_DIR setenv sh $JPP_DIR set_variable DEBUG set_variable WORKDIR if do_usage *then usage $script(input file)+" fi if (( $ fatal "Invalid number of arguments." fi JCookie.sh set_array INPUT_FILES $argv[1
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
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
data_type v[N+1][M+1]
Definition: JPolint.hh:777
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62