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