changes from Misha
[u/mrichter/AliRoot.git] / TRD / AliTRDrecoParam.cxx
CommitLineData
e4f2f73d 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
8df1f8f5 28#include "AliLog.h"
29
e4f2f73d 30#include "AliTRDrecoParam.h"
31
32ClassImp(AliTRDrecoParam)
33
a2fbb6ec 34
e4f2f73d 35//______________________________________________________________
36AliTRDrecoParam::AliTRDrecoParam()
37 :AliDetectorRecoParam()
8ae98148 38 ,fkdNchdy(12.)
91834b8d 39 ,fkMaxTheta(1.0)
40 ,fkMaxPhi(2.0)
e4f2f73d 41 ,fkRoad0y(6.0)
42 ,fkRoad0z(8.5)
43 ,fkRoad1y(2.0)
44 ,fkRoad1z(20.0)
45 ,fkRoad2y(3.0)
46 ,fkRoad2z(20.0)
b06a50a5 47 ,fkPtThreshold(2.0)
e4f2f73d 48 ,fkPlaneQualityThreshold(5.0)// 4.2? under Investigation
566bf887 49 ,fkRoadzMultiplicator(1.5)
e4f2f73d 50 ,fkFindable(.333)
eb38ed55 51 ,fkChi2Z(30./*14.*//*12.5*/)
e4f2f73d 52 ,fkChi2Y(.25)
5a2e200c 53 ,fkChi2YSlope(7.73)
54 ,fkChi2ZSlope(0.069)
8c499dbf 55 ,fkChi2YCut(0.5)
5a2e200c 56 ,fkPhiSlope(10.6)
8ae98148 57 ,fkNMeanClusters(20.)
58 ,fkNSigmaClusters(2.)
59 ,fkNClusterNoise(0.)
60 ,fkNMeanTracklets(5.5)
e4f2f73d 61 ,fkTrackLikelihood(-15.)
8c499dbf 62 ,fNumberOfConfigs(3)
a2fbb6ec 63 ,fFlags(0)
9dcc64cc 64 ,fRawStreamVersion("DEFAULT")
df83a620 65 ,fMinMaxCutSigma(4.)
66 ,fMinLeftRightCutSigma(8.)
fc546d21 67 ,fClusMaxThresh(4.5)
68 ,fClusSigThresh(3.5)
56b32fd7 69 ,fTCnexp(1)
8c499dbf 70 ,fRecEveryNTB(1)
4e459a9d 71 ,fNumberOfPresamples(0)
72 ,fNumberOfPostsamples(0)
e4f2f73d 73{
74 //
75 // Default constructor
76 //
d937ad7a 77 fSysCovMatrix[0] = 0.; // y direction (1 cm)
78 fSysCovMatrix[1] = 0.; // z direction (1 cm)
3afdab72 79 fSysCovMatrix[2] = 0.; // snp
80 fSysCovMatrix[3] = 0.; // tgl
81 fSysCovMatrix[4] = 0.; // 1/pt
22a4ab0c 82
a2fbb6ec 83 // Xe tail cancellation parameters
84 fTCParams[0] = 1.156; // r1
85 fTCParams[1] = 0.130; // r2
86 fTCParams[2] = 0.114; // c1
87 fTCParams[3] = 0.624; // c2
88 // Ar tail cancellation parameters
89 fTCParams[4] = 6.; // r1
90 fTCParams[5] = 0.62; // r2
91 fTCParams[6] = 0.0087;// c1
92 fTCParams[7] = 0.07; // c2
93
22a4ab0c 94 memset(fPIDThreshold, 0, AliTRDCalPID::kNMom*sizeof(Double_t));
a2fbb6ec 95 memset(fStreamLevel, 0, kTRDreconstructionTasks * sizeof(Int_t));
96
9dcc64cc 97 SetPIDmethod(AliTRDPIDResponse::kLQ1D);
a2fbb6ec 98 SetEightSlices();
99 SetImproveTracklets();
100 SetLUT();
101 SetTailCancelation();
e4f2f73d 102}
103
104//______________________________________________________________
a7ac01d2 105AliTRDrecoParam::AliTRDrecoParam(const AliTRDrecoParam &ref)
106 :AliDetectorRecoParam(ref)
8ae98148 107 ,fkdNchdy(ref.fkdNchdy)
a7ac01d2 108 ,fkMaxTheta(ref.fkMaxTheta)
109 ,fkMaxPhi(ref.fkMaxPhi)
110 ,fkRoad0y(ref.fkRoad0y)
d6171f43 111 ,fkRoad0z(ref.fkRoad0z)
a7ac01d2 112 ,fkRoad1y(ref.fkRoad1y)
d6171f43 113 ,fkRoad1z(ref.fkRoad1z)
a7ac01d2 114 ,fkRoad2y(ref.fkRoad2y)
115 ,fkRoad2z(ref.fkRoad2z)
d6171f43 116 ,fkPtThreshold(ref.fkPtThreshold)
a7ac01d2 117 ,fkPlaneQualityThreshold(ref.fkPlaneQualityThreshold)
566bf887 118 ,fkRoadzMultiplicator(ref.fkRoadzMultiplicator)
a7ac01d2 119 ,fkFindable(ref.fkFindable)
120 ,fkChi2Z(ref.fkChi2Z)
121 ,fkChi2Y(ref.fkChi2Y)
5a2e200c 122 ,fkChi2YSlope(ref.fkChi2YSlope)
123 ,fkChi2ZSlope(ref.fkChi2ZSlope)
8c499dbf 124 ,fkChi2YCut(ref.fkChi2YCut)
5a2e200c 125 ,fkPhiSlope(ref.fkPhiSlope)
8ae98148 126 ,fkNMeanClusters(ref.fkNMeanClusters)
127 ,fkNSigmaClusters(ref.fkNSigmaClusters)
128 ,fkNClusterNoise(ref.fkNClusterNoise)
129 ,fkNMeanTracklets(ref.fkNMeanTracklets)
a7ac01d2 130 ,fkTrackLikelihood(ref.fkTrackLikelihood)
8c499dbf 131 ,fNumberOfConfigs(ref.fNumberOfConfigs)
a2fbb6ec 132 ,fFlags(ref.fFlags)
133 ,fRawStreamVersion(ref.fRawStreamVersion)
a7ac01d2 134 ,fMinMaxCutSigma(ref.fMinMaxCutSigma)
135 ,fMinLeftRightCutSigma(ref.fMinLeftRightCutSigma)
136 ,fClusMaxThresh(ref.fClusMaxThresh)
137 ,fClusSigThresh(ref.fClusSigThresh)
138 ,fTCnexp(ref.fTCnexp)
8c499dbf 139 ,fRecEveryNTB(ref.fRecEveryNTB)
4e459a9d 140 ,fNumberOfPresamples(ref.fNumberOfPresamples)
141 ,fNumberOfPostsamples(ref.fNumberOfPostsamples)
a7ac01d2 142{
143 //
144 // Copy constructor
145 //
a7ac01d2 146 memcpy(fSysCovMatrix, ref.fSysCovMatrix, 5*sizeof(Double_t));
a2fbb6ec 147 memcpy(fTCParams, ref.fTCParams, 8*sizeof(Double_t));
22a4ab0c 148 memcpy(fPIDThreshold, ref.fPIDThreshold, AliTRDCalPID::kNMom*sizeof(Double_t));
a2fbb6ec 149 memcpy(fStreamLevel, ref.fStreamLevel, kTRDreconstructionTasks * sizeof(Int_t));
a7ac01d2 150}
151
152//______________________________________________________________
f09f3167 153AliTRDrecoParam& AliTRDrecoParam::operator=(const AliTRDrecoParam &ref)
d6171f43 154{
155 //
156 // assignment operator
157 //
158
159 if(this == &ref) return *this;
160 AliDetectorRecoParam::operator=(ref);
161 fkdNchdy = ref.fkdNchdy;
162 fkMaxTheta = ref.fkMaxTheta;
163 fkMaxPhi = ref.fkMaxPhi;
164 fkRoad0y = ref.fkRoad0y;
165 fkRoad0z = ref.fkRoad0z;
166 fkRoad1y = ref.fkRoad1y;
167 fkRoad1z = ref.fkRoad1z;
168 fkRoad2y = ref.fkRoad2y;
169 fkRoad2z = ref.fkRoad2z;
170 fkPtThreshold = ref.fkPtThreshold;
171 fkPlaneQualityThreshold= ref.fkPlaneQualityThreshold;
172 fkRoadzMultiplicator = ref.fkRoadzMultiplicator;
173 fkFindable = ref.fkFindable;
174 fkChi2Z = ref.fkChi2Z;
175 fkChi2Y = ref.fkChi2Y;
176 fkChi2YSlope = ref.fkChi2YSlope;
177 fkChi2ZSlope = ref.fkChi2ZSlope;
178 fkChi2YCut = ref.fkChi2YCut;
179 fkPhiSlope = ref.fkPhiSlope;
180 fkNMeanClusters = ref.fkNMeanClusters;
181 fkNSigmaClusters = ref.fkNSigmaClusters;
182 fkNClusterNoise = ref.fkNClusterNoise;
183 fkNMeanTracklets = ref.fkNMeanTracklets;
184 fkTrackLikelihood = ref.fkTrackLikelihood;
185 fNumberOfConfigs = ref.fNumberOfConfigs;
186 fFlags = ref.fFlags;
187 fRawStreamVersion = ref.fRawStreamVersion;
188 fMinMaxCutSigma = ref.fMinMaxCutSigma;
189 fMinLeftRightCutSigma = ref.fMinLeftRightCutSigma;
190 fClusMaxThresh = ref.fClusMaxThresh;
191 fClusSigThresh = ref.fClusSigThresh;
192 fTCnexp = ref.fTCnexp;
193 fRecEveryNTB = ref.fRecEveryNTB;
194 fNumberOfPresamples = ref.fNumberOfPresamples;
195 fNumberOfPostsamples = ref.fNumberOfPostsamples;
196
197 memcpy(fSysCovMatrix, ref.fSysCovMatrix, 5*sizeof(Double_t));
198 memcpy(fTCParams, ref.fTCParams, 8*sizeof(Double_t));
199 memcpy(fPIDThreshold, ref.fPIDThreshold, AliTRDCalPID::kNMom*sizeof(Double_t));
200 memcpy(fStreamLevel, ref.fStreamLevel, kTRDreconstructionTasks * sizeof(Int_t));
201 return *this;
202}
203
204//______________________________________________________________
e4f2f73d 205AliTRDrecoParam *AliTRDrecoParam::GetLowFluxParam()
206{
207 //
208 // Parameters for the low flux environment
209 //
210
8ae98148 211 AliTRDrecoParam *rec = new AliTRDrecoParam();
212 rec->fkdNchdy = 12.; // pp in TRD
a2fbb6ec 213 rec->SetVertexConstrained();
828c6f80 214 rec->SetCheckTimeConsistency();
8ae98148 215 return rec;
e4f2f73d 216
217}
218
219//______________________________________________________________
8c499dbf 220AliTRDrecoParam *AliTRDrecoParam::GetLowFluxHLTParam()
221{
222 //
223 // Parameters for the high flux environment in HLT
224 //
225
226 AliTRDrecoParam *rec = GetLowFluxParam();
82ddb093 227 rec->fNumberOfConfigs = 2;
8c499dbf 228 return rec;
229
230}
231
232//______________________________________________________________
e4f2f73d 233AliTRDrecoParam *AliTRDrecoParam::GetHighFluxParam()
234{
235 //
236 // Parameters for the high flux environment
237 //
238
fb872574 239 AliTRDrecoParam *rec = new AliTRDrecoParam();
8ae98148 240 rec->fkdNchdy = 4000.; // PbPb in TRD
a2fbb6ec 241 rec->SetVertexConstrained();
828c6f80 242 rec->SetCheckTimeConsistency();
fb872574 243 return rec;
e4f2f73d 244
245}
9716329b 246
247//______________________________________________________________
8c499dbf 248AliTRDrecoParam *AliTRDrecoParam::GetHighFluxHLTParam()
249{
250 //
251 // Parameters for the high flux environment in HLT
252 //
253
254 AliTRDrecoParam *rec = GetHighFluxParam();
255 rec->fNumberOfConfigs = 1;
8c499dbf 256 return rec;
257
258}
259
260//______________________________________________________________
9716329b 261AliTRDrecoParam *AliTRDrecoParam::GetCosmicTestParam()
262{
263 //
264 // Parameters for the cosmics data
265 //
266
9716329b 267 AliTRDrecoParam *par = new AliTRDrecoParam();
6e39bde4 268 par->fSysCovMatrix[0] = 2.; // y direction (1 cm)
269 par->fSysCovMatrix[1] = 2.; // z direction (1 cm)
b72f4eaf 270 par->fkChi2YSlope = 0.11853;
271 par->fkChi2ZSlope = 0.04527;
272 par->fkChi2YCut = 1.;
6e39bde4 273 par->fkPhiSlope = 10.; //3.17954;
8ae98148 274 par->fkMaxTheta = 2.1445;
275 par->fkMaxPhi = 2.7475;
5a2e200c 276 par->fkNMeanClusters = 12.89;
277 par->fkNSigmaClusters = 2.095;
566bf887 278 par->fkRoadzMultiplicator = 3.;
a2fbb6ec 279 par->fStreamLevel[kTracker] = 1;
828c6f80 280 par->SetCheckTimeConsistency();
9716329b 281 return par;
282
283}
8ae98148 284
285
286//______________________________________________________________
287Float_t AliTRDrecoParam::GetNClusters() const
288{
289 // Estimate the number of clusters in the TRD detector
290
291 Float_t nclusters = (fkNMeanClusters + 2*fkNSigmaClusters)*fkNMeanTracklets*fkdNchdy;
292 nclusters *= 1.+fkNClusterNoise;
293 return nclusters;
294}
11d80e40 295
296//______________________________________________________________
297void AliTRDrecoParam::SetPIDLQslices(Int_t s)
298{
299// Setting number of slices used by the PID LQ method s={1, 2}
300// If PID NN is set this function will change to PID LQ.
301
302 if(IsPIDNeuralNetwork()){
303 AliWarning("PID set to NN. Changing to LQ.");
304 SetPIDNeuralNetwork(kFALSE);
305 }
306
307 switch(s){
308 case 1:
309 if(TESTBIT(fFlags, kLQ2D)) CLRBIT(fFlags, kLQ2D);
310 break;
311 case 2:
312 SETBIT(fFlags, kLQ2D);
313 break;
314 default:
315 AliWarning(Form("N[%d] PID LQ slices not implemented. Using default 2.", s));
316 SETBIT(fFlags, kLQ2D);
317 break;
318 }
319}
320