]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/CALO/AliHLTCaloConstants.h
NULL pointer protections
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloConstants.h
index f803591507d7d4f241ffa4525d16c4b943937831..14c374831f4c554031ebf0c250b72c595b9a35fa 100644 (file)
 /// @brief  Class containing constants for PHOS and EMCAL
 ///         loaded libraries
 
-#include "Rtypes.h"
 
+#include "Rtypes.h"
+#include "TString.h"
 #ifndef ALIHLTCALOCONSTANTS_H
 #define ALIHLTCALOCONSTANTS_H
 
-class TString;
+#include "AliCaloConstants.h"
+
+
+// namespace CaloHLTConst
+// {
+//   const int MAXHOSTS=20;
+//   //Constants related to the ALTRO chip (Common to EMCAL / PHOS )
+//   const int MAXBINVALUE = 1023;
+//   const int NGAINS         =   2;    
+//   const int HIGHGAIN    =   1;
+//   const int LOWGAIN     =   0;
+//   const int ALTROMAXSAMPLES = 1008;    /**<The maximum number of samples of the ALTRO*/
+//   const int ALTROMAXPRESAMPLES = 15;        
+//   const int NALTROS        =   4;      /**<Number of ALTROs per frontend card*/
+//   const int NALTROCHANNELS =  16;
+
+//   //FEE constants common to PHOS EMCAL
+//   const int CSPSPERFEE    = 32;
+//   const int NBRANCHES      =   2;   
+//   const int MAXHWADDRESSES = 4096;
+  
+//   namespace EmcalHLTConst
+//   {
+//     const int NZROWSMOD      =  48;   /**<Number of rows per module*/       
+//     const int NXCOLUMNSMOD   =  24;   /**<Number of columns per module*/ 
+//     const int NRCUSPERSECTOR = 4;     /**<Number of RCUs per sector*/
+//     const int NMODULES    =    10;    /**<Number of modules of the EMCAL detector*/
+//     const int NRCUSPERMODULE =  2 ;   /**<Number of RCUs per Module*/
+//     const int NFEECS         =  9;    /**<Number of Frontend cards per branch*/
+//   };
+  
+//   namespace PhosHLTConst
+//   {
+//     const int NZROWSMOD      =  56;   /**<Number of rows per module*/       
+//     const int NXCOLUMNSMOD   =  64;   /**<Number of columns per module*/ 
+//     const int NMODULES    =    5;     /**<Number of modules of the PHOS detector*/
+//     const int NRCUSPERMODULE =  4 ;   /**<Number of RCUs per Module*/
+//     const int NFEECS         =  14;   /**<Number of Frontend cards per branch*/
+//   };
+  
+// };
+
+
+// namespace CALO  =  CaloHLTConst; // just for easier notation
+// namespace EMCAL =  CaloHLTConst::EmcalHLTConst;
+// namespace PHOS  =  CaloHLTConst::PhosHLTConst;
+
+
+
 
 class AliHLTCaloConstants
 {
 public:
-  
-  AliHLTCaloConstants(TString det);
+  AliHLTCaloConstants();
   virtual ~AliHLTCaloConstants();
+  virtual void InitConstants() = 0; 
+
+  // Common PHOS / EMCAL stuff
+  static  Int_t GetALTROMAXSAMPLES()    { return ALTRO::ALTROMAXSAMPLES; };
+  static  Int_t GetNGAINS()             { return ALTRO::NGAINS; };
+  static  Int_t GetHIGHGAIN()           { return ALTRO::HIGHGAIN; };
+  static  Int_t GetLOWGAIN()          { return ALTRO::LOWGAIN; };
+  static  Int_t GetMAXBINVALUE()      { return ALTRO::MAXBINVALUE; };
+  static  Int_t GetCSPSPERFEE()       { return CALO::CSPSPERFEE; };
+  static  Int_t GetNALTROS()           { return ALTRO::NALTROS; };
+  static  Int_t GetNALTROCHANNELS()    { return ALTRO::NALTROCHANNELS; };
+  static  Int_t GetNBRANCHES()         { return CALO::NBRANCHES; };    
+  static Int_t GetMAXHWADDRESSES() { return CALO::MAXHWADDRESSES; }
+
+  // Detector specific stuff
+  // PHOS Only, bad move somewher else, PTH
+  virtual Int_t GetNZROWSRCU() const  { return   56 ; } ; 
+  virtual Int_t GetNXCOLUMNSRCU() const { return 16; } ;
+  // END PHOS Only
+
+  virtual Int_t GetNZROWSMOD() const      = 0; 
+  virtual Int_t GetNXCOLUMNSMOD() const   = 0; 
+  virtual Int_t GetNMODULES() const       = 0; 
+  virtual Int_t GetNRCUSPERMODULE() const = 0;
+  virtual Int_t GetNFEECS() const         = 0;
   
-  Int_t GetMAXHOSTS() const {return fkMAXHOSTS; } 
-  Int_t GetDEFAULTEVENTPORT() const { return fkDEFAULTEVENTPORT; }  
-  Int_t GetMAXBINVALUE() const { return fkMAXBINVALUE; }                
-  Int_t GetHIGHGAIN() const { return fkHIGHGAIN; }              
-  Int_t GetLOWGAIN() const { return fkLOWGAIN; }                
-  Int_t GetALTROMAXSAMPLES() const { return fkALTROMAXSAMPLES; }        
-  Int_t GetALTROMAXPRESAMPLES() const { return fkALTROMAXPRESAMPLES; }   
-  Int_t GetNZROWSRCU() const { return fkNZROWSRCU; }            
-  Int_t GetNXCOLUMNSRCU() const { return fkNXCOLUMNSRCU; }      
-  Int_t GetNZROWSMOD() const { return fkNZROWSMOD; }            
-  Int_t GetNXCOLUMNSMOD() const { return fkNXCOLUMNSMOD; }      
-  Int_t GetNGAINS() const{ return fkNGAINS; }           
-  Int_t GetNDATATYPES() const { return fkNDATATYPES; }          
-  Int_t GetPFMAXPATHLENGTH() const { return fkPFMAXPATHLENGTH; }        
-  Int_t GetPFDEFAULTNSAMPLES() const { return fkPFDEFAULTNSAMPLES; } 
-  Int_t GetPFDEFAULTSTARTINDEX() const { return fkPFDEFAULTSTARTINDEX; }  
-  Double_t GetDEFAULTTAU() const { return fkDEFAULTTAU; }               
-  Int_t GetDEFAULTFS() const { return fkDEFAULTFS; }            
-  Int_t GetMODULE0() const { return fkMODULE0; }                
-  Int_t GetMODULE1() const { return fkMODULE1; }                
-  Int_t GetMODULE2() const { return fkMODULE2; }        
-  Int_t GetMODULE3() const { return fkMODULE3; }                
-  Int_t GetMODULE4() const { return fkMODULE4; }                
-  Int_t GetCSPSPERFEE() const { return fkCSPSPERFEE; }          
-  Int_t GetRCU0() const { return fkRCU0; }              
-  Int_t GetRCU1() const { return fkRCU1; }              
-  Int_t GetRCU2() const { return fkRCU2; }              
-  Int_t GetRCU3() const { return fkRCU3; }              
-  Int_t GetZ0() const { return fkZ0; }                  
-  Int_t GetZ1() const { return fkZ1; }                  
-  Int_t GetX0() const { return fkX0; }                  
-  Int_t GetX1() const { return fkX1; }                  
-  Int_t GetNMODULES() const { return fkNMODULES; }              
-  Int_t GetNRCUS() const { return fkNRCUS; }            
-  Int_t GetNRCUSPERMODULE() const { return fkNRCUSPERMODULE; }  
-  Int_t GetNRCUSPERTOTAL() const { return fkNRCUSPERTOTAL; }    
-  Int_t GetNFEECS() const { return fkNFEECS; }          
-  Int_t GetNALTROS() const { return fkNALTROS; }                
-  Int_t GetNALTROCHANNELS() const { return fkNALTROCHANNELS; }  
-  Int_t GetNBRANCHES() const { return fkNBRANCHES; }           
-  Float_t GetCELLSTEP() const {return fkCELLSTEP; }
-  Int_t GetNRCUSPERSECTOR() const {return fkNRCUSPERSECTOR; }
+  Int_t GetDDLOFFSET() const { return fkDDLOFFSET; }
+  Float_t GetCELLSTEP() const { return fkCELLSTEP; }
+  
+  //EMCAL specific, !! Move somewhere else, PTH
+  Float_t GetMAXCELLSTEPETA() const { return fkMAXCELLSTEPETA; }  //FR
+  Float_t GetMINCELLSTEPETA() const { return fkMINCELLSTEPETA; }  //FR
+  Float_t GetCELLSTEPPHI() const { return fkCELLSTEPPHI; }        //FR
+  Float_t GetCELLHEIGHT() const { return fkCELLHEIGHT; }        //FR
+  Float_t GetCELLANGLE() const { return fkCELLANGLE; }        //FR
+  Float_t GetRADLENGTH() const { return fkRADLENGTH; }        //FR
+  Float_t GetCRITICENERGY() const { return fkCRITICENERGY; }        //FR
+  Float_t GetCJ() const { return fkCJ;} //FR
+  TString GetDETNAME() { return fkDETNAME; };
+
+protected:
+  //EMCAL specific, !! Move somewhere else, PTH
+  // @todo: These variables should be declared constant, doesnt work right now
+  // because the default copy contructor is called somewhere.
+  Float_t fkMAXCELLSTEPETA;
+  Float_t fkMINCELLSTEPETA;
+  Float_t fkCELLSTEPPHI;
+  Float_t fkCELLHEIGHT;
+  Float_t fkCELLANGLE;
+  Float_t fkRADLENGTH;
+  Float_t fkCRITICENERGY;
+  Float_t fkCJ;
+  Float_t fkCELLSTEP; //Constant
 
+  Int_t fkDDLOFFSET;   //Constant
+  TString fkDETNAME;
 
 private:
+  AliHLTCaloConstants(const AliHLTCaloConstants & );
+  AliHLTCaloConstants & operator = (const AliHLTCaloConstants &); 
+
+  ClassDef(AliHLTCaloConstants, 1)
+};
 
-  AliHLTCaloConstants();
 
-  const Int_t fkMAXHOSTS; // soon to be obsolete
-  const Int_t fkDEFAULTEVENTPORT; // soon to be obsolete
-  const Int_t fkMAXBINVALUE; // 1023;
-  const Int_t fkHIGHGAIN; //   1;
-  const Int_t fkLOWGAIN; //   0;
-  const Int_t fkALTROMAXSAMPLES; // 1008;                           /**<The maximum number of samples of the ALTRO*/
-  const Int_t fkALTROMAXPRESAMPLES; // 15;        
-  const Int_t fkNZROWSRCU; //   56;                    /**<Number of rows per module*/       
-  const Int_t fkNXCOLUMNSRCU; //   16; 
-  const Int_t fkNZROWSMOD; //  48;            /**<Number of rows per module*/       
-  const Int_t fkNXCOLUMNSMOD; //  24;            /**<Number of columns per module*/ 
-  const Int_t fkNGAINS; //   2;                             /**<Number of gains per ALTRO channel*/
-  const Int_t fkNDATATYPES; //   10;    
-  const Int_t fkPFMAXPATHLENGTH; // 256;
-  const Int_t fkPFDEFAULTNSAMPLES; // 70;
-  const Int_t fkPFDEFAULTSTARTINDEX; // 0;
-  const Double_t fkDEFAULTTAU; // 0.2;                /**<Assume that the signal rise time of the altrp pulses is 2 us (nominal value of the electronics)*/
-  const Int_t fkDEFAULTFS; // 10;   /**<Assume that the signal is samples with 10 MHZ samle rate*/
-  const Int_t fkMODULE0; // 0;
-  const Int_t fkMODULE1; // 1;
-  const Int_t fkMODULE2; // 2;
-  const Int_t fkMODULE3; // 3;
-  const Int_t fkMODULE4; // 4;
-  const Int_t fkCSPSPERFEE; // 32;
-  const Int_t fkRCU0; // 0;
-  const Int_t fkRCU1; // 1;
-  const Int_t fkRCU2; // 2;
-  const Int_t fkRCU3; // 3;
-  const Int_t fkZ0; // 0;
-  const Int_t fkZ1; // 1;
-  const Int_t fkX0; // 0;
-  const Int_t fkX1; // 1;
-  const Int_t fkNMODULES; //      13;                            /**<Number of modules of the EMCAL detector*/
-  const Int_t fkNRCUS; //      4;                             /**<Number of RCUs per Module*/
-  const Int_t fkNRCUSPERMODULE; //  2;                            /**<Number of RCUs per Module*/
-  const Int_t fkNRCUSPERTOTAL; //  NMODULES*NRCUSPERMODULE;        /**<Total number of RCUs for EMCAL*/
-  const Int_t fkNFEECS; //  9;                             /**<Number of frontend cards per branch*/
-  const Int_t fkNALTROS; //   4;                            /**<Number of ALTROs per fkrontend card*/
-  const Int_t fkNALTROCHANNELS; //  16;
-  const Int_t fkNBRANCHES; //   2;      
-  const Float_t fkCELLSTEP;   // Obsolete variable? Called in Calomapper!
-  const Int_t fkNRCUSPERSECTOR; // 4;
 
-};
 #endif