]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/testITSU/MakeITSRecoParam.C
recoparam tuned for tdr5 setup
[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   //
39   // long tracks
40   /*
41   // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
42   //
43   int   c0nBranch[7]   = {5,10,15,4,6,6,10}; // max branching for the seed on layer
44   int   c0nCands[7]    = {10,20,45,20,45,15,10}; // max candidates for the TPC seed
45   float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2 
46   float c0gloChi2[7]   = {6, 10,20,40,70,70,70}; // cut on seed global norm chi2
47   float c0missPen[7]   = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
48   float c0maxChi2SA[14] = {0.,0.,0.,0.,2.,3.,8., 10.,10.,10.,10.,10.,10.,10.};   // chi2SA vs Nclus
49   float c0maxChi2Match = 10.;
50   */
51   //
52   //  /*
53   // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% TDR5 setup
54   int   c0nBranch[7] = {3,9,15,4,5,7,10}; // max branching for the seed on layer
55   int   c0nCands[7]  = {10,15,45,20,60,20,10}; // max candidates for the TPC seed
56   float c0tr2clChi2[7] = {20,25,30,40,45,45,70}; // cut on cluster to track chi2 
57   float c0gloChi2[7]   = {6,10,20,30,60,60,70}; // cut on seed global norm chi2
58   float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
59   float c0maxChi2SA[14] = {0.,0.,0.,0.,2.5,5.,10., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
60   float c0maxChi2Match = 10.;
61   //  */
62
63
64   // short tracks from decays
65   /*
66   // tuned for 20x20 pixels with x/x0= 0.3,0.3,0.3,0.5,0.5,0.5,0.5% CDR setup
67   int   c1nBranch[7]   = {0,0,0,4,6,6,10}; // max branching for the seed on layer
68   int   c1nCands[7]    = {0,0,0,20,45,15,10}; // max candidates for the TPC seed
69   float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2 
70   float c1gloChi2[7]   = {0,0,0,16,40,30,30}; // cut on seed global norm chi2
71   float c1missPen[7]   = {0.,0.,0.,2.,2.,2.,2.};    // missing cluster penalty
72   float c1maxChi2SA[14] = {0.,0.,0.,7.,8.,8.,8., 10.,10.,10.,10.,10.,10.,10.};  // chi2SA vs Nclus
73   float c1maxChi2Match = 8.;
74   */
75
76   // short tracks from decays
77   int   c1nBranch[7]   = {0,0,0,4,6,6,10}; // max branching for the seed on layer
78   int   c1nCands[7]    = {0,0,0,5,5,5,8}; // max candidates for the TPC seed
79   float c1tr2clChi2[7] = {0,0,0,20,20,20,30}; // cut on cluster to track chi2 
80   float c1gloChi2[7]   = {0,0,0,16,40,35,30}; // cut on seed global norm chi2
81   float c1missPen[7]   = {0.,0.,0.,2.,2.,2.,2.};    // missing cluster penalty
82   float c1maxChi2SA[14] = {0.,0.,0.,5.,13.,13.,18., 10.,10.,10.,10.,10.,10.,10.};  // chi2SA vs Nclus
83   float c1maxChi2Match = 10.;
84
85   //
86   /*
87     // tuned for 20x33 pixels
88   int   c0nBranch[7] = {5,10,15,4,6,6,10}; // max branching for the seed on layer
89   int   c0nCands[7]  = {10,20,25,20,30,15,20}; // max candidates for the TPC seed
90   float c0tr2clChi2[7] = {20,20,25,25,25,30,40}; // cut on cluster to track chi2 
91   float c0gloChi2[7]   = {9, 10,15,20,30,30,30}; // cut on seed global norm chi2
92   float c0missPen[7] = {2.,2.,2.,2.,2.,2.,2.};    // missing cluster penalty
93   float c0maxChi2SA[14] = {0.,0.,0.,0.,12.,13.,18., 20.,20.,20.,20.,20.,20.,20.};   // chi2SA vs Nclus
94   float c0maxChi2Match = 10.;
95   */
96
97   //
98   {
99     AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetLowFluxParam();
100     //
101     itsRecoParam->SetNLayers(nLr);
102     //
103     //******************************************************************
104     itsRecoParam->SetEventSpecie(AliRecoParam::kLowMult);
105     itsRecoParam->SetTitle("LowMult");
106     recoParamArray->AddLast(itsRecoParam);
107     //******************************************************************
108     for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
109     //  
110     // Add tracking conditions >>>
111     trCond = new AliITSUTrackCond();
112     trCond->SetNLayers(nLr); 
113     trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
114     //
115     // to exclude some layer use trCon->ExcludeLayer(lrID);
116     //
117     for (int i=0;i<nLr;i++) {
118       trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
119       trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
120       trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]); // cut on cluster to track chi2
121       trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
122       trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
123     }
124     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
125     //
126     trCond->AddNewCondition(5); // min hits
127     trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
128     trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
129     trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
130     //
131     trCond->Init();
132     //
133     itsRecoParam->AddTrackingCondition(trCond);
134     //-----------------------------------------------------------
135     // short tracks
136     trCond = new AliITSUTrackCond();
137     trCond->SetNLayers(nLr); 
138     //
139     trCond->ExcludeLayer(0);
140     trCond->ExcludeLayer(1);
141     trCond->ExcludeLayer(2);
142     //
143     trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
144     //
145     // to exclude some layer use trCon->ExcludeLayer(lrID);
146     //
147     for (int i=0;i<nLr;i++) {
148       trCond->SetMaxBranches(i,c1nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
149       trCond->SetMaxCandidates(i,c1nCands[i]);   // each tpc track may have at most nCands prolongations
150       trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
151       trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]);  // cut on cluster to track global chi2
152       trCond->SetMissPenalty(i,c1missPen[i]);    // missing cluster penalty
153     }
154     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
155     //
156     trCond->AddNewCondition(4); // min hits
157     trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4); // at least 1 hit in 2 outer layers
158     //
159     trCond->Init();
160     //
161     itsRecoParam->AddTrackingCondition(trCond);
162    
163     // Add tracking conditions <<<
164   }
165   {
166     AliITSURecoParam * itsRecoParam = AliITSURecoParam::GetHighFluxParam();
167     //
168     itsRecoParam->SetNLayers(nLr);
169     //
170     //******************************************************************
171     itsRecoParam->SetEventSpecie(AliRecoParam::kHighMult);
172     itsRecoParam->SetTitle("HighMult");
173     recoParamArray->AddLast(itsRecoParam);
174     //******************************************************************
175     for (int i=0;i<nLr;i++) itsRecoParam->SetAllowDiagonalClusterization(i,kAllowDiagCl);
176     //  
177     // Add tracking conditions >>>
178     trCond = new AliITSUTrackCond();
179     trCond->SetNLayers(nLr); 
180     trCond->SetMaxITSTPCMatchChi2(c0maxChi2Match);
181     //
182     for (int i=0;i<nLr;i++) {
183       trCond->SetMaxBranches(i,c0nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
184       trCond->SetMaxCandidates(i,c0nCands[i]);   // each tpc track may have at most nCands prolongations
185       trCond->SetMaxTr2ClChi2(i,c0tr2clChi2[i]);   // cut on cluster to track chi2
186       trCond->SetMaxChi2GloNrm(i,c0gloChi2[i]);  // cut on cluster to track global chi2
187       trCond->SetMissPenalty(i,c0missPen[i]);    // missing cluster penalty
188     }
189     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c0maxChi2SA[i-1]);
190     //
191     trCond->AddNewCondition(5); // min hits
192     trCond->AddGroupPattern( kBit0|kBit1|kBit2, 2); // at least 2 hits in 3 inner layers
193     trCond->AddGroupPattern( kBit3|kBit4      , 1); // at least 1 hit in 2 middle layers
194     trCond->AddGroupPattern( kBit5|kBit6      , 1); // at least 1 hit in 2 outer layers
195     //
196     trCond->Init();
197     //
198     itsRecoParam->AddTrackingCondition(trCond);
199     //-----------------------------------------------------------
200     // short tracks
201     trCond = new AliITSUTrackCond();
202     trCond->SetNLayers(nLr); 
203     //
204     trCond->ExcludeLayer(0);
205     trCond->ExcludeLayer(1);
206     trCond->ExcludeLayer(2);
207     //
208     trCond->SetMaxITSTPCMatchChi2(c1maxChi2Match);
209     //
210     // to exclude some layer use trCon->ExcludeLayer(lrID);
211     //
212     for (int i=0;i<nLr;i++) {
213       trCond->SetMaxBranches(i,c1nBranch[i]);    // each seed propagated to given layer can produce max nBranch branches
214       trCond->SetMaxCandidates(i,c1nCands[i]);   // each tpc track may have at most nCands prolongations
215       trCond->SetMaxTr2ClChi2(i,c1tr2clChi2[i]); // cut on cluster to track chi2
216       trCond->SetMaxChi2GloNrm(i,c1gloChi2[i]);  // cut on cluster to track global chi2
217       trCond->SetMissPenalty(i,c1missPen[i]);    // missing cluster penalty
218     }
219     for (int i=1;i<=2*nLr;i++) trCond->SetMaxITSSAChi2(i,c1maxChi2SA[i-1]);
220     //
221     trCond->AddNewCondition(4); // min hits
222     trCond->AddGroupPattern( kBit3|kBit4|kBit5|kBit6, 4);
223     //
224     trCond->Init();
225     //
226     itsRecoParam->AddTrackingCondition(trCond);
227     // Add tracking conditions <<<
228     //
229   }
230   //
231   // Set the default
232   Bool_t defaultIsSet = kFALSE;
233   for(Int_t i =0; i < recoParamArray->GetEntriesFast(); i++) {
234     AliDetectorRecoParam *param = (AliDetectorRecoParam *)recoParamArray->UncheckedAt(i);
235     if (!param) continue;
236     if (default & param->GetEventSpecie()) {
237       param->SetAsDefault();
238       defaultIsSet = kTRUE;
239     }
240   }
241
242   if (!defaultIsSet) {
243     Error(macroname,"The default reconstruction parameters are not set! Exiting...");
244     return;
245   }
246
247   // save in CDB storage
248   AliCDBMetaData *md= new AliCDBMetaData();
249   md->SetResponsible("Andrea Dainese");
250   md->SetComment("Reconstruction parameters ITS.");
251   md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
252   md->SetBeamPeriod(0);
253   AliCDBId id("ITS/Calib/RecoParam",0,AliCDBRunRange::Infinity());
254   cdb->GetDefaultStorage()->Put(recoParamArray,id, md);
255   //
256   return;
257 }
258