]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDCommonParam.h
First round of effc++ changes
[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 class AliTRDpadPlane;
17
18 class AliTRDCommonParam : public TObject
19 {
20
21   public:
22   
23     enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
24     
25     AliTRDCommonParam(const AliTRDCommonParam &p);   
26     AliTRDCommonParam &operator=(const AliTRDCommonParam &p); 
27     static AliTRDCommonParam *Instance();
28     static void     Terminate();
29     virtual void    Copy(TObject &p) const;
30     
31     void            SetField(Float_t field)                        { fField = field; };
32     void            SetExB(Int_t exbOn = 1)                        { fExBOn = exbOn; };
33     
34     Float_t         GetField()                               const { return fField;  };
35     Bool_t          ExBOn()                                  const { return fExBOn;  };
36     
37     AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const;
38     Int_t           GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
39     Int_t           GetColMax(Int_t p) const;
40     Double_t        GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
41     Double_t        GetCol0(Int_t p) const;
42   
43   protected:
44
45     static AliTRDCommonParam *fgInstance;     //  Instance of this class (singleton implementation)
46     static Bool_t             fgTerminated;   //  Defines if this class has already been terminated
47     
48     void Init();
49     
50     Float_t                   fField;         //  Magnetic field
51     Int_t                     fExBOn;         //  Switch for the ExB effects
52   
53     TObjArray                *fPadPlaneArray; //! Array of pad plane objects
54   
55   private:
56
57     // This is a singleton, constructor is private!  
58     AliTRDCommonParam();
59     virtual ~AliTRDCommonParam();
60   
61     ClassDef(AliTRDCommonParam,1)             // The constant parameters common to simulation and reconstruction       
62
63 };
64
65 #endif