Jpp  19.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 4
78  useL0 1
79  numberOfOutliers 2
80  numberOfPrefits 50
81  DZMax 0.0
82  numberOfDZMax 1
83  TMaxLocal_ns 12
84  ctMin 0.0
85  roadWidth_m 50.0
86  Qmin 1.5)
87 
89 
90 eval JMuonPrefit \
91  -a $DETECTOR \
92  -+${^CALIBRATION} \
93  -T $TMAX_S \
94  -f $INPUT_FILE \
95  -o ${OUTPUT_FILE/\%/jprefit} \
96  -n ${NUMBER_OF_EVENTS} \
97  -@ `make_equation PARAMETERS` \
98  -d $DEBUG --!
99 
100 CHECK_EXIT_CODE
101 
102 APPLICATIONS+=$JMUONPREFIT
103 
104 timer_stop
105 timer_print
106 
107 
108 # ------------------------------------------------------------------------------------------
109 # JMuonSimplex
110 # ------------------------------------------------------------------------------------------
111 
112 PARAMETERS=(
113  sigma_ns 3
114  TMaxLocal_ns 15.0
115  ctMin 0.0
116  roadWidth_m 50.0
117  numberOfPrefits 0)
118 
120 
121 eval JMuonSimplex \
122  -a $DETECTOR \
123  -+${^CALIBRATION} \
124  -T $TMAX_S \
125  -f ${OUTPUT_FILE/\%/jprefit} \
126  -o ${OUTPUT_FILE/\%/jsimplex} \
127  -@ `make_equation PARAMETERS` \
128  -d ${DEBUG} --!
129 
130 CHECK_EXIT_CODE
131 
132 rm -vf ${OUTPUT_FILE/\%/jprefit}
133 
134 APPLICATIONS+=$JMUONSIMPLEX
135 
136 timer_stop
137 timer_print
138 
139 
140 # ------------------------------------------------------------------------------------------
141 # JMuonStart
142 # ------------------------------------------------------------------------------------------
143 
144 PARAMETERS=(
145  roadWidth_m 50.0
146  R_Hz 7.0e3
147  TMin_ns -25.0
148  TMax_ns +25.0
149  Pmin1 1.0e-3
150  Pmin2 1.0e-2
151  numberOfPrefits 0)
152 
154 
155 eval JMuonStart \
156  -a $DETECTOR \
157  -+${^CALIBRATION} \
158  -T $TMAX_S \
159  -f ${OUTPUT_FILE/\%/jsimplex} \
160  -o ${OUTPUT_FILE/\%/jstart} \
161  -P $PDF \
162  -@ `make_equation PARAMETERS` \
163  -d $DEBUG --!
164 
165 CHECK_EXIT_CODE
166 
167 rm -vf ${OUTPUT_FILE/\%/jsimplex}
168 
169 APPLICATIONS+=$JMUONSTART
170 
171 timer_stop
172 timer_print
173 
174 
175 # ------------------------------------------------------------------------------------------
176 # JMuonGandalf
177 # ------------------------------------------------------------------------------------------
178 
179 PARAMETERS=(
180  TTS_ns 2
181  E_GeV 10.0
182  TMin_ns -50.0
183  TMax_ns +450.0
184  ZMin_m -3.0
185  ZMax_m +9.0
186  R_Hz 7.0e3
187  roadWidth_m 50.0
188  numberOfPrefits 0)
189 
191 
192 eval JMuonGandalf \
193  -a $DETECTOR \
194  -+${^CALIBRATION} \
195  -T $TMAX_S \
196  -f ${OUTPUT_FILE/\%/jstart} \
197  -o ${OUTPUT_FILE/\%/jgandalf} \
198  -P $PDF \
199  -@ `make_equation PARAMETERS` \
200  -d $DEBUG --!
201 
202 CHECK_EXIT_CODE
203 
204 rm -vf ${OUTPUT_FILE/\%/jstart}
205 
206 APPLICATIONS+=$JMUONGANDALF
207 
208 timer_stop
209 timer_print
210 
211 
212 # ------------------------------------------------------------------------------------------
213 # JMuonStart
214 # ------------------------------------------------------------------------------------------
215 
216 PARAMETERS=(
217  roadWidth_m 50.0
218  R_Hz 7.0e3
219  TMin_ns -25.0
220  TMax_ns +25.0
221  Pmin1 1.0e-3
222  Pmin2 1.0e-2
223  numberOfPrefits 1)
224 
226 
227 eval JMuonStart \
228  -a $DETECTOR \
229  -+${^CALIBRATION} \
230  -T $TMAX_S \
231  -f ${OUTPUT_FILE/\%/jgandalf} \
232  -o ${OUTPUT_FILE/\%/jstart2} \
233  -P $PDF \
234  -@ `make_equation PARAMETERS` \
235  -d $DEBUG --!
236 
237 CHECK_EXIT_CODE
238 
239 rm -vf ${OUTPUT_FILE/\%/jgandalf}
240 
241 APPLICATIONS+=$JMUONSTART
242 
243 timer_stop
244 timer_print
245 
246 
247 # ------------------------------------------------------------------------------------------
248 # JMuonEnergy
249 # ------------------------------------------------------------------------------------------
250 
251 PARAMETERS=(
252  roadWidth_m 80.0
253  R_Hz 7.0e3
254  EMin_log 0.0
255  EMax_log 7.0
256  TMin_ns -25.0
257  TMax_ns +25.0
258  ZMin_m -3.0
259  resolution 0.01
260  mestimator 3
261  numberOfPrefits 1)
262 
264 
265 eval JMuonEnergy \
266  -a $DETECTOR \
267  -+${^CALIBRATION} \
268  -T $TMAX_S \
269  -f ${OUTPUT_FILE/\%/jstart2} \
270  -o ${OUTPUT_FILE/\%/jenergy} \
271  -P $PDF \
272  -@ `make_equation PARAMETERS` \
273  -d $DEBUG --!
274 
275 CHECK_EXIT_CODE
276 
277 rm -vf ${OUTPUT_FILE/\%/jstart2}
278 
279 APPLICATIONS+=$JMUONENERGY
280 
281 timer_stop
282 timer_print
283 
284 
285 # ------------------------------------------------------------------------------------------
286 # JHistory
287 # ------------------------------------------------------------------------------------------
288 
290 
291 JHistory \
292  -f ${OUTPUT_FILE/\%/jenergy} \
293  -o ${OUTPUT_FILE/\%/jhistory} \
294  -A "$APPLICATIONS[*]" \
295  -d $DEBUG --!
296 
297 CHECK_EXIT_CODE
298 
299 rm -vf ${OUTPUT_FILE/\%/jenergy}
300 
301 timer_stop
302 timer_print
303 
304 
305 # ------------------------------------------------------------------------------------------
306 # rename outputfile and remove intermediate files
307 # ------------------------------------------------------------------------------------------
308 
310 
311 mv -v \
312  ${OUTPUT_FILE/\%/jhistory} \
313  ${OUTPUT_FILE/\%/${SUFFIX}}
314 
315 timer_stop
316 timer_print
317 
318 
319 # ------------------------------------------------------------------------------------------
320 # JConvertEvt
321 # ------------------------------------------------------------------------------------------
322 
324 
325 JConvertEvt \
326  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
327  -o ${OUTPUT_FILE/\%/${SUFFIX}.offline} \
328  -a $DETECTOR \
329  -+${^CALIBRATION} \
330  -T $TMAX_S \
331  -P $PMT \
332  -d $DEBUG --!
333 
334 timer_stop
335 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)
*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
Definition: datalogs.sh:34
then fatal Wrong number of arguments fi JConvertDetectorFormat a o
set_variable SUFFIX
const int n
Definition: JPolint.hh:786
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 JCalibrateToT a
Definition: JTuneHV.sh:107
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
* 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 JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonStart.sh:47
then usage $script[energy[distance[z of PMT]]] fi case set_variable z
Definition: JDrawPDF.sh:45
JFIT::JHistory JHistory
Definition: JHistory.hh:354
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
then fatal Wrong number of arguments fi set_variable ARCHIVE $argv[1] set_variable VERSION $argv[2] set_variable DIR $argv[3] source JAcousticsToolkit sh set_variable DETECTOR $DIR $ACOUSTICS_DETECTOR if[[!-f $DETECTOR]]
then JHobbit a $DETECTOR f
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
data_type v[N+1][M+1]
Definition: JPolint.hh:866
then echo
Definition: JQAQC.sh:92
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
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62