Introduced better way to estimate number of clusters in TRD for offline
[u/mrichter/AliRoot.git] / TRD / AliTRDrecoParam.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, 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 /* $Id$ */
17
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Parameter class for the TRD reconstruction                               //
21 //                                                                           //
22 //  Authors:                                                                 //
23 //    Alex Bercuci <A.Bercuci@gsi.de>                                        //
24 //    Markus Fasel <M.Fasel@gsi.de>                                          //
25 //                                                                           //
26 ///////////////////////////////////////////////////////////////////////////////
27
28 #include "AliTRDrecoParam.h"
29 #include "AliTRDrawStreamBase.h"
30
31 ClassImp(AliTRDrecoParam)
32
33 //______________________________________________________________
34 AliTRDrecoParam::AliTRDrecoParam()
35   :AliDetectorRecoParam()
36   ,fkdNchdy(12.)
37   ,fkMaxTheta(1.0)      
38   ,fkMaxPhi(2.0) 
39   ,fkRoad0y(6.0)
40   ,fkRoad0z(8.5) 
41   ,fkRoad1y(2.0)
42   ,fkRoad1z(20.0)       
43   ,fkRoad2y(3.0)
44   ,fkRoad2z(20.0)
45   ,fkPlaneQualityThreshold(5.0)// 4.2? under Investigation
46   ,fkFindable(.333)
47   ,fkChi2Z(30./*14.*//*12.5*/)
48   ,fkChi2Y(.25)
49   ,fkChi2YCut(7.73)
50   ,fkChi2ZCut(0.069)
51   ,fkPhiCut(10.6)
52   ,fkNMeanClusters(20.)
53   ,fkNSigmaClusters(2.)
54   ,fkNClusterNoise(0.)
55   ,fkNMeanTracklets(5.5)
56   ,fkTrackLikelihood(-15.)
57   ,fMinMaxCutSigma(4.)
58   ,fMinLeftRightCutSigma(8.)
59   ,fClusMaxThresh(4.5)
60   ,fClusSigThresh(3.5)
61   ,fTCnexp(1)
62   ,fNumberOfPresamples(0)
63   ,fNumberOfPostsamples(0)
64 {
65   //
66   // Default constructor
67   //
68   SetTailCancelation();
69   SetLUT();
70   SetClusterSharing(kFALSE);
71   SetVertexConstrained();
72   SetImproveTracklets(kFALSE);
73
74   fSysCovMatrix[0] = 1.; // y direction (1 cm)
75   fSysCovMatrix[1] = 1.; // z direction (1 cm)
76   fSysCovMatrix[2] = 0.; // snp
77   fSysCovMatrix[3] = 0.; // tgl
78   fSysCovMatrix[4] = 0.; // 1/pt
79
80   memset(fPIDThreshold, 0, AliTRDCalPID::kNMom*sizeof(Double_t));
81 }
82
83 //______________________________________________________________
84 AliTRDrecoParam::AliTRDrecoParam(const AliTRDrecoParam &ref)
85   :AliDetectorRecoParam(ref)
86   ,fkdNchdy(ref.fkdNchdy)
87   ,fkMaxTheta(ref.fkMaxTheta)
88   ,fkMaxPhi(ref.fkMaxPhi)
89   ,fkRoad0y(ref.fkRoad0y)
90   ,fkRoad0z(ref.fkRoad0z) 
91   ,fkRoad1y(ref.fkRoad1y)
92   ,fkRoad1z(ref.fkRoad1z)       
93   ,fkRoad2y(ref.fkRoad2y)
94   ,fkRoad2z(ref.fkRoad2z)
95   ,fkPlaneQualityThreshold(ref.fkPlaneQualityThreshold)
96   ,fkFindable(ref.fkFindable)
97   ,fkChi2Z(ref.fkChi2Z)
98   ,fkChi2Y(ref.fkChi2Y)
99   ,fkChi2YCut(ref.fkChi2YCut)
100   ,fkChi2ZCut(ref.fkChi2ZCut)
101   ,fkPhiCut(ref.fkPhiCut)
102   ,fkNMeanClusters(ref.fkNMeanClusters)
103   ,fkNSigmaClusters(ref.fkNSigmaClusters)
104   ,fkNClusterNoise(ref.fkNClusterNoise)
105   ,fkNMeanTracklets(ref.fkNMeanTracklets)
106   ,fkTrackLikelihood(ref.fkTrackLikelihood)
107   ,fMinMaxCutSigma(ref.fMinMaxCutSigma)
108   ,fMinLeftRightCutSigma(ref.fMinLeftRightCutSigma)
109   ,fClusMaxThresh(ref.fClusMaxThresh)
110   ,fClusSigThresh(ref.fClusSigThresh)
111   ,fTCnexp(ref.fTCnexp)
112   ,fNumberOfPresamples(ref.fNumberOfPresamples)
113   ,fNumberOfPostsamples(ref.fNumberOfPostsamples)
114 {
115   //
116   // Copy constructor
117   //
118   SetClusterSharing(ref.IsClusterSharing());
119   SetVertexConstrained(ref.IsVertexConstrained());
120   SetLUT(ref.IsLUT());
121   SetTailCancelation(ref.IsTailCancelation());
122   SetImproveTracklets(ref.HasImproveTracklets());
123
124   memcpy(fSysCovMatrix, ref.fSysCovMatrix, 5*sizeof(Double_t));
125   memcpy(fPIDThreshold, ref.fPIDThreshold, AliTRDCalPID::kNMom*sizeof(Double_t));
126 }
127
128 //______________________________________________________________
129 AliTRDrecoParam *AliTRDrecoParam::GetLowFluxParam()
130 {
131   //
132   // Parameters for the low flux environment
133   //
134
135   AliTRDrecoParam *rec = new AliTRDrecoParam();
136   rec->fkdNchdy = 12.; // pp in TRD
137   return rec;
138
139 }
140
141 //______________________________________________________________
142 AliTRDrecoParam *AliTRDrecoParam::GetHighFluxParam()
143 {
144   //
145   // Parameters for the high flux environment
146   //
147
148   AliTRDrecoParam *rec = new AliTRDrecoParam();
149   rec->fkdNchdy = 4000.; // PbPb in TRD
150   rec->SetImproveTracklets(kTRUE);
151
152   return rec;
153
154 }
155
156 //______________________________________________________________
157 AliTRDrecoParam *AliTRDrecoParam::GetCosmicTestParam()
158 {
159   //
160   // Parameters for the cosmics data
161   //
162
163   AliTRDrawStreamBase::SetRawStreamVersion("TB");
164   AliTRDrecoParam *par = new AliTRDrecoParam();
165   par->SetVertexConstrained(kFALSE);
166   par->fkChi2YCut       = 1.136;
167   par->fkChi2ZCut       = 0.069;
168   par->fkMaxTheta       = 2.1445;
169   par->fkMaxPhi         = 2.7475;
170   par->fkNMeanClusters  = 12.;
171   par->fkNSigmaClusters = 2.5;
172   return par;
173
174 }
175
176
177 //______________________________________________________________
178 Float_t AliTRDrecoParam::GetNClusters() const
179 {
180   // Estimate the number of clusters in the TRD detector
181   
182   Float_t nclusters = (fkNMeanClusters + 2*fkNSigmaClusters)*fkNMeanTracklets*fkdNchdy;
183   nclusters *= 1.+fkNClusterNoise;
184   return nclusters;
185 }