Jpp  18.6.0-rc.1
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 set_variable: RATE_HZ RECONSTRUCTION_RATE_HZ 6.0e3
29 
30 if do_usage $*; then
31  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
32 fi
33 
34 if (( $# < 4 )); then
35  fatal "Wrong number of arguments."
36 fi
37 
42 set_array CALIBRATION $argv[5,-1]
43 
44 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
45  fatal "The output file must have the wildcard % in the name, e.g. %.root"
46 fi
47 
48 typeset -A PARAMETERS
49 typeset -a APPLICATIONS
50 
52 
53 
54 if [[ "$OVERWRITE" == 1 ]]; then
55  rm -vf \
56  ${OUTPUT_FILE/\%/jprefit} \
57  ${OUTPUT_FILE/\%/jsimplex} \
58  ${OUTPUT_FILE/\%/jgandalf} \
59  ${OUTPUT_FILE/\%/jstart} \
60  ${OUTPUT_FILE/\%/jenergy} \
61  ${OUTPUT_FILE/\%/jhistory} \
62  ${OUTPUT_FILE/\%/${SUFFIX}} \
63  ${OUTPUT_FILE/\%/${SUFFIX}.offline}
64 fi
65 
66 if (( ${#CALIBRATION} != 0 )); then
68 fi
69 
70 
71 # ------------------------------------------------------------------------------------------
72 # JMuonPrefit
73 # ------------------------------------------------------------------------------------------
74 
75 PARAMETERS=(
76  sigma_ns 5
77  gridAngle_deg 1
78  useL0 0
79  numberOfOutliers 3
80  numberOfPrefits 50
81  DZMax 0.0
82  numberOfDZMax 1
83  TMaxLocal_ns 18
84  ctMin 0.0
85  roadWidth_m 200.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 200.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 # JMuonGandalf
141 # ------------------------------------------------------------------------------------------
142 
143 PARAMETERS=(
144  TTS_ns 2
145  E_GeV 1.0e3
146  TMin_ns -50.0
147  TMax_ns +450.0
148  R_Hz $RATE_HZ
149  roadWidth_m 175.0
150  numberOfPrefits 0)
151 
153 
154 eval JMuonGandalf \
155  -a $DETECTOR \
156  -+${^CALIBRATION} \
157  -T $TMAX_S \
158  -f ${OUTPUT_FILE/\%/jsimplex} \
159  -o ${OUTPUT_FILE/\%/jgandalf} \
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+=$JMUONGANDALF
169 
170 timer_stop
171 timer_print
172 
173 
174 # ------------------------------------------------------------------------------------------
175 # JMuonStart
176 # ------------------------------------------------------------------------------------------
177 
178 PARAMETERS=(
179  roadWidth_m 160.0
180  R_Hz $RATE_HZ
181  TMin_ns -25.0
182  TMax_ns +75.0
183  Pmin1 1.0e-3
184  Pmin2 1.0e-2
185  numberOfPrefits 1)
186 
188 
189 eval JMuonStart \
190  -a $DETECTOR \
191  -+${^CALIBRATION} \
192  -T $TMAX_S \
193  -f ${OUTPUT_FILE/\%/jgandalf} \
194  -o ${OUTPUT_FILE/\%/jstart} \
195  -P $PDF \
196  -@ `make_equation PARAMETERS` \
197  -d $DEBUG --!
198 
199 CHECK_EXIT_CODE
200 
201 rm -vf ${OUTPUT_FILE/\%/jgandalf}
202 
203 APPLICATIONS+=$JMUONSTART
204 
205 timer_stop
206 timer_print
207 
208 
209 # ------------------------------------------------------------------------------------------
210 # JMuonEnergy
211 # ------------------------------------------------------------------------------------------
212 
213 PARAMETERS=(
214  roadWidth_m 200.0
215  R_Hz $RATE_HZ
216  EMin_log 0.0
217  EMax_log 8.0
218  TMin_ns -50.0
219  TMax_ns +450.0
220  mestimator 1
221  numberOfPrefits 1)
222 
224 
225 eval JMuonEnergy \
226  -a $DETECTOR \
227  -+${^CALIBRATION} \
228  -T $TMAX_S \
229  -f ${OUTPUT_FILE/\%/jstart} \
230  -o ${OUTPUT_FILE/\%/jenergy} \
231  -P $PDF \
232  -E $ENERGY_CORRECTION \
233  -@ `make_equation PARAMETERS` \
234  -d $DEBUG --!
235 
236 CHECK_EXIT_CODE
237 
238 rm -vf ${OUTPUT_FILE/\%/jstart}
239 
240 APPLICATIONS+=$JMUONENERGY
241 
242 timer_stop
243 timer_print
244 
245 
246 # ------------------------------------------------------------------------------------------
247 # JHistory
248 # ------------------------------------------------------------------------------------------
249 
251 
252 JHistory \
253  -f ${OUTPUT_FILE/\%/jenergy} \
254  -o ${OUTPUT_FILE/\%/jhistory} \
255  -A "$APPLICATIONS[*]" \
256  -d $DEBUG --!
257 
258 CHECK_EXIT_CODE
259 
260 rm -vf ${OUTPUT_FILE/\%/jenergy}
261 
262 timer_stop
263 timer_print
264 
265 
266 # ------------------------------------------------------------------------------------------
267 # rename outputfile and remove intermediate files
268 # ------------------------------------------------------------------------------------------
269 
271 
272 mv -v \
273  ${OUTPUT_FILE/\%/jhistory} \
274  ${OUTPUT_FILE/\%/${SUFFIX}}
275 
276 timer_stop
277 timer_print
278 
279 
280 # ------------------------------------------------------------------------------------------
281 # JConvertEvt
282 # ------------------------------------------------------------------------------------------
283 
285 
286 JConvertEvt \
287  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
288  -o ${OUTPUT_FILE/\%/${SUFFIX}.offline} \
289  -a $DETECTOR \
290  -+${^CALIBRATION} \
291  -T $TMAX_S \
292  -P $PMT \
293  -d $DEBUG --!
294 
295 timer_stop
296 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
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
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]]
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