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