File indexing completed on 2025-01-18 09:15:46
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
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 GetMaxCellID (void) const;
0044 TString DecodeCellID(int ) const;
0045 double GetX (int ) const;
0046 double GetY (int ) const;
0047 double GetZ (int ) const;
0048 bool Initialize (TString, int);
0049 bool Initialize (RootSetupWrapper&);
0050 bool IsInit (void) const;
0051
0052 friend class RootSetupWrapper;
0053
0054 private:
0055 static Setup* instancePtr;
0056 Setup(){}
0057 ~Setup() {}
0058
0059
0060 bool isInit=false;
0061
0062 std::map<int, TString> assemblyID;
0063 std::map<int, int> ROunit;
0064 std::map<int, int> ROchannel;
0065 std::map<int, int> Board;
0066
0067 std::map< std::pair<int, int>, int> CellIDfromRO;
0068 int nMaxLayer;
0069 int nMaxRow;
0070 int nMaxColumn;
0071 int nMaxModule;
0072 int nMaxROUnit;
0073 int maxCellID;
0074 ClassDef(Setup,1)
0075 };
0076
0077
0078 #endif