Finer binning
[u/mrichter/AliRoot.git] / ITS / AliITSRecoParam.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 "AliITSRecoParam.h"
17 #include "AliESDV0Params.h"
18 #include "AliLog.h"
19
20 /* $Id$ */
21
22 ///////////////////////////////////////////////////////////////////////////////
23 //                                                                           //
24 // Class with ITS reconstruction parameters                                  //
25 // Origin: andrea.dainese@lnl.infn.it                                        //
26 //                                                                           //
27 ///////////////////////////////////////////////////////////////////////////////
28
29
30
31 ClassImp(AliITSRecoParam)
32
33 const Int_t AliITSRecoParam::fgkLayersNotToSkip[AliITSgeomTGeo::kNLayers]={0,0,0,0,0,0};
34 const Double_t AliITSRecoParam::fgkrInsideShield[2]={7.5,25.0};
35 const Double_t AliITSRecoParam::fgkrOutsideShield[2]={10.5,30.0};
36 const Double_t AliITSRecoParam::fgkdshield[2]={0.0097,0.0034};
37 const Double_t AliITSRecoParam::fgkX0shield[2]={38.6,42.0};
38
39 //_____________________________________________________________________________
40 AliITSRecoParam::AliITSRecoParam() : AliDetectorRecoParam(),
41 fTracker(0),
42 fITSonly(kFALSE),
43 fVertexer(0),
44 fClusterFinder(0),
45 fPID(0),
46 fVtxr3DZCutWide(0.),
47 fVtxr3DRCutWide(0.),
48 fVtxr3DZCutNarrow(0.),
49 fVtxr3DRCutNarrow(0.),
50 fVtxr3DPhiCutLoose(0.),
51 fVtxr3DPhiCutTight(0.),
52 fVtxr3DDCACut(0.),
53 fVtxr3DPileupAlgo(1),
54 fVtxr3DHighMultAlgo(1),
55 fMaxSnp(1.),
56 fNSigmaYLayerForRoadY(0),
57 fNSigmaRoadY(0),
58 fNSigmaZLayerForRoadZ(0),
59 fNSigmaRoadZ(0),
60 fNSigma2RoadZC(0),
61 fNSigma2RoadYC(0),
62 fNSigma2RoadZNonC(0),
63 fNSigma2RoadYNonC(0),
64 fRoadMisal(0),
65 fMaxNormChi2NonCForHypothesis(0),
66 fMaxChi2(0),
67 fMaxRoad(0),
68 fMaxChi2In(0),
69 fChi2PerCluster(0),
70 fSearchForExtras(kTRUE),                             
71 fXV(0), 
72 fYV(0),
73 fZV(0),
74 fSigmaXV(0),
75 fSigmaYV(0),
76 fSigmaZV(0),
77 fVertexCut(0),
78 fMaxDZforPrimTrk(0),
79 fMaxDZToUseConstraint(0), 
80 fMaxDforV0dghtrForProlongation(0),
81 fMaxDForProlongation(0),
82 fMaxDZForProlongation(0),
83 fMinPtForProlongation(0),
84 fAddVirtualClustersInDeadZone(kFALSE),
85 fZWindowDeadZone(0),
86 fSigmaXDeadZoneHit2(0),
87 fSigmaZDeadZoneHit2(0),
88 fXPassDeadZoneHits(0),
89 fSkipSubdetsNotInTriggerCluster(kTRUE),
90 fUseTGeoInTracker(3),
91 fStepSizeTGeo(5.),
92 fAllowSharedClusters(kTRUE),
93 fClusterErrorsParam(1),
94 fComputePlaneEff(kFALSE),
95 fHistoPlaneEff(kFALSE),
96 fUseTrackletsPlaneEff(kFALSE),
97 fMCTrackletsPlaneEff(kFALSE),
98 fBkgTrackletsPlaneEff(kFALSE),
99 fTrackleterPhiWindowL1(0.10),
100 fTrackleterPhiWindowL2(0.07),
101 fTrackleterZetaWindowL1(0.6),
102 fTrackleterZetaWindowL2(0.4),
103 fUpdateOncePerEventPlaneEff(kTRUE),
104 fMinContVtxPlaneEff(3),
105 fIPlanePlaneEff(0),
106 fReadPlaneEffFromOCDB(kFALSE),
107 fMinPtPlaneEff(0),
108 fMaxMissingClustersPlaneEff(5),
109 fMaxMissingClustersOutPlaneEff(5),
110 fRequireClusterInOuterLayerPlaneEff(kFALSE),
111 fRequireClusterInInnerLayerPlaneEff(kFALSE),
112 fOnlyConstraintPlaneEff(kFALSE),
113 fNSigXFromBoundaryPlaneEff(1.),
114 fNSigZFromBoundaryPlaneEff(1.),
115 fImproveWithVertex(kFALSE),
116 fExtendedEtaAcceptance(kFALSE),
117 fUseBadZonesFromOCDB(kTRUE),
118 fUseSingleBadChannelsFromOCDB(kFALSE),
119 fMinFractionOfBadInRoad(0),
120 fAllowProlongationWithEmptyRoad(kFALSE),
121 fInwardFlagSA(kFALSE),
122 fOuterStartLayerSA(2),
123 fInnerStartLayerSA(3),
124 fMinNPointsSA(3),
125 fFactorSAWindowSizes(1.),
126 fNLoopsSA(32),
127 fMinPhiSA(0.002),
128 fMaxPhiSA(0.0145),
129 fMinLambdaSA(0.003),
130 fMaxLambdaSA(0.008),
131 fMinClusterChargeSA(0.),
132 fSAOnePointTracks(kFALSE),
133 fSAUseAllClusters(kFALSE),
134 fMaxSPDcontrForSAToUseAllClusters(1000000),
135 fSAUsedEdxInfo(kFALSE),
136 fSelectBestMIP03(kFALSE),
137 fFlagFakes(kFALSE),
138 fUseImproveKalman(kFALSE),
139 fFindV0s(kTRUE),
140 fStoreLikeSignV0s(kFALSE),
141 fUseUnfoldingInClusterFinderSPD(kFALSE),
142 fUseUnfoldingInClusterFinderSDD(kTRUE),
143 fUseUnfoldingInClusterFinderSSD(kFALSE),
144 fUseBadChannelsInClusterFinderSSD(kFALSE),
145 fUseSDDCorrectionMaps(kTRUE),
146 fUseSDDClusterSizeSelection(kFALSE),
147 fMinClusterChargeSDD(0.),
148 fUseChargeMatchingInClusterFinderSSD(kTRUE),
149 fTrackleterPhiWindow(0.08),
150 fTrackleterThetaWindow(0.025),
151 fTrackleterPhiShift(0.0045),
152 fTrackleterRemoveClustersFromOverlaps(kFALSE),
153 fTrackleterPhiOverlapCut(0.005),
154 fTrackleterZetaOverlapCut(0.05),
155 fTrackleterPhiRotationAngle(0.0),
156 fTrackleterNStdDev(1.5),
157 fScaleDTBySin2T(kFALSE),
158 fUseCosmicRunShiftsSSD(kFALSE),
159 fSPDRemoveNoisyFlag(kTRUE),
160 fSPDRemoveDeadFlag(kTRUE),
161 fVertexerFastSmearX(0.005),
162 fVertexerFastSmearY(0.005),
163 fVertexerFastSmearZ(0.01),
164 fAlignFilterCosmics(kFALSE),
165 fAlignFilterCosmicMergeTracks(kTRUE),
166 fAlignFilterMinITSPoints(4),
167 fAlignFilterMinITSPointsMerged(4),
168 fAlignFilterOnlyITSSATracks(kTRUE),
169 fAlignFilterOnlyITSTPCTracks(kFALSE),
170 fAlignFilterSkipExtra(kFALSE),
171 fAlignFilterMaxMatchingAngle(0.085),
172 fAlignFilterMinAngleWrtModulePlanes(0.52),
173 fAlignFilterMinPt(0.),
174 fAlignFilterMaxPt(1.e10),
175 fAlignFilterFillQANtuples(kTRUE),
176 //
177 fMultCutPxDrSPDin(0.1),
178 fMultCutPxDrSPDout(0.15),
179 fMultCutPxDz(0.2),
180 fMultCutDCArz(0.5),
181 fMultCutMinElectronProbTPC(0.5),
182 fMultCutMinElectronProbESD(0.1),
183 fMultCutMinP(0.05),
184 fMultCutMinRGamma(2.),
185 fMultCutMinRK0(1.),
186 fMultCutMinPointAngle(0.98),
187 fMultCutMaxDCADauther(0.5),
188 fMultCutMassGamma(0.03),
189 fMultCutMassGammaNSigma(5.),
190 fMultCutMassK0(0.03),
191 fMultCutMassK0NSigma(5.),
192 fMultCutChi2cGamma(2.),
193 fMultCutChi2cK0(2.),
194 fMultCutGammaSFromDecay(-10.),
195 fMultCutK0SFromDecay(-10.),
196 fMultCutMaxDCA(1.),
197 //
198 fCorrectLorentzAngleSPD(kTRUE),
199 fTanLorentzAngleHolesSPD(0.017455), // tan(1 degree)
200 fCorrectLorentzAngleSSD(kTRUE),
201 fTanLorentzAngleHolesSSD(0.016),  // tan(0.94 degrees)
202 fTanLorentzAngleElectronsSSD(0.068), // tan(3.98 degrees)
203 //
204 fESDV0Params(NULL),
205 fOptReco("All")
206 {
207   //
208   // constructor
209   //
210   SetName("ITS");
211   SetTitle("ITS");
212
213   SetLayersParameters();
214   for(Int_t i=0; i<AliITSgeomTGeo::kNLayers; i++) fLayersToSkip[i]=0;
215   SetUseTGeoInTracker(3);
216   SetStepSizeTGeo(5.);
217   SetAllowSharedClusters(kTRUE);
218   SetFindV0s(kTRUE);
219   SetAddVirtualClustersInDeadZone(kFALSE);
220   SetUseAmplitudeInfo(kTRUE);
221   SetClusterErrorsParam(1);
222   SetClusterMisalError(0.);
223   SetClusterMisalErrorBOn(0.);
224   SetVertexer3DDefaults();
225
226   for(Int_t i=0; i<AliITSgeomTGeo::kNLayers; i++) fAlignFilterUseLayer[i]=kTRUE;
227   fESDV0Params = new AliESDV0Params();
228   
229   fESDV0Params->SetMaxDist0(0.1);
230   fESDV0Params->SetMaxDist1(0.1);
231   fESDV0Params->SetMaxDist(1.);
232   fESDV0Params->SetMinPointAngle(0.85);
233   fESDV0Params->SetMinPointAngle2(0.99);
234   fESDV0Params->SetMinR(0.5);
235   fESDV0Params->SetMaxR(220.);
236   fESDV0Params->SetMinPABestConst(0.9999);
237   fESDV0Params->SetMaxRBestConst(10.);
238   fESDV0Params->SetCausality0Cut(0.19);
239   fESDV0Params->SetLikelihood01Cut(0.45);
240   fESDV0Params->SetLikelihood1Cut(0.5);  
241   fESDV0Params->SetCombinedCut(0.55);
242   fESDV0Params->SetMinClFullTrk(5.0);
243   fESDV0Params->SetMinTgl0(1.05);
244   fESDV0Params->SetMinRTgl0(40.0);
245
246   fESDV0Params->SetMinNormDistForbTgl0(3.0);
247   fESDV0Params->SetMinClForb0(4.5);
248   fESDV0Params->SetMinNormDistForb1(3.0);
249   fESDV0Params->SetMinNormDistForb2(2.0);
250   fESDV0Params->SetMinNormDistForb3(1.0);
251   fESDV0Params->SetMinNormDistForb4(4.0);
252   fESDV0Params->SetMinNormDistForb5(5.0);
253   fESDV0Params->SetMinNormDistForbProt(2.0);
254   fESDV0Params->SetMaxPidProbPionForb(0.5);
255
256   fESDV0Params->SetMinRTPCdensity(40.);
257   fESDV0Params->SetMaxRTPCdensity0(110.);
258   fESDV0Params->SetMaxRTPCdensity10(120.);
259   fESDV0Params->SetMaxRTPCdensity20(130.);
260   fESDV0Params->SetMaxRTPCdensity30(140.);
261
262   fESDV0Params->SetMinTPCdensity(0.6);
263   fESDV0Params->SetMinTgl1(1.1);
264   fESDV0Params->SetMinTgl2(1.0);
265   fESDV0Params->SetMinchi2before0(16.);
266   fESDV0Params->SetMinchi2before1(16.);
267   fESDV0Params->SetMinchi2after0(16.);
268   fESDV0Params->SetMinchi2after1(16.);
269   fESDV0Params->SetAddchi2SharedCl(18.);
270   fESDV0Params->SetAddchi2NegCl0(25.);
271   fESDV0Params->SetAddchi2NegCl1(30.);
272   fESDV0Params->SetSigp0Par0(0.0001);
273   fESDV0Params->SetSigp0Par1(0.001);
274   fESDV0Params->SetSigp0Par2(0.1);
275   fESDV0Params->SetSigpPar0(0.5);
276   fESDV0Params->SetSigpPar1(0.6);
277   fESDV0Params->SetSigpPar2(0.4);
278   fESDV0Params->SetMaxDcaLh0(0.5);
279   fESDV0Params->SetStreamLevel(0);
280   fESDV0Params->SetChi2KF(100);
281   fESDV0Params->SetRobustChi2KF(100);
282   
283 }
284 //_____________________________________________________________________________
285 AliITSRecoParam::~AliITSRecoParam() 
286 {
287   //
288   // destructor
289   //  
290   if(fESDV0Params){
291     delete fESDV0Params;
292     fESDV0Params=NULL;
293   }
294 }
295 //_____________________________________________________________________________
296 AliITSRecoParam *AliITSRecoParam::GetHighFluxParam() 
297 {
298   //
299   // make default reconstruction  parameters for hig  flux env.
300   //
301   AliITSRecoParam *param = new AliITSRecoParam();
302   param->SetVertexer3DDefaults();
303   param->SetSPDVertexerPileupAlgoOff();
304   // use of bads from OCDB
305   param->SetUseBadZonesFromOCDB(kTRUE);
306   param->SetUseSingleBadChannelsFromOCDB(kFALSE);
307   // use pointing to vertex during prolongation
308   param->SetImproveWithVertex(kTRUE);
309   // extended eta acceptance
310   param->SetExtendedEtaAcceptance(kFALSE);
311   // allow to skip layer if no cluster and no bad
312   param->SetAllowProlongationWithEmptyRoad(kFALSE);
313   // set event specie
314   param->SetEventSpecie(AliRecoParam::kHighMult);
315
316   param->fMaxSnp = 0.95;
317
318   param->fNSigmaYLayerForRoadY = 4.;
319   param->fNSigmaRoadY = 7.5;
320   param->fNSigmaZLayerForRoadZ = 4.;
321   param->fNSigmaRoadZ = 7.5;
322
323   param->fNSigma2RoadZC = 60.; //7.75^2
324   param->fNSigma2RoadYC = 60.; //7.75^2
325   param->fNSigma2RoadZNonC = 50.; //7.07^2
326   param->fNSigma2RoadYNonC = 50.; //7.07^2
327
328   param->fMaxChi2PerCluster[0] = 11.; //7
329   param->fMaxChi2PerCluster[1] = 12.; //5
330   param->fMaxChi2PerCluster[2] = 12.; //8
331   param->fMaxChi2PerCluster[3] = 5.;  //8
332   param->fMaxChi2PerCluster[4] = 12.; //6.5
333
334   param->fMaxNormChi2NonC[0] = 7.;
335   param->fMaxNormChi2NonC[1] = 8.;
336   param->fMaxNormChi2NonC[2] = 8.;
337   param->fMaxNormChi2NonC[3] = 11.;
338   param->fMaxNormChi2NonC[4] = 14.;
339   param->fMaxNormChi2NonC[5] = 25.;
340
341   param->fMaxNormChi2C[0] = 11.;
342   param->fMaxNormChi2C[1] = 13.;
343   param->fMaxNormChi2C[2] = 15.;
344   param->fMaxNormChi2C[3] = 18.;
345   param->fMaxNormChi2C[4] = 30.;
346   param->fMaxNormChi2C[5] = 35.;
347
348   param->fMaxNormChi2NonCForHypothesis = 7.;
349   
350   param->fMaxChi2 = 35.;
351
352   param->fMaxChi2s[0] = 25.; //40   
353   param->fMaxChi2s[1] = 25.; //40   
354   param->fMaxChi2s[2] = 25.; //40   
355   param->fMaxChi2s[3] = 25.; //40   
356   param->fMaxChi2s[4] = 40.; //40   
357   param->fMaxChi2s[5] = 50.; //40
358
359   param->fMaxRoad = 6.;
360
361   // not used
362   param->fMaxChi2In = 16.;
363    
364   param->fMaxChi2sR[0] = 10.;   
365   param->fMaxChi2sR[1] = 10.;   
366   param->fMaxChi2sR[2] = 10.;   
367   param->fMaxChi2sR[3] = 10.;   
368   param->fMaxChi2sR[4] = 30.;   
369   param->fMaxChi2sR[5] = 40.;   
370
371
372   param->fChi2PerCluster = 9.;
373   // not used
374   param->fSearchForExtras = kFALSE;
375
376   param->fXV = 0.;
377   param->fYV = 0.;
378   param->fZV = 0.;
379   param->fSigmaXV = 0.0050;
380   param->fSigmaYV = 0.0050;
381   param->fSigmaZV = 0.0100;
382
383   param->fVertexCut = 25.;
384
385   param->fMaxDZforPrimTrk = 0.4;
386   param->fMaxDZToUseConstraint = 3.;
387
388   param->fMaxDforV0dghtrForProlongation = 30.;
389   param->fMaxDForProlongation = 40.;//10.;
390   param->fMaxDZForProlongation = 60.;//20.;
391   param->fMinPtForProlongation = 0.120;
392
393   param->fZWindowDeadZone = 2.0;
394   param->fSigmaXDeadZoneHit2 = 0.004/12.;
395   param->fSigmaZDeadZoneHit2 = 0.001/12.;
396   param->fXPassDeadZoneHits = 0.018;
397   //
398   // mult reco
399   param->fMultCutPxDrSPDin = 0.1;
400   param->fMultCutPxDrSPDout = 0.15;
401   param->fMultCutPxDz = 0.2;
402   param->fMultCutDCArz = 0.5;
403   param->fMultCutMinElectronProbTPC = 0.5;
404   param->fMultCutMinElectronProbESD = 0.1;
405   param->fMultCutMinP = 0.05;
406   param->fMultCutMinRGamma = 2.;
407   param->fMultCutMinRK0 = 1.;
408   param->fMultCutMinPointAngle = 0.98;
409   param->fMultCutMaxDCADauther = 0.5;
410   param->fMultCutMassGamma = 0.03;
411   param->fMultCutMassGammaNSigma = 5.;
412   param->fMultCutMassK0 = 0.03;
413   param->fMultCutMassK0NSigma = 5.;
414   param->fMultCutChi2cGamma = 2.;
415   param->fMultCutChi2cK0 = 2.;
416   param->fMultCutGammaSFromDecay = -10.;
417   param->fMultCutK0SFromDecay = -10.;
418   param->fMultCutMaxDCA = 1.;  
419   //
420   // trackleter
421   param->fTrackleterPhiWindow = 0.06;
422   param->fScaleDTBySin2T = kTRUE;
423   //
424   param->fSelectBestMIP03 = kFALSE;//kTRUE;
425   param->fFlagFakes       = kTRUE;
426   param->fUseImproveKalman= kFALSE;
427   //
428   return param;
429 }
430 //_____________________________________________________________________________
431 AliITSRecoParam *AliITSRecoParam::GetLowFluxParam() 
432 {
433   //
434   // make default reconstruction  parameters for low  flux env.
435   //
436   AliITSRecoParam *param = new AliITSRecoParam();
437   param->SetVertexer3DDefaults();
438
439   // full use of bads from OCDB
440   param->SetUseBadZonesFromOCDB(kTRUE);
441   param->SetUseSingleBadChannelsFromOCDB(kTRUE);
442   // extended eta acceptance
443   param->SetExtendedEtaAcceptance(kTRUE);
444   // allow to skip layer if no cluster and no bad
445   param->SetAllowProlongationWithEmptyRoad(kTRUE);
446   // set event specie
447   param->SetEventSpecie(AliRecoParam::kLowMult);
448
449   param->fMaxSnp = 0.95;
450
451   param->fNSigmaYLayerForRoadY = 4.;
452   param->fNSigmaRoadY = 7.5;
453   param->fNSigmaZLayerForRoadZ = 4.;
454   param->fNSigmaRoadZ = 7.5;
455
456   param->fNSigma2RoadZC = 60.; //7.75^2
457   param->fNSigma2RoadYC = 60.; //7.75^2
458   param->fNSigma2RoadZNonC = 50.; //7.07^2
459   param->fNSigma2RoadYNonC = 50.; //7.07^2
460
461   param->fMaxChi2PerCluster[0] = 11.; //7
462   param->fMaxChi2PerCluster[1] = 12.; //5
463   param->fMaxChi2PerCluster[2] = 12.; //8
464   param->fMaxChi2PerCluster[3] = 5.;  //8
465   param->fMaxChi2PerCluster[4] = 12.; //6.5
466
467   param->fMaxNormChi2NonC[0] = 7.;
468   param->fMaxNormChi2NonC[1] = 8.;
469   param->fMaxNormChi2NonC[2] = 8.;
470   param->fMaxNormChi2NonC[3] = 11.;
471   param->fMaxNormChi2NonC[4] = 14.;
472   param->fMaxNormChi2NonC[5] = 25.;
473
474   param->fMaxNormChi2C[0] = 11.;
475   param->fMaxNormChi2C[1] = 13.;
476   param->fMaxNormChi2C[2] = 15.;
477   param->fMaxNormChi2C[3] = 18.;
478   param->fMaxNormChi2C[4] = 30.;
479   param->fMaxNormChi2C[5] = 35.;
480
481   param->fMaxNormChi2NonCForHypothesis = 7.;
482   
483   param->fMaxChi2 = 35.;
484
485   param->fMaxChi2s[0] = 25.; //40   
486   param->fMaxChi2s[1] = 25.; //40   
487   param->fMaxChi2s[2] = 25.; //40   
488   param->fMaxChi2s[3] = 25.; //40   
489   param->fMaxChi2s[4] = 40.; //40   
490   param->fMaxChi2s[5] = 50.; //40
491
492   param->fMaxRoad = 6.;
493
494   // not used
495   param->fMaxChi2In = 16.;
496    
497   param->fMaxChi2sR[0] = 10.;   
498   param->fMaxChi2sR[1] = 10.;   
499   param->fMaxChi2sR[2] = 10.;   
500   param->fMaxChi2sR[3] = 10.;   
501   param->fMaxChi2sR[4] = 30.;   
502   param->fMaxChi2sR[5] = 40.;   
503
504   param->fChi2PerCluster = 9.;
505   // not used
506
507   param->fXV = 0.;
508   param->fYV = 0.;
509   param->fZV = 0.;
510   param->fSigmaXV = 0.0050;
511   param->fSigmaYV = 0.0050;
512   param->fSigmaZV = 0.0100;
513
514   param->fVertexCut = 25.;
515
516   param->fMaxDZforPrimTrk = 0.4;
517   param->fMaxDZToUseConstraint = 3.;
518
519   param->fMaxDforV0dghtrForProlongation = 30.;
520   param->fMaxDForProlongation = 40.;//10.;
521   param->fMaxDZForProlongation = 60.;//20.;
522   param->fMinPtForProlongation = 0.120;
523
524   param->fZWindowDeadZone = 2.0;
525   param->fSigmaXDeadZoneHit2 = 0.004/12.;
526   param->fSigmaZDeadZoneHit2 = 0.001/12.;
527   param->fXPassDeadZoneHits = 0.018;
528   param->SetNLoopsSA(20);
529   param->fMaxPhiSA = 0.07;
530   param->fMaxLambdaSA = 0.04;
531
532  
533   param->GetESDV0Params()->SetMinRTgl0(0.5);
534   param->GetESDV0Params()->SetMaxDist(1.5);
535   param->GetESDV0Params()->SetMaxDcaLh0(1.5);
536   param->GetESDV0Params()->SetMaxRBestConst(80);
537   param->GetESDV0Params()->SetMinPABestConst(0.99);
538   param->GetESDV0Params()->SetMinNormDistForbTgl0(1.);
539   param->GetESDV0Params()->SetMinNormDistForb1(2.);
540   param->GetESDV0Params()->SetMinNormDistForbProt(1.);
541   param->GetESDV0Params()->SetMaxPidProbPionForb(0.7);
542   param->GetESDV0Params()->SetLikelihood01Cut(0.3);
543   param->GetESDV0Params()->SetLikelihood1Cut(0.35);
544   param->GetESDV0Params()->SetCombinedCut(0.4);
545
546   // mult reco
547   param->fMultCutPxDrSPDin = 0.1;
548   param->fMultCutPxDrSPDout = 0.15;
549   param->fMultCutPxDz = 0.2;
550   param->fMultCutDCArz = 0.5;
551   param->fMultCutMinElectronProbTPC = 0.5;
552   param->fMultCutMinElectronProbESD = 0.1;
553   param->fMultCutMinP = 0.05;
554   param->fMultCutMinRGamma = 2.;
555   param->fMultCutMinRK0 = 1.;
556   param->fMultCutMinPointAngle = 0.98;
557   param->fMultCutMaxDCADauther = 0.5;
558   param->fMultCutMassGamma = 0.03;
559   param->fMultCutMassGammaNSigma = 5.;
560   param->fMultCutMassK0 = 0.03;
561   param->fMultCutMassK0NSigma = 5.;
562   param->fMultCutChi2cGamma = 2.;
563   param->fMultCutChi2cK0 = 2.;
564   param->fMultCutGammaSFromDecay = -10.;
565   param->fMultCutK0SFromDecay = -10.;
566   param->fMultCutMaxDCA = 1.;  
567   //
568
569   return param;
570 }
571 //_____________________________________________________________________________
572 AliITSRecoParam *AliITSRecoParam::GetCosmicTestParam() 
573 {
574   //
575   // make default reconstruction  parameters for cosmics
576   //
577   AliITSRecoParam *param = new AliITSRecoParam();
578
579   // vertexer for cosmics
580   param->SetVertexer(2);
581
582   param->SetClusterErrorsParam(2);
583   param->SetFindV0s(kFALSE);
584   param->SetAddVirtualClustersInDeadZone(kFALSE);
585   param->SetUseAmplitudeInfo(kFALSE);
586
587   // set event specie
588   param->SetEventSpecie(AliRecoParam::kCosmic);
589
590   // full use of bads from OCDB
591   param->SetUseBadZonesFromOCDB(kTRUE);
592   param->SetUseSingleBadChannelsFromOCDB(kTRUE);
593
594   // find independently ITS SA tracks 
595   param->SetSAUseAllClusters();
596   param->SetOuterStartLayerSA(AliITSgeomTGeo::GetNLayers()-2);
597
598   //****** COSMICS 2009 (same as COSMICS 2008) *********************
599
600   // to maximize efficiency
601   param->SetAllowProlongationWithEmptyRoad();
602   param->SetMinNPointsSA(2);
603
604   // larger seach windows for SA (in case of large misalignments)
605   param->SetNLoopsSA(32);
606   param->SetFactorSAWindowSizes(20);
607
608   // additional error due to misal (B off)
609   param->SetClusterMisalErrorY(1.0,1.0,1.0,1.0,1.0,1.0); // [cm]
610   param->SetClusterMisalErrorZ(1.0,1.0,1.0,1.0,1.0,1.0); // [cm]
611   // additional error due to misal (B on)
612   param->SetClusterMisalErrorYBOn(0.0,0.0,0.1,0.1,0.1,0.1); // [cm]
613   param->SetClusterMisalErrorZBOn(0.1,0.1,0.1,0.1,0.1,0.1); // [cm]
614
615
616   // SDD configuration 
617   param->fUseSDDCorrectionMaps = kFALSE;
618   param->fUseSDDClusterSizeSelection=kTRUE;
619   param->fMinClusterChargeSDD=30.;
620   
621
622   // alignment data filter
623   param->SetAlignFilterCosmics(kTRUE);
624   param->SetAlignFilterCosmicMergeTracks(kTRUE); 
625   param->SetAlignFilterMinITSPoints(1);
626   param->SetAlignFilterMinITSPointsMerged(3);
627   param->SetAlignFilterOnlyITSSATracks(kTRUE);
628   param->SetAlignFilterOnlyITSTPCTracks(kFALSE);
629   param->SetAlignFilterSkipExtra(kFALSE);
630   param->SetAlignFilterMaxMatchingAngle(0.085/*5deg*/);
631   param->SetAlignFilterMinPt(0.2);          
632   param->SetAlignFilterMaxPt(1.e10);          
633   param->SetAlignFilterFillQANtuples(kTRUE);    
634
635   //******************************************************************
636
637   param->fMaxSnp = 0.95;
638
639   param->fNSigmaYLayerForRoadY = 4.;
640   param->fNSigmaRoadY = 7.5;
641   param->fNSigmaZLayerForRoadZ = 4.;
642   param->fNSigmaRoadZ = 7.5;
643
644   param->fNSigma2RoadZC = 60.; //7.75^2
645   param->fNSigma2RoadYC = 60.; //7.75^2
646   param->fNSigma2RoadZNonC = 50.; //7.07^2
647   param->fNSigma2RoadYNonC = 50.; //7.07^2
648
649   param->fMaxChi2PerCluster[0] = 11.; //7
650   param->fMaxChi2PerCluster[1] = 12.; //5
651   param->fMaxChi2PerCluster[2] = 12.; //8
652   param->fMaxChi2PerCluster[3] = 5.;  //8
653   param->fMaxChi2PerCluster[4] = 12.; //6.5
654
655   param->fMaxNormChi2NonC[0] = 7.;
656   param->fMaxNormChi2NonC[1] = 8.;
657   param->fMaxNormChi2NonC[2] = 8.;
658   param->fMaxNormChi2NonC[3] = 11.;
659   param->fMaxNormChi2NonC[4] = 14.;
660   param->fMaxNormChi2NonC[5] = 25.;
661
662   param->fMaxNormChi2C[0] = 11.;
663   param->fMaxNormChi2C[1] = 13.;
664   param->fMaxNormChi2C[2] = 15.;
665   param->fMaxNormChi2C[3] = 18.;
666   param->fMaxNormChi2C[4] = 30.;
667   param->fMaxNormChi2C[5] = 35.;
668
669   param->fMaxNormChi2NonCForHypothesis = 7.;
670   
671   param->fMaxChi2 = 35.;
672
673   param->fMaxChi2s[0] = 25.; //40   
674   param->fMaxChi2s[1] = 25.; //40   
675   param->fMaxChi2s[2] = 25.; //40   
676   param->fMaxChi2s[3] = 25.; //40   
677   param->fMaxChi2s[4] = 40.; //40   
678   param->fMaxChi2s[5] = 50.; //40
679
680   param->fMaxRoad = 6.;
681
682   // not used
683   param->fMaxChi2In = 16.;
684    
685   param->fMaxChi2sR[0] = 10.;   
686   param->fMaxChi2sR[1] = 10.;   
687   param->fMaxChi2sR[2] = 10.;   
688   param->fMaxChi2sR[3] = 10.;   
689   param->fMaxChi2sR[4] = 30.;   
690   param->fMaxChi2sR[5] = 40.;   
691
692   param->fChi2PerCluster = 9.;
693   // not used
694
695   param->fXV = 0.;
696   param->fYV = 0.;
697   param->fZV = 0.;
698   param->fSigmaXV = 0.0050;
699   param->fSigmaYV = 0.0050;
700   param->fSigmaZV = 0.0100;
701
702   param->fVertexCut = 25.;
703
704   param->fMaxDZforPrimTrk = 0.4;
705   param->fMaxDZToUseConstraint = 3.;
706
707   param->fMaxDforV0dghtrForProlongation = 30.;
708   param->fMaxDForProlongation = 10.;
709   param->fMaxDZForProlongation = 20.;
710   param->fMinPtForProlongation = 0.120;
711
712   param->fZWindowDeadZone = 2.0;
713   param->fSigmaXDeadZoneHit2 = 0.004/12.;
714   param->fSigmaZDeadZoneHit2 = 0.001/12.;
715   param->fXPassDeadZoneHits = 0.018;
716
717   return param;
718 }
719 //_____________________________________________________________________________
720 AliITSRecoParam *AliITSRecoParam::GetPlaneEffParam(Int_t i)
721 {
722   //
723   // make special reconstruction parameters for Plane Efficiency study on layer i (0,5)
724   // 
725   // if i=-1, then the evaluation for both pixel layers is tried with the tracklet method
726   //
727  if (i<-1 || i>=AliITSgeomTGeo::kNLayers) {
728     printf("AliITSRecoParam::GetPlaneEffParam: index of ITS Plane nor in the range [0,5] neither =-1\n");
729     printf("returning null pointer");
730     return NULL;
731   }
732   if(i>=0) {  // Method using tracks (remove given plane from tracking)
733     AliITSRecoParam *param;
734     param = GetLowFluxParam();
735     param->SetClusterErrorsParam(2);
736     // find independently ITS SA tracks 
737     param->SetSAUseAllClusters();
738     param->SetOuterStartLayerSA(2);
739     param->SetAllowProlongationWithEmptyRoad(kTRUE);
740     // larger seach windows for SA (in case of large misalignments)
741     param->SetFactorSAWindowSizes(2);
742
743     // Misalignment syst errors decided at ITS meeting 25.03.2010
744     // additional error due to misal (B off)
745     param->SetClusterMisalErrorY(0.0010,0.0010,0.0300,0.0300,0.0020,0.0020); // [cm]
746     param->SetClusterMisalErrorZ(0.0100,0.0100,0.0100,0.0100,0.0500,0.0500); // [cm]
747     // additional error due to misal (B on)
748     param->SetClusterMisalErrorYBOn(0.0010,0.0030,0.0500,0.0500,0.0020,0.0020); // [cm]
749     param->SetClusterMisalErrorZBOn(0.0100,0.0100,0.0100,0.0100,0.0500,0.0500); // [cm]
750     //----
751
752     // SDD configuration 
753     param->SetUseSDDCorrectionMaps(kTRUE); // changed 30.04.2010
754     param->SetUseSDDClusterSizeSelection(kTRUE);
755     param->SetMinClusterChargeSDD(30.);
756     param->SetUseUnfoldingInClusterFinderSDD(kFALSE);
757     //
758     param->SetComputePlaneEff();
759     param->SetLayerToSkip(i);
760     param->SetIPlanePlaneEff(i);
761     param->fNSigXFromBoundaryPlaneEff= 1.;
762     param->fNSigZFromBoundaryPlaneEff= 1.;
763     // optimized setting for SPD0 (i==0)
764     if (i==0) {
765       param->fMinPtPlaneEff = 0.200; // high pt particles
766       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layers out of 5 without cluster
767       param->fMaxMissingClustersOutPlaneEff = 2; // at most 2 layers out of 5 external ones without cluster
768       param->fRequireClusterInOuterLayerPlaneEff = kTRUE; // cluster on SPD1 must be
769       //param->fOnlyConstraintPlaneEff = kTRUE;
770     }
771     if (i==1 ) {
772       param->fMinPtPlaneEff = 0.200; // high pt particles
773       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layer out of 5 without cluster
774       param->fMaxMissingClustersOutPlaneEff = 2; // at most 2 layer out of 4 external ones without cluster
775       //param->fRequireClusterInOuterLayerPlaneEff = kTRUE; // cluster on SSD1 must be
776     }
777     if (i==2) {
778       param->fMinPtPlaneEff = 0.200; // high pt particles
779       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layer out of 5 without cluster
780       param->fMaxMissingClustersOutPlaneEff = 2; // at most 2 layer out of 3 external ones without cluster
781       //param->fRequireClusterInOuterLayerPlaneEff = kTRUE;
782       //param->fOnlyConstraintPlaneEff = kTRUE;
783     }
784     if (i==3) {
785       param->fMinPtPlaneEff = 0.200; // high pt particles
786       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layer out of 5 without cluster
787       param->fMaxMissingClustersOutPlaneEff = 1; // at most 1 layer out of 2 external ones without cluster
788     }
789     if (i==4) {
790       param->fMinPtPlaneEff = 0.200; // high pt particles
791       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layer out of 5 without cluster
792       param->fMaxMissingClustersOutPlaneEff = 1; // at most 1 layer out of 1 external ones without cluster
793       // param->fRequireClusterInOuterLayerPlaneEff = kTRUE;
794       //param->fOnlyConstraintPlaneEff = kTRUE;
795     }
796     if (i==5) {
797       param->fMinPtPlaneEff = 0.200; // high pt particles
798       param->fMaxMissingClustersPlaneEff = 2; // at most 2 layer out of 5 without cluster
799     }
800     //
801     return param;
802   }
803   else if (i==-1) { // Method using tracklets
804     AliITSRecoParam *param;
805     param = GetLowFluxParam();
806     param->SetIPlanePlaneEff(i);
807     param->SetComputePlaneEff(kTRUE,kFALSE);
808     param->SetUseTrackletsPlaneEff(kTRUE);
809     param->SetTrackleterPhiWindowL2(0.07);
810     param->SetTrackleterZetaWindowL2(0.4);
811     param->SetTrackleterPhiWindowL1(0.10);
812     param->SetTrackleterZetaWindowL1(0.6);
813     param->SetUpdateOncePerEventPlaneEff(kTRUE);
814     param->SetMinContVtxPlaneEff(3);
815     return param;
816   }
817   else {
818     AliErrorGeneral("AliITSRecoParam",Form("Unrecognised value of i %d\n",i));
819     return 0;
820   }
821 }
822
823 //_____________________________________________________________________________
824 void AliITSRecoParam::SetLayersParameters() 
825 {
826   //
827   // number of layers and layers spatial resolutions
828   //
829
830   // spatial resolutions of the detectors
831   // y: 12 12 38 38 20 20 micron
832   fSigmaY2[0]=1.44e-6;
833   fSigmaY2[1]=1.44e-6;
834   fSigmaY2[2]=1.444e-5;
835   fSigmaY2[3]=1.444e-5;
836   fSigmaY2[4]=4.0e-6;
837   fSigmaY2[5]=4.0e-6;
838   // z: 120 120 28 28 830 830 micron
839   fSigmaZ2[0]=1.44e-4;
840   fSigmaZ2[1]=1.44e-4;
841   fSigmaZ2[2]=7.84e-6;
842   fSigmaZ2[3]=7.84e-6;
843   fSigmaZ2[4]=6.889e-3;
844   fSigmaZ2[5]=6.889e-3;
845
846   return;
847 }
848 //_____________________________________________________________________________
849 void AliITSRecoParam::PrintParameters() const 
850 {
851   //
852   // print parameters
853   //
854
855   printf("=============================  AliITSRecoParam::PrintParameters ");
856   printf("============================= \n\n");
857   for(Int_t i=0; i<AliITSgeomTGeo::kNLayers; i++) {
858     if(!fLayersToSkip[i]) {
859       printf("ITS Traking: using layer %d\n",i);
860     } else {
861       printf("ITS Traking: skipping layer %d\n",i);
862     }
863   }
864   for(Int_t i=0; i<AliITSgeomTGeo::kNLayers; i++) {
865     if(fUseAmplitudeInfo[i]) {
866       printf("ITS Traking: use amplitude info for layer %d\n",i);
867     } else {
868       printf("ITS Traking: don't use amplitude info for layer %d\n",i);
869     }
870   }
871   for(Int_t i=0; i<AliITSgeomTGeo::kNLayers; i++)
872     printf("Layer %d:\n  sigmaY2 %f, sigmaZ2 %f\n  sigmaMisalY %f, sigmaMisalZ %f\n  max norm chi2 for non constrained tracks %f\n  max norm chi2 for constrained tracks %f\n  max predicted chi2 (cluster & track prol.) %f\n",i,fSigmaY2[i],fSigmaZ2[i],fClusterMisalErrorY[i],fClusterMisalErrorZ[i],fMaxNormChi2NonC[i],fMaxNormChi2C[i],fMaxChi2s[i]);
873
874
875   Dump();
876
877   return;
878 }
879
880
881 //_____________________________________________________________________________
882 Bool_t AliITSRecoParam::SetOptReco(TString r){
883   // Set option for local reconstruction. 
884   // The string must contain at least one of the following
885   // substrings: "All", "SPD", "SDD", "SSD"
886   Bool_t isFine = kFALSE;
887   if(r.Contains("All") || r.Contains("SPD") || r.Contains("SDD") 
888      || r.Contains("SSD")){
889       isFine = kTRUE;
890       fOptReco=r;
891   }
892   return isFine;
893
894