changes from fzhou
[u/mrichter/AliRoot.git] / TRD / AliTRDCommonParam.h
CommitLineData
4a238045 1#ifndef ALITRDCOMMONPARAM_H
2#define ALITRDCOMMONPARAM_H
3551db50 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6///////////////////////////////////////////////////////////////////////////////
7// //
2745a409 8// Class containing constant common parameters //
3551db50 9// //
10///////////////////////////////////////////////////////////////////////////////
11
12/* $Id$ */
13
14#include "TObject.h"
15
a076fc2f 16#include "AliTRDSimParam.h"
17
ba84a3e3 18class TRootIoCtor;
19
3551db50 20class AliTRDpadPlane;
21
22class AliTRDCommonParam : public TObject
23{
2745a409 24
3551db50 25 public:
3551db50 26
a076fc2f 27 enum { kNlayer = 6
28 , kNstack = 5
29 , kNsector = 18
30 , kNdet = 540 };
31
32 enum { kXenon = 0
33 , kArgon = 1 };
3551db50 34
ba84a3e3 35 AliTRDCommonParam(TRootIoCtor *);
3551db50 36 AliTRDCommonParam(const AliTRDCommonParam &p);
37 AliTRDCommonParam &operator=(const AliTRDCommonParam &p);
671a9fcf 38 virtual ~AliTRDCommonParam();
39
2745a409 40 static AliTRDCommonParam *Instance();
671a9fcf 41 static void Terminate();
42
2745a409 43 virtual void Copy(TObject &p) const;
3551db50 44
a076fc2f 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; }
5f6f5c22 57
a076fc2f 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);
b43a3e17 65
3551db50 66 protected:
2745a409 67
a076fc2f 68 void SampleTimeStruct(Float_t vdrift);
b43a3e17 69
5f6f5c22 70 static AliTRDCommonParam *fgInstance; // Instance of this class (singleton implementation)
71 static Bool_t fgTerminated; // Defines if this class has already been terminated
a076fc2f 72
5f6f5c22 73 Int_t fExBOn; // Switch for the ExB effects
a076fc2f 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
5f6f5c22 85 Float_t fSamplingFrequency; // Sampling Frequency in MHz
a076fc2f 86
87 Int_t fGasMixture; // Gas mixture: 0-Xe/C02 1-Ar/CO2.
3551db50 88
3551db50 89 private:
2745a409 90
91 // This is a singleton, constructor is private!
3551db50 92 AliTRDCommonParam();
3551db50 93
a076fc2f 94 ClassDef(AliTRDCommonParam,7) // The constant parameters common to simulation and reconstruction
f162af62 95
3551db50 96};
3551db50 97#endif