Jpp
 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 
22 set_variable PDF $JPP_DATA/J%p.dat
23 set_variable SUF ${JORCASHOWERREC_SUF:-jshowerchain.orca}
24 
25 if ( do_usage $* ); then
26  usage "$script <detector file> <input file> <output file> [PDF file descriptor]"
27 fi
28 
29 case $# in
30  4) set_variable PDF $4;&
34  *) fatal "Wrong number of arguments.";;
35 esac
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 # ------------------------------------------------------------------------------------------
42 # JShowerPrefit
43 # ------------------------------------------------------------------------------------------
44 
45 
46 # default input values
47 PARAMETERS=(
48  factoryLimit 40
49  NMaxHits 20
50  sigma_ns 4
51  numberOfOutliers 4
52  TMaxLocal_ns 120
53  ctMin -0.7
54  roadWidth_m 50)
55 
57 
58 eval JShowerPrefit \
59  -a $DETECTOR \
60  -f $INPUT_FILE \
61  -o ${OUTPUT_FILE/\%/jshprefit} \
62  -@ `make_equation PARAMETERS` \
63  -d ${DEBUG} --!
64 
65 timer_stop
66 timer_print
67 
68 
69 # ------------------------------------------------------------------------------------------
70 # JShowerPointSimplex
71 # ------------------------------------------------------------------------------------------
72 
73 
74 # default input values
75 PARAMETERS=(
76  numberOfPrefits 50
77  minPrefitsSize 9
78  sigma_ns 1
79  TMaxLocal_ns 15
80  TMax_ns 60
81  TMin_ns -60
82  roadWidth_m 60
83  ctMin 0.2
84  TWindow_ns "-130, 120"
85  pos_grid_m " -20, 20"
86  pos_step_m 20
87  time_grid_ns " -90, 90"
88  time_step_ns 30
89  simplex_step_m 2
90  simplex_step_ns 10
91  tukey_std_dev 20.0)
92 
94 
95 eval JShowerPointSimplex \
96  -a $DETECTOR \
97  -f ${OUTPUT_FILE/\%/jshprefit} \
98  -o ${OUTPUT_FILE/\%/jshpointsimplex} \
99  -@ `make_equation PARAMETERS` \
100  -d ${DEBUG} --!
101 
102 timer_stop
103 timer_print
104 
105 
106 # ------------------------------------------------------------------------------------------
107 # JShowerPositionFit
108 # ------------------------------------------------------------------------------------------
109 
110 
111 # default input values
112 PARAMETERS=(
113  numberOfPrefits 100
114  TMax_ns 120
115  TMin_ns -120
116  roadWidth_m 80
117  E_GeV 10
118  R_Hz 10000
119  TTS_ns 2)
120 
122 
123 eval JShowerPositionFit \
124  -a $DETECTOR \
125  -f ${OUTPUT_FILE/\%/jshpointsimplex} \
126  -F $PDF \
127  -o ${OUTPUT_FILE/\%/jshpositionfit} \
128  -@ `make_equation PARAMETERS` \
129  -d ${DEBUG} --!
130 
131 timer_stop
132 timer_print
133 
134 
135 # ------------------------------------------------------------------------------------------
136 # JShowerEnergyPrefit
137 # ------------------------------------------------------------------------------------------
138 
139 
140 # default input values
141 PARAMETERS=(
142  numberOfPrefits 5
143  Emin_GeV 1
144  Emax_GeV 100
145  resolution 0.01
146  TMax_ns 500
147  TMin_ns -500
148  R_Hz 10000
149  mestimator 3
150  roadWidth_m 80)
151 
153 
154 eval JShowerEnergyPrefit \
155  -a $DETECTOR \
156  -f ${OUTPUT_FILE/\%/jshpositionfit} \
157  -F $PDF \
158  -o ${OUTPUT_FILE/\%/jshenergyprefit} \
159  -@ `make_equation PARAMETERS` \
160  -d $DEBUG --!
161 
162 timer_stop
163 timer_print
164 
165 
166 # ------------------------------------------------------------------------------------------
167 # JShowerDirectionPrefit
168 # ------------------------------------------------------------------------------------------
169 
170 
171 # default input values
172 PARAMETERS=(
173  numberOfPrefits 1
174  TMax_ns 30
175  TMin_ns -30
176  roadWidth_m 80
177  DMin_m 80 # can be lower to speed up the reconstruction (for online)
178  E_GeV 13
179  R_Hz 10000
180  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
181  MaxAngle_deg_lowE 40
182  scanAngle_deg_lowE 10
183  MaxAngle_deg_highE 20
184  scanAngle_deg_highE 5)
186 
187 eval JShowerDirectionPrefit \
188  -a $DETECTOR \
189  -f ${OUTPUT_FILE/\%/jshenergyprefit} \
190  -F $PDF \
191  -o ${OUTPUT_FILE/\%/jshdirectionprefit} \
192  -@ `make_equation PARAMETERS` \
193  -d $DEBUG --!
194 
195 timer_stop
196 timer_print
197 
198 
199 # ------------------------------------------------------------------------------------------
200 # JShowerFit
201 # ------------------------------------------------------------------------------------------
202 
203 
204 # default input values
205 PARAMETERS=(
206  numberOfPrefits 4
207  TMax_ns 30
208  TMin_ns -30
209  roadWidth_m 80
210  R_Hz 10000
211  mestimator 3 # 0=normal, 1=lorentzian, 2=linear, 3=null
212  fit_step 0.05)
213 
215 
216 eval JShowerFit \
217  -a $DETECTOR \
218  -f ${OUTPUT_FILE/\%/jshdirectionprefit} \
219  -F $PDF \
220  -o ${OUTPUT_FILE/\%/jshfit} \
221  -@ `make_equation PARAMETERS` \
222  -E $JPP_DIR/software/JReconstruction/energy_correction_showerfit_fullorca.txt \
223  -d $DEBUG --!
224 
225 timer_stop
226 timer_print
227 
228 
229 # ------------------------------------------------------------------------------------------
230 # rename outputfile and remove intermediate files
231 # ------------------------------------------------------------------------------------------
232 
234 
235 mv \
236  ${OUTPUT_FILE/\%/jshfit} \
237  ${OUTPUT_FILE/\%/${SUF}} \
238  -v
239 
240 rm \
241  ${OUTPUT_FILE/\%/jshprefit} \
242  ${OUTPUT_FILE/\%/jshpointsimplex} \
243  ${OUTPUT_FILE/\%/jshpositionfit} \
244  ${OUTPUT_FILE/\%/jshenergyprefit} \
245  ${OUTPUT_FILE/\%/jshdirectionprefit} \
246  -v
247 
248 timer_stop
249 timer_print
250 
251 
252 # ------------------------------------------------------------------------------------------
253 # JConvertEvt
254 # ------------------------------------------------------------------------------------------
255 
257 
258 JConvertEvt \
259  -f ${OUTPUT_FILE/\%/${SUF}} \
260  -o ${OUTPUT_FILE/\%/${SUF}.aanet} \
261  -d $DEBUG --!
262 
263 timer_stop
264 timer_print
void set_variable(const std::string &name, const std::string &value)
Set environment variable.
set_variable DETECTOR
Definition: JLegolas.sh:31
then check_input_file $DETECTOR $INPUT_FILE for OPTION in A B C D E F
Definition: JFilter.sh:47
then for mestimator in normal linear lorentzian
Definition: JMEstimator.sh:34
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
esac $JPP_BIN JLogger sh $LOGGER until pgrep JGetMessage</dev/null > dev null
then usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62