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