Jpp
 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 
20 set_variable PDF $JPP_DATA/J%p.dat
21 set_variable SUF ${JORCAREC_SUF:-jchain.orca}
22 
23 if ( do_usage $* ); then
24  usage "$script <detector file> <input file> <output file> [PDF file descriptor]"
25 fi
26 
27 case $# in
28  4) set_variable PDF $4;&
32  *) fatal "Wrong number of arguments.";;
33 esac
34 
35 if [[ ! "$OUTPUT_FILE" == *"%"* ]]; then
36  fatal "The output file must have the wildcard % in the name, e.g. %.root"
37 fi
38 
39 
40 # ------------------------------------------------------------------------------------------
41 # JMuonPrefit
42 # ------------------------------------------------------------------------------------------
43 
44 PARAMETERS=(
45  sigma_ns 5
46  gridAngle_deg 5
47  useL0 1
48  numberOfOutliers 2
49  numberOfPrefits 12
50  DZMax 0.0
51  numberOfDZMax 1
52  TMaxLocal_ns 12
53  ctMin 0.0
54  roadWidth_m 50.0)
55 
57 
58 eval JMuonPrefit \
59  -a $DETECTOR \
60  -f $INPUT_FILE \
61  -o ${OUTPUT_FILE/\%/jprefit} \
62  -@ `make_equation PARAMETERS` \
63  -d $DEBUG --!
64 
65 CHECK_EXIT_CODE
66 
67 timer_stop
68 timer_print
69 
70 
71 # ------------------------------------------------------------------------------------------
72 # JMuonSimplex
73 # ------------------------------------------------------------------------------------------
74 
75 PARAMETERS=(
76  sigma_ns 3
77  TMaxLocal_ns 15.0
78  ctMin 0.0
79  roadWidth_m 50.0
80  numberOfPrefits 0)
81 
83 
84 eval JMuonSimplex \
85  -a $DETECTOR \
86  -f ${OUTPUT_FILE/\%/jprefit} \
87  -o ${OUTPUT_FILE/\%/jsimplex} \
88  -@ `make_equation PARAMETERS` \
89  -d ${DEBUG} --!
90 
91 CHECK_EXIT_CODE
92 
93 timer_stop
94 timer_print
95 
96 
97 # ------------------------------------------------------------------------------------------
98 # JMuonStart
99 # ------------------------------------------------------------------------------------------
100 
101 PARAMETERS=(
102  roadWidth_m 50.0
103  R_Hz 7.0e3
104  TMin_ns -25.0
105  TMax_ns +25.0
106  Pmin1 1.0e-3
107  Pmin2 1.0e-2
108  numberOfPrefits 0)
109 
111 
112 eval JMuonStart \
113  -a $DETECTOR \
114  -f ${OUTPUT_FILE/\%/jsimplex} \
115  -o ${OUTPUT_FILE/\%/jstart} \
116  -P $PDF \
117  -@ `make_equation PARAMETERS` \
118  -d $DEBUG --!
119 
120 CHECK_EXIT_CODE
121 
122 timer_stop
123 timer_print
124 
125 
126 # ------------------------------------------------------------------------------------------
127 # JMuonGandalf
128 # ------------------------------------------------------------------------------------------
129 
130 PARAMETERS=(
131  TTS_ns 2
132  E_GeV 10.0
133  TMin_ns -50.0
134  TMax_ns +450.0
135  ZMin_m -3.0
136  ZMax_m +9.0
137  R_Hz 7.0e3
138  roadWidth_m 50.0
139  numberOfPrefits 0)
140 
142 
143 eval JMuonGandalf \
144  -a $DETECTOR \
145  -f ${OUTPUT_FILE/\%/jstart} \
146  -o ${OUTPUT_FILE/\%/jgandalf} \
147  -P $PDF \
148  -@ `make_equation PARAMETERS` \
149  -d $DEBUG --!
150 
151 CHECK_EXIT_CODE
152 
153 timer_stop
154 timer_print
155 
156 
157 # ------------------------------------------------------------------------------------------
158 # JMuonStart
159 # ------------------------------------------------------------------------------------------
160 
161 PARAMETERS=(
162  roadWidth_m 50.0
163  R_Hz 7.0e3
164  TMin_ns -25.0
165  TMax_ns +25.0
166  Pmin1 1.0e-3
167  Pmin2 1.0e-2
168  numberOfPrefits 1)
169 
171 
172 eval JMuonStart \
173  -a $DETECTOR \
174  -f ${OUTPUT_FILE/\%/jgandalf} \
175  -o ${OUTPUT_FILE/\%/jstart2} \
176  -P $PDF \
177  -@ `make_equation PARAMETERS` \
178  -d $DEBUG --!
179 
180 CHECK_EXIT_CODE
181 
182 timer_stop
183 timer_print
184 
185 
186 # ------------------------------------------------------------------------------------------
187 # JMuonEnergy
188 # ------------------------------------------------------------------------------------------
189 
190 PARAMETERS=(
191  roadWidth_m 50.0
192  R_Hz 7.0e3
193  EMin_log 0.0
194  EMax_log 7.0
195  TMin_ns -25.0
196  TMax_ns +25.0
197  ZMin_m -3.0
198  resolution 0.01
199  mestimator 3
200  numberOfPrefits 1)
201 
203 
204 eval JMuonEnergy \
205  -a $DETECTOR \
206  -f ${OUTPUT_FILE/\%/jstart2} \
207  -o ${OUTPUT_FILE/\%/jenergy} \
208  -P $PDF \
209  -@ `make_equation PARAMETERS` \
210  -d $DEBUG --!
211 
212 CHECK_EXIT_CODE
213 
214 timer_stop
215 timer_print
216 
217 
218 # ------------------------------------------------------------------------------------------
219 # rename outputfile and remove intermediate files
220 # ------------------------------------------------------------------------------------------
221 
223 
224 mv \
225  ${OUTPUT_FILE/\%/jenergy} \
226  ${OUTPUT_FILE/\%/${SUF}} \
227  -v
228 
229 rm \
230  ${OUTPUT_FILE/\%/jprefit} \
231  ${OUTPUT_FILE/\%/jsimplex} \
232  ${OUTPUT_FILE/\%/jstart} \
233  ${OUTPUT_FILE/\%/jgandalf} \
234  ${OUTPUT_FILE/\%/jstart2} \
235  -v
236 
237 timer_stop
238 timer_print
239 
240 
241 # ------------------------------------------------------------------------------------------
242 # JConvertEvt
243 # ------------------------------------------------------------------------------------------
244 
246 
247 JConvertEvt \
248  -f ${OUTPUT_FILE/\%/${SUF}} \
249  -o ${OUTPUT_FILE/\%/${SUF}.aanet} \
250  -d $DEBUG --!
251 
252 timer_stop
253 timer_print
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
set_variable DETECTOR
Definition: JLegolas.sh:31
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 SUF
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
exit
Definition: JPizza.sh:36
&set_variable INPUT_FILE
Definition: JLegolas.sh:30
fi JEventTimesliceWriter a
then JPizza f
Definition: JPizza.sh:46
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 print_variable DETECTOR INPUT_FILE INTERMEDIATE_FILE check_input_file $DETECTOR $INPUT_FILE check_output_file $INTERMEDIATE_FILE $OUTPUT_FILE JMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JPath.sh:52
* usage
then usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
data_type v[N+1][M+1]
Definition: JPolint.hh:707
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:60
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62