]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/CALO/AliHLTCaloConstants.h
Refactoring of handling of constants.
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloConstants.h
1 //-*- Mode: C++ -*-
2 // $Id: AliHLTCALOConstants.h $
3
4 //* This file is property of and copyright by the ALICE HLT Project        * 
5 //* ALICE Experiment at CERN, All rights reserved.                         *
6 //* See cxx source for full Copyright notice                               */
7
8 /// @file   AliHLCaloConstants.h
9 /// @author Svein Lindal
10 /// @date   
11 /// @brief  Class containing constants for PHOS and EMCAL
12 ///         loaded libraries
13
14
15 #include "Rtypes.h"
16 #include "TString.h"
17 #ifndef ALIHLTCALOCONSTANTS_H
18 #define ALIHLTCALOCONSTANTS_H
19
20
21 namespace CaloHLTConst
22 {
23   //Constants related to the ALTRO chip (Common to EMCAL / PHOS )
24   const int MAXBINVALUE = 1023;
25   const int NGAINS         =   2;    
26   const int HIGHGAIN    =   0;
27   const int LOWGAIN     =   1;
28   const int ALTROMAXSAMPLES = 1008;    /**<The maximum number of samples of the ALTRO*/
29   const int ALTROMAXPRESAMPLES = 15;        
30   const int NALTROS        =   4;      /**<Number of ALTROs per frontend card*/
31   const int NALTROCHANNELS =  16;
32
33   //FEE constants common to PHOS EMCAL
34   const int CSPSPERFEE    = 32;
35   const int NBRANCHES      =   2;   
36   
37   namespace EmcalHLTConst
38   {
39     const int NZROWSMOD      =  48;   /**<Number of rows per module*/       
40     const int NXCOLUMNSMOD   =  24;   /**<Number of columns per module*/ 
41     const int NRCUSPERSECTOR = 4;
42     const int NMODULES    =    10;    /**<Number of modules of the EMCAL detector*/
43     const int NRCUSPERMODULE =  2 ;   /**<Number of RCUs per Module*/
44     const int NFEECS         =  9; 
45   };
46
47   namespace PhosHLTConst
48   {
49     const int NZROWSMOD      =  56;   /**<Number of rows per module*/       
50     const int NXCOLUMNSMOD   =  64;   /**<Number of columns per module*/ 
51     const int NMODULES    =    5;     /**<Number of modules of the EMCAL detector*/
52     const int NRCUSPERMODULE =  4 ;   /**<Number of RCUs per Module*/
53     const int NFEECS         =  14;   /**<Number of Frontend cards per branch*/
54   };
55 };
56
57
58 namespace CALO  =  CaloHLTConst; // just for easier notation
59 namespace EMCAL =  CaloHLTConst::EmcalHLTConst;
60 namespace PHOS  =  CaloHLTConst::PhosHLTConst;
61
62
63 class AliHLTCaloConstants
64 {
65 public:
66   AliHLTCaloConstants();
67   virtual ~AliHLTCaloConstants();
68   virtual void InitConstants() = 0; 
69
70   // Common PHOS / EMCAL stuff
71   static  Int_t GetALTROMAXSAMPLES()    { return CALO::ALTROMAXSAMPLES; }; 
72   static  Int_t GetNGAINS()             { return CALO::NGAINS; };       
73   static  Int_t GetHIGHGAIN()           { return CALO::HIGHGAIN; };
74   static  Int_t GetLOWGAIN()          { return CALO::LOWGAIN; }; 
75   static  Int_t GetMAXBINVALUE()      { return CALO::MAXBINVALUE; };    
76   static  Int_t GetCSPSPERFEE()       { return CALO::CSPSPERFEE; };                                     
77   static  Int_t GetNALTROS()           { return CALO::NALTROS; };                                       
78   static  Int_t GetNALTROCHANNELS()    { return CALO::NALTROCHANNELS; };                                        
79   static  Int_t GetNBRANCHES()         { return CALO::NBRANCHES; };     
80
81   // Detector specific stuff
82
83  
84   //  virtual Int_t GetNZROWSRCU() const      = 0; 
85   // virtual Int_t GetNXCOLUMNSRCU() const   = 0;
86   
87   // PHOS Only, bad move somewher else, PTH
88   virtual Int_t GetNZROWSRCU() const  { return   56 ; } ; 
89   virtual Int_t GetNXCOLUMNSRCU() const { return 16; } ;
90   // END PHOS Only
91
92   virtual Int_t GetNZROWSMOD() const      = 0; 
93   virtual Int_t GetNXCOLUMNSMOD() const   = 0; 
94   virtual Int_t GetNMODULES() const       = 0; 
95   //  virtual Int_t GetNRCUS() const          = 0;
96   virtual Int_t GetNRCUSPERMODULE() const = 0;
97   //  virtual Int_t GetNRCUSPERTOTAL() const  = 0;
98   virtual Int_t GetNFEECS() const         = 0;
99   
100   Int_t GetDDLOFFSET() const { return fkDDLOFFSET; }
101   Float_t GetCELLSTEP() const { return fkCELLSTEP; }
102   
103   //EMCAL specific, !! Move somewhere else, PTH
104   Float_t GetMAXCELLSTEPETA() const { return fkMAXCELLSTEPETA; }  //FR
105   Float_t GetMINCELLSTEPETA() const { return fkMINCELLSTEPETA; }  //FR
106   Float_t GetCELLSTEPPHI() const { return fkCELLSTEPPHI; }        //FR
107   Float_t GetCELLHEIGHT() const { return fkCELLHEIGHT; }        //FR
108   Float_t GetCELLANGLE() const { return fkCELLANGLE; }        //FR
109   Float_t GetRADLENGTH() const { return fkRADLENGTH; }        //FR
110   Float_t GetCRITICENERGY() const { return fkCRITICENERGY; }        //FR
111   Float_t GetCJ() const { return fkCJ;} //FR
112   TString GetDETNAME() { return fkDETNAME; };
113
114 protected:
115   TString fkDETNAME;
116   Float_t fkCELLSTEP; //Constant
117   Int_t fkDDLOFFSET;   //Constant
118   
119   //EMCAL specific, !! Move somewhere else, PTH
120   // @todo: These variables should be declared constant, doesnt work right now
121   // because the default copy contructor is called somewhere.
122   Float_t fkMAXCELLSTEPETA;
123   Float_t fkMINCELLSTEPETA;
124   Float_t fkCELLSTEPPHI;
125   Float_t fkCELLHEIGHT;
126   Float_t fkCELLANGLE;
127   Float_t fkRADLENGTH;
128   Float_t fkCRITICENERGY;
129   Float_t fkCJ;
130   
131 private:
132   
133   ClassDef(AliHLTCaloConstants, 1)
134 };
135
136
137
138 #endif