Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-03-29 07:49:51

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 namespace DetConf{
0011   enum Type { Undef, 
0012               Single8M, 
0013               Single4M, 
0014               Single2MH, 
0015               Single2MV, 
0016               SingleTile, 
0017               Dual8M, 
0018               LargeTB
0019             };
0020 }
0021 
0022 
0023 class Setup{
0024   
0025  public:
0026   // deleting copy constructor. 
0027   Setup(const Setup &)=delete;
0028   Setup& operator=(const Setup&)=delete;
0029   
0030   static Setup *GetInstance(){
0031     if(instancePtr == NULL) instancePtr = new Setup();
0032     return instancePtr;
0033   }
0034   
0035   TString GetAssemblyID(int /**/) const;
0036   TString GetAssemblyID(int /**/, int /**/, int /**/, int /**/) const;
0037   int     GetCellID    (int /**/, int /**/) const;
0038   int     GetCellID    (int /**/, int /**/, int /**/, int /**/)const;
0039   int     GetColumn    (int /**/) const;
0040   int     GetChannelInLayer(int /**/) const;
0041   int     GetChannelInLayerFull(int /**/) const;
0042   int     GetMaxChannelInLayerFull(void) const;
0043   int     GetNActiveLayers(void) const;
0044   int     GetNActiveCells(void) const;
0045   int     GetLayer     (int /**/) const;
0046   int     GetModule    (int /**/) const;
0047   double  GetModuleX   (int /**/) const;
0048   double  GetModuleY   (int /**/) const;
0049   int     GetROchannel (int /**/) const;
0050   int     GetROchannel (int /**/, int /**/, int /**/, int /**/) const;
0051   int     GetROunit    (int /**/) const;
0052   int     GetROunit    (int /**/, int /**/, int /**/, int /**/) const;
0053   int     GetRow       (int /**/) const;
0054   int     GetTotalNbChannels(void) const;
0055   int     GetNMaxLayer  (void) const;
0056   int     GetNMaxRow    (void) const;
0057   int     GetNMaxColumn (void) const;
0058   int     GetNMaxModule (void) const;
0059   int     GetNMaxROUnit (void) const;
0060   int     GetNMaxKCUs   (void) const;
0061   int     GetAbsNMaxROChannel(void) const;
0062   int     GetMaxCellID (void) const;
0063   int     GetLayersInSegmentFromLayer(int) const;
0064   int     GetLayersInSegment(int) const;
0065   double  GetSegmentDepth(int cellID) const;
0066   
0067   TString DecodeCellID(int /**/) const;
0068   double  GetX         (int /**/) const;
0069   double  GetY         (int /**/) const;
0070   double  GetZ         (int /**/) const;
0071   bool    Initialize   (TString, int);
0072   bool    Initialize   (RootSetupWrapper&);
0073   bool    IsInit       (void) const;
0074   bool    IsLayerOn     (int /**/, int /**/) const; 
0075   float     GetMinX       (void) const;
0076   float     GetMaxX       (void) const;
0077   float     GetMinY       (void) const;
0078   float     GetMaxY       (void) const;
0079   float     GetMinZ       (void) const;
0080   float     GetMaxZ       (void) const;
0081   float     GetCellWidth  (void) const;
0082   float     GetCellHeight (void) const;
0083   float     GetCellDepth  (void) const;
0084   DetConf::Type GetDetectorConfig(void) const;
0085   bool ContainedInSetup(int /**/) const;
0086   friend class RootSetupWrapper;
0087   
0088  private:
0089   static Setup* instancePtr;
0090   Setup(){}
0091   ~Setup() {}
0092   
0093   
0094   bool isInit=false;
0095   //key is CellID
0096   std::map<int, TString> assemblyID;
0097   std::map<int, int>     ROunit;
0098   std::map<int, int>     ROchannel;
0099   std::map<int, int>     Board;
0100   //key is module number
0101   std::map<int, std::pair<float,float>> ModPos;
0102   //Inverse mapping
0103   std::map< std::pair<int, int>, int> CellIDfromRO;
0104   // key is layerNr
0105   std::map<int,int>     SegmentSum;
0106   int nMaxLayer;
0107   int nMaxRow;
0108   int nMaxColumn;
0109   int nMaxModule;
0110   int nMaxROUnit;
0111   int maxCellID;
0112   float cellW = 5.;/*cm, width*/
0113   float cellH = 5.;/*cm, height*/
0114   float cellD = 2.;/*cm, depth*/
0115   int sumOpt  = 0;
0116   ClassDef(Setup,3)
0117 };
0118 
0119 
0120 #endif