Jpp  15.0.3
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 typeset -A PARAMETERS
45 
46 # ------------------------------------------------------------------------------------------
47 # JMuonPrefit
48 # ------------------------------------------------------------------------------------------
49 
50 PARAMETERS=(
51  sigma_ns 5
52  gridAngle_deg 1
53  useL0 0
54  numberOfOutliers 3
55  numberOfPrefits 12
56  DZMax 0.0
57  numberOfDZMax 1
58  TMaxLocal_ns 18
59  ctMin 0.0
60  roadWidth_m 200.0)
61 
63 
64 eval JMuonPrefit \
65  -a $DETECTOR \
66  -+${^CALIBRATION} \
67  -T $TMAX_S \
68  -f $INPUT_FILE \
69  -o ${OUTPUT_FILE/\%/jprefit} \
70  -n ${NUMBER_OF_EVENTS} \
71  -@ `make_equation PARAMETERS` \
72  -d $DEBUG --!
73 
74 CHECK_EXIT_CODE
75 
76 timer_stop
77 timer_print
78 
79 
80 # ------------------------------------------------------------------------------------------
81 # JMuonSimplex
82 # ------------------------------------------------------------------------------------------
83 
84 PARAMETERS=(
85  sigma_ns 3
86  TMaxLocal_ns 15.0
87  ctMin 0.0
88  roadWidth_m 200.0
89  numberOfPrefits 0)
90 
92 
93 eval JMuonSimplex \
94  -a $DETECTOR \
95  -+${^CALIBRATION} \
96  -T $TMAX_S \
97  -f ${OUTPUT_FILE/\%/jprefit} \
98  -o ${OUTPUT_FILE/\%/jsimplex} \
99  -@ `make_equation PARAMETERS` \
100  -d ${DEBUG} --!
101 
102 CHECK_EXIT_CODE
103 
104 timer_stop
105 timer_print
106 
107 
108 # ------------------------------------------------------------------------------------------
109 # JMuonGandalf
110 # ------------------------------------------------------------------------------------------
111 
112 PARAMETERS=(
113  TTS_ns 2
114  E_GeV 1.0e3
115  TMin_ns -50.0
116  TMax_ns +450.0
117  R_Hz 6.0e3
118  roadWidth_m 175.0
119  numberOfPrefits 0)
120 
122 
123 eval JMuonGandalf \
124  -a $DETECTOR \
125  -+${^CALIBRATION} \
126  -T $TMAX_S \
127  -f ${OUTPUT_FILE/\%/jsimplex} \
128  -o ${OUTPUT_FILE/\%/jgandalf} \
129  -P $PDF \
130  -@ `make_equation PARAMETERS` \
131  -d $DEBUG --!
132 
133 CHECK_EXIT_CODE
134 
135 timer_stop
136 timer_print
137 
138 
139 # ------------------------------------------------------------------------------------------
140 # JMuonStart
141 # ------------------------------------------------------------------------------------------
142 
143 PARAMETERS=(
144  roadWidth_m 160.0
145  R_Hz 6.0e3
146  TMin_ns -25.0
147  TMax_ns +75.0
148  Pmin1 1.0e-3
149  Pmin2 1.0e-2
150  numberOfPrefits 1)
151 
153 
154 eval JMuonStart \
155  -a $DETECTOR \
156  -+${^CALIBRATION} \
157  -T $TMAX_S \
158  -f ${OUTPUT_FILE/\%/jgandalf} \
159  -o ${OUTPUT_FILE/\%/jstart} \
160  -P $PDF \
161  -@ `make_equation PARAMETERS` \
162  -d $DEBUG --!
163 
164 CHECK_EXIT_CODE
165 
166 timer_stop
167 timer_print
168 
169 
170 # ------------------------------------------------------------------------------------------
171 # JMuonEnergy
172 # ------------------------------------------------------------------------------------------
173 
174 PARAMETERS=(
175  roadWidth_m 200.0
176  R_Hz 6.0e3
177  EMin_log 0.0
178  EMax_log 8.0
179  TMin_ns -50.0
180  TMax_ns +450.0
181  mestimator 1
182  numberOfPrefits 1)
183 
185 
186 eval JMuonEnergy \
187  -a $DETECTOR \
188  -+${^CALIBRATION} \
189  -T $TMAX_S \
190  -f ${OUTPUT_FILE/\%/jstart} \
191  -o ${OUTPUT_FILE/\%/jenergy} \
192  -P $PDF \
193  -E $ENERGY_CORRECTION \
194  -@ `make_equation PARAMETERS` \
195  -d $DEBUG --!
196 
197 CHECK_EXIT_CODE
198 
199 timer_stop
200 timer_print
201 
202 
203 # ------------------------------------------------------------------------------------------
204 # rename outputfile and remove intermediate files
205 # ------------------------------------------------------------------------------------------
206 
208 
209 mv -v \
210  ${OUTPUT_FILE/\%/jenergy} \
211  ${OUTPUT_FILE/\%/${SUFFIX}}
212 
213 rm -vf \
214  ${OUTPUT_FILE/\%/jprefit} \
215  ${OUTPUT_FILE/\%/jsimplex} \
216  ${OUTPUT_FILE/\%/jgandalf} \
217  ${OUTPUT_FILE/\%/jstart} \
218 
219 timer_stop
220 timer_print
221 
222 
223 # ------------------------------------------------------------------------------------------
224 # JConvertEvt
225 # ------------------------------------------------------------------------------------------
226 
228 
229 JConvertEvt \
230  -f ${OUTPUT_FILE/\%/${SUFFIX}} \
231  -o ${OUTPUT_FILE/\%/${SUFFIX}.aanet} \
232  -a $DETECTOR \
233  -P $PMT \
234  -d $DEBUG --!
235 
236 timer_stop
237 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)
set_variable INPUT_FILE
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
* usage
then JConvertDetectorFormat a $DETECTOR[1] o
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
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
do if[[!-f $ACOUSTICS_WORKDIR/${KEY}.txt]]
Definition: JAcoustics.sh:39