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