]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDrecoParam.h
new setter for RoadzMultiplicator
[u/mrichter/AliRoot.git] / TRD / AliTRDrecoParam.h
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 #ifndef ALITRDCALPID_H
18 #include "Cal/AliTRDCalPID.h"
19 #endif
20
21 class TString;
22
23 class AliTRDrecoParam : public AliDetectorRecoParam
24 {
25 public:
26   enum ETRDReconstructionTask{
27     kClusterizer = 0,
28     kTracker = 1,
29     kPID = 2,
30     kTRDreconstructionTasks = 3
31   };
32   enum ETRDflags {
33     kDriftGas,
34     kVertexConstraint,
35     kTailCancelation,
36     kImproveTracklet, 
37     kLUT, 
38     kGAUS,
39     kClusterSharing,
40     kSteerPID,
41     kEightSlices,
42     kCheckTimeConsistency
43   };
44   AliTRDrecoParam();
45   AliTRDrecoParam(const AliTRDrecoParam &rec);
46   ~AliTRDrecoParam() { }
47
48   Double_t GetChi2Y() const                 { return fkChi2Y;    }
49   Double_t GetChi2Z() const                 { return fkChi2Z;    }
50   Double_t GetChi2YSlope() const            { return fkChi2YSlope; }
51   Double_t GetChi2ZSlope() const            { return fkChi2ZSlope; }
52         Double_t GetChi2YCut() const              { return fkChi2YCut; }
53   Double_t GetPhiSlope() const              { return fkPhiSlope;   }
54   Float_t  GetNClusters() const;
55   Double_t GetNMeanClusters() const         { return fkNMeanClusters; }
56   Double_t GetNSigmaClusters() const        { return fkNSigmaClusters; }
57   Double_t GetFindableClusters() const      { return fkFindable; }
58   Double_t GetMaxTheta() const              { return fkMaxTheta; }
59   Double_t GetMaxPhi() const                { return fkMaxPhi;   }
60   Double_t GetPlaneQualityThreshold() const { return fkPlaneQualityThreshold; }
61   Double_t GetPIDThreshold(Float_t /*p*/) const { return 0.;}
62   Double_t GetRoad0y() const                { return fkRoad0y;   }
63   Double_t GetRoad0z() const                { return fkRoad0z;   }
64   Double_t GetRoad1y() const                { return fkRoad1y;   }
65   Double_t GetRoad1z() const                { return fkRoad1z;   }
66   Double_t GetRoad2y() const                { return fkRoad2y;   }
67   Double_t GetRoad2z() const                { return fkRoad2z;   }
68   Double_t GetRoadzMultiplicator() const    { return fkRoadzMultiplicator; }
69   Double_t GetTrackLikelihood() const       { return fkTrackLikelihood;       }
70   inline void GetSysCovMatrix(Double_t *sys) const;  
71   inline void GetTCParams(Double_t *par) const;
72   inline Int_t GetStreamLevel(ETRDReconstructionTask task) const;
73   const TString *GetRawStreamVersion() const{ return &fRawStreamVersion; };
74   Int_t    GetADCBaseline() const           { return fADCBaseline; }
75   Double_t GetMinMaxCutSigma() const        { return fMinMaxCutSigma;     };
76   Double_t GetMinLeftRightCutSigma() const  { return fMinLeftRightCutSigma;  };
77   Double_t GetClusMaxThresh() const         { return fClusMaxThresh;   };
78   Double_t GetClusSigThresh() const         { return fClusSigThresh;   };
79   Int_t    GetTCnexp() const                { return fTCnexp;          };
80   Int_t    GetNumberOfPresamples()  const   { return fNumberOfPresamples;}
81   Int_t    GetNumberOfPostsamples() const   { return fNumberOfPostsamples;}
82   Bool_t   IsArgon() const                  { return TESTBIT(fFlags, kDriftGas); }
83   Bool_t   IsCheckTimeConsistency() const   { return kCheckTimeConsistency;}
84   Bool_t   IsXenon() const                  { return !TESTBIT(fFlags, kDriftGas); }
85   Bool_t   IsPIDNeuralNetwork() const       { return TESTBIT(fFlags, kSteerPID);}
86   Bool_t   IsVertexConstrained() const      { return TESTBIT(fFlags, kVertexConstraint); }
87   Bool_t   IsEightSlices() const            { return TESTBIT(fFlags, kEightSlices);}
88   Bool_t   HasImproveTracklets() const      { return TESTBIT(fFlags, kImproveTracklet);}
89   Bool_t   UseClusterSharing() const        { return TESTBIT(fFlags, kClusterSharing);}
90   Bool_t   UseLUT() const                   { return TESTBIT(fFlags, kLUT);}
91   Bool_t   UseGAUS() const                  { return TESTBIT(fFlags, kGAUS);}
92   Bool_t   UseTailCancelation() const       { return TESTBIT(fFlags, kTailCancelation); }
93         
94   static   AliTRDrecoParam *GetLowFluxParam();
95   static   AliTRDrecoParam *GetHighFluxParam();
96   static   AliTRDrecoParam *GetCosmicTestParam();
97
98   void     SetArgon(Bool_t b = kTRUE)                         {if(b) SETBIT(fFlags, kDriftGas); else CLRBIT(fFlags, kDriftGas);}
99   void     SetCheckTimeConsistency(Bool_t b = kTRUE)          {if(b) SETBIT(fFlags, kCheckTimeConsistency); else CLRBIT(fFlags, kCheckTimeConsistency);}
100   void     SetClusterSharing(Bool_t b = kTRUE)                {if(b) SETBIT(fFlags, kClusterSharing); else CLRBIT(fFlags, kClusterSharing);}
101   void     SetEightSlices(Bool_t b = kTRUE)                   {if(b) SETBIT(fFlags, kEightSlices); else CLRBIT(fFlags, kEightSlices);}
102   void     SetImproveTracklets(Bool_t b = kTRUE)              {if(b) SETBIT(fFlags, kImproveTracklet); else CLRBIT(fFlags, kImproveTracklet);}
103   void     SetLUT(Bool_t b=kTRUE)                             {if(b) SETBIT(fFlags, kLUT); else CLRBIT(fFlags, kLUT);}
104   void     SetGAUS(Bool_t b=kTRUE)                            {if(b) SETBIT(fFlags, kGAUS); else CLRBIT(fFlags, kGAUS);}
105   void     SetPIDNeuralNetwork(Bool_t b=kTRUE)                {if(b) SETBIT(fFlags, kSteerPID); else CLRBIT(fFlags, kSteerPID);}
106   void     SetTailCancelation(Bool_t b=kTRUE)                 {if(b) SETBIT(fFlags, kTailCancelation); else CLRBIT(fFlags, kTailCancelation);}
107   void     SetXenon(Bool_t b = kTRUE)                         {if(b) CLRBIT(fFlags, kDriftGas); else SETBIT(fFlags, kDriftGas);}
108   void     SetVertexConstrained()                             {SETBIT(fFlags, kVertexConstraint);}
109   void     SetMaxTheta(Double_t maxTheta)                     {fkMaxTheta = maxTheta;}
110   void     SetMaxPhi(Double_t maxPhi)                         {fkMaxPhi = maxPhi;}
111   void     SetFindableClusters(Double_t r)                    {fkFindable = r;}
112   void     SetChi2Y(Double_t chi2)                            {fkChi2Y = chi2;}
113   void     SetChi2Z(Double_t chi2)                            {fkChi2Z = chi2;}
114   void     SetChi2YSlope(Double_t chi2YSlope)                 {fkChi2YSlope = chi2YSlope;}
115   void     SetChi2ZSlope(Double_t chi2ZSlope)                 {fkChi2ZSlope = chi2ZSlope;}
116         void       SetChi2YCut(Double_t chi2Cut)                      {fkChi2YCut = chi2Cut; }
117   void     SetPhiSlope(Double_t phiSlope)                     {fkPhiSlope = phiSlope;}
118   void     SetNMeanClusters(Double_t meanNclusters)           {fkNMeanClusters = meanNclusters;}
119   void     SetNSigmaClusters(Double_t sigmaNclusters)         {fkNSigmaClusters = sigmaNclusters;} 
120   void     SetRawStreamVersion(const Char_t *version)         {fRawStreamVersion = version; }
121   void     SetRoadzMultiplicator(Double_t mult)               {fkRoadzMultiplicator = mult; } 
122   void     SetADCBaseline(Int_t baseline)                     { fADCBaseline = baseline; }
123   void     SetMinMaxCutSigma(Float_t minMaxCutSigma)          { fMinMaxCutSigma   = minMaxCutSigma; }
124   void     SetMinLeftRightCutSigma(Float_t minLeftRightCutSigma) { fMinLeftRightCutSigma   = minLeftRightCutSigma; };
125   void     SetClusMaxThresh(Float_t thresh)                   { fClusMaxThresh   = thresh; };
126   void     SetClusSigThresh(Float_t thresh)                   { fClusSigThresh   = thresh; };
127   inline void SetPIDThreshold(Double_t *pid);
128   void     SetNexponential(Int_t nexp)                        { fTCnexp          = nexp;   };
129   inline void SetTCParams(Double_t *par);
130   inline void SetStreamLevel(ETRDReconstructionTask task, Int_t level);
131   inline void SetSysCovMatrix(Double_t *sys);
132   void     SetNumberOfPresamples(Int_t n)                     { fNumberOfPresamples = n;}
133   void     SetNumberOfPostsamples(Int_t n)                    { fNumberOfPostsamples = n;}
134
135 private:
136   // Physics reference values for TRD
137   Double_t  fkdNchdy;                // dNch/dy
138   Double_t  fkMaxTheta;              // Maximum theta
139   Double_t  fkMaxPhi;                // Maximum phi - momentum cut
140
141   Double_t  fkRoad0y;                // Road for middle cluster
142   Double_t  fkRoad0z;                // Road for middle cluster
143
144   Double_t  fkRoad1y;                // Road in y for seeded cluster
145   Double_t  fkRoad1z;                // Road in z for seeded cluster
146
147   Double_t  fkRoad2y;                // Road in y for extrapolated cluster
148   Double_t  fkRoad2z;                // Road in z for extrapolated cluster
149   
150   Double_t  fkPlaneQualityThreshold; // Quality threshold
151   Double_t  fkRoadzMultiplicator;    // Multiplicator for the Roads in z 
152   Double_t  fkFindable;              // minimum ratio of clusters per tracklet supposed to be attached.
153   Double_t  fkChi2Z;                 // Max chi2 on the z direction for seeding clusters fit
154   Double_t  fkChi2Y;                 // Max chi2 on the y direction for seeding clusters Rieman fit
155   Double_t  fkChi2YSlope;            // Slope of the chi2-distribution in y-direction
156   Double_t  fkChi2ZSlope;            // Slope of the chi2-distribution in z-direction
157         Double_t  fkChi2YCut;                                                    // Cut on the Chi2 in y-direction in the likelihood filter
158   Double_t  fkPhiSlope;              // Slope of the distribution of the deviation between track angle and tracklet angle
159   Double_t  fkNMeanClusters;         // Mean number of clusters per tracklet
160   Double_t  fkNSigmaClusters;        // Sigma of the number of clusters per tracklet
161   Double_t  fkNClusterNoise;         // ratio of noisy clusters to the true one
162   Double_t  fkNMeanTracklets;        // Mean number of tracklets per track
163   Double_t  fkTrackLikelihood;       // Track likelihood for tracklets Rieman fit
164   
165   Double_t  fSysCovMatrix[5];        // Systematic uncertainty from calibration and alignment for each tracklet
166   Double_t  fPIDThreshold[AliTRDCalPID::kNMom];   // PID Thresholds for Electron candidate decision
167
168   // Reconstruction Options for TRD reconstruction
169   Int_t     fStreamLevel[kTRDreconstructionTasks]; // Stream Level
170   Long64_t  fFlags;                  // option Flags
171   
172   // Raw Reader Params
173   TString   fRawStreamVersion;       // Raw Reader version
174   Int_t     fADCBaseline;            // ADC Baseline
175
176   // Clusterization parameter
177   Double_t  fMinMaxCutSigma;         // Threshold sigma noise pad middle
178   Double_t  fMinLeftRightCutSigma;   // Threshold sigma noise sum pad
179   Double_t  fClusMaxThresh;          // Threshold value for cluster maximum
180   Double_t  fClusSigThresh;          // Threshold value for cluster signal
181   Int_t     fTCnexp;                 // Number of exponentials, digital filter
182   Double_t  fTCParams[8];            // Tail Cancellation parameters for drift gases 
183   
184   // ADC parameter
185   Int_t     fNumberOfPresamples;     // number of presamples 
186   Int_t     fNumberOfPostsamples;     // number of postsamples 
187
188   ClassDef(AliTRDrecoParam, 10)       // Reconstruction parameters for TRD detector
189
190 };
191
192 //___________________________________________________
193 inline void AliTRDrecoParam::GetSysCovMatrix(Double_t *sys) const
194 {
195   if(!sys) return;
196   memcpy(sys, fSysCovMatrix, 5*sizeof(Double_t));
197 }
198
199 //___________________________________________________
200 inline void AliTRDrecoParam::SetSysCovMatrix(Double_t *sys)
201 {
202   if(!sys) return;
203   memcpy(fSysCovMatrix, sys, 5*sizeof(Double_t));
204 }
205
206 //___________________________________________________
207 inline void AliTRDrecoParam::SetPIDThreshold(Double_t *pid)
208 {
209   if(!pid) return;
210   memcpy(fPIDThreshold, pid, AliTRDCalPID::kNMom*sizeof(Double_t));
211 }
212
213 //___________________________________________________
214 inline void AliTRDrecoParam::SetStreamLevel(ETRDReconstructionTask task, Int_t level){
215   if(task >= kTRDreconstructionTasks) return;
216   fStreamLevel[static_cast<Int_t>(task)] = level;
217 }
218
219 //___________________________________________________
220 inline Int_t AliTRDrecoParam::GetStreamLevel(ETRDReconstructionTask task) const{
221   if(task >= kTRDreconstructionTasks) return 0;
222   return fStreamLevel[static_cast<Int_t>(task)];
223 }
224
225 //___________________________________________________
226 inline void AliTRDrecoParam::GetTCParams(Double_t *par) const
227 {
228   if(!par) return;
229   if(IsArgon()) memcpy(par, &fTCParams[4], 4*sizeof(Double_t));
230   else memcpy(par, &fTCParams[0], 4*sizeof(Double_t));
231 }
232
233 //___________________________________________________
234 inline void AliTRDrecoParam::SetTCParams(Double_t *par)
235 {
236   if(!par) return;
237   memcpy(fTCParams, par, 8*sizeof(Double_t));
238 }
239 #endif