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