Jpp  15.0.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 source $JPP_DIR/setenv.sh $JPP_DIR
18 
19 set_variable: DEBUG RECONSTRUCTION_DEBUG 1
20 set_variable: PDF RECONSTRUCTION_PDF $JPP_DATA/J%p.dat
21 set_variable: SUFFIX RECONSTRUCTION_SUFFIX jchain.arca
22 set_variable: ENERGY_CORRECTION RECONSTRUCTION_ENERGY_CORRECTION energy_correction_arca.txt
23 set_variable: NUMBER_OF_EVENTS RECONSTRUCTION_NUMBER_OF_EVENTS $((2**31))
24 set_variable: TMAX_S RECONSTRUCTION_TMAX_S 100
25 
26 if do_usage $*; then
27  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
28 fi
29 
30 if (( $# < 4 )); then
31  fatal "Wrong number of arguments."
32 fi
33 
38 set_array CALIBRATION $argv[5,-1]
39 
40 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
41  fatal "The output file must have the wildcard % in the name, e.g. %.root"
42 fi
43 
44 
45 # ------------------------------------------------------------------------------------------
46 # JMuonPrefit
47 # ------------------------------------------------------------------------------------------
48 
49 PARAMETERS=(
50  sigma_ns 5
51  gridAngle_deg 1
52  useL0 0
53  numberOfOutliers 3
54  numberOfPrefits 12
55  DZMax 0.0
56  numberOfDZMax 1
57  TMaxLocal_ns 18
58  ctMin 0.0
59  roadWidth_m 200.0)
60 
62 
63 eval JMuonPrefit \
64  -a $DETECTOR \
65  -+${^CALIBRATION} \
66  -T $TMAX_S \
67  -f $INPUT_FILE \
68  -o ${OUTPUT_FILE/\%/jprefit} \
69  -n ${NUMBER_OF_EVENTS} \
70  -@ `make_equation PARAMETERS` \
71  -d $DEBUG --!
72 
73 CHECK_EXIT_CODE
74 
75 timer_stop
76 timer_print
77 
78 
79 # ------------------------------------------------------------------------------------------
80 # JMuonSimplex
81 # ------------------------------------------------------------------------------------------
82 
83 PARAMETERS=(
84  sigma_ns 3
85  TMaxLocal_ns 15.0
86  ctMin 0.0
87  roadWidth_m 200.0
88  numberOfPrefits 0)
89 
91 
92 eval JMuonSimplex \
93  -a $DETECTOR \
94  -+${^CALIBRATION} \
95  -T $TMAX_S \
96  -f ${OUTPUT_FILE/\%/jprefit} \
97  -o ${OUTPUT_FILE/\%/jsimplex} \
98  -@ `make_equation PARAMETERS` \
99  -d ${DEBUG} --!
100 
101 CHECK_EXIT_CODE
102 
103 timer_stop
104 timer_print
105 
106 
107 # ------------------------------------------------------------------------------------------
108 # JMuonGandalf
109 # ------------------------------------------------------------------------------------------
110 
111 PARAMETERS=(
112  TTS_ns 2
113  E_GeV 1.0e3
114  TMin_ns -50.0
115  TMax_ns +450.0
116  R_Hz 6.0e3
117  roadWidth_m 175.0
118  numberOfPrefits 0)
119 
121 
122 eval JMuonGandalf \
123  -a $DETECTOR \
124  -+${^CALIBRATION} \
125  -T $TMAX_S \
126  -f ${OUTPUT_FILE/\%/jsimplex} \
127  -o ${OUTPUT_FILE/\%/jgandalf} \
128  -P $PDF \
129  -@ `make_equation PARAMETERS` \
130  -d $DEBUG --!
131 
132 CHECK_EXIT_CODE
133 
134 timer_stop
135 timer_print
136 
137 
138 # ------------------------------------------------------------------------------------------
139 # JMuonStart
140 # ------------------------------------------------------------------------------------------
141 
142 PARAMETERS=(
143  roadWidth_m 160.0
144  R_Hz 6.0e3
145  TMin_ns -25.0
146  TMax_ns +75.0
147  Pmin1 1.0e-3
148  Pmin2 1.0e-2
149  numberOfPrefits 1)
150 
152 
153 eval JMuonStart \
154  -a $DETECTOR \
155  -+${^CALIBRATION} \
156  -T $TMAX_S \
157  -f ${OUTPUT_FILE/\%/jgandalf} \
158  -o ${OUTPUT_FILE/\%/jstart} \
159  -P $PDF \
160  -@ `make_equation PARAMETERS` \
161  -d $DEBUG --!
162 
163 CHECK_EXIT_CODE
164 
165 timer_stop
166 timer_print
167 
168 
169 # ------------------------------------------------------------------------------------------
170 # JMuonEnergy
171 # ------------------------------------------------------------------------------------------
172 
173 PARAMETERS=(
174  roadWidth_m 200.0
175  R_Hz 6.0e3
176  EMin_log 0.0
177  EMax_log 8.0
178  TMin_ns -50.0
179  TMax_ns +450.0
180  mestimator 1
181  numberOfPrefits 1)
182 
184 
185 eval JMuonEnergy \
186  -a $DETECTOR \
187  -+${^CALIBRATION} \
188  -T $TMAX_S \
189  -f ${OUTPUT_FILE/\%/jstart} \
190  -o ${OUTPUT_FILE/\%/jenergy} \
191  -P $PDF \
192  -E $ENERGY_CORRECTION \
193  -@ `make_equation PARAMETERS` \
194  -d $DEBUG --!
195 
196 CHECK_EXIT_CODE
197 
198 timer_stop
199 timer_print
200 
201 
202 # ------------------------------------------------------------------------------------------
203 # rename outputfile and remove intermediate files
204 # ------------------------------------------------------------------------------------------
205 
207 
208 mv -v \
209  ${OUTPUT_FILE/\%/jenergy} \
210  ${OUTPUT_FILE/\%/${SUFFIX}}
211 
212 rm -vf \
213  ${OUTPUT_FILE/\%/jprefit} \
214  ${OUTPUT_FILE/\%/jsimplex} \
215  ${OUTPUT_FILE/\%/jgandalf} \
216  ${OUTPUT_FILE/\%/jstart} \
217 
218 timer_stop
219 timer_print
220 
221 
222 # ------------------------------------------------------------------------------------------
223 # JConvertEvt
224 # ------------------------------------------------------------------------------------------
225 
227 
228 JConvertEvt \
229  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
230  -o ${OUTPUT_FILE/\%/${SUFFIX}.aanet} \
231  -a $DETECTOR \
232  -P $PMT \
233  -d $DEBUG --!
234 
235 timer_stop
236 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)
set_variable INPUT_FILE
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
* 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 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
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 (( $