]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/testITSU/MakeITSRecoParam.C
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / ITS / UPGRADE / testITSU / MakeITSRecoParam.C
1 void MakeITSRecoParam(AliRecoParam::EventSpecie_t default=AliRecoParam::kLowMult, const char* cdbURI="local://") {
2 //========================================================================
3 //
4 // Steering macro for ITSU reconstruction parameters
5 //
6 // Contact: ruben.shahoyan@cern.ch
7 //
8 //========================================================================
9   const char* macroname = "MakeITSRecoParam.C";
10   //
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   //
14   gSystem->Load("libITSUpgradeBase.so");
15   gSystem->Load("libITSUpgradeSim.so");
16   gSystem->Load("libITSUpgradeRec.so");
17   //
18   // Activate CDB storage and load geometry from CDB
19   AliCDBManager* cdb = AliCDBManager::Instance();
20   cdb->SetDefaultStorage(cdbURI);
21   AliITSUTrackCond* trcond = 0;
22   int nLr = 7;
23   
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");
34     recoParamArray->AddLast(itsRecoParam);
35   }
36   //
37   const Bool_t kAllowDiagCl = kFALSE;
38   const Bool_t kUseLUT[3] = {kTRUE,kTRUE,kFALSE}; // use TGeo mat.queries only for RefitInward
39   //
40   // long tracks
41   /*
42   // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
43   //
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.;
51   */
52   //
53   //  /*
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.;
62   //  */
63
64
65   // short tracks from decays
66   /*
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.;
75   */
76
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.;
85
86   //
87   /*
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.;
96   */
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.;
105
106
107   //
108   {
109     AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
110     //
111     itsRecoParam->SetNLayers(nLr);
112     //
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]);
120     //  
121     // Add tracking conditions >>>
122     trCond = new AliITSUTrackCond();
123     trCond->SetNLayers(nLr); 
124     trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
125     //
126     // to exclude some layer use trCon->ExcludeLayer(lrID);
127     //
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
134     }
135     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
136     //
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
141     //
142     trCond->Init();
143     //
144     itsRecoParam->AddTrackingCondition(trCond);
145     //-----------------------------------------------------------
146     // short tracks
147     trCond = new AliITSUTrackCond();
148     trCond->SetNLayers(nLr); 
149     //
150     trCond->ExcludeLayer(0);
151     trCond->ExcludeLayer(1);
152     trCond->ExcludeLayer(2);
153     //
154     trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
155     //
156     // to exclude some layer use trCon->ExcludeLayer(lrID);
157     //
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
164     }
165     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
166     //
167     trCond->AddNewCondition(4); // min hits
168     trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
169     //
170     trCond->Init();
171     //
172     itsRecoParam->AddTrackingCondition(trCond); 
173     // Add tracking conditions <<<
174     //-----------------------------------------------------------
175     // very short tracks
176     trCond = new AliITSUTrackCond();
177     trCond->SetNLayers(nLr); 
178     //
179     trCond->ExcludeLayer(0);
180     trCond->ExcludeLayer(1);
181     trCond->ExcludeLayer(2);
182     trCond->ExcludeLayer(3);
183     trCond->ExcludeLayer(4);
184     //
185     trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
186     //
187     // to exclude some layer use trCon->ExcludeLayer(lrID);
188     //
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
195     }
196     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
197     //
198     trCond->AddNewCondition(2); // min hits
199     trCond->AddGroupPattern( kBit5|kBit6, 2);
200     //
201     trCond->Init();
202     //
203     itsRecoParam->AddTrackingCondition(trCond);
204     // Add tracking conditions <<<
205   }
206   {
207     AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
208     //
209     itsRecoParam->SetNLayers(nLr);
210     //
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]);
218     //  
219     // Add tracking conditions >>>
220     trCond = new AliITSUTrackCond();
221     trCond->SetNLayers(nLr); 
222     trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
223     //
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
230     }
231     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
232     //
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
237     //
238     trCond->Init();
239     //
240     itsRecoParam->AddTrackingCondition(trCond);
241     //-----------------------------------------------------------
242     // short tracks
243     trCond = new AliITSUTrackCond();
244     trCond->SetNLayers(nLr); 
245     //
246     trCond->ExcludeLayer(0);
247     trCond->ExcludeLayer(1);
248     trCond->ExcludeLayer(2);
249     //
250     trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
251     //
252     // to exclude some layer use trCon->ExcludeLayer(lrID);
253     //
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
260     }
261     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
262     //
263     trCond->AddNewCondition(4); // min hits
264     trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4);
265     //
266     trCond->Init();
267     //
268     itsRecoParam->AddTrackingCondition(trCond);
269     // Add tracking conditions <<<
270     //
271     //-----------------------------------------------------------
272     // very short tracks
273     trCond = new AliITSUTrackCond();
274     trCond->SetNLayers(nLr); 
275     //
276     trCond->ExcludeLayer(0);
277     trCond->ExcludeLayer(1);
278     trCond->ExcludeLayer(2);
279     trCond->ExcludeLayer(3);
280     trCond->ExcludeLayer(4);
281     //
282     trCond->SetMaxITSTPCMatchChi2(c2maxChi2Match);
283     //
284     // to exclude some layer use trCon->ExcludeLayer(lrID);
285     //
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
292     }
293     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c2maxChi2SA[i-1]);
294     //
295     trCond->AddNewCondition(2); // min hits
296     trCond->AddGroupPattern( kBit5|kBit6, 2);
297     //
298     trCond->Init();
299     //
300     itsRecoParam->AddTrackingCondition(trCond);
301     // Add tracking conditions <<<
302   }
303   //
304   // Set the default
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;
312     }
313   }
314
315   if (!defaultIsSet) {
316     Error(macroname,"The default reconstruction parameters are not set! Exiting...");
317     return;
318   }
319
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);
328   //
329   return;
330 }
331