Jpp  15.0.3
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 typeset -A PARAMETERS
42 
43 # ------------------------------------------------------------------------------------------
44 # JShowerPrefit
45 # ------------------------------------------------------------------------------------------
46 
47 # default input values
48 PARAMETERS=(
49  factoryLimit 40
50  NMaxHits 20
51  sigma_ns 4
52  numberOfOutliers 4
53  TMaxLocal_ns 120
54  ctMin -0.7
55  roadWidth_m 50
56  numberOfPrefits 50) #JShowerPointSimplex needs 50 prefits from JShowerPrefit
57 
59 
60 eval JShowerPrefit \
61  -a $DETECTOR \
62  -+${^CALIBRATION} \
63  -T $TMAX_S \
64  -f $INPUT_FILE \
65  -o ${OUTPUT_FILE/\%/jshprefit} \
66  -n ${NUMBER_OF_EVENTS} \
67  -@ `make_equation PARAMETERS` \
68  -d ${DEBUG} --!
69 
70 timer_stop
71 timer_print
72 
73 
74 # ------------------------------------------------------------------------------------------
75 # JShowerPointSimplex
76 # ------------------------------------------------------------------------------------------
77 
78 # default input values
79 PARAMETERS=(
80  numberOfPrefits 0 # 0 means all inputs are processed
81  numberOfOutfits 100
82  minPrefitsSize 9
83  sigma_ns 1
84  TMaxLocal_ns 15
85  TMax_ns 60
86  TMin_ns -60
87  roadWidth_m 60
88  ctMin 0.2
89  TWindow_ns "-130 120"
90  pos_grid_m " -20 20"
91  pos_step_m 20
92  time_grid_ns " -90 90"
93  time_step_ns 30
94  simplex_step_m 2
95  simplex_step_ns 10
96  tukey_std_dev 20.0)
97 
99 
100 eval JShowerPointSimplex \
101  -a $DETECTOR \
102  -+${^CALIBRATION} \
103  -T $TMAX_S \
104  -f ${OUTPUT_FILE/\%/jshprefit} \
105  -o ${OUTPUT_FILE/\%/jshpointsimplex} \
106  -@ `make_equation PARAMETERS` \
107  -d ${DEBUG} --!
108 
109 timer_stop
110 timer_print
111 
112 rm -vf ${OUTPUT_FILE/\%/jshprefit}
113 
114 # ------------------------------------------------------------------------------------------
115 # JShowerPositionFit
116 # ------------------------------------------------------------------------------------------
117 
118 # default input values
119 PARAMETERS=(
120  numberOfPrefits 0
121  numberOfOutfits 5
122  TMax_ns 120
123  TMin_ns -120
124  roadWidth_m 80
125  E_GeV 10
126  R_Hz 10000
127  TTS_ns 2)
128 
130 
131 eval JShowerPositionFit \
132  -a $DETECTOR \
133  -+${^CALIBRATION} \
134  -T $TMAX_S \
135  -f ${OUTPUT_FILE/\%/jshpointsimplex} \
136  -F $PDF \
137  -o ${OUTPUT_FILE/\%/jshpositionfit} \
138  -@ `make_equation PARAMETERS` \
139  -d ${DEBUG} --!
140 
141 timer_stop
142 timer_print
143 
144 rm -vf ${OUTPUT_FILE/\%/jshpointsimplex}
145 
146 # ------------------------------------------------------------------------------------------
147 # JShowerEnergyPrefit
148 # ------------------------------------------------------------------------------------------
149 
150 # default input values
151 PARAMETERS=(
152  numberOfPrefits 0
153  numberOfOutfits 1
154  Emin_GeV 1
155  Emax_GeV 100
156  resolution 0.01
157  TMax_ns 500
158  TMin_ns -500
159  R_Hz 10000
160  mestimator 3
161  roadWidth_m 80)
162 
164 
165 eval JShowerEnergyPrefit \
166  -a $DETECTOR \
167  -+${^CALIBRATION} \
168  -T $TMAX_S \
169  -f ${OUTPUT_FILE/\%/jshpositionfit} \
170  -F $PDF \
171  -o ${OUTPUT_FILE/\%/jshenergyprefit} \
172  -@ `make_equation PARAMETERS` \
173  -d $DEBUG --!
174 
175 timer_stop
176 timer_print
177 
178 rm -vf ${OUTPUT_FILE/\%/jshpositionfit}
179 
180 # ------------------------------------------------------------------------------------------
181 # JShowerDirectionPrefit
182 # ------------------------------------------------------------------------------------------
183 
184 # default input values
185 PARAMETERS=(
186  numberOfPrefits 0
187  numberOfOutfits 4
188  TMax_ns 30
189  TMin_ns -30
190  roadWidth_m 80
191  DMin_m 80 # can be lower to speed up the reconstruction (for online)
192  E_GeV 13
193  R_Hz 10000
194  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
195  MaxAngle_deg_lowE 40
196  scanAngle_deg_lowE 10
197  MaxAngle_deg_highE 20
198  scanAngle_deg_highE 5)
199 
201 
202 eval JShowerDirectionPrefit \
203  -a $DETECTOR \
204  -+${^CALIBRATION} \
205  -T $TMAX_S \
206  -f ${OUTPUT_FILE/\%/jshenergyprefit} \
207  -F $PDF \
208  -o ${OUTPUT_FILE/\%/jshdirectionprefit} \
209  -@ `make_equation PARAMETERS` \
210  -d $DEBUG --!
211 
212 timer_stop
213 timer_print
214 
215 rm -vf ${OUTPUT_FILE/\%/jshenergyprefit}
216 
217 # ------------------------------------------------------------------------------------------
218 # JShowerFit
219 # ------------------------------------------------------------------------------------------
220 
221 # default input values
222 PARAMETERS=(
223  numberOfPrefits 4
224  TMax_ns 30
225  TMin_ns -30
226  roadWidth_m 80
227  R_Hz 10000
228  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
229  fit_step 0.05)
230 
232 
233 eval JShowerFit \
234  -a $DETECTOR \
235  -+${^CALIBRATION} \
236  -T $TMAX_S \
237  -f ${OUTPUT_FILE/\%/jshdirectionprefit} \
238  -F $PDF \
239  -o ${OUTPUT_FILE/\%/jshfit} \
240  -@ `make_equation PARAMETERS` \
241  -E $JPP_DIR/software/JReconstruction/energy_correction_showerfit_fullorca.txt \
242  -d $DEBUG --!
243 
244 CHECK_EXIT_CODE
245 
246 timer_stop
247 timer_print
248 
249 rm -vf ${OUTPUT_FILE/\%/jshdirectionprefit}
250 
251 # ------------------------------------------------------------------------------------------
252 # rename outputfile
253 # ------------------------------------------------------------------------------------------
254 
256 
257 mv \
258  ${OUTPUT_FILE/\%/jshfit} \
259  ${OUTPUT_FILE/\%/${SUFFIX}} \
260  -v
261 
262 timer_stop
263 timer_print
264 
265 
266 # ------------------------------------------------------------------------------------------
267 # JConvertEvt
268 # ------------------------------------------------------------------------------------------
269 
271 
272 JConvertEvt \
273  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
274  -o ${OUTPUT_FILE/\%/${SUFFIX}.aanet} \
275  -a $DETECTOR \
276  -P $PMT \
277  -d $DEBUG --!
278 
279 timer_stop
280 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 nIn only modules within the given range of floors are used 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 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
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
set_variable INPUT_FILE
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:42
o $QUALITY_ROOT d $DEBUG!JPlot1D f
Definition: JDataQuality.sh:66
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
then awk F
* usage
then JConvertDetectorFormat a $DETECTOR[1] o
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
do JPlot2D f $WORKDIR detector root
&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:42
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
script
Definition: JAcoustics.sh:2
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