CbmRoot
CbmRichMCbmDigiMapManager.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_CBMRICHMCBMDIGIMAPMANAGER_H_
9 #define RICH_DETECTOR_CBMRICHMCBMDIGIMAPMANAGER_H_
10 
11 #include <RtypesCore.h> // for Int_t
12 
13 #include <iostream> // for string
14 #include <map> // for map
15 #include <vector> // for vector
16 
17 class CbmRichPixelData;
18 class CbmRichPmtData;
19 
21 private:
23 
24 public:
29  static CbmRichMCbmDigiMapManager fInstance;
30  return fInstance;
31  }
32 
33  /*
34  * \brief Return digi address by path to node.
35  */
36  Int_t GetPixelAddressByPath(const std::string& path);
37 
38  /*
39  * \brief Return CbmRichDataPixel by digi address.
40  */
42 
43  /*
44  * \brief Return the addresses of the direct neighbour pixels.
45  * C++11 efficient way to return vector
46  */
47  std::vector<Int_t> GetDirectNeighbourPixels(Int_t address);
48 
49  /*
50  * \brief Return the addresses of the diagonal neighbour pixels.
51  * C++11 efficient way to return vector
52  */
53  std::vector<Int_t> GetDiagonalNeighbourPixels(Int_t address);
54 
55  /*
56  * \brief Return random address. Needed for noise digi.
57  */
58  Int_t GetRandomPixelAddress();
59 
60 
61  /*
62  * \brief Return addresses of all pixels
63  */
64  std::vector<Int_t> GetPixelAddresses();
65 
66  /*
67  * \brief Return ids for all pmts
68  */
69  std::vector<Int_t> GetPmtIds();
70 
71  /*
72  * \brief Return CbmRichDataPmt by id.
73  */
74  CbmRichPmtData* GetPmtDataById(Int_t id);
75 
76 public:
78 
79 private:
80  std::map<std::string, Int_t> fPixelPathToAddressMap;
81  std::map<Int_t, CbmRichPixelData*> fPixelAddressToDataMap;
82  std::vector<Int_t> fPixelAddresses; // vector of all pixel addresses
83 
84  std::map<std::string, Int_t> fPmtPathToIdMap;
85  std::map<Int_t, CbmRichPmtData*> fPmtIdToDataMap;
86  std::vector<Int_t> fPmtIds;
87 
88  /*
89  * \brief Initialize maps.
90  */
91  void Init();
92 
97 
102 };
103 
104 #endif /* RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_ */
CbmRichPixelData
Definition: CbmRichDetectorData.h:17
CbmRichMCbmDigiMapManager::GetRandomPixelAddress
Int_t GetRandomPixelAddress()
Definition: CbmRichMCbmDigiMapManager.cxx:205
CbmRichMCbmDigiMapManager::CbmRichMCbmDigiMapManager
CbmRichMCbmDigiMapManager()
Definition: CbmRichMCbmDigiMapManager.cxx:28
CbmRichMCbmDigiMapManager::GetPixelAddresses
std::vector< Int_t > GetPixelAddresses()
Definition: CbmRichMCbmDigiMapManager.cxx:211
CbmRichMCbmDigiMapManager::fPixelAddresses
std::vector< Int_t > fPixelAddresses
Definition: CbmRichMCbmDigiMapManager.h:82
CbmRichMCbmDigiMapManager::~CbmRichMCbmDigiMapManager
virtual ~CbmRichMCbmDigiMapManager()
Definition: CbmRichMCbmDigiMapManager.cxx:38
CbmRichMCbmDigiMapManager::GetPixelDataByAddress
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Definition: CbmRichMCbmDigiMapManager.cxx:198
CbmRichMCbmDigiMapManager::CbmRichMCbmDigiMapManager
CbmRichMCbmDigiMapManager(const CbmRichMCbmDigiMapManager &)
Copy constructor.
CbmRichPmtData
Definition: CbmRichDetectorData.h:26
CbmRichMCbmDigiMapManager::Init
void Init()
Definition: CbmRichMCbmDigiMapManager.cxx:40
CbmRichMCbmDigiMapManager::fPmtIds
std::vector< Int_t > fPmtIds
Definition: CbmRichMCbmDigiMapManager.h:86
CbmRichMCbmDigiMapManager::GetPmtDataById
CbmRichPmtData * GetPmtDataById(Int_t id)
Definition: CbmRichMCbmDigiMapManager.cxx:219
CbmRichMCbmDigiMapManager
Definition: CbmRichMCbmDigiMapManager.h:20
CbmRichMCbmDigiMapManager::fPmtPathToIdMap
std::map< std::string, Int_t > fPmtPathToIdMap
Definition: CbmRichMCbmDigiMapManager.h:84
CbmRichMCbmDigiMapManager::operator=
CbmRichMCbmDigiMapManager & operator=(const CbmRichMCbmDigiMapManager &)
Assignment operator.
CbmRichMCbmDigiMapManager::fPmtIdToDataMap
std::map< Int_t, CbmRichPmtData * > fPmtIdToDataMap
Definition: CbmRichMCbmDigiMapManager.h:85
CbmRichMCbmDigiMapManager::GetInstance
static CbmRichMCbmDigiMapManager & GetInstance()
Definition: CbmRichMCbmDigiMapManager.h:28
CbmRichMCbmDigiMapManager::GetPmtIds
std::vector< Int_t > GetPmtIds()
Definition: CbmRichMCbmDigiMapManager.cxx:216
CbmRichMCbmDigiMapManager::fPixelPathToAddressMap
std::map< std::string, Int_t > fPixelPathToAddressMap
Definition: CbmRichMCbmDigiMapManager.h:80
CbmRichMCbmDigiMapManager::fPixelAddressToDataMap
std::map< Int_t, CbmRichPixelData * > fPixelAddressToDataMap
Definition: CbmRichMCbmDigiMapManager.h:81
CbmRichMCbmDigiMapManager::GetDirectNeighbourPixels
std::vector< Int_t > GetDirectNeighbourPixels(Int_t address)
Definition: CbmRichMCbmDigiMapManager.cxx:227
CbmRichMCbmDigiMapManager::GetDiagonalNeighbourPixels
std::vector< Int_t > GetDiagonalNeighbourPixels(Int_t address)
Definition: CbmRichMCbmDigiMapManager.cxx:234
CbmRichMCbmDigiMapManager::GetPixelAddressByPath
Int_t GetPixelAddressByPath(const std::string &path)
Definition: CbmRichMCbmDigiMapManager.cxx:189