Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JORCAMuonReconstruction.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 ORCA.
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 ${JORCAREC_DEBUG:-1}
20 set_variable PDF ${JORCAREC_PDF:-$JPP_DATA/J%p.dat}
21 set_variable SUF ${JORCAREC_SUF:-jchain.orca}
22 set_variable NUMBER_OF_EVENTS ${JORCAREC_NUMBER_OF_EVENTS:-$((2**31))}
23 
24 if ( do_usage $* ); then
25  usage "$script <detector file> <input file> <output file> <PMT parameters file> [(calibration file)+]"
26 fi
27 
28 if (( $# < 4 )); then
29  fatal "Wrong number of arguments."
30 fi
31 
36 set_array CALIBRATION $argv[5,-1]
37 
38 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
39  fatal "The output file must have the wildcard % in the name, e.g. %.root"
40 fi
41 
42 
43 # ------------------------------------------------------------------------------------------
44 # JMuonPrefit
45 # ------------------------------------------------------------------------------------------
46 
47 PARAMETERS=(
48  sigma_ns 5
49  gridAngle_deg 5
50  useL0 1
51  numberOfOutliers 2
52  numberOfPrefits 12
53  DZMax 0.0
54  numberOfDZMax 1
55  TMaxLocal_ns 12
56  ctMin 0.0
57  roadWidth_m 50.0)
58 
60 
61 eval JMuonPrefit \
62  -a $DETECTOR \
63  -f $INPUT_FILE \
64  -o ${OUTPUT_FILE/\%/jprefit} \
65  -n ${NUMBER_OF_EVENTS} \
66  -@ `make_equation PARAMETERS` \
67  -d $DEBUG --!
68 
69 CHECK_EXIT_CODE
70 
71 timer_stop
72 timer_print
73 
74 
75 # ------------------------------------------------------------------------------------------
76 # JMuonSimplex
77 # ------------------------------------------------------------------------------------------
78 
79 PARAMETERS=(
80  sigma_ns 3
81  TMaxLocal_ns 15.0
82  ctMin 0.0
83  roadWidth_m 50.0
84  numberOfPrefits 0)
85 
87 
88 eval JMuonSimplex \
89  -a $DETECTOR \
90  -f ${OUTPUT_FILE/\%/jprefit} \
91  -o ${OUTPUT_FILE/\%/jsimplex} \
92  -@ `make_equation PARAMETERS` \
93  -d ${DEBUG} --!
94 
95 CHECK_EXIT_CODE
96 
97 timer_stop
98 timer_print
99 
100 
101 # ------------------------------------------------------------------------------------------
102 # JMuonStart
103 # ------------------------------------------------------------------------------------------
104 
105 PARAMETERS=(
106  roadWidth_m 50.0
107  R_Hz 7.0e3
108  TMin_ns -25.0
109  TMax_ns +25.0
110  Pmin1 1.0e-3
111  Pmin2 1.0e-2
112  numberOfPrefits 0)
113 
115 
116 eval JMuonStart \
117  -a $DETECTOR \
118  -f ${OUTPUT_FILE/\%/jsimplex} \
119  -o ${OUTPUT_FILE/\%/jstart} \
120  -P $PDF \
121  -@ `make_equation PARAMETERS` \
122  -d $DEBUG --!
123 
124 CHECK_EXIT_CODE
125 
126 timer_stop
127 timer_print
128 
129 
130 # ------------------------------------------------------------------------------------------
131 # JMuonGandalf
132 # ------------------------------------------------------------------------------------------
133 
134 PARAMETERS=(
135  TTS_ns 2
136  E_GeV 10.0
137  TMin_ns -50.0
138  TMax_ns +450.0
139  ZMin_m -3.0
140  ZMax_m +9.0
141  R_Hz 7.0e3
142  roadWidth_m 50.0
143  numberOfPrefits 0)
144 
146 
147 eval JMuonGandalf \
148  -a $DETECTOR \
149  -f ${OUTPUT_FILE/\%/jstart} \
150  -o ${OUTPUT_FILE/\%/jgandalf} \
151  -P $PDF \
152  -@ `make_equation PARAMETERS` \
153  -+${^CALIBRATION} \
154  -d $DEBUG --!
155 
156 CHECK_EXIT_CODE
157 
158 timer_stop
159 timer_print
160 
161 
162 # ------------------------------------------------------------------------------------------
163 # JMuonStart
164 # ------------------------------------------------------------------------------------------
165 
166 PARAMETERS=(
167  roadWidth_m 50.0
168  R_Hz 7.0e3
169  TMin_ns -25.0
170  TMax_ns +25.0
171  Pmin1 1.0e-3
172  Pmin2 1.0e-2
173  numberOfPrefits 1)
174 
176 
177 eval JMuonStart \
178  -a $DETECTOR \
179  -f ${OUTPUT_FILE/\%/jgandalf} \
180  -o ${OUTPUT_FILE/\%/jstart2} \
181  -P $PDF \
182  -@ `make_equation PARAMETERS` \
183  -d $DEBUG --!
184 
185 CHECK_EXIT_CODE
186 
187 timer_stop
188 timer_print
189 
190 
191 # ------------------------------------------------------------------------------------------
192 # JMuonEnergy
193 # ------------------------------------------------------------------------------------------
194 
195 PARAMETERS=(
196  roadWidth_m 80.0
197  R_Hz 7.0e3
198  EMin_log 0.0
199  EMax_log 7.0
200  TMin_ns -25.0
201  TMax_ns +25.0
202  ZMin_m -3.0
203  resolution 0.01
204  mestimator 3
205  numberOfPrefits 1)
206 
208 
209 eval JMuonEnergy \
210  -a $DETECTOR \
211  -f ${OUTPUT_FILE/\%/jstart2} \
212  -o ${OUTPUT_FILE/\%/jenergy} \
213  -P $PDF \
214  -@ `make_equation PARAMETERS` \
215  -d $DEBUG --!
216 
217 CHECK_EXIT_CODE
218 
219 timer_stop
220 timer_print
221 
222 
223 # ------------------------------------------------------------------------------------------
224 # rename outputfile and remove intermediate files
225 # ------------------------------------------------------------------------------------------
226 
228 
229 mv \
230  ${OUTPUT_FILE/\%/jenergy} \
231  ${OUTPUT_FILE/\%/${SUF}} \
232  -v
233 
234 rm \
235  ${OUTPUT_FILE/\%/jprefit} \
236  ${OUTPUT_FILE/\%/jsimplex} \
237  ${OUTPUT_FILE/\%/jstart} \
238  ${OUTPUT_FILE/\%/jgandalf} \
239  ${OUTPUT_FILE/\%/jstart2} \
240  -v
241 
242 timer_stop
243 timer_print
244 
245 
246 # ------------------------------------------------------------------------------------------
247 # JConvertEvt
248 # ------------------------------------------------------------------------------------------
249 
251 
252 JConvertEvt \
253  -f ${OUTPUT_FILE/\%/${SUF}} \
254  -o ${OUTPUT_FILE/\%/${SUF}.aanet} \
255  -a $DETECTOR \
256  -+${^CALIBRATION} \
257  -P $PMT \
258  -d $DEBUG --!
259 
260 timer_stop
261 timer_print
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
static const JPBS_t PMT(3, 4, 2, 3)
PBS of photo-multiplier tube (PMT)
set_variable INPUT_FILE
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:79
then echo
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 usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
*set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2,-2] set_variable OUTPUT_FILE $argv[-1]
Definition: JDomino.sh:39
&set_variable OUTPUT_FILE
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then JCalibrateToT a
Definition: JTuneHV.sh:108
alias put_queue eval echo n
Definition: qlib.csh:19
set_variable DETECTOR
data_type v[N+1][M+1]
Definition: JPolint.hh:740
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:60
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62