.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / ITS / UPGRADE / testITSU / MakeITSRecoParam.C
CommitLineData
f8a27611 1void MakeITSRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult, const char* cdbURI="local://") {
2//========================================================================
3//
42c3d4bd 4// Steering macro for ITSU reconstruction parameters
f8a27611 5//
42c3d4bd 6// Contact: ruben.shahoyan@cern.ch
f8a27611 7//
8//========================================================================
f8a27611 9 const char* macroname = "MakeITSRecoParam.C";
10 //
42c3d4bd 11 enum {kBit0=0x1<<0,kBit1=0x1<<1,kBit2=0x1<<2,kBit3=0x1<<3,kBit4=0x1<<4,kBit5=0x1<<5,kBit6=0x1<<6,kBit7=0x7<<2,kBit8=0x1<<8};
12 //
13 //
4070f709 14 gSystem->Load("libITSUpgradeBase");
15 gSystem->Load("libITSUpgradeSim");
16 gSystem->Load("libITSUpgradeRec");
f8a27611 17 //
18 // Activate CDB storage and load geometry from CDB
19 AliCDBManager* cdb = AliCDBManager::Instance();
20 cdb->SetDefaultStorage(cdbURI);
42c3d4bd 21 AliITSUTrackCond* trcond = 0;
f8a27611 22 int nLr = 7;
14ba4e91 23
f8a27611 24 TObjArray *recoParamArray = new TObjArray();
25 //
26 {
27 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetCosmicTestParam();
28 //
29 itsRecoParam->SetNLayers(nLr);
30 //
31 //******************************************************************
32 itsRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
33 itsRecoParam->SetTitle("Cosmic");
c64acbbe 34 itsRecoParam->SetTracker(0);
35 itsRecoParam->SetSAonly(kFALSE);
c7811d12 36 itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
f8a27611 37 recoParamArray->AddLast(itsRecoParam);
38 }
39 //
70f61d86 40 const Bool_t kAllowDiagCl = kFALSE;
6cb10ec2 41 const Bool_t kUseLUT[3] = {kTRUE,kTRUE,kFALSE}; // use TGeo mat.queries only for RefitInward
70f61d86 42 //
097e4cdf 43 // long tracks
14ba4e91 44 /*
45 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
46 //
097e4cdf 47 int c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
48 int c0nCands[7] = {10,20,45,20,45,15,10}; // max candidates for the TPC seed
49 float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2
50 float c0gloChi2[7] = {6, 10,20,40,70,70,70}; // cut on seed global norm chi2
51 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
5e3587be 52 float c0maxChi2SA[14] = {0.,0.,0.,0.,2.,3.,8., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
097e4cdf 53 float c0maxChi2Match = 10.;
14ba4e91 54 */
097e4cdf 55 //
14ba4e91 56 // /*
57 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% TDR5 setup
58 int c0nBranch[7] = {3,9,15,4,5,7,10}; // max branching for the seed on layer
59 int c0nCands[7] = {10,15,45,20,60,20,10}; // max candidates for the TPC seed
60 float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2
61 float c0gloChi2[7] = {6,10,20,30,60,60,70}; // cut on seed global norm chi2
62 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
63 float c0maxChi2SA[14] = {0.,0.,0.,0.,2.5,5.,10., 20.,20.,20.,20.,20.,20.,20.}; // chi2SA vs Nclus
64 float c0maxChi2Match = 10.;
65 // */
66
67
097e4cdf 68 // short tracks from decays
14ba4e91 69 /*
70 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
097e4cdf 71 int c1nBranch[7] = {0,0,0,4,6,6,10}; // max branching for the seed on layer
72 int c1nCands[7] = {0,0,0,20,45,15,10}; // max candidates for the TPC seed
73 float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2
74 float c1gloChi2[7] = {0,0,0,16,40,30,30}; // cut on seed global norm chi2
75 float c1missPen[7] = {0.,0.,0.,2.,2.,2.,2.}; // missing cluster penalty
5e3587be 76 float c1maxChi2SA[14] = {0.,0.,0.,7.,8.,8.,8., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
097e4cdf 77 float c1maxChi2Match = 8.;
14ba4e91 78 */
79
80 // short tracks from decays
81 int c1nBranch[7] = {0,0,0,4,6,6,10}; // max branching for the seed on layer
1318fc42 82 int c1nCands[7] = {0,0,0,5,5,5,8}; // max candidates for the TPC seed
14ba4e91 83 float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2
84 float c1gloChi2[7] = {0,0,0,16,40,35,30}; // cut on seed global norm chi2
85 float c1missPen[7] = {0.,0.,0.,2.,2.,2.,2.}; // missing cluster penalty
86 float c1maxChi2SA[14] = {0.,0.,0.,5.,13.,13.,18., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
87 float c1maxChi2Match = 10.;
097e4cdf 88
70f61d86 89 //
90 /*
91 // tuned for 20x33 pixels
097e4cdf 92 int c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
93 int c0nCands[7] = {10,20,25,20,30,15,20}; // max candidates for the TPC seed
94 float c0tr2clChi2[7] = {20,20,25,25,25,30,40}; // cut on cluster to track chi2
95 float c0gloChi2[7] = {9, 10,15,20,30,30,30}; // cut on seed global norm chi2
96 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
5e3587be 97 float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.}; // chi2SA vs Nclus
097e4cdf 98 float c0maxChi2Match = 10.;
70f61d86 99 */
1318fc42 100 // very short tracks from decays
101 int c2nBranch[7] = {0,0,0,0,0,6,10}; // max branching for the seed on layer
102 int c2nCands[7] = {0,0,0,0,0,5,8}; // max candidates for the TPC seed
103 float c2tr2clChi2[7] = {0,0,0,0,0,15,20}; // cut on cluster to track chi2
104 float c2gloChi2[7] = {0,0,0,0,0,15,20}; // cut on seed global norm chi2
105 float c2missPen[7] = {0.,0.,0.,0.,0.,2.,2.}; // missing cluster penalty
106 float c2maxChi2SA[14] = {0.,5.,5.,5.,13.,13.,18., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus, meaningless for 2 point tracks
107 float c2maxChi2Match = 6.;
108
70f61d86 109
ee58ce21 110 //
f8a27611 111 {
112 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
113 //
114 itsRecoParam->SetNLayers(nLr);
115 //
116 //******************************************************************
117 itsRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
118 itsRecoParam->SetTitle("LowMult");
c64acbbe 119 itsRecoParam->SetTracker(0);
120 itsRecoParam->SetSAonly(kFALSE);
c7811d12 121 itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
f8a27611 122 recoParamArray->AddLast(itsRecoParam);
42c3d4bd 123 //******************************************************************
70f61d86 124 for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
6cb10ec2 125 for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
ee58ce21 126 //
42c3d4bd 127 // Add tracking conditions >>>
128 trCond = new AliITSUTrackCond();
129 trCond->SetNLayers(nLr);
097e4cdf 130 trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
ee54014a 131 //
d99994b2 132 // to exclude some layer use trCon->ExcludeLayer(lrID);
133 //
ee54014a 134 for (int i=0;i<nLr;i++) {
097e4cdf 135 trCond->SetMaxBranches(i,c0nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
136 trCond->SetMaxCandidates(i,c0nCands[i]); // each tpc track may have at most nCands prolongations
137 trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
138 trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]); // cut on cluster to track global chi2
139 trCond->SetMissPenalty(i,c0missPen[i]); // missing cluster penalty
ee54014a 140 }
5e3587be 141 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
38997c3c 142 //
42c3d4bd 143 trCond->AddNewCondition(5); // min hits
70f61d86 144 trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
145 trCond->AddGroupPattern( kBit3|kBit4 , 1); // at least 1 hit in 2 middle layers
146 trCond->AddGroupPattern( kBit5|kBit6 , 1); // at least 1 hit in 2 outer layers
ee54014a 147 //
148 trCond->Init();
149 //
42c3d4bd 150 itsRecoParam->AddTrackingCondition(trCond);
097e4cdf 151 //-----------------------------------------------------------
152 // short tracks
153 trCond = new AliITSUTrackCond();
154 trCond->SetNLayers(nLr);
155 //
156 trCond->ExcludeLayer(0);
157 trCond->ExcludeLayer(1);
158 trCond->ExcludeLayer(2);
159 //
160 trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
097e4cdf 161 //
162 // to exclude some layer use trCon->ExcludeLayer(lrID);
163 //
164 for (int i=0;i<nLr;i++) {
165 trCond->SetMaxBranches(i,c1nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
166 trCond->SetMaxCandidates(i,c1nCands[i]); // each tpc track may have at most nCands prolongations
167 trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
168 trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]); // cut on cluster to track global chi2
169 trCond->SetMissPenalty(i,c1missPen[i]); // missing cluster penalty
097e4cdf 170 }
5e3587be 171 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
097e4cdf 172 //
173 trCond->AddNewCondition(4); // min hits
174 trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
175 //
176 trCond->Init();
177 //
1318fc42 178 itsRecoParam->AddTrackingCondition(trCond);
179 // Add tracking conditions <<<
180 //-----------------------------------------------------------
181 // very short tracks
182 trCond = new AliITSUTrackCond();
183 trCond->SetNLayers(nLr);
184 //
185 trCond->ExcludeLayer(0);
186 trCond->ExcludeLayer(1);
187 trCond->ExcludeLayer(2);
188 trCond->ExcludeLayer(3);
189 trCond->ExcludeLayer(4);
190 //
191 trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
192 //
193 // to exclude some layer use trCon->ExcludeLayer(lrID);
194 //
195 for (int i=0;i<nLr;i++) {
196 trCond->SetMaxBranches(i,c2nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
197 trCond->SetMaxCandidates(i,c2nCands[i]); // each tpc track may have at most nCands prolongations
198 trCond->SetMaxTr2ClChi2(i,c2tr2clChi2[i]); // cut on cluster to track chi2
199 trCond->SetMaxChi2GloNrm(i,c2gloChi2[i]); // cut on cluster to track global chi2
200 trCond->SetMissPenalty(i,c2missPen[i]); // missing cluster penalty
201 }
202 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
203 //
204 trCond->AddNewCondition(2); // min hits
205 trCond->AddGroupPattern( kBit5|kBit6, 2);
206 //
207 trCond->Init();
208 //
097e4cdf 209 itsRecoParam->AddTrackingCondition(trCond);
ee58ce21 210 // Add tracking conditions <<<
f8a27611 211 }
212 {
213 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
214 //
215 itsRecoParam->SetNLayers(nLr);
216 //
217 //******************************************************************
218 itsRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
219 itsRecoParam->SetTitle("HighMult");
c64acbbe 220 itsRecoParam->SetTracker(0);
221 itsRecoParam->SetSAonly(kFALSE);
c7811d12 222 itsRecoParam->SetMaxROCycle(126); // AliITSUSimulation::kMaxROCycleAccept
f8a27611 223 recoParamArray->AddLast(itsRecoParam);
42c3d4bd 224 //******************************************************************
70f61d86 225 for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
6cb10ec2 226 for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
ee54014a 227 //
42c3d4bd 228 // Add tracking conditions >>>
229 trCond = new AliITSUTrackCond();
230 trCond->SetNLayers(nLr);
097e4cdf 231 trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
ee54014a 232 //
233 for (int i=0;i<nLr;i++) {
097e4cdf 234 trCond->SetMaxBranches(i,c0nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
235 trCond->SetMaxCandidates(i,c0nCands[i]); // each tpc track may have at most nCands prolongations
236 trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
237 trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]); // cut on cluster to track global chi2
238 trCond->SetMissPenalty(i,c0missPen[i]); // missing cluster penalty
ee54014a 239 }
5e3587be 240 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
ee54014a 241 //
42c3d4bd 242 trCond->AddNewCondition(5); // min hits
70f61d86 243 trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
244 trCond->AddGroupPattern( kBit3|kBit4 , 1); // at least 1 hit in 2 middle layers
245 trCond->AddGroupPattern( kBit5|kBit6 , 1); // at least 1 hit in 2 outer layers
ee54014a 246 //
247 trCond->Init();
248 //
42c3d4bd 249 itsRecoParam->AddTrackingCondition(trCond);
097e4cdf 250 //-----------------------------------------------------------
251 // short tracks
252 trCond = new AliITSUTrackCond();
253 trCond->SetNLayers(nLr);
254 //
255 trCond->ExcludeLayer(0);
256 trCond->ExcludeLayer(1);
257 trCond->ExcludeLayer(2);
258 //
259 trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
097e4cdf 260 //
261 // to exclude some layer use trCon->ExcludeLayer(lrID);
262 //
263 for (int i=0;i<nLr;i++) {
264 trCond->SetMaxBranches(i,c1nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
265 trCond->SetMaxCandidates(i,c1nCands[i]); // each tpc track may have at most nCands prolongations
266 trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
267 trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]); // cut on cluster to track global chi2
268 trCond->SetMissPenalty(i,c1missPen[i]); // missing cluster penalty
097e4cdf 269 }
5e3587be 270 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
097e4cdf 271 //
272 trCond->AddNewCondition(4); // min hits
273 trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4);
274 //
275 trCond->Init();
276 //
277 itsRecoParam->AddTrackingCondition(trCond);
ee58ce21 278 // Add tracking conditions <<<
42c3d4bd 279 //
1318fc42 280 //-----------------------------------------------------------
281 // very short tracks
282 trCond = new AliITSUTrackCond();
283 trCond->SetNLayers(nLr);
284 //
285 trCond->ExcludeLayer(0);
286 trCond->ExcludeLayer(1);
287 trCond->ExcludeLayer(2);
288 trCond->ExcludeLayer(3);
289 trCond->ExcludeLayer(4);
290 //
291 trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
292 //
293 // to exclude some layer use trCon->ExcludeLayer(lrID);
294 //
295 for (int i=0;i<nLr;i++) {
296 trCond->SetMaxBranches(i,c2nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
297 trCond->SetMaxCandidates(i,c2nCands[i]); // each tpc track may have at most nCands prolongations
298 trCond->SetMaxTr2ClChi2(i,c2tr2clChi2[i]); // cut on cluster to track chi2
299 trCond->SetMaxChi2GloNrm(i,c2gloChi2[i]); // cut on cluster to track global chi2
300 trCond->SetMissPenalty(i,c2missPen[i]); // missing cluster penalty
301 }
302 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
303 //
304 trCond->AddNewCondition(2); // min hits
305 trCond->AddGroupPattern( kBit5|kBit6, 2);
306 //
307 trCond->Init();
308 //
309 itsRecoParam->AddTrackingCondition(trCond);
310 // Add tracking conditions <<<
f8a27611 311 }
312 //
313 // Set the default
314 Bool_t defaultIsSet = kFALSE;
315 for(Int_t i =0; i < recoParamArray->GetEntriesFast(); i++) {
316 AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
317 if (!param) continue;
318 if (default & param->GetEventSpecie()) {
319 param->SetAsDefault();
320 defaultIsSet = kTRUE;
321 }
322 }
323
324 if (!defaultIsSet) {
325 Error(macroname,"The default reconstruction parameters are not set! Exiting...");
326 return;
327 }
328
329 // save in CDB storage
330 AliCDBMetaData *md= new AliCDBMetaData();
331 md->SetResponsible("Andrea Dainese");
332 md->SetComment("Reconstruction parameters ITS.");
333 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
334 md->SetBeamPeriod(0);
335 AliCDBId id("ITS/Calib/RecoParam",0,AliCDBRunRange::Infinity());
336 cdb->GetDefaultStorage()->Put(recoParamArray,id, md);
337 //
338 return;
339}
340