Jpp  18.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JORCAMuonReconstruction.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 ORCA.
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: NUMBER_OF_EVENTS RECONSTRUCTION_NUMBER_OF_EVENTS $((2**31))
25 set_variable+ OVERWRITE RECONSTRUCTION_OVERWRITE 1
26 set_variable: TMAX_S RECONSTRUCTION_TMAX_S 100
27 
28 if do_usage $*; then
29  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
30 fi
31 
32 if (( $# < 4 )); then
33  fatal "Wrong number of arguments."
34 fi
35 
40 set_array CALIBRATION $argv[5,-1]
41 
42 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
43  fatal "The output file must have the wildcard % in the name, e.g. %.root"
44 fi
45 
46 typeset -A PARAMETERS
47 typeset -a APPLICATIONS
48 
50 
51 
52 if [[ "$OVERWRITE" == 1 ]]; then
53  rm -vf \
54  ${OUTPUT_FILE/\%/jprefit} \
55  ${OUTPUT_FILE/\%/jsimplex} \
56  ${OUTPUT_FILE/\%/jstart} \
57  ${OUTPUT_FILE/\%/jgandalf} \
58  ${OUTPUT_FILE/\%/jstart2} \
59  ${OUTPUT_FILE/\%/jenergy} \
60  ${OUTPUT_FILE/\%/jhistory} \
61  ${OUTPUT_FILE/\%/${SUFFIX}} \
62  ${OUTPUT_FILE/\%/${SUFFIX}.offline}
63 fi
64 
65 
66 if (( ${#CALIBRATION} != 0 )); then
68 fi
69 
70 
71 # ------------------------------------------------------------------------------------------
72 # JMuonPrefit
73 # ------------------------------------------------------------------------------------------
74 
75 PARAMETERS=(
76  sigma_ns 5
77  gridAngle_deg 5
78  useL0 1
79  numberOfOutliers 2
80  numberOfPrefits 12
81  DZMax 0.0
82  numberOfDZMax 1
83  TMaxLocal_ns 12
84  ctMin 0.0
85  roadWidth_m 50.0)
86 
88 
89 eval JMuonPrefit \
90  -a $DETECTOR \
91  -+${^CALIBRATION} \
92  -T $TMAX_S \
93  -f $INPUT_FILE \
94  -o ${OUTPUT_FILE/\%/jprefit} \
95  -n ${NUMBER_OF_EVENTS} \
96  -@ `make_equation PARAMETERS` \
97  -d $DEBUG --!
98 
99 CHECK_EXIT_CODE
100 
101 APPLICATIONS+=$JMUONPREFIT
102 
103 timer_stop
104 timer_print
105 
106 
107 # ------------------------------------------------------------------------------------------
108 # JMuonSimplex
109 # ------------------------------------------------------------------------------------------
110 
111 PARAMETERS=(
112  sigma_ns 3
113  TMaxLocal_ns 15.0
114  ctMin 0.0
115  roadWidth_m 50.0
116  numberOfPrefits 0)
117 
119 
120 eval JMuonSimplex \
121  -a $DETECTOR \
122  -+${^CALIBRATION} \
123  -T $TMAX_S \
124  -f ${OUTPUT_FILE/\%/jprefit} \
125  -o ${OUTPUT_FILE/\%/jsimplex} \
126  -@ `make_equation PARAMETERS` \
127  -d ${DEBUG} --!
128 
129 CHECK_EXIT_CODE
130 
131 rm -vf ${OUTPUT_FILE/\%/jprefit}
132 
133 APPLICATIONS+=$JMUONSIMPLEX
134 
135 timer_stop
136 timer_print
137 
138 
139 # ------------------------------------------------------------------------------------------
140 # JMuonStart
141 # ------------------------------------------------------------------------------------------
142 
143 PARAMETERS=(
144  roadWidth_m 50.0
145  R_Hz 7.0e3
146  TMin_ns -25.0
147  TMax_ns +25.0
148  Pmin1 1.0e-3
149  Pmin2 1.0e-2
150  numberOfPrefits 0)
151 
153 
154 eval JMuonStart \
155  -a $DETECTOR \
156  -+${^CALIBRATION} \
157  -T $TMAX_S \
158  -f ${OUTPUT_FILE/\%/jsimplex} \
159  -o ${OUTPUT_FILE/\%/jstart} \
160  -P $PDF \
161  -@ `make_equation PARAMETERS` \
162  -d $DEBUG --!
163 
164 CHECK_EXIT_CODE
165 
166 rm -vf ${OUTPUT_FILE/\%/jsimplex}
167 
168 APPLICATIONS+=$JMUONSTART
169 
170 timer_stop
171 timer_print
172 
173 
174 # ------------------------------------------------------------------------------------------
175 # JMuonGandalf
176 # ------------------------------------------------------------------------------------------
177 
178 PARAMETERS=(
179  TTS_ns 2
180  E_GeV 10.0
181  TMin_ns -50.0
182  TMax_ns +450.0
183  ZMin_m -3.0
184  ZMax_m +9.0
185  R_Hz 7.0e3
186  roadWidth_m 50.0
187  numberOfPrefits 0)
188 
190 
191 eval JMuonGandalf \
192  -a $DETECTOR \
193  -+${^CALIBRATION} \
194  -T $TMAX_S \
195  -f ${OUTPUT_FILE/\%/jstart} \
196  -o ${OUTPUT_FILE/\%/jgandalf} \
197  -P $PDF \
198  -@ `make_equation PARAMETERS` \
199  -d $DEBUG --!
200 
201 CHECK_EXIT_CODE
202 
203 rm -vf ${OUTPUT_FILE/\%/jstart}
204 
205 APPLICATIONS+=$JMUONGANDALF
206 
207 timer_stop
208 timer_print
209 
210 
211 # ------------------------------------------------------------------------------------------
212 # JMuonStart
213 # ------------------------------------------------------------------------------------------
214 
215 PARAMETERS=(
216  roadWidth_m 50.0
217  R_Hz 7.0e3
218  TMin_ns -25.0
219  TMax_ns +25.0
220  Pmin1 1.0e-3
221  Pmin2 1.0e-2
222  numberOfPrefits 1)
223 
225 
226 eval JMuonStart \
227  -a $DETECTOR \
228  -+${^CALIBRATION} \
229  -T $TMAX_S \
230  -f ${OUTPUT_FILE/\%/jgandalf} \
231  -o ${OUTPUT_FILE/\%/jstart2} \
232  -P $PDF \
233  -@ `make_equation PARAMETERS` \
234  -d $DEBUG --!
235 
236 CHECK_EXIT_CODE
237 
238 rm -vf ${OUTPUT_FILE/\%/jgandalf}
239 
240 APPLICATIONS+=$JMUONSTART
241 
242 timer_stop
243 timer_print
244 
245 
246 # ------------------------------------------------------------------------------------------
247 # JMuonEnergy
248 # ------------------------------------------------------------------------------------------
249 
250 PARAMETERS=(
251  roadWidth_m 80.0
252  R_Hz 7.0e3
253  EMin_log 0.0
254  EMax_log 7.0
255  TMin_ns -25.0
256  TMax_ns +25.0
257  ZMin_m -3.0
258  resolution 0.01
259  mestimator 3
260  numberOfPrefits 1)
261 
263 
264 eval JMuonEnergy \
265  -a $DETECTOR \
266  -+${^CALIBRATION} \
267  -T $TMAX_S \
268  -f ${OUTPUT_FILE/\%/jstart2} \
269  -o ${OUTPUT_FILE/\%/jenergy} \
270  -P $PDF \
271  -@ `make_equation PARAMETERS` \
272  -d $DEBUG --!
273 
274 CHECK_EXIT_CODE
275 
276 rm -vf ${OUTPUT_FILE/\%/jstart2}
277 
278 APPLICATIONS+=$JMUONENERGY
279 
280 timer_stop
281 timer_print
282 
283 
284 # ------------------------------------------------------------------------------------------
285 # JHistory
286 # ------------------------------------------------------------------------------------------
287 
289 
290 JHistory \
291  -f ${OUTPUT_FILE/\%/jenergy} \
292  -o ${OUTPUT_FILE/\%/jhistory} \
293  -A "$APPLICATIONS[*]" \
294  -d $DEBUG --!
295 
296 CHECK_EXIT_CODE
297 
298 rm -vf ${OUTPUT_FILE/\%/jenergy}
299 
300 timer_stop
301 timer_print
302 
303 
304 # ------------------------------------------------------------------------------------------
305 # rename outputfile and remove intermediate files
306 # ------------------------------------------------------------------------------------------
307 
309 
310 mv -v \
311  ${OUTPUT_FILE/\%/jhistory} \
312  ${OUTPUT_FILE/\%/${SUFFIX}}
313 
314 timer_stop
315 timer_print
316 
317 
318 # ------------------------------------------------------------------------------------------
319 # JConvertEvt
320 # ------------------------------------------------------------------------------------------
321 
323 
324 JConvertEvt \
325  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
326  -o ${OUTPUT_FILE/\%/${SUFFIX}.offline} \
327  -a $DETECTOR \
328  -+${^CALIBRATION} \
329  -T $TMAX_S \
330  -P $PMT \
331  -d $DEBUG --!
332 
333 timer_stop
334 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 $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 JDetectorMechanics getMechanics
Function object to get string mechanics.
Definition: JMechanics.hh:242
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 rm vf
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
set_variable SUFFIX
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 rm
Definition: sftpput.zsh:30
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 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
then echo
Definition: JQAQC.sh:90
then usage $script(input file)+< output file >" fi if (( $ fatal "Wrong number of arguments." fi set_array INPUT_FILES $argv[1
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