Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-06-30 07:55:58

0001 #ifndef SETUP_H
0002 #define SETUP_H
0003 
0004 #include <cstddef>
0005 #include <map>
0006 #include "TString.h"
0007 
0008 class RootSetupWrapper;
0009 
0010 class Setup{
0011   
0012  public:
0013   // deleting copy constructor. 
0014   Setup(const Setup &)=delete;
0015   Setup& operator=(const Setup&)=delete;
0016   
0017   static Setup *GetInstance(){
0018     if(instancePtr == NULL) instancePtr = new Setup();
0019     return instancePtr;
0020   }
0021   
0022   TString GetAssemblyID(int /**/) const;
0023   TString GetAssemblyID(int /**/, int /**/, int /**/, int /**/) const;
0024   int     GetCellID    (int /**/, int /**/) const;
0025   int     GetCellID    (int /**/, int /**/, int /**/, int /**/)const;
0026   int     GetColumn    (int /**/) const;
0027   int     GetChannelInLayer(int /**/) const;
0028   int     GetLayer     (int /**/) const;
0029   int     GetModule    (int /**/) const;
0030   double  GetModuleX   (int /**/) const;
0031   double  GetModuleY   (int /**/) const;
0032   int     GetROchannel (int /**/) const;
0033   int     GetROchannel (int /**/, int /**/, int /**/, int /**/) const;
0034   int     GetROunit    (int /**/) const;
0035   int     GetROunit    (int /**/, int /**/, int /**/, int /**/) const;
0036   int     GetRow       (int /**/) const;
0037   int     GetTotalNbChannels(void) const;
0038   int     GetNMaxLayer  (void) const;
0039   int     GetNMaxRow    (void) const;
0040   int     GetNMaxColumn (void) const;
0041   int     GetNMaxModule (void) const;
0042   int     GetNMaxROUnit (void) const;
0043   int     GetNMaxKCUs   (void) const;
0044   int     GetMaxCellID (void) const;
0045   TString DecodeCellID(int /**/) const;
0046   double  GetX         (int /**/) const;
0047   double  GetY         (int /**/) const;
0048   double  GetZ         (int /**/) const;
0049   bool    Initialize   (TString, int);
0050   bool    Initialize   (RootSetupWrapper&);
0051   bool    IsInit       (void) const;
0052   float     GetMinX       (void) const;
0053   float     GetMaxX       (void) const;
0054   float     GetMinY       (void) const;
0055   float     GetMaxY       (void) const;
0056   float     GetMinZ       (void) const;
0057   float     GetMaxZ       (void) const;
0058   float     GetCellWidth  (void) const;
0059   float     GetCellHeight (void) const;
0060   float     GetCellDepth  (void) const;
0061 
0062   friend class RootSetupWrapper;
0063   
0064  private:
0065   static Setup* instancePtr;
0066   Setup(){}
0067   ~Setup() {}
0068   
0069   
0070   bool isInit=false;
0071   //key is CellID
0072   std::map<int, TString> assemblyID;
0073   std::map<int, int>     ROunit;
0074   std::map<int, int>     ROchannel;
0075   std::map<int, int>     Board;
0076   //Inverse mapping
0077   std::map< std::pair<int, int>, int> CellIDfromRO;
0078   int nMaxLayer;
0079   int nMaxRow;
0080   int nMaxColumn;
0081   int nMaxModule;
0082   int nMaxROUnit;
0083   int maxCellID;
0084   float cellW=5.;/*cm, width*/
0085   float cellH=5.;/*cm, height*/
0086   float cellD=2.;/*cm, depth*/
0087   ClassDef(Setup,2)
0088 };
0089 
0090 
0091 #endif