CbmRoot
CbmRichDigiMapManager.h
Go to the documentation of this file.
1 /*
2  * CbmRichDigiMap.h
3  *
4  * Created on: Dec 17, 2015
5  * Author: slebedev
6  */
7 
8 #ifndef RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_
9 #define RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_
10 
11 #include <RtypesCore.h> // for Int_t
12 #include <TString.h> // for TString
13 
14 #include <iostream> // for string
15 #include <map> // for map
16 #include <vector> // for vector
17 
18 class CbmRichPixelData;
19 class CbmRichPmtData;
20 
22 private:
24 
25 public:
30  static CbmRichDigiMapManager fInstance;
31  return fInstance;
32  }
33 
34  /*
35  * \brief Return digi address by path to node.
36  */
37  Int_t GetPixelAddressByPath(const std::string& path);
38 
39  /*
40  * \brief Return CbmRichDataPixel by digi address.
41  */
43 
44  /*
45  * \brief Return the addresses of the direct neighbour pixels.
46  * C++11 efficient way to return vector
47  */
48  std::vector<Int_t> GetDirectNeighbourPixels(Int_t address);
49 
50  /*
51  * \brief Return the addresses of the diagonal neighbour pixels.
52  * C++11 efficient way to return vector
53  */
54  std::vector<Int_t> GetDiagonalNeighbourPixels(Int_t address);
55 
56  /*
57  * \brief Return random address. Needed for noise digi.
58  */
59  Int_t GetRandomPixelAddress();
60 
61 
62  /*
63  * \brief Return addresses of all pixels
64  */
65  std::vector<Int_t> GetPixelAddresses();
66 
67  /*
68  * \brief Return ids for all pmts
69  */
70  std::vector<Int_t> GetPmtIds();
71 
72  /*
73  * \brief Return CbmRichDataPmt by id.
74  */
75  CbmRichPmtData* GetPmtDataById(Int_t id);
76 
77 public:
78  virtual ~CbmRichDigiMapManager();
79 
80 private:
81  std::map<std::string, Int_t> fPixelPathToAddressMap;
82  std::map<Int_t, CbmRichPixelData*> fPixelAddressToDataMap;
83  std::vector<Int_t> fPixelAddresses; // vector of all pixel addresses
84 
85  std::map<std::string, Int_t> fPmtPathToIdMap;
86  std::map<Int_t, CbmRichPmtData*> fPmtIdToDataMap;
87  std::vector<Int_t> fPmtIds;
88 
89  int getDetectorSetup(TString const nodePath);
90 
91  /*
92  * \brief Initialize maps.
93  */
94  void Init();
95 
100 
105 };
106 
107 #endif /* RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_ */
CbmRichPixelData
Definition: CbmRichDetectorData.h:17
CbmRichDigiMapManager::GetPmtIds
std::vector< Int_t > GetPmtIds()
Definition: CbmRichDigiMapManager.cxx:285
CbmRichDigiMapManager::GetPixelAddresses
std::vector< Int_t > GetPixelAddresses()
Definition: CbmRichDigiMapManager.cxx:280
CbmRichDigiMapManager::~CbmRichDigiMapManager
virtual ~CbmRichDigiMapManager()
Definition: CbmRichDigiMapManager.cxx:37
CbmRichDigiMapManager::getDetectorSetup
int getDetectorSetup(TString const nodePath)
Definition: CbmRichDigiMapManager.cxx:309
CbmRichDigiMapManager::fPixelPathToAddressMap
std::map< std::string, Int_t > fPixelPathToAddressMap
Definition: CbmRichDigiMapManager.h:81
CbmRichDigiMapManager
Definition: CbmRichDigiMapManager.h:21
CbmRichDigiMapManager::GetPmtDataById
CbmRichPmtData * GetPmtDataById(Int_t id)
Definition: CbmRichDigiMapManager.cxx:288
CbmRichDigiMapManager::fPmtPathToIdMap
std::map< std::string, Int_t > fPmtPathToIdMap
Definition: CbmRichDigiMapManager.h:85
CbmRichDigiMapManager::fPmtIds
std::vector< Int_t > fPmtIds
Definition: CbmRichDigiMapManager.h:87
CbmRichDigiMapManager::fPixelAddresses
std::vector< Int_t > fPixelAddresses
Definition: CbmRichDigiMapManager.h:83
CbmRichDigiMapManager::fPixelAddressToDataMap
std::map< Int_t, CbmRichPixelData * > fPixelAddressToDataMap
Definition: CbmRichDigiMapManager.h:82
CbmRichPmtData
Definition: CbmRichDetectorData.h:26
CbmRichDigiMapManager::GetDirectNeighbourPixels
std::vector< Int_t > GetDirectNeighbourPixels(Int_t address)
Definition: CbmRichDigiMapManager.cxx:296
CbmRichDigiMapManager::Init
void Init()
Definition: CbmRichDigiMapManager.cxx:39
CbmRichDigiMapManager::GetDiagonalNeighbourPixels
std::vector< Int_t > GetDiagonalNeighbourPixels(Int_t address)
Definition: CbmRichDigiMapManager.cxx:303
CbmRichDigiMapManager::GetPixelAddressByPath
Int_t GetPixelAddressByPath(const std::string &path)
Definition: CbmRichDigiMapManager.cxx:259
CbmRichDigiMapManager::GetRandomPixelAddress
Int_t GetRandomPixelAddress()
Definition: CbmRichDigiMapManager.cxx:274
CbmRichDigiMapManager::CbmRichDigiMapManager
CbmRichDigiMapManager(const CbmRichDigiMapManager &)
Copy constructor.
CbmRichDigiMapManager::GetInstance
static CbmRichDigiMapManager & GetInstance()
Definition: CbmRichDigiMapManager.h:29
CbmRichDigiMapManager::CbmRichDigiMapManager
CbmRichDigiMapManager()
Definition: CbmRichDigiMapManager.cxx:27
CbmRichDigiMapManager::operator=
CbmRichDigiMapManager & operator=(const CbmRichDigiMapManager &)
Assignment operator.
CbmRichDigiMapManager::fPmtIdToDataMap
std::map< Int_t, CbmRichPmtData * > fPmtIdToDataMap
Definition: CbmRichDigiMapManager.h:86
CbmRichDigiMapManager::GetPixelDataByAddress
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Definition: CbmRichDigiMapManager.cxx:267