]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCommonParam.h
Bug fix in the constructor (thanks to A.Marin)
[u/mrichter/AliRoot.git] / TRD / AliTRDCommonParam.h
1 #ifndef ALITRDCOMMONPARAM_H
2 #define ALITRDCOMMONPARAM_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 ///////////////////////////////////////////////////////////////////////////////
7 //                                                                           //
8 // Class containing constant common parameters                               //
9 //                                                                           //
10 ///////////////////////////////////////////////////////////////////////////////
11
12 /* $Id$ */
13
14 #include "TObject.h"
15
16 #include "AliTRDSimParam.h"
17
18 class TRootIoCtor;
19
20 class AliTRDpadPlane;
21
22 class AliTRDCommonParam : public TObject
23 {
24
25   public:
26   
27     enum { kNlayer  = 6
28          , kNstack  = 5
29          , kNsector = 18
30          , kNdet    = 540 };
31
32     enum { kXenon =   0
33          , kArgon =   1   };
34     
35     AliTRDCommonParam(TRootIoCtor *);
36     AliTRDCommonParam(const AliTRDCommonParam &p);   
37     AliTRDCommonParam &operator=(const AliTRDCommonParam &p); 
38     virtual        ~AliTRDCommonParam();
39
40     static AliTRDCommonParam *Instance();
41     static  void    Terminate();
42
43     virtual void    Copy(TObject &p) const;
44     
45     void            SetExB(Int_t exbOn = 1)                        { fExBOn             = exbOn;    }
46     void            SetSamplingFrequency(Float_t freq)             { fSamplingFrequency = freq;     }
47     void            SetXenon()                                     { fGasMixture        = kXenon; 
48                                                                      AliTRDSimParam::Instance()->ReInit(); }
49     void            SetArgon()                                     { fGasMixture        = kArgon; 
50                                                                      AliTRDSimParam::Instance()->ReInit(); }
51
52     Bool_t          ExBOn() const                                  { return fExBOn;                 }
53     Bool_t          IsXenon() const                                { return (fGasMixture == kXenon) 
54                                                                      ? kTRUE : kFALSE;              }
55     Bool_t          IsArgon() const                                { return (fGasMixture == kArgon) 
56                                                                      ? kTRUE : kFALSE;              }
57
58     Int_t           GetGasMixture() const                          { return fGasMixture;            }
59     Float_t         GetSamplingFrequency() const                   { return fSamplingFrequency;     }
60
61     Float_t         GetOmegaTau(Float_t vdrift);
62     Bool_t          GetDiffCoeff(Float_t &dl, Float_t &dt, Float_t vdrift);
63
64     Double_t        TimeStruct(Float_t vdrift, Double_t xd, Double_t z);
65
66   protected:
67
68     void            SampleTimeStruct(Float_t vdrift);
69
70     static AliTRDCommonParam *fgInstance;          //  Instance of this class (singleton implementation)
71     static Bool_t             fgTerminated;        //  Defines if this class has already been terminated    
72
73     Int_t                     fExBOn;              //  Switch for the ExB effects
74
75     Float_t                   fDiffusionT;         //  Transverse drift coefficient
76     Float_t                   fDiffusionL;         //  Longitudinal drift coefficient
77     Float_t                   fDiffLastVdrift;     //  The structures are valid for fLastVdrift (caching)
78
79     Float_t                  *fTimeStruct1;        //! Time Structure of Drift Cells
80     Float_t                  *fTimeStruct2;        //! Time Structure of Drift Cells
81     Float_t                   fVDlo;               //  Lower drift velocity, for interpolation
82     Float_t                   fVDhi;               //  Higher drift velocity, for interpolation
83     Float_t                   fTimeLastVdrift;     //  The structures are valid for fLastVdrift (caching)
84
85     Float_t                   fSamplingFrequency;  //  Sampling Frequency in MHz
86
87     Int_t                     fGasMixture;         //  Gas mixture: 0-Xe/C02 1-Ar/CO2. 
88   
89   private:
90
91     // This is a singleton, constructor is private!  
92     AliTRDCommonParam();
93   
94     ClassDef(AliTRDCommonParam,7)                  // The constant parameters common to simulation and reconstruction
95
96 };
97 #endif