CbmRoot
Loading...
Searching...
No Matches
CbmRichMCbmDigiMapManager.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2020 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Adrian Amatus Weber [committer], Florian Uhlig */
4
5/*
6 * CbmRichDigiMap.h
7 *
8 * Created on: Dec 17, 2015
9 * Author: slebedev
10 */
11
12#ifndef RICH_DETECTOR_CBMRICHMCBMDIGIMAPMANAGER_H_
13#define RICH_DETECTOR_CBMRICHMCBMDIGIMAPMANAGER_H_
14
15#include <RtypesCore.h> // for Int_t
16
17#include <iostream> // for string
18#include <map> // for map
19#include <vector> // for vector
20
22class CbmRichPmtData;
23
25private:
27
28public:
33 {
34 static CbmRichMCbmDigiMapManager fInstance;
35 return fInstance;
36 }
37
38 /*
39 * \brief Return digi address by path to node.
40 */
41 Int_t GetPixelAddressByPath(const std::string& path);
42
43 /*
44 * \brief Return CbmRichDataPixel by digi address.
45 */
47
48 /*
49 * \brief Return the addresses of the direct neighbour pixels.
50 * C++11 efficient way to return vector
51 */
52 std::vector<Int_t> GetDirectNeighbourPixels(Int_t address);
53
54 /*
55 * \brief Return the addresses of the diagonal neighbour pixels.
56 * C++11 efficient way to return vector
57 */
58 std::vector<Int_t> GetDiagonalNeighbourPixels(Int_t address);
59
60 /*
61 * \brief Return random address. Needed for noise digi.
62 */
64
65
66 /*
67 * \brief Return addresses of all pixels
68 */
69 std::vector<Int_t> GetPixelAddresses();
70
71 /*
72 * \brief Return ids for all pmts
73 */
74 std::vector<Int_t> GetPmtIds();
75
76 /*
77 * \brief Return CbmRichDataPmt by id.
78 */
80
81public:
83
84private:
85 std::map<std::string, Int_t> fPixelPathToAddressMap;
86 std::map<Int_t, CbmRichPixelData*> fPixelAddressToDataMap;
87 std::vector<Int_t> fPixelAddresses; // vector of all pixel addresses
88
89 std::map<std::string, Int_t> fPmtPathToIdMap;
90 std::map<Int_t, CbmRichPmtData*> fPmtIdToDataMap;
91 std::vector<Int_t> fPmtIds;
92
93 /*
94 * \brief Initialize maps.
95 */
96 void Init();
97
102
107};
108
109#endif /* RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_ */
Int_t GetPixelAddressByPath(const std::string &path)
std::map< Int_t, CbmRichPixelData * > fPixelAddressToDataMap
std::map< Int_t, CbmRichPmtData * > fPmtIdToDataMap
std::map< std::string, Int_t > fPmtPathToIdMap
std::map< std::string, Int_t > fPixelPathToAddressMap
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
CbmRichMCbmDigiMapManager(const CbmRichMCbmDigiMapManager &)
Copy constructor.
static CbmRichMCbmDigiMapManager & GetInstance()
std::vector< Int_t > GetDiagonalNeighbourPixels(Int_t address)
CbmRichPmtData * GetPmtDataById(Int_t id)
std::vector< Int_t > GetDirectNeighbourPixels(Int_t address)
CbmRichMCbmDigiMapManager & operator=(const CbmRichMCbmDigiMapManager &)
Assignment operator.