updated macros (with new cut values) for (anti-)proton-(anti-)lambda and lambda-...
[u/mrichter/AliRoot.git] / TRD / AliTRDrecoParam.h
CommitLineData
e4f2f73d 1#ifndef ALITRDRECOPARAM_H
2#define ALITRDRECOPARAM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4ba1d6ae 4* See cxx source for full Copyright notice */
e4f2f73d 5
6/* $Id$ */
7
8////////////////////////////////////////////////////////////////////////////
9// //
10// Parameter class for the TRD reconstruction //
11// //
12////////////////////////////////////////////////////////////////////////////
13
14#ifndef ALIDETECTORRECOPARAM_H
15#include "AliDetectorRecoParam.h"
16#endif
9dcc64cc 17
22a4ab0c 18#ifndef ALITRDCALPID_H
97587798 19#include "AliTRDCalPID.h"
22a4ab0c 20#endif
e4f2f73d 21
9dcc64cc 22#ifndef ALITRDPIDRESPONSE_H
23#include "AliTRDPIDResponse.h"
24#endif
25
a2fbb6ec 26class TString;
27
e4f2f73d 28class AliTRDrecoParam : public AliDetectorRecoParam
29{
3c66288b 30public:
a2fbb6ec 31 enum ETRDReconstructionTask{
32 kClusterizer = 0,
33 kTracker = 1,
34 kPID = 2,
35 kTRDreconstructionTasks = 3
36 };
37 enum ETRDflags {
11d80e40 38 kDriftGas
39 ,kVertexConstraint
40 ,kTailCancelation
41 ,kImproveTracklet
42 ,kLUT
43 ,kGAUS
44 ,kClusterSharing
45 ,kSteerPID
46 ,kEightSlices
47 ,kCheckTimeConsistency
48 ,kLQ2D
828c6f80 49 };
4ba1d6ae 50 AliTRDrecoParam();
a7ac01d2 51 AliTRDrecoParam(const AliTRDrecoParam &rec);
f09f3167 52 AliTRDrecoParam& operator=(const AliTRDrecoParam &rec);
4ba1d6ae 53 ~AliTRDrecoParam() { }
54
55 Double_t GetChi2Y() const { return fkChi2Y; }
56 Double_t GetChi2Z() const { return fkChi2Z; }
5a2e200c 57 Double_t GetChi2YSlope() const { return fkChi2YSlope; }
58 Double_t GetChi2ZSlope() const { return fkChi2ZSlope; }
39d9c03c 59 Double_t GetChi2Cut() const { return fChi2Cut; }
5a2e200c 60 Double_t GetChi2YCut() const { return fkChi2YCut; }
61 Double_t GetPhiSlope() const { return fkPhiSlope; }
8ae98148 62 Float_t GetNClusters() const;
63 Double_t GetNMeanClusters() const { return fkNMeanClusters; }
64 Double_t GetNSigmaClusters() const { return fkNSigmaClusters; }
4ba1d6ae 65 Double_t GetFindableClusters() const { return fkFindable; }
86a261ed 66 Int_t GetPIDLQslices() const;
67 AliTRDPIDResponse::ETRDPIDMethod GetPIDmethod() const;
4ba1d6ae 68 Double_t GetMaxTheta() const { return fkMaxTheta; }
69 Double_t GetMaxPhi() const { return fkMaxPhi; }
3afdab72 70 Double_t GetPlaneQualityThreshold() const { return fkPlaneQualityThreshold; }
56b32fd7 71 Double_t GetPIDThreshold(Float_t /*p*/) const { return 0.;}
4ba1d6ae 72 Double_t GetRoad0y() const { return fkRoad0y; }
73 Double_t GetRoad0z() const { return fkRoad0z; }
4ba1d6ae 74 Double_t GetRoad1y() const { return fkRoad1y; }
75 Double_t GetRoad1z() const { return fkRoad1z; }
4ba1d6ae 76 Double_t GetRoad2y() const { return fkRoad2y; }
77 Double_t GetRoad2z() const { return fkRoad2z; }
566bf887 78 Double_t GetRoadzMultiplicator() const { return fkRoadzMultiplicator; }
4ba1d6ae 79 Double_t GetTrackLikelihood() const { return fkTrackLikelihood; }
86a261ed 80 void GetSysCovMatrix(Double_t *sys) const;
81 void GetTCParams(Double_t *par) const;
82 Int_t GetStreamLevel(ETRDReconstructionTask task) const;
828c6f80 83 const TString *GetRawStreamVersion() const{ return &fRawStreamVersion; };
4ba1d6ae 84 Double_t GetMinMaxCutSigma() const { return fMinMaxCutSigma; };
85 Double_t GetMinLeftRightCutSigma() const { return fMinLeftRightCutSigma; };
86 Double_t GetClusMaxThresh() const { return fClusMaxThresh; };
87 Double_t GetClusSigThresh() const { return fClusSigThresh; };
88 Int_t GetTCnexp() const { return fTCnexp; };
828c6f80 89 Int_t GetNumberOfPresamples() const { return fNumberOfPresamples;}
90 Int_t GetNumberOfPostsamples() const { return fNumberOfPostsamples;}
8c499dbf 91 Int_t GetNumberOfSeedConfigs() const { return fNumberOfConfigs;}
92 Int_t GetRecEveryNTB() const { return fRecEveryNTB; }
86a261ed 93 // Tracklet parameters
94 Double_t GetCorrDZDXbiasRC(Bool_t dzdx) const { return fdzdxCorrRCbias[dzdx];}
95 Double_t GetCorrDZDX(Bool_t rc) const { return fdzdxCorrFactor[rc];}
96 Double_t GetCorrDZDXxcross() const { return fdzdxXcrossFactor;}
97 void GetYcorrTailCancel(Int_t it, Double_t par[2]) const;
98 Double_t GetS2Ycorr(Bool_t sgn) const { return fS2Ycorr[sgn];}
99
828c6f80 100 Bool_t IsArgon() const { return TESTBIT(fFlags, kDriftGas); }
101 Bool_t IsCheckTimeConsistency() const { return kCheckTimeConsistency;}
b06a50a5 102 Bool_t IsOverPtThreshold(Double_t pt) const {return Bool_t(pt>fkPtThreshold);}
828c6f80 103 Bool_t IsXenon() const { return !TESTBIT(fFlags, kDriftGas); }
a2fbb6ec 104 Bool_t IsPIDNeuralNetwork() const { return TESTBIT(fFlags, kSteerPID);}
828c6f80 105 Bool_t IsVertexConstrained() const { return TESTBIT(fFlags, kVertexConstraint); }
a2fbb6ec 106 Bool_t IsEightSlices() const { return TESTBIT(fFlags, kEightSlices);}
107 Bool_t HasImproveTracklets() const { return TESTBIT(fFlags, kImproveTracklet);}
108 Bool_t UseClusterSharing() const { return TESTBIT(fFlags, kClusterSharing);}
109 Bool_t UseLUT() const { return TESTBIT(fFlags, kLUT);}
110 Bool_t UseGAUS() const { return TESTBIT(fFlags, kGAUS);}
111 Bool_t UseTailCancelation() const { return TESTBIT(fFlags, kTailCancelation); }
3c66288b 112
4ba1d6ae 113 static AliTRDrecoParam *GetLowFluxParam();
8c499dbf 114 static AliTRDrecoParam *GetLowFluxHLTParam();
4ba1d6ae 115 static AliTRDrecoParam *GetHighFluxParam();
8c499dbf 116 static AliTRDrecoParam *GetHighFluxHLTParam();
4ba1d6ae 117 static AliTRDrecoParam *GetCosmicTestParam();
118
828c6f80 119 void SetArgon(Bool_t b = kTRUE) {if(b) SETBIT(fFlags, kDriftGas); else CLRBIT(fFlags, kDriftGas);}
120 void SetCheckTimeConsistency(Bool_t b = kTRUE) {if(b) SETBIT(fFlags, kCheckTimeConsistency); else CLRBIT(fFlags, kCheckTimeConsistency);}
121 void SetClusterSharing(Bool_t b = kTRUE) {if(b) SETBIT(fFlags, kClusterSharing); else CLRBIT(fFlags, kClusterSharing);}
122 void SetEightSlices(Bool_t b = kTRUE) {if(b) SETBIT(fFlags, kEightSlices); else CLRBIT(fFlags, kEightSlices);}
123 void SetImproveTracklets(Bool_t b = kTRUE) {if(b) SETBIT(fFlags, kImproveTracklet); else CLRBIT(fFlags, kImproveTracklet);}
8c25d014 124 void SetLUT(Bool_t b=kTRUE) {if(b) SETBIT(fFlags, kLUT); else CLRBIT(fFlags, kLUT);}
125 void SetGAUS(Bool_t b=kTRUE) {if(b) SETBIT(fFlags, kGAUS); else CLRBIT(fFlags, kGAUS);}
126 void SetPIDNeuralNetwork(Bool_t b=kTRUE) {if(b) SETBIT(fFlags, kSteerPID); else CLRBIT(fFlags, kSteerPID);}
86a261ed 127 void SetPIDmethod(AliTRDPIDResponse::ETRDPIDMethod method);
11d80e40 128 void SetPIDLQslices(Int_t s);
8c25d014 129 void SetTailCancelation(Bool_t b=kTRUE) {if(b) SETBIT(fFlags, kTailCancelation); else CLRBIT(fFlags, kTailCancelation);}
828c6f80 130 void SetXenon(Bool_t b = kTRUE) {if(b) CLRBIT(fFlags, kDriftGas); else SETBIT(fFlags, kDriftGas);}
a2fbb6ec 131 void SetVertexConstrained() {SETBIT(fFlags, kVertexConstraint);}
132 void SetMaxTheta(Double_t maxTheta) {fkMaxTheta = maxTheta;}
133 void SetMaxPhi(Double_t maxPhi) {fkMaxPhi = maxPhi;}
134 void SetFindableClusters(Double_t r) {fkFindable = r;}
135 void SetChi2Y(Double_t chi2) {fkChi2Y = chi2;}
136 void SetChi2Z(Double_t chi2) {fkChi2Z = chi2;}
137 void SetChi2YSlope(Double_t chi2YSlope) {fkChi2YSlope = chi2YSlope;}
138 void SetChi2ZSlope(Double_t chi2ZSlope) {fkChi2ZSlope = chi2ZSlope;}
39d9c03c 139 void SetChi2Cut(Double_t chi2Cut) {fChi2Cut = chi2Cut; }
a2fbb6ec 140 void SetChi2YCut(Double_t chi2Cut) {fkChi2YCut = chi2Cut; }
141 void SetPhiSlope(Double_t phiSlope) {fkPhiSlope = phiSlope;}
142 void SetNMeanClusters(Double_t meanNclusters) {fkNMeanClusters = meanNclusters;}
143 void SetNSigmaClusters(Double_t sigmaNclusters) {fkNSigmaClusters = sigmaNclusters;}
240db9c7 144 void SetRawStreamVersion(const Char_t *version) {fRawStreamVersion = version; }
145 void SetRoadzMultiplicator(Double_t mult) {fkRoadzMultiplicator = mult; }
fb872574 146 void SetMinMaxCutSigma(Float_t minMaxCutSigma) { fMinMaxCutSigma = minMaxCutSigma; }
4ba1d6ae 147 void SetMinLeftRightCutSigma(Float_t minLeftRightCutSigma) { fMinLeftRightCutSigma = minLeftRightCutSigma; };
148 void SetClusMaxThresh(Float_t thresh) { fClusMaxThresh = thresh; };
149 void SetClusSigThresh(Float_t thresh) { fClusSigThresh = thresh; };
86a261ed 150 void SetPIDThreshold(Double_t *pid);
b06a50a5 151 void SetPtThreshold(Double_t pt) {fkPtThreshold = pt;}
4ba1d6ae 152 void SetNexponential(Int_t nexp) { fTCnexp = nexp; };
86a261ed 153 void SetTCParams(Double_t *par);
154 void SetTrackletParams(Double_t *par=NULL);
155 void SetStreamLevel(ETRDReconstructionTask task, Int_t level);
156 void SetSysCovMatrix(Double_t *sys);
fb872574 157 void SetNumberOfPresamples(Int_t n) { fNumberOfPresamples = n;}
158 void SetNumberOfPostsamples(Int_t n) { fNumberOfPostsamples = n;}
b33337a6 159 void SetRecEveryTwoTB() { fRecEveryNTB = 2; fkNMeanClusters = 10; }
4ba1d6ae 160
3c66288b 161private:
8ae98148 162 // Physics reference values for TRD
163 Double_t fkdNchdy; // dNch/dy
4ba1d6ae 164 Double_t fkMaxTheta; // Maximum theta
8ae98148 165 Double_t fkMaxPhi; // Maximum phi - momentum cut
b06a50a5 166 // Tracker params
4ba1d6ae 167 Double_t fkRoad0y; // Road for middle cluster
168 Double_t fkRoad0z; // Road for middle cluster
169
170 Double_t fkRoad1y; // Road in y for seeded cluster
171 Double_t fkRoad1z; // Road in z for seeded cluster
172
173 Double_t fkRoad2y; // Road in y for extrapolated cluster
174 Double_t fkRoad2z; // Road in z for extrapolated cluster
b06a50a5 175 Double_t fkPtThreshold; // pt threshold for using TRD points for updating Kalaman track
4ba1d6ae 176 Double_t fkPlaneQualityThreshold; // Quality threshold
566bf887 177 Double_t fkRoadzMultiplicator; // Multiplicator for the Roads in z
8ae98148 178 Double_t fkFindable; // minimum ratio of clusters per tracklet supposed to be attached.
4ba1d6ae 179 Double_t fkChi2Z; // Max chi2 on the z direction for seeding clusters fit
180 Double_t fkChi2Y; // Max chi2 on the y direction for seeding clusters Rieman fit
5a2e200c 181 Double_t fkChi2YSlope; // Slope of the chi2-distribution in y-direction
182 Double_t fkChi2ZSlope; // Slope of the chi2-distribution in z-direction
39d9c03c 183 Double_t fChi2Cut; // Cut on the Chi2 track/tracklet 0 used to diecide if the kalman track should be updated
8c499dbf 184 Double_t fkChi2YCut; // Cut on the Chi2 in y-direction in the likelihood filter
5a2e200c 185 Double_t fkPhiSlope; // Slope of the distribution of the deviation between track angle and tracklet angle
8ae98148 186 Double_t fkNMeanClusters; // Mean number of clusters per tracklet
187 Double_t fkNSigmaClusters; // Sigma of the number of clusters per tracklet
188 Double_t fkNClusterNoise; // ratio of noisy clusters to the true one
189 Double_t fkNMeanTracklets; // Mean number of tracklets per track
4ba1d6ae 190 Double_t fkTrackLikelihood; // Track likelihood for tracklets Rieman fit
4ba1d6ae 191
3afdab72 192 Double_t fSysCovMatrix[5]; // Systematic uncertainty from calibration and alignment for each tracklet
4d6aee34 193 Double_t fPIDThreshold[AliTRDCalPID::kNMom]; // PID Thresholds for Electron candidate decision
8c499dbf 194 Int_t fNumberOfConfigs; // Used number of seed configurations
e4f2f73d 195
a2fbb6ec 196 // Reconstruction Options for TRD reconstruction
197 Int_t fStreamLevel[kTRDreconstructionTasks]; // Stream Level
198 Long64_t fFlags; // option Flags
9dcc64cc 199
a2fbb6ec 200 // Raw Reader Params
201 TString fRawStreamVersion; // Raw Reader version
a2fbb6ec 202
86a261ed 203 // Tracklet parameters
204 Double_t fdzdxCorrFactor[2]; // correction of dzdx estimation due to z bias; [0] for !RC, [1] for RC
205 Double_t fdzdxCorrRCbias[2]; // correction of dzdx estimation bias for RC; [0] for dz/dx>0, [1] for dz/dx<0
206 Double_t fdzdxXcrossFactor; // bias in dzdx of estimated xcross [RC]
207 Double_t fYcorrTailCancel[3][2]; // y linear q/pt correction due to wrong tail cancellation. [0] opposite sign !RC, [1] same sign !RC, [2] RC
208 Double_t fS2Ycorr[2]; // inflation factor of error parameterization in r-phi due to wrong estimation of residuals. [0] opposite sign, [1] same sign
209
a7ac01d2 210 // Clusterization parameter
4ba1d6ae 211 Double_t fMinMaxCutSigma; // Threshold sigma noise pad middle
212 Double_t fMinLeftRightCutSigma; // Threshold sigma noise sum pad
213 Double_t fClusMaxThresh; // Threshold value for cluster maximum
214 Double_t fClusSigThresh; // Threshold value for cluster signal
4ba1d6ae 215 Int_t fTCnexp; // Number of exponentials, digital filter
a2fbb6ec 216 Double_t fTCParams[8]; // Tail Cancellation parameters for drift gases
8c499dbf 217 Int_t fRecEveryNTB; // Reconstruct each nth timebin
218
4ba1d6ae 219 // ADC parameter
4e459a9d 220 Int_t fNumberOfPresamples; // number of presamples
221 Int_t fNumberOfPostsamples; // number of postsamples
9716329b 222
86a261ed 223 ClassDef(AliTRDrecoParam, 13) // Reconstruction parameters for TRD detector
e4f2f73d 224
225};
3afdab72 226
227//___________________________________________________
7e88424f 228inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys) const
3afdab72 229{
230 if(!sys) return;
231 memcpy(sys, fSysCovMatrix, 5*sizeof(Double_t));
232}
233
234//___________________________________________________
235inline void AliTRDrecoParam::SetSysCovMatrix(Double_t *sys)
236{
237 if(!sys) return;
238 memcpy(fSysCovMatrix, sys, 5*sizeof(Double_t));
239}
240
22a4ab0c 241//___________________________________________________
242inline void AliTRDrecoParam::SetPIDThreshold(Double_t *pid)
243{
244 if(!pid) return;
245 memcpy(fPIDThreshold, pid, AliTRDCalPID::kNMom*sizeof(Double_t));
246}
3c66288b 247
a2fbb6ec 248//___________________________________________________
249inline void AliTRDrecoParam::SetStreamLevel(ETRDReconstructionTask task, Int_t level){
250 if(task >= kTRDreconstructionTasks) return;
251 fStreamLevel[static_cast<Int_t>(task)] = level;
252}
253
254//___________________________________________________
255inline Int_t AliTRDrecoParam::GetStreamLevel(ETRDReconstructionTask task) const{
256 if(task >= kTRDreconstructionTasks) return 0;
257 return fStreamLevel[static_cast<Int_t>(task)];
258}
259
260//___________________________________________________
261inline void AliTRDrecoParam::GetTCParams(Double_t *par) const
262{
263 if(!par) return;
264 if(IsArgon()) memcpy(par, &fTCParams[4], 4*sizeof(Double_t));
265 else memcpy(par, &fTCParams[0], 4*sizeof(Double_t));
266}
3c66288b 267
a2fbb6ec 268//___________________________________________________
269inline void AliTRDrecoParam::SetTCParams(Double_t *par)
270{
271 if(!par) return;
272 memcpy(fTCParams, par, 8*sizeof(Double_t));
273}
11d80e40 274
86a261ed 275
276//___________________________________________________
277inline void AliTRDrecoParam::GetYcorrTailCancel(Int_t it, Double_t par[2]) const
278{
279 if(it<0||it>2) return;
280 par[0] = fYcorrTailCancel[it][0]; par[1] = fYcorrTailCancel[it][1];
281}
282
11d80e40 283//___________________________________________________
284inline Int_t AliTRDrecoParam::GetPIDLQslices() const
285{
286 if(IsPIDNeuralNetwork()) return -1;
287 return TESTBIT(fFlags, kLQ2D) ? 2 : 1;
288}
289
9dcc64cc 290//___________________________________________________
291inline AliTRDPIDResponse::ETRDPIDMethod AliTRDrecoParam::GetPIDmethod() const
292{
293 AliTRDPIDResponse::ETRDPIDMethod method = AliTRDPIDResponse::kLQ1D;
294 if(IsPIDNeuralNetwork()) method = AliTRDPIDResponse::kNN;
295 else if(TESTBIT(fFlags, kLQ2D)) method = AliTRDPIDResponse::kLQ2D;
296 return method;
297}
298
299//___________________________________________________
300inline void AliTRDrecoParam::SetPIDmethod(AliTRDPIDResponse::ETRDPIDMethod method)
301{
302 switch(method){
303 case AliTRDPIDResponse::kLQ2D:
304 CLRBIT(fFlags, kSteerPID);
305 SETBIT(fFlags, kLQ2D);
306 break;
307 case AliTRDPIDResponse::kNN:
308 SETBIT(fFlags, kSteerPID);
309 break;
310 case AliTRDPIDResponse::kLQ1D:
311 default:
312 CLRBIT(fFlags, kSteerPID);
313 CLRBIT(fFlags, kLQ2D);
314 break;
315 }
316}
317
e4f2f73d 318#endif