Jpp  15.0.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JORCAShowerReconstruction.sh
Go to the documentation of this file.
1 #!/bin/zsh
2 #
3 # \author adomi
4 #
5 script=${0##*/}
6 
7 
8 # ------------------------------------------------------------------------------------------
9 #
10 # Script to run the JPP Shower Reconstruction Chain for ORCA.
11 #
12 # ------------------------------------------------------------------------------------------
13 
14 
15 if [ -z $JPP_DIR ]; then
16  echo "Variable JPP_DIR undefined."
17  exit
18 fi
19 source $JPP_DIR/setenv.sh $JPP_DIR
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 jchain.orca
24 set_variable: NUMBER_OF_EVENTS RECONSTRUCTION_NUMBER_OF_EVENTS $((2**31))
25 set_variable: TMAX_S RECONSTRUCTION_TMAX_S 100
26 
27 if do_usage $*; then
28  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
29 fi
30 
35 set_array CALIBRATION $argv[5,-1]
36 
37 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
38  fatal "The output file must have the wildcard % in the name, e.g. %.root"
39 fi
40 
41 
42 # ------------------------------------------------------------------------------------------
43 # JShowerPrefit
44 # ------------------------------------------------------------------------------------------
45 
46 maxOutFits=50
47 
48 # default input values
49 PARAMETERS=(
50  factoryLimit 40
51  NMaxHits 20
52  sigma_ns 4
53  numberOfOutliers 4
54  TMaxLocal_ns 120
55  ctMin -0.7
56  roadWidth_m 50
57  numberOfPrefits 50) #JShowerPointSimplex needs 50 prefits from JShowerPrefit
58 
60 
61 eval JShowerPrefit \
62  -a $DETECTOR \
63  -+${^CALIBRATION} \
64  -T $TMAX_S \
65  -f $INPUT_FILE \
66  -o ${OUTPUT_FILE/\%/jshprefit} \
67  -n ${NUMBER_OF_EVENTS} \
68  -@ `make_equation PARAMETERS` \
69  -d ${DEBUG} --!
70 
71 timer_stop
72 timer_print
73 
74 
75 # ------------------------------------------------------------------------------------------
76 # JShowerPointSimplex
77 # ------------------------------------------------------------------------------------------
78 
79 # default input values
80 PARAMETERS=(
81  numberOfPrefits 0 # 0 means all inputs are processed
82  numberOfOutfits 100
83  minPrefitsSize 9
84  sigma_ns 1
85  TMaxLocal_ns 15
86  TMax_ns 60
87  TMin_ns -60
88  roadWidth_m 60
89  ctMin 0.2
90  TWindow_ns "-130, 120"
91  pos_grid_m " -20, 20"
92  pos_step_m 20
93  time_grid_ns " -90, 90"
94  time_step_ns 30
95  simplex_step_m 2
96  simplex_step_ns 10
97  tukey_std_dev 20.0)
98 
100 
101 eval JShowerPointSimplex \
102  -a $DETECTOR \
103  -+${^CALIBRATION} \
104  -T $TMAX_S \
105  -f ${OUTPUT_FILE/\%/jshprefit} \
106  -o ${OUTPUT_FILE/\%/jshpointsimplex} \
107  -@ `make_equation PARAMETERS` \
108  -d ${DEBUG} --!
109 
110 timer_stop
111 timer_print
112 
113 rm -vf ${OUTPUT_FILE/\%/jshprefit}
114 
115 # ------------------------------------------------------------------------------------------
116 # JShowerPositionFit
117 # ------------------------------------------------------------------------------------------
118 
119 # default input values
120 PARAMETERS=(
121  numberOfPrefits 0
122  numberOfOutfits 5
123  TMax_ns 120
124  TMin_ns -120
125  roadWidth_m 80
126  E_GeV 10
127  R_Hz 10000
128  TTS_ns 2)
129 
131 
132 eval JShowerPositionFit \
133  -a $DETECTOR \
134  -+${^CALIBRATION} \
135  -T $TMAX_S \
136  -f ${OUTPUT_FILE/\%/jshpointsimplex} \
137  -F $PDF \
138  -o ${OUTPUT_FILE/\%/jshpositionfit} \
139  -@ `make_equation PARAMETERS` \
140  -d ${DEBUG} --!
141 
142 timer_stop
143 timer_print
144 
145 rm -vf ${OUTPUT_FILE/\%/jshpointsimplex}
146 
147 # ------------------------------------------------------------------------------------------
148 # JShowerEnergyPrefit
149 # ------------------------------------------------------------------------------------------
150 
151 # default input values
152 PARAMETERS=(
153  numberOfPrefits 0
154  numberOfOutfits 1
155  Emin_GeV 1
156  Emax_GeV 100
157  resolution 0.01
158  TMax_ns 500
159  TMin_ns -500
160  R_Hz 10000
161  mestimator 3
162  roadWidth_m 80)
163 
165 
166 eval JShowerEnergyPrefit \
167  -a $DETECTOR \
168  -+${^CALIBRATION} \
169  -T $TMAX_S \
170  -f ${OUTPUT_FILE/\%/jshpositionfit} \
171  -F $PDF \
172  -o ${OUTPUT_FILE/\%/jshenergyprefit} \
173  -@ `make_equation PARAMETERS` \
174  -d $DEBUG --!
175 
176 timer_stop
177 timer_print
178 
179 rm -vf ${OUTPUT_FILE/\%/jshpositionfit}
180 
181 # ------------------------------------------------------------------------------------------
182 # JShowerDirectionPrefit
183 # ------------------------------------------------------------------------------------------
184 
185 # default input values
186 PARAMETERS=(
187  numberOfPrefits 0
188  numberOfOutfits 4
189  TMax_ns 30
190  TMin_ns -30
191  roadWidth_m 80
192  DMin_m 80 # can be lower to speed up the reconstruction (for online)
193  E_GeV 13
194  R_Hz 10000
195  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
196  MaxAngle_deg_lowE 40
197  scanAngle_deg_lowE 10
198  MaxAngle_deg_highE 20
199  scanAngle_deg_highE 5)
200 
202 
203 eval JShowerDirectionPrefit \
204  -a $DETECTOR \
205  -+${^CALIBRATION} \
206  -T $TMAX_S \
207  -f ${OUTPUT_FILE/\%/jshenergyprefit} \
208  -F $PDF \
209  -o ${OUTPUT_FILE/\%/jshdirectionprefit} \
210  -@ `make_equation PARAMETERS` \
211  -d $DEBUG --!
212 
213 timer_stop
214 timer_print
215 
216 rm -vf ${OUTPUT_FILE/\%/jshenergyprefit}
217 
218 # ------------------------------------------------------------------------------------------
219 # JShowerFit
220 # ------------------------------------------------------------------------------------------
221 
222 # default input values
223 PARAMETERS=(
224  numberOfPrefits 4
225  TMax_ns 30
226  TMin_ns -30
227  roadWidth_m 80
228  R_Hz 10000
229  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
230  fit_step 0.05)
231 
233 
234 eval JShowerFit \
235  -a $DETECTOR \
236  -+${^CALIBRATION} \
237  -T $TMAX_S \
238  -f ${OUTPUT_FILE/\%/jshdirectionprefit} \
239  -F $PDF \
240  -o ${OUTPUT_FILE/\%/jshfit} \
241  -@ `make_equation PARAMETERS` \
242  -E $JPP_DIR/software/JReconstruction/energy_correction_showerfit_fullorca.txt \
243  -d $DEBUG --!
244 
245 CHECK_EXIT_CODE
246 
247 timer_stop
248 timer_print
249 
250 rm -vf ${OUTPUT_FILE/\%/jshdirectionprefit}
251 
252 # ------------------------------------------------------------------------------------------
253 # rename outputfile
254 # ------------------------------------------------------------------------------------------
255 
257 
258 mv \
259  ${OUTPUT_FILE/\%/jshfit} \
260  ${OUTPUT_FILE/\%/${SUFFIX}} \
261  -v
262 
263 timer_stop
264 timer_print
265 
266 
267 # ------------------------------------------------------------------------------------------
268 # JConvertEvt
269 # ------------------------------------------------------------------------------------------
270 
272 
273 JConvertEvt \
274  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
275  -o ${OUTPUT_FILE/\%/${SUFFIX}.aanet} \
276  -a $DETECTOR \
277  -P $PMT \
278  -d $DEBUG --!
279 
280 timer_stop
281 timer_print
then usage $script< detector file >< detectorfile > nIf the range of floors is the first detector file is aligned to the second before the comparison fi case set_variable RANGE $argv[3]
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 JMuonPostfit f
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
then for mestimator in normal linear lorentzian
Definition: JMEstimator.sh:34
then JPlot1D f $WORKDIR postfit[prefit\] root
set_variable INPUT_FILE
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
mestimator
*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 usage E
Definition: JMuonPostfit.sh:35
then echo
const int n
Definition: JPolint.hh:660
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:20
do set_variable OUTPUT_DIRECTORY $WORKDIR T
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
then awk F
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
&set_variable OUTPUT_FILE
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 JCalibrateToT a
Definition: JTuneHV.sh:116
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 usage $script< input_file >< detector_file > fi set_variable OUTPUT_DIR set_variable SELECTOR JDAQTimesliceL1 set_variable DEBUG case set_variable DEBUG
set_variable DETECTOR
do set_variable DETECTOR_TXT $WORKDIR detector
data_type v[N+1][M+1]
Definition: JPolint.hh:740
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
then usage $script< detector file >< inputfile > fi case set_array PARAMETERS
script
Definition: JAcoustics.sh:2
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 case set_variable NUMBER_OF_EVENTS
Definition: JRunAnalyzer.sh:17
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:62
do if[[!-f $ACOUSTICS_WORKDIR/${KEY}.txt]]
Definition: JAcoustics.sh:39
then usage $script< string identifier >< detectorfile > event file(toashort file)+" "\nNote that the event files and toashort files should be one-to-one related." fi if (( $