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