Jpp
 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 
20 set_variable PDF $JPP_DATA/J%p.dat
21 set_variable PMT $JPP_DATA/PMT_parameters.txt
22 set_variable SUF ${JARCAREC_SUF:-jchain.arca}
23 set_variable NUMBER_OF_EVENTS ${JARCAREC_NUMBER_OF_EVENTS:-$((2**31))}
24 
25 if ( do_usage $* ); then
26  usage "$script <detector file> <input file> <output file> [PDF file descriptor [PMT parameters file]]"
27 fi
28 
29 case $# in
30  5) set_variable PMT $5;&
31  4) set_variable PDF $4;&
35  *) fatal "Wrong number of arguments.";;
36 esac
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 1
50  useL0 0
51  numberOfOutliers 3
52  numberOfPrefits 12
53  DZMax 0.0
54  numberOfDZMax 1
55  TMaxLocal_ns 18
56  ctMin 0.0
57  roadWidth_m 200.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 200.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 # JMuonGandalf
103 # ------------------------------------------------------------------------------------------
104 
105 PARAMETERS=(
106  TTS_ns 2
107  E_GeV 1.0e3
108  TMin_ns -50.0
109  TMax_ns +450.0
110  R_Hz 6.0e3
111  roadWidth_m 175.0
112  numberOfPrefits 0)
113 
115 
116 eval JMuonGandalf \
117  -a $DETECTOR \
118  -f ${OUTPUT_FILE/\%/jsimplex} \
119  -o ${OUTPUT_FILE/\%/jgandalf} \
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 # JMuonStart
132 # ------------------------------------------------------------------------------------------
133 
134 PARAMETERS=(
135  roadWidth_m 160.0
136  R_Hz 6.0e3
137  TMin_ns -25.0
138  TMax_ns +75.0
139  Pmin1 1.0e-3
140  Pmin2 1.0e-2
141  numberOfPrefits 1)
142 
144 
145 eval JMuonStart \
146  -a $DETECTOR \
147  -f ${OUTPUT_FILE/\%/jgandalf} \
148  -o ${OUTPUT_FILE/\%/jstart} \
149  -P $PDF \
150  -@ `make_equation PARAMETERS` \
151  -d $DEBUG --!
152 
153 CHECK_EXIT_CODE
154 
155 timer_stop
156 timer_print
157 
158 
159 # ------------------------------------------------------------------------------------------
160 # JMuonEnergy
161 # ------------------------------------------------------------------------------------------
162 
163 PARAMETERS=(
164  roadWidth_m 200.0
165  R_Hz 6.0e3
166  EMin_log 0.0
167  EMax_log 8.0
168  TMin_ns -50.0
169  TMax_ns +450.0
170  mestimator 1
171  numberOfPrefits 1)
172 
174 
175 eval JMuonEnergy \
176  -a $DETECTOR \
177  -f ${OUTPUT_FILE/\%/jstart} \
178  -o ${OUTPUT_FILE/\%/jenergy} \
179  -P $PDF \
180  -E energy_correction_arca.txt \
181  -@ `make_equation PARAMETERS` \
182  -d $DEBUG --!
183 
184 CHECK_EXIT_CODE
185 
186 timer_stop
187 timer_print
188 
189 
190 # ------------------------------------------------------------------------------------------
191 # rename outputfile and remove intermediate files
192 # ------------------------------------------------------------------------------------------
193 
195 
196 mv \
197  ${OUTPUT_FILE/\%/jenergy} \
198  ${OUTPUT_FILE/\%/${SUF}} \
199  -v
200 
201 rm \
202  ${OUTPUT_FILE/\%/jprefit} \
203  ${OUTPUT_FILE/\%/jsimplex} \
204  ${OUTPUT_FILE/\%/jgandalf} \
205  ${OUTPUT_FILE/\%/jstart} \
206  -v
207 
208 timer_stop
209 timer_print
210 
211 
212 # ------------------------------------------------------------------------------------------
213 # JConvertEvt
214 # ------------------------------------------------------------------------------------------
215 
217 
218 JConvertEvt \
219  -f ${OUTPUT_FILE/\%/${SUF}} \
220  -o ${OUTPUT_FILE/\%/${SUF}.aanet} \
221  -a $DETECTOR \
222  -P $PMT \
223  -d $DEBUG --!
224 
225 timer_stop
226 timer_print
set_variable DETECTOR
then usage $script< detector file >< inputfile >< outputfile > fi case set_variable PDF
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)
exit
Definition: JPizza.sh:36
do set_array DAQHEADER JPrintDAQHeader f
Definition: JTuneHV.sh:74
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 PMT $JPP_DATA PMT_parameters txt set_variable SUF
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 $
&set_variable OUTPUT_FILE
do $DIR JTransitTime o
Definition: JTransitTime.sh:44
* usage
then JFileTuna f $INPUT_FILE
Definition: file-Tuna.sh:66
then JMuonMCEvt f $INPUT_FILE o $INTERMEDIATE_FILE d
Definition: JMuonPath.sh:45
then JCalibrateToT a
Definition: JTuneHV.sh:103
alias put_queue eval echo n
Definition: qlib.csh:19
PARAMETERS
Definition: JAcoustics.sh:52
data_type v[N+1][M+1]
Definition: JPolint.hh:740
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:36
script
Definition: JAcoustics.sh:2
set_variable INPUT_FILE
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 usage $script[input file[working directory[option]]] nWhere option can be E
Definition: JMuonPostfit.sh:37
then $DIR JPlotNPE PDG P
Definition: JPlotNPE-PDG.sh:60
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62