Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 08:26:14

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