Jpp  18.0.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}.offline}
63 fi
64 
65 if (( ${#CALIBRATION} != 0 )); then
67 fi
68 
69 
70 # ------------------------------------------------------------------------------------------
71 # JMuonPrefit
72 # ------------------------------------------------------------------------------------------
73 
74 PARAMETERS=(
75  sigma_ns 5
76  gridAngle_deg 1
77  useL0 0
78  numberOfOutliers 3
79  numberOfPrefits 50
80  DZMax 0.0
81  numberOfDZMax 1
82  TMaxLocal_ns 18
83  ctMin 0.0
84  roadWidth_m 200.0)
85 
87 
88 eval JMuonPrefit \
89  -a $DETECTOR \
90  -+${^CALIBRATION} \
91  -T $TMAX_S \
92  -f $INPUT_FILE \
93  -o ${OUTPUT_FILE/\%/jprefit} \
94  -n ${NUMBER_OF_EVENTS} \
95  -@ `make_equation PARAMETERS` \
96  -d $DEBUG --!
97 
98 CHECK_EXIT_CODE
99 
100 APPLICATIONS+=$JMUONPREFIT
101 
102 timer_stop
103 timer_print
104 
105 
106 # ------------------------------------------------------------------------------------------
107 # JMuonSimplex
108 # ------------------------------------------------------------------------------------------
109 
110 PARAMETERS=(
111  sigma_ns 3
112  TMaxLocal_ns 15.0
113  ctMin 0.0
114  roadWidth_m 200.0
115  numberOfPrefits 0)
116 
118 
119 eval JMuonSimplex \
120  -a $DETECTOR \
121  -+${^CALIBRATION} \
122  -T $TMAX_S \
123  -f ${OUTPUT_FILE/\%/jprefit} \
124  -o ${OUTPUT_FILE/\%/jsimplex} \
125  -@ `make_equation PARAMETERS` \
126  -d ${DEBUG} --!
127 
128 CHECK_EXIT_CODE
129 
130 rm -vf ${OUTPUT_FILE/\%/jprefit}
131 
132 APPLICATIONS+=$JMUONSIMPLEX
133 
134 timer_stop
135 timer_print
136 
137 
138 # ------------------------------------------------------------------------------------------
139 # JMuonGandalf
140 # ------------------------------------------------------------------------------------------
141 
142 PARAMETERS=(
143  TTS_ns 2
144  E_GeV 1.0e3
145  TMin_ns -50.0
146  TMax_ns +450.0
147  R_Hz 6.0e3
148  roadWidth_m 175.0
149  numberOfPrefits 0)
150 
152 
153 eval JMuonGandalf \
154  -a $DETECTOR \
155  -+${^CALIBRATION} \
156  -T $TMAX_S \
157  -f ${OUTPUT_FILE/\%/jsimplex} \
158  -o ${OUTPUT_FILE/\%/jgandalf} \
159  -P $PDF \
160  -@ `make_equation PARAMETERS` \
161  -d $DEBUG --!
162 
163 CHECK_EXIT_CODE
164 
165 rm -vf ${OUTPUT_FILE/\%/jsimplex}
166 
167 APPLICATIONS+=$JMUONGANDALF
168 
169 timer_stop
170 timer_print
171 
172 
173 # ------------------------------------------------------------------------------------------
174 # JMuonStart
175 # ------------------------------------------------------------------------------------------
176 
177 PARAMETERS=(
178  roadWidth_m 160.0
179  R_Hz 6.0e3
180  TMin_ns -25.0
181  TMax_ns +75.0
182  Pmin1 1.0e-3
183  Pmin2 1.0e-2
184  numberOfPrefits 1)
185 
187 
188 eval JMuonStart \
189  -a $DETECTOR \
190  -+${^CALIBRATION} \
191  -T $TMAX_S \
192  -f ${OUTPUT_FILE/\%/jgandalf} \
193  -o ${OUTPUT_FILE/\%/jstart} \
194  -P $PDF \
195  -@ `make_equation PARAMETERS` \
196  -d $DEBUG --!
197 
198 CHECK_EXIT_CODE
199 
200 rm -vf ${OUTPUT_FILE/\%/jgandalf}
201 
202 APPLICATIONS+=$JMUONSTART
203 
204 timer_stop
205 timer_print
206 
207 
208 # ------------------------------------------------------------------------------------------
209 # JMuonEnergy
210 # ------------------------------------------------------------------------------------------
211 
212 PARAMETERS=(
213  roadWidth_m 200.0
214  R_Hz 6.0e3
215  EMin_log 0.0
216  EMax_log 8.0
217  TMin_ns -50.0
218  TMax_ns +450.0
219  mestimator 1
220  numberOfPrefits 1)
221 
223 
224 eval JMuonEnergy \
225  -a $DETECTOR \
226  -+${^CALIBRATION} \
227  -T $TMAX_S \
228  -f ${OUTPUT_FILE/\%/jstart} \
229  -o ${OUTPUT_FILE/\%/jenergy} \
230  -P $PDF \
231  -E $ENERGY_CORRECTION \
232  -@ `make_equation PARAMETERS` \
233  -d $DEBUG --!
234 
235 CHECK_EXIT_CODE
236 
237 rm -vf ${OUTPUT_FILE/\%/jstart}
238 
239 APPLICATIONS+=$JMUONENERGY
240 
241 timer_stop
242 timer_print
243 
244 
245 # ------------------------------------------------------------------------------------------
246 # JHistory
247 # ------------------------------------------------------------------------------------------
248 
250 
251 JHistory \
252  -f ${OUTPUT_FILE/\%/jenergy} \
253  -o ${OUTPUT_FILE/\%/jhistory} \
254  -A "$APPLICATIONS[*]" \
255  -d $DEBUG --!
256 
257 CHECK_EXIT_CODE
258 
259 rm -vf ${OUTPUT_FILE/\%/jenergy}
260 
261 timer_stop
262 timer_print
263 
264 
265 # ------------------------------------------------------------------------------------------
266 # rename outputfile and remove intermediate files
267 # ------------------------------------------------------------------------------------------
268 
270 
271 mv -v \
272  ${OUTPUT_FILE/\%/jhistory} \
273  ${OUTPUT_FILE/\%/${SUFFIX}}
274 
275 timer_stop
276 timer_print
277 
278 
279 # ------------------------------------------------------------------------------------------
280 # JConvertEvt
281 # ------------------------------------------------------------------------------------------
282 
284 
285 JConvertEvt \
286  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
287  -o ${OUTPUT_FILE/\%/${SUFFIX}.offline} \
288  -a $DETECTOR \
289  -+${^CALIBRATION} \
290  -T $TMAX_S \
291  -P $PMT \
292  -d $DEBUG --!
293 
294 timer_stop
295 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< input file >[option[primary[working directory]]] nWhere option can be E
Definition: JMuonPostfit.sh:40
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