7024ed2923a65c8ee6fe78a268a65a1e716798c1
[u/mrichter/AliRoot.git] / STEER / STEER / AliGRPRecoParam.cxx
1 /**************************************************************************
2  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 #include "AliGRPRecoParam.h"
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 // Class with GRP reconstruction parameters                                  //
21 // Origin: andrea.dainese@lnl.infn.it                                        //
22 //                                                                           //
23 ///////////////////////////////////////////////////////////////////////////////
24
25
26
27 ClassImp(AliGRPRecoParam)
28
29 //_____________________________________________________________________________
30 AliGRPRecoParam::AliGRPRecoParam() : AliDetectorRecoParam(),
31 fMostProbablePt(0.350),
32 fVertexerTracksConstraintITS(kTRUE),
33 fVertexerTracksConstraintTPC(kTRUE),
34 fVertexerTracksNCuts(21),
35 fVertexerTracksITSdcacut(0.1),
36 fVertexerTracksITSdcacutIter0(0.1),
37 fVertexerTracksITSmaxd0z0(0.5),
38 fVertexerTracksITSminCls(5),
39 fVertexerTracksITSmintrks(1),
40 fVertexerTracksITSnsigma(3.),
41 fVertexerTracksITSnindetfitter(100.),
42 fVertexerTracksITSmaxtgl(1000.), 
43 fVertexerTracksITSfidR(3.),
44 fVertexerTracksITSfidZ(30.),
45 fVertexerTracksITSalgo(1.),
46 fVertexerTracksITSalgoIter0(4.),
47 //
48 fVertexerTracksITSMVTukey2(7.),
49 fVertexerTracksITSMVSig2Ini(1e3),
50 fVertexerTracksITSMVMaxSigma2(5.0),
51 fVertexerTracksITSMVMinSig2Red(0.05),
52 fVertexerTracksITSMVMinDst(10e-4),
53 fVertexerTracksITSMVScanStep(2.),
54 fVertexerTracksITSMVMaxWghNtr(10),
55 fVertexerTracksITSMVFinalWBinary(1),
56 fVertexerTracksITSMVBCSpacing(50),
57 //
58 fVertexerTracksTPCdcacut(0.1),
59 fVertexerTracksTPCdcacutIter0(1.0),
60 fVertexerTracksTPCmaxd0z0(5.),
61 fVertexerTracksTPCminCls(10),
62 fVertexerTracksTPCmintrks(1),
63 fVertexerTracksTPCnsigma(3.),
64 fVertexerTracksTPCnindetfitter(0.1),
65 fVertexerTracksTPCmaxtgl(1.5), 
66 fVertexerTracksTPCfidR(3.),
67 fVertexerTracksTPCfidZ(30.),
68 fVertexerTracksTPCalgo(1.),
69 fVertexerTracksTPCalgoIter0(4.),
70 //
71 fVertexerTracksTPCMVTukey2(7.),
72 fVertexerTracksTPCMVSig2Ini(1e3),
73 fVertexerTracksTPCMVMaxSigma2(5.0),
74 fVertexerTracksTPCMVMinSig2Red(0.05),
75 fVertexerTracksTPCMVMinDst(10e-4),
76 fVertexerTracksTPCMVScanStep(2.),
77 fVertexerTracksTPCMVMaxWghNtr(10),
78 fVertexerTracksTPCMVFinalWBinary(1),
79 fVertexerTracksTPCMVBCSpacing(50),
80 //
81 fVertexerV0NCuts(7),
82 fVertexerV0Chi2max(33.),
83 fVertexerV0DNmin(0.05),
84 fVertexerV0DPmin(0.05),
85 fVertexerV0DCAmax(1.5),
86 fVertexerV0CPAmin(0.9),
87 fVertexerV0Rmin(0.2),
88 fVertexerV0Rmax(200.),
89 fVertexerCascadeNCuts(8),
90 fVertexerCascadeChi2max(33.),
91 fVertexerCascadeDV0min(0.01),
92 fVertexerCascadeMassWin(0.008),
93 fVertexerCascadeDBachMin(0.01),
94 fVertexerCascadeDCAmax(2.0),
95 fVertexerCascadeCPAmin(0.98),
96 fVertexerCascadeRmin(0.2),
97 fVertexerCascadeRmax(100.)
98 {
99   //
100   // constructor
101   //
102   SetName("GRP");
103   SetTitle("GRP");
104 }
105
106 //_____________________________________________________________________________
107 AliGRPRecoParam::~AliGRPRecoParam() 
108 {
109   //
110   // destructor
111   //  
112 }
113
114 AliGRPRecoParam::AliGRPRecoParam(const AliGRPRecoParam& par) :
115   AliDetectorRecoParam(par),
116   fMostProbablePt(par.fMostProbablePt),
117   fVertexerTracksConstraintITS(par.fVertexerTracksConstraintITS),
118   fVertexerTracksConstraintTPC(par.fVertexerTracksConstraintTPC),
119   fVertexerTracksNCuts(par.fVertexerTracksNCuts),
120   fVertexerTracksITSdcacut(par.fVertexerTracksITSdcacut),
121   fVertexerTracksITSdcacutIter0(par.fVertexerTracksITSdcacutIter0),
122   fVertexerTracksITSmaxd0z0(par.fVertexerTracksITSmaxd0z0),
123   fVertexerTracksITSminCls(par.fVertexerTracksITSminCls),
124   fVertexerTracksITSmintrks(par.fVertexerTracksITSmintrks),
125   fVertexerTracksITSnsigma(par.fVertexerTracksITSnsigma),
126   fVertexerTracksITSnindetfitter(par.fVertexerTracksITSnindetfitter),
127   fVertexerTracksITSmaxtgl(par.fVertexerTracksITSmaxtgl), 
128   fVertexerTracksITSfidR(par.fVertexerTracksITSfidR),
129   fVertexerTracksITSfidZ(par.fVertexerTracksITSfidZ),
130   fVertexerTracksITSalgo(par.fVertexerTracksITSalgo),
131   fVertexerTracksITSalgoIter0(par.fVertexerTracksITSalgoIter0),
132   //
133   fVertexerTracksITSMVTukey2(par.fVertexerTracksITSMVTukey2),
134   fVertexerTracksITSMVSig2Ini(par.fVertexerTracksITSMVSig2Ini),
135   fVertexerTracksITSMVMaxSigma2(par.fVertexerTracksITSMVMaxSigma2),
136   fVertexerTracksITSMVMinSig2Red(par.fVertexerTracksITSMVMinSig2Red),
137   fVertexerTracksITSMVMinDst(par.fVertexerTracksITSMVMinDst),
138   fVertexerTracksITSMVScanStep(par.fVertexerTracksITSMVScanStep),
139   fVertexerTracksITSMVMaxWghNtr(par.fVertexerTracksITSMVMaxWghNtr),
140   fVertexerTracksITSMVFinalWBinary(par.fVertexerTracksITSMVFinalWBinary),
141   fVertexerTracksITSMVBCSpacing(par.fVertexerTracksITSMVBCSpacing),
142   //
143   fVertexerTracksTPCdcacut(par.fVertexerTracksTPCdcacut),
144   fVertexerTracksTPCdcacutIter0(par.fVertexerTracksTPCdcacutIter0),
145   fVertexerTracksTPCmaxd0z0(par.fVertexerTracksTPCmaxd0z0),
146   fVertexerTracksTPCminCls(par.fVertexerTracksTPCminCls),
147   fVertexerTracksTPCmintrks(par.fVertexerTracksTPCmintrks),
148   fVertexerTracksTPCnsigma(par.fVertexerTracksTPCnsigma),
149   fVertexerTracksTPCnindetfitter(par.fVertexerTracksTPCnindetfitter),
150   fVertexerTracksTPCmaxtgl(par.fVertexerTracksTPCmaxtgl), 
151   fVertexerTracksTPCfidR(par.fVertexerTracksTPCfidR),
152   fVertexerTracksTPCfidZ(par.fVertexerTracksTPCfidZ),
153   fVertexerTracksTPCalgo(par.fVertexerTracksTPCalgo),
154   fVertexerTracksTPCalgoIter0(par.fVertexerTracksTPCalgoIter0),
155   //
156   fVertexerTracksTPCMVTukey2(par.fVertexerTracksTPCMVTukey2),
157   fVertexerTracksTPCMVSig2Ini(par.fVertexerTracksTPCMVSig2Ini),
158   fVertexerTracksTPCMVMaxSigma2(par.fVertexerTracksTPCMVMaxSigma2),
159   fVertexerTracksTPCMVMinSig2Red(par.fVertexerTracksTPCMVMinSig2Red),
160   fVertexerTracksTPCMVMinDst(par.fVertexerTracksTPCMVMinDst),
161   fVertexerTracksTPCMVScanStep(par.fVertexerTracksTPCMVScanStep),
162   fVertexerTracksTPCMVMaxWghNtr(par.fVertexerTracksTPCMVMaxWghNtr),
163   fVertexerTracksTPCMVFinalWBinary(par.fVertexerTracksTPCMVFinalWBinary),
164   fVertexerTracksTPCMVBCSpacing(par.fVertexerTracksTPCMVBCSpacing),
165   //
166   fVertexerV0NCuts(par.fVertexerV0NCuts),
167   fVertexerV0Chi2max(par.fVertexerV0Chi2max),
168   fVertexerV0DNmin(par.fVertexerV0DNmin),
169   fVertexerV0DPmin(par.fVertexerV0DPmin),
170   fVertexerV0DCAmax(par.fVertexerV0DCAmax),
171   fVertexerV0CPAmin(par.fVertexerV0CPAmin),
172   fVertexerV0Rmin(par.fVertexerV0Rmin),
173   fVertexerV0Rmax(par.fVertexerV0Rmax),
174   fVertexerCascadeNCuts(par.fVertexerCascadeNCuts),
175   fVertexerCascadeChi2max(par.fVertexerCascadeChi2max),
176   fVertexerCascadeDV0min(par.fVertexerCascadeDV0min),
177   fVertexerCascadeMassWin(par.fVertexerCascadeMassWin),
178   fVertexerCascadeDBachMin(par.fVertexerCascadeDBachMin),
179   fVertexerCascadeDCAmax(par.fVertexerCascadeDCAmax),
180   fVertexerCascadeCPAmin(par.fVertexerCascadeCPAmin),
181   fVertexerCascadeRmin(par.fVertexerCascadeRmin),
182   fVertexerCascadeRmax(par.fVertexerCascadeRmax)
183 {
184   // copy constructor
185 }
186
187 //_____________________________________________________________________________
188 AliGRPRecoParam& AliGRPRecoParam::operator = (const AliGRPRecoParam& par)
189 {
190   // assignment operator
191
192   if(&par == this) return *this;
193
194   this->~AliGRPRecoParam();
195   new(this) AliGRPRecoParam(par);
196   return *this;
197 }
198
199 //_____________________________________________________________________________
200 AliGRPRecoParam *AliGRPRecoParam::GetHighFluxParam() 
201 {
202   //
203   // make default reconstruction  parameters for high flux env.
204   //
205   AliGRPRecoParam *param = new AliGRPRecoParam();
206
207   // to speed up the vertexing in PbPb
208   param->fVertexerTracksITSalgoIter0 = 1.;
209   param->fVertexerTracksTPCalgoIter0 = 1.;
210
211   // tighter selections for V0s
212   param->fVertexerV0Chi2max = 33.;
213   param->fVertexerV0DNmin   = 0.1;
214   param->fVertexerV0DPmin   = 0.1;
215   param->fVertexerV0DCAmax  = 1.0;
216   param->fVertexerV0CPAmin  = 0.998;
217   param->fVertexerV0Rmin    = 0.9;
218   param->fVertexerV0Rmax    = 100.;
219
220   // tighter selections for Cascades
221   param->fVertexerCascadeChi2max  = 33.; 
222   param->fVertexerCascadeDV0min   = 0.05;  
223   param->fVertexerCascadeMassWin  = 0.008; 
224   param->fVertexerCascadeDBachMin = 0.030;
225   param->fVertexerCascadeDCAmax   = 0.3;  
226   param->fVertexerCascadeCPAmin   = 0.999;  
227   param->fVertexerCascadeRmin     = 0.9;    
228   param->fVertexerCascadeRmax     = 100.;    
229
230   return param;
231 }
232 //_____________________________________________________________________________
233 AliGRPRecoParam *AliGRPRecoParam::GetLowFluxParam() 
234 {
235   //
236   // make default reconstruction  parameters for low  flux env.
237   //
238   AliGRPRecoParam *param = new AliGRPRecoParam();
239   return param;
240 }
241 //_____________________________________________________________________________
242 AliGRPRecoParam *AliGRPRecoParam::GetCosmicTestParam() 
243 {
244   //
245   // make default reconstruction  parameters for cosmics env.
246   //
247   AliGRPRecoParam *param = new AliGRPRecoParam();
248
249   param->SetVertexerTracksConstraintITS(kFALSE);
250   param->SetVertexerTracksConstraintTPC(kFALSE);
251   param->SetMostProbablePt(3.0);
252
253   return param;
254 }
255 //_____________________________________________________________________________
256 void AliGRPRecoParam::GetVertexerTracksCuts(Int_t mode,Double_t *cuts, int n) const {
257   //
258   // get cuts for ITS (0) or TPC (1) mode
259   //
260   if(mode==1) {
261     if (n>0)  cuts[0] = fVertexerTracksTPCdcacut;
262     if (n>1)  cuts[1] = fVertexerTracksTPCdcacutIter0;
263     if (n>2)  cuts[2] = fVertexerTracksTPCmaxd0z0;
264     if (n>3)  cuts[3] = fVertexerTracksTPCminCls;
265     if (n>4)  cuts[4] = fVertexerTracksTPCmintrks;
266     if (n>5)  cuts[5] = fVertexerTracksTPCnsigma;
267     if (n>6)  cuts[6] = fVertexerTracksTPCnindetfitter;
268     if (n>7)  cuts[7] = fVertexerTracksTPCmaxtgl; 
269     if (n>8)  cuts[8] = fVertexerTracksTPCfidR;
270     if (n>9)  cuts[9] = fVertexerTracksTPCfidZ;
271     if (n>10) cuts[10]= fVertexerTracksTPCalgo;
272     if (n>11) cuts[11]= fVertexerTracksTPCalgoIter0;
273     //
274     if (n>12)  cuts[12]= fVertexerTracksTPCMVTukey2;
275     if (n>13)  cuts[13]= fVertexerTracksTPCMVSig2Ini;
276     if (n>14)  cuts[14]= fVertexerTracksTPCMVMaxSigma2;
277     if (n>15)  cuts[15]= fVertexerTracksTPCMVMinSig2Red;
278     if (n>16)  cuts[16]= fVertexerTracksTPCMVMinDst;
279     if (n>17)  cuts[17]= fVertexerTracksTPCMVScanStep;
280     if (n>18)  cuts[18]= fVertexerTracksTPCMVMaxWghNtr;
281     if (n>19)  cuts[19]= fVertexerTracksTPCMVFinalWBinary;
282     if (n>20)  cuts[20]= fVertexerTracksTPCMVBCSpacing;
283   } else {
284     if (n>0 ) cuts[0] = fVertexerTracksITSdcacut;
285     if (n>1 ) cuts[1] = fVertexerTracksITSdcacutIter0;
286     if (n>2 ) cuts[2] = fVertexerTracksITSmaxd0z0;
287     if (n>3 ) cuts[3] = fVertexerTracksITSminCls;
288     if (n>4 ) cuts[4] = fVertexerTracksITSmintrks;
289     if (n>5 ) cuts[5] = fVertexerTracksITSnsigma;
290     if (n>6 ) cuts[6] = fVertexerTracksITSnindetfitter;
291     if (n>7 ) cuts[7] = fVertexerTracksITSmaxtgl; 
292     if (n>8 ) cuts[8] = fVertexerTracksITSfidR;
293     if (n>9 ) cuts[9] = fVertexerTracksITSfidZ;
294     if (n>10) cuts[10]= fVertexerTracksITSalgo;
295     if (n>11) cuts[11]= fVertexerTracksITSalgoIter0;
296     //
297     if (n>12) cuts[12]= fVertexerTracksITSMVTukey2;
298     if (n>13) cuts[13]= fVertexerTracksITSMVSig2Ini;
299     if (n>14) cuts[14]= fVertexerTracksITSMVMaxSigma2;
300     if (n>15) cuts[15]= fVertexerTracksITSMVMinSig2Red;
301     if (n>16) cuts[16]= fVertexerTracksITSMVMinDst;
302     if (n>17) cuts[17]= fVertexerTracksITSMVScanStep;
303     if (n>18) cuts[18]= fVertexerTracksITSMVMaxWghNtr;
304     if (n>19) cuts[19]= fVertexerTracksITSMVFinalWBinary;
305     if (n>20) cuts[20]= fVertexerTracksITSMVBCSpacing;
306   }
307
308   return;
309 }
310 //_____________________________________________________________________________
311 void AliGRPRecoParam::SetVertexerTracksCuts(Int_t mode,Int_t ncuts,Double_t cuts[21]) {
312   //
313   // set cuts for ITS (0) or TPC (1) mode
314   //
315   if(ncuts!=fVertexerTracksNCuts) {
316     printf("AliGRPRecoParam: Number of AliVertexerTracks cuts is %d\n",fVertexerTracksNCuts);
317     return;
318   }
319
320   if(mode==1) {
321     if (ncuts>0) fVertexerTracksTPCdcacut = cuts[0];
322     if (ncuts>1) fVertexerTracksTPCdcacutIter0 = cuts[1];
323     if (ncuts>2) fVertexerTracksTPCmaxd0z0 = cuts[2];
324     if (ncuts>3) fVertexerTracksTPCminCls = cuts[3];
325     if (ncuts>4) fVertexerTracksTPCmintrks = cuts[4];
326     if (ncuts>5) fVertexerTracksTPCnsigma = cuts[5];
327     if (ncuts>6) fVertexerTracksTPCnindetfitter = cuts[6];
328     if (ncuts>7) fVertexerTracksTPCmaxtgl = cuts[7]; 
329     if (ncuts>8) fVertexerTracksTPCfidR = cuts[8];
330     if (ncuts>9) fVertexerTracksTPCfidZ = cuts[9];
331     if (ncuts>10) fVertexerTracksTPCalgo = cuts[10];
332     if (ncuts>11) fVertexerTracksTPCalgoIter0 = cuts[11];
333     //
334     if (ncuts>12) fVertexerTracksTPCMVTukey2       = cuts[12];
335     if (ncuts>13) fVertexerTracksTPCMVSig2Ini      = cuts[13];
336     if (ncuts>14) fVertexerTracksTPCMVMaxSigma2    = cuts[14];
337     if (ncuts>15) fVertexerTracksTPCMVMinSig2Red   = cuts[15];
338     if (ncuts>16) fVertexerTracksTPCMVMinDst       = cuts[16];
339     if (ncuts>17) fVertexerTracksTPCMVScanStep     = cuts[17];
340     if (ncuts>18) fVertexerTracksTPCMVMaxWghNtr    = cuts[18];
341     if (ncuts>19) fVertexerTracksTPCMVFinalWBinary = cuts[19];
342     if (ncuts>20) fVertexerTracksTPCMVBCSpacing    = cuts[20];
343   } else {
344     if (ncuts>0) fVertexerTracksITSdcacut = cuts[0];
345     if (ncuts>1) fVertexerTracksITSdcacutIter0 = cuts[1];
346     if (ncuts>2) fVertexerTracksITSmaxd0z0 = cuts[2];
347     if (ncuts>3) fVertexerTracksITSminCls = cuts[3];
348     if (ncuts>4) fVertexerTracksITSmintrks = cuts[4];
349     if (ncuts>5) fVertexerTracksITSnsigma = cuts[5];
350     if (ncuts>6) fVertexerTracksITSnindetfitter = cuts[6];
351     if (ncuts>7) fVertexerTracksITSmaxtgl = cuts[7]; 
352     if (ncuts>8) fVertexerTracksITSfidR = cuts[8];
353     if (ncuts>9) fVertexerTracksITSfidZ = cuts[9];
354     if (ncuts>10) fVertexerTracksITSalgo = cuts[10];
355     if (ncuts>11) fVertexerTracksITSalgoIter0 = cuts[11];
356     //
357     if (ncuts>12) fVertexerTracksITSMVTukey2       = cuts[12];
358     if (ncuts>13) fVertexerTracksITSMVSig2Ini      = cuts[13];
359     if (ncuts>14) fVertexerTracksITSMVMaxSigma2    = cuts[14];
360     if (ncuts>15) fVertexerTracksITSMVMinSig2Red   = cuts[15];
361     if (ncuts>16) fVertexerTracksITSMVMinDst       = cuts[16];
362     if (ncuts>17) fVertexerTracksITSMVScanStep     = cuts[17];
363     if (ncuts>18) fVertexerTracksITSMVMaxWghNtr    = cuts[18];
364     if (ncuts>19) fVertexerTracksITSMVFinalWBinary = cuts[19];
365     if (ncuts>20) fVertexerTracksITSMVBCSpacing    = cuts[20];
366   }
367   //
368   return;
369 }
370 //_____________________________________________________________________________
371 void AliGRPRecoParam::GetVertexerV0Cuts(Double_t *cuts) const {
372   //
373   // get cuts for AliV0vertexer
374   //
375   cuts[0] = fVertexerV0Chi2max;
376   cuts[1] = fVertexerV0DNmin;
377   cuts[2] = fVertexerV0DPmin;
378   cuts[3] = fVertexerV0DCAmax;
379   cuts[4] = fVertexerV0CPAmin;
380   cuts[5] = fVertexerV0Rmin;
381   cuts[6] = fVertexerV0Rmax;
382   return;
383 }
384 //_____________________________________________________________________________
385 void AliGRPRecoParam::SetVertexerV0Cuts(Int_t ncuts,Double_t cuts[7]) {
386   //
387   // set cuts for AliV0vertexer
388   //
389   if(ncuts!=fVertexerV0NCuts) {
390     printf("AliGRPRecoParam: Number of AliV0vertexer cuts is %d\n",fVertexerV0NCuts);
391     return;
392   }
393   fVertexerV0Chi2max = cuts[0];
394   fVertexerV0DNmin   = cuts[1];
395   fVertexerV0DPmin   = cuts[2];
396   fVertexerV0DCAmax  = cuts[3];
397   fVertexerV0CPAmin  = cuts[4];
398   fVertexerV0Rmin    = cuts[5];
399   fVertexerV0Rmax    = cuts[6];
400   return;
401 }
402 //_____________________________________________________________________________
403 void AliGRPRecoParam::GetVertexerCascadeCuts(Double_t *cuts) const {
404   //
405   // get cuts for AliCascadevertexer
406   //
407   cuts[0] = fVertexerCascadeChi2max;
408   cuts[1] = fVertexerCascadeDV0min;
409   cuts[2] = fVertexerCascadeMassWin;
410   cuts[3] = fVertexerCascadeDBachMin;
411   cuts[4] = fVertexerCascadeDCAmax;
412   cuts[5] = fVertexerCascadeCPAmin;
413   cuts[6] = fVertexerCascadeRmin;
414   cuts[7] = fVertexerCascadeRmax;
415   return;
416 }
417 //_____________________________________________________________________________
418 void AliGRPRecoParam::SetVertexerCascadeCuts(Int_t ncuts,Double_t cuts[8]) {
419   //
420   // set cuts for AliCascadeVertexer
421   //
422   if(ncuts!=fVertexerCascadeNCuts) {
423     printf("AliGRPRecoParam: Number of AliCascadeVertexer cuts is %d\n",fVertexerCascadeNCuts);
424     return;
425   }
426   fVertexerCascadeChi2max  = cuts[0];
427   fVertexerCascadeDV0min   = cuts[1];
428   fVertexerCascadeMassWin  = cuts[2];
429   fVertexerCascadeDBachMin = cuts[3];
430   fVertexerCascadeDCAmax   = cuts[4];
431   fVertexerCascadeCPAmin   = cuts[5];
432   fVertexerCascadeRmin     = cuts[6];
433   fVertexerCascadeRmax     = cuts[7];
434   return;
435 }