forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsim_challenge.sh
More file actions
executable file
·221 lines (177 loc) · 7.18 KB
/
Copy pathsim_challenge.sh
File metadata and controls
executable file
·221 lines (177 loc) · 7.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
#!/bin/bash
# chain of algorithms from MC and reco
# ------------ LOAD UTILITY FUNCTIONS ----------------------------
. ${O2_ROOT}/share/scripts/jobutils.sh
# ----------- START WITH ACTUAL SCRIPT ---------------------------
if [ -z "$SHMSIZE" ]; then export SHMSIZE=10000000000; fi
# default number of events
nevPP=10
nevPbPb=10
# default interaction rates in kHz
intRatePP=400
intRatePbPb=50
# default collision system
collSyst="pp"
generPP="pythia8pp"
generPbPb="pythia8hi"
# default sim engine
engine="TGeant3"
# options to pass to every workflow
gloOpt=" -b --run --shm-segment-size $SHMSIZE"
# ITS reco options depends on pp or pbpb
ITSRecOpt=""
# option to set the number of sim workers
simWorker=""
# option to set the number of tpc-lanes
tpcLanes=""
Usage()
{
echo "Usage: ${0##*/} [-s system /pp[Def] or pbpb/] [-r IR(kHz) /Def = $intRatePP(pp)/$intRatePbPb(pbpb)] [-n Number of events /Def = $nevPP(pp) or $nevPbPb(pbpb)/] [-e TGeant3|TGeant4] [-f fromstage sim|digi|reco /Def = sim]"
exit
}
fromstage="sim"
while [ $# -gt 0 ] ; do
case $1 in
-n) nev=$2; shift 2 ;;
-s) collSyst=$2; shift 2 ;;
-r) intRate=$2; shift 2 ;;
-e) engine=$2; shift 2 ;;
-f) fromstage=$2; shift 2 ;;
-j) simWorker="-j $2"; shift 2 ;;
-l) tpcLanes="--tpc-lanes $2"; shift 2 ;;
-h) Usage ;;
*) echo "Wrong input"; Usage;
esac
done
# convert to lower case (the bash construct ${collSyst,,} is less portable)
collSyst=`echo "$collSyst" | awk '{print tolower($0)}'`
if [ "$collSyst" == "pp" ]; then
gener="$generPP"
ITSRecOpt=" --configKeyValues \"ITSVertexerParam.phiCut=0.5;ITSVertexerParam.clusterContributorsCut=3;ITSVertexerParam.tanLambdaCut=0.2\""
[[ "nev" -lt "1" ]] && nev="$nevPP"
[[ "intRate" -lt "1" ]] && intRate="$intRatePP"
elif [ "$collSyst" == "pbpb" ]; then
gener="$generPbPb"
[[ "nev" -lt "1" ]] && nev="$nevPbPb"
[[ "intRate" -lt "1" ]] && intRate="$intRatePbPb"
else
echo "Wrong collision system $collSyst provided, should be pp or pbpb"
Usage
fi
dosim="0"
dodigi="0"
dotrdtrap="0"
doreco="0"
# convert to lowercase
fromstage=`echo "$fromstage" | awk '{print tolower($0)}'`
if [ "$fromstage" == "sim" ]; then
dosim="1"
dodigi="1"
dotrdtrap="1"
doreco="1"
elif [ "$fromstage" == "digi" ]; then
dodigi="1"
dotrdtrap="1"
doreco="1"
elif [ "$fromstage" == "reco" ]; then
doreco="1"
else
echo "Wrong stage string $fromstage provided, should be sim or digi or reco"
Usage
fi
if [ "$dosim" == "1" ]; then
#---------------------------------------------------
echo "Running simulation for $nev $collSyst events with $gener generator and engine $engine"
taskwrapper sim.log o2-sim -n"$nev" --configKeyValues "Diamond.width[2]=6." -g "$gener" -e "$engine" $simWorker
##------ extract number of hits
taskwrapper hitstats.log root -q -b -l ${O2_ROOT}/share/macro/analyzeHits.C
fi
if [ "$dodigi" == "1" ]; then
echo "Running digitization for $intRate kHz interaction rate"
intRate=$((1000*(intRate)));
taskwrapper digi.log o2-sim-digitizer-workflow $gloOpt --interactionRate $intRate $tpcLanes
echo "Return status of digitization: $?"
# existing checks
#root -b -q O2/Detectors/ITSMFT/ITS/macros/test/CheckDigits.C+
fi
if [ "$dotrdtrap" == "1" ]; then
echo "Running TRD trap simulator"
taskwrapper trdtrap.log o2-trd-trap-sim $gloOpt
echo "Return status of trd trap sim: $?"
fi
if [ "$doreco" == "1" ]; then
echo "Running TPC reco flow"
#needs TPC digitized data
taskwrapper tpcreco.log o2-tpc-reco-workflow $gloOpt --input-type digits --output-type clusters,tracks,send-clusters-per-sector --configKeyValues "GPU_rec.maxTrackQPt=20"
echo "Return status of tpcreco: $?"
echo "Running ITS reco flow"
taskwrapper itsreco.log o2-its-reco-workflow --trackerCA --tracking-mode async $gloOpt $ITSRecOpt
echo "Return status of itsreco: $?"
# existing checks
# root -b -q O2/Detectors/ITSMFT/ITS/macros/test/CheckClusters.C+
# root -b -q O2/Detectors/ITSMFT/ITS/macros/test/CheckTracks.C+
echo "Running MFT reco flow"
#needs MFT digitized data
taskwrapper mftreco.log o2-mft-reco-workflow $gloOpt
echo "Return status of mftreco: $?"
echo "Running MCH reco flow"
taskwrapper mchreco.log o2-mch-reco-workflow $gloOpt
echo "Return status of mchreco: $?"
echo "Running FT0 reco flow"
#needs FT0 digitized data
taskwrapper ft0reco.log o2-ft0-reco-workflow $gloOpt
echo "Return status of ft0reco: $?"
echo "Running FDD reco flow"
#needs FDD digitized data
taskwrapper fddreco.log o2-fdd-reco-workflow $gloOpt
echo "Return status of fddreco: $?"
echo "Running FV0 reco flow"
#needs FV0 digitized data
taskwrapper fv0reco.log o2-fv0-reco-workflow $gloOpt
echo "Return status of fv0reco: $?"
echo "Running MID reco flow"
#needs MID digitized data
taskwrapper midreco.log "o2-mid-digits-reader-workflow | o2-mid-reco-workflow $gloOpt"
echo "Return status of midreco: $?"
echo "Running ITS-TPC matching flow"
#needs results of o2-tpc-reco-workflow, o2-its-reco-workflow and o2-fit-reco-workflow
taskwrapper itstpcMatch.log o2-tpcits-match-workflow $gloOpt
echo "Return status of itstpcMatch: $?"
echo "Running TRD matching to ITS-TPC and TPC"
#needs results of o2-tpc-reco-workflow, o2-tpcits-match-workflow and o2-trd-tracklet-transformer
taskwrapper trdTrkltTransf.log o2-trd-tracklet-transformer $gloOpt
echo "Return status of trdTrkltTransf: $?"
taskwrapper trdMatch.log o2-trd-global-tracking $gloOpt
echo "Return status of trdTracker: $?"
echo "Running MFT-MCH matching flow"
#needs results of o2-mch-reco-workflow and o2-mft-reco-workflow
taskwrapper mftmchMatch.log o2-globalfwd-matcher-workflow $gloOpt
echo "Return status of mftmchMatch: $?"
echo "Running TOF reco flow to produce clusters"
#needs results of TOF digitized data and results of o2-tpcits-match-workflow
taskwrapper tofReco.log o2-tof-reco-workflow $gloOpt
echo "Return status of tof cluster reco : $?"
echo "Running Track-TOF macthing flow"
#needs results of TOF clusters data from o2-tof-reco-workflow and results of o2-tpc-reco-workflow and ITS-TPC matching
taskwrapper tofMatchTracks.log o2-tof-matcher-workflow $gloOpt
echo "Return status of o2-tof-matcher-workflow: $?"
echo "Running TOF matching QA"
#need results of ITSTPC-TOF matching (+ TOF clusters and ITS-TPC tracks)
taskwrapper tofmatch_qa.log root -b -q -l $O2_ROOT/share/macro/checkTOFMatching.C
echo "Return status of TOF matching qa: $?"
echo "Running primary vertex finding flow"
#needs results of TPC-ITS matching and FIT workflows
taskwrapper pvfinder.log o2-primary-vertexing-workflow $gloOpt
echo "Return status of primary vertexing: $?"
echo "Running secondary vertex finding flow"
#needs results of all trackers + P.Vertexer
taskwrapper svfinder.log o2-secondary-vertexing-workflow $gloOpt
echo "Return status of secondary vertexing: $?"
echo "Running ZDC reconstruction"
#need ZDC digits
taskwrapper zdcreco.log o2-zdc-digits-reco $gloOpt
echo "Return status of ZDC reconstruction: $?"
echo "Producing AOD"
taskwrapper aod.log o2-aod-producer-workflow --aod-writer-keep dangling --aod-writer-resfile "AO2D" --aod-writer-resmode UPDATE --aod-timeframe-id 1
echo "Return status of AOD production: $?"
fi