1 void MakeITSRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult, const char* cdbURI="local://") {
2 //========================================================================
4 // Steering macro for ITSU reconstruction parameters
6 // Contact: ruben.shahoyan@cern.ch
8 //========================================================================
9 const char* macroname = "MakeITSRecoParam.C";
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};
14 gSystem->Load("libITSUpgradeBase.so");
15 gSystem->Load("libITSUpgradeSim.so");
16 gSystem->Load("libITSUpgradeRec.so");
18 // Activate CDB storage and load geometry from CDB
19 AliCDBManager* cdb = AliCDBManager::Instance();
20 cdb->SetDefaultStorage(cdbURI);
21 AliITSUTrackCond* trcond = 0;
24 TObjArray *recoParamArray = new TObjArray();
27 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetCosmicTestParam();
29 itsRecoParam->SetNLayers(nLr);
31 //******************************************************************
32 itsRecoParam->SetEventSpecie(AliRecoParam::kCosmic);
33 itsRecoParam->SetTitle("Cosmic");
34 recoParamArray->AddLast(itsRecoParam);
37 const Bool_t kAllowDiagCl = kFALSE;
38 const Bool_t kUseLUT[3] = {kTRUE,kTRUE,kFALSE}; // use TGeo mat.queries only for RefitInward
42 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
44 int c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
45 int c0nCands[7] = {10,20,45,20,45,15,10}; // max candidates for the TPC seed
46 float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2
47 float c0gloChi2[7] = {6, 10,20,40,70,70,70}; // cut on seed global norm chi2
48 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
49 float c0maxChi2SA[14] = {0.,0.,0.,0.,2.,3.,8., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
50 float c0maxChi2Match = 10.;
54 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% TDR5 setup
55 int c0nBranch[7] = {3,9,15,4,5,7,10}; // max branching for the seed on layer
56 int c0nCands[7] = {10,15,45,20,60,20,10}; // max candidates for the TPC seed
57 float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2
58 float c0gloChi2[7] = {6,10,20,30,60,60,70}; // cut on seed global norm chi2
59 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
60 float c0maxChi2SA[14] = {0.,0.,0.,0.,2.5,5.,10., 20.,20.,20.,20.,20.,20.,20.}; // chi2SA vs Nclus
61 float c0maxChi2Match = 10.;
65 // short tracks from decays
67 // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
68 int c1nBranch[7] = {0,0,0,4,6,6,10}; // max branching for the seed on layer
69 int c1nCands[7] = {0,0,0,20,45,15,10}; // max candidates for the TPC seed
70 float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2
71 float c1gloChi2[7] = {0,0,0,16,40,30,30}; // cut on seed global norm chi2
72 float c1missPen[7] = {0.,0.,0.,2.,2.,2.,2.}; // missing cluster penalty
73 float c1maxChi2SA[14] = {0.,0.,0.,7.,8.,8.,8., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
74 float c1maxChi2Match = 8.;
77 // short tracks from decays
78 int c1nBranch[7] = {0,0,0,4,6,6,10}; // max branching for the seed on layer
79 int c1nCands[7] = {0,0,0,5,5,5,8}; // max candidates for the TPC seed
80 float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2
81 float c1gloChi2[7] = {0,0,0,16,40,35,30}; // cut on seed global norm chi2
82 float c1missPen[7] = {0.,0.,0.,2.,2.,2.,2.}; // missing cluster penalty
83 float c1maxChi2SA[14] = {0.,0.,0.,5.,13.,13.,18., 10.,10.,10.,10.,10.,10.,10.}; // chi2SA vs Nclus
84 float c1maxChi2Match = 10.;
88 // tuned for 20x33 pixels
89 int c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
90 int c0nCands[7] = {10,20,25,20,30,15,20}; // max candidates for the TPC seed
91 float c0tr2clChi2[7] = {20,20,25,25,25,30,40}; // cut on cluster to track chi2
92 float c0gloChi2[7] = {9, 10,15,20,30,30,30}; // cut on seed global norm chi2
93 float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.}; // missing cluster penalty
94 float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.}; // chi2SA vs Nclus
95 float c0maxChi2Match = 10.;
97 // very short tracks from decays
98 int c2nBranch[7] = {0,0,0,0,0,6,10}; // max branching for the seed on layer
99 int c2nCands[7] = {0,0,0,0,0,5,8}; // max candidates for the TPC seed
100 float c2tr2clChi2[7] = {0,0,0,0,0,15,20}; // cut on cluster to track chi2
101 float c2gloChi2[7] = {0,0,0,0,0,15,20}; // cut on seed global norm chi2
102 float c2missPen[7] = {0.,0.,0.,0.,0.,2.,2.}; // missing cluster penalty
103 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
104 float c2maxChi2Match = 6.;
109 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
111 itsRecoParam->SetNLayers(nLr);
113 //******************************************************************
114 itsRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
115 itsRecoParam->SetTitle("LowMult");
116 recoParamArray->AddLast(itsRecoParam);
117 //******************************************************************
118 for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
119 for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
121 // Add tracking conditions >>>
122 trCond = new AliITSUTrackCond();
123 trCond->SetNLayers(nLr);
124 trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
126 // to exclude some layer use trCon->ExcludeLayer(lrID);
128 for (int i=0;i<nLr;i++) {
129 trCond->SetMaxBranches(i,c0nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
130 trCond->SetMaxCandidates(i,c0nCands[i]); // each tpc track may have at most nCands prolongations
131 trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
132 trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]); // cut on cluster to track global chi2
133 trCond->SetMissPenalty(i,c0missPen[i]); // missing cluster penalty
135 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
137 trCond->AddNewCondition(5); // min hits
138 trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
139 trCond->AddGroupPattern( kBit3|kBit4 , 1); // at least 1 hit in 2 middle layers
140 trCond->AddGroupPattern( kBit5|kBit6 , 1); // at least 1 hit in 2 outer layers
144 itsRecoParam->AddTrackingCondition(trCond);
145 //-----------------------------------------------------------
147 trCond = new AliITSUTrackCond();
148 trCond->SetNLayers(nLr);
150 trCond->ExcludeLayer(0);
151 trCond->ExcludeLayer(1);
152 trCond->ExcludeLayer(2);
154 trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
156 // to exclude some layer use trCon->ExcludeLayer(lrID);
158 for (int i=0;i<nLr;i++) {
159 trCond->SetMaxBranches(i,c1nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
160 trCond->SetMaxCandidates(i,c1nCands[i]); // each tpc track may have at most nCands prolongations
161 trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
162 trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]); // cut on cluster to track global chi2
163 trCond->SetMissPenalty(i,c1missPen[i]); // missing cluster penalty
165 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
167 trCond->AddNewCondition(4); // min hits
168 trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
172 itsRecoParam->AddTrackingCondition(trCond);
173 // Add tracking conditions <<<
174 //-----------------------------------------------------------
176 trCond = new AliITSUTrackCond();
177 trCond->SetNLayers(nLr);
179 trCond->ExcludeLayer(0);
180 trCond->ExcludeLayer(1);
181 trCond->ExcludeLayer(2);
182 trCond->ExcludeLayer(3);
183 trCond->ExcludeLayer(4);
185 trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
187 // to exclude some layer use trCon->ExcludeLayer(lrID);
189 for (int i=0;i<nLr;i++) {
190 trCond->SetMaxBranches(i,c2nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
191 trCond->SetMaxCandidates(i,c2nCands[i]); // each tpc track may have at most nCands prolongations
192 trCond->SetMaxTr2ClChi2(i,c2tr2clChi2[i]); // cut on cluster to track chi2
193 trCond->SetMaxChi2GloNrm(i,c2gloChi2[i]); // cut on cluster to track global chi2
194 trCond->SetMissPenalty(i,c2missPen[i]); // missing cluster penalty
196 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
198 trCond->AddNewCondition(2); // min hits
199 trCond->AddGroupPattern( kBit5|kBit6, 2);
203 itsRecoParam->AddTrackingCondition(trCond);
204 // Add tracking conditions <<<
207 AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
209 itsRecoParam->SetNLayers(nLr);
211 //******************************************************************
212 itsRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
213 itsRecoParam->SetTitle("HighMult");
214 recoParamArray->AddLast(itsRecoParam);
215 //******************************************************************
216 for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
217 for (int i=AliITSURecoParam::kNTrackingPhases;i--;) itsRecoParam->SetUseMatLUT(i,kUseLUT[i]);
219 // Add tracking conditions >>>
220 trCond = new AliITSUTrackCond();
221 trCond->SetNLayers(nLr);
222 trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
224 for (int i=0;i<nLr;i++) {
225 trCond->SetMaxBranches(i,c0nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
226 trCond->SetMaxCandidates(i,c0nCands[i]); // each tpc track may have at most nCands prolongations
227 trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
228 trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]); // cut on cluster to track global chi2
229 trCond->SetMissPenalty(i,c0missPen[i]); // missing cluster penalty
231 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
233 trCond->AddNewCondition(5); // min hits
234 trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
235 trCond->AddGroupPattern( kBit3|kBit4 , 1); // at least 1 hit in 2 middle layers
236 trCond->AddGroupPattern( kBit5|kBit6 , 1); // at least 1 hit in 2 outer layers
240 itsRecoParam->AddTrackingCondition(trCond);
241 //-----------------------------------------------------------
243 trCond = new AliITSUTrackCond();
244 trCond->SetNLayers(nLr);
246 trCond->ExcludeLayer(0);
247 trCond->ExcludeLayer(1);
248 trCond->ExcludeLayer(2);
250 trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
252 // to exclude some layer use trCon->ExcludeLayer(lrID);
254 for (int i=0;i<nLr;i++) {
255 trCond->SetMaxBranches(i,c1nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
256 trCond->SetMaxCandidates(i,c1nCands[i]); // each tpc track may have at most nCands prolongations
257 trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
258 trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]); // cut on cluster to track global chi2
259 trCond->SetMissPenalty(i,c1missPen[i]); // missing cluster penalty
261 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
263 trCond->AddNewCondition(4); // min hits
264 trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4);
268 itsRecoParam->AddTrackingCondition(trCond);
269 // Add tracking conditions <<<
271 //-----------------------------------------------------------
273 trCond = new AliITSUTrackCond();
274 trCond->SetNLayers(nLr);
276 trCond->ExcludeLayer(0);
277 trCond->ExcludeLayer(1);
278 trCond->ExcludeLayer(2);
279 trCond->ExcludeLayer(3);
280 trCond->ExcludeLayer(4);
282 trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
284 // to exclude some layer use trCon->ExcludeLayer(lrID);
286 for (int i=0;i<nLr;i++) {
287 trCond->SetMaxBranches(i,c2nBranch[i]); // each seed propagated to given layer can produce max nBranch branches
288 trCond->SetMaxCandidates(i,c2nCands[i]); // each tpc track may have at most nCands prolongations
289 trCond->SetMaxTr2ClChi2(i,c2tr2clChi2[i]); // cut on cluster to track chi2
290 trCond->SetMaxChi2GloNrm(i,c2gloChi2[i]); // cut on cluster to track global chi2
291 trCond->SetMissPenalty(i,c2missPen[i]); // missing cluster penalty
293 for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
295 trCond->AddNewCondition(2); // min hits
296 trCond->AddGroupPattern( kBit5|kBit6, 2);
300 itsRecoParam->AddTrackingCondition(trCond);
301 // Add tracking conditions <<<
305 Bool_t defaultIsSet = kFALSE;
306 for(Int_t i =0; i < recoParamArray->GetEntriesFast(); i++) {
307 AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
308 if (!param) continue;
309 if (default & param->GetEventSpecie()) {
310 param->SetAsDefault();
311 defaultIsSet = kTRUE;
316 Error(macroname,"The default reconstruction parameters are not set! Exiting...");
320 // save in CDB storage
321 AliCDBMetaData *md= new AliCDBMetaData();
322 md->SetResponsible("Andrea Dainese");
323 md->SetComment("Reconstruction parameters ITS.");
324 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
325 md->SetBeamPeriod(0);
326 AliCDBId id("ITS/Calib/RecoParam",0,AliCDBRunRange::Infinity());
327 cdb->GetDefaultStorage()->Put(recoParamArray,id, md);