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