CbmRoot
Loading...
Searching...
No Matches
CbmRichDigiMapManager.h
Go to the documentation of this file.
1/* Copyright (C) 2015-2024 GSI/JINR-LIT, Darmstadt/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev, Martin Beyer, Andrey Lebedev [committer], Florian Uhlig */
4
5/*
6 * CbmRichDigiMap.h
7 *
8 * Created on: Dec 17, 2015
9 * Author: slebedev
10 */
11
12#ifndef RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_
13#define RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_
14
15#include <RtypesCore.h> // for Int_t
16#include <TString.h> // for TString
17
18#include <iostream> // for string
19#include <map> // for map
20#include <vector> // for vector
21
23class CbmRichPmtData;
24
26 private:
28
29 public:
34 {
35 static CbmRichDigiMapManager fInstance;
36 return fInstance;
37 }
38
42 Int_t GetPixelAddressByPath(const std::string& path);
43
48
53
57 std::vector<Int_t> GetPixelAddresses();
58
62 std::vector<Int_t> GetPmtIds();
63
68
77 std::vector<Int_t> GetNeighbourPixels(Int_t address, Int_t N, Bool_t horizontal = true, Bool_t vertical = true,
78 Bool_t diagonal = true);
79
84 std::vector<Int_t> GetDirectNeighbourPixels(Int_t address, Bool_t horizontal = true, Bool_t vertical = true)
85 {
86 return GetNeighbourPixels(address, 1, horizontal, vertical, false);
87 }
88
93 std::vector<Int_t> GetDiagonalNeighbourPixels(Int_t address)
94 {
95 return GetNeighbourPixels(address, 1, false, false, true);
96 }
97
106 std::vector<Int_t> GetNxNNeighbourPixels(Int_t address, Int_t n)
107 {
108 return GetNeighbourPixels(address, n, true, true, true);
109 }
110
111 public:
112 virtual ~CbmRichDigiMapManager();
113
114 private:
115 std::map<std::string, Int_t> fPixelPathToAddressMap;
116 std::map<Int_t, CbmRichPixelData*> fPixelAddressToDataMap;
117 std::vector<Int_t> fPixelAddresses; // vector of all pixel addresses
118
119 std::map<std::string, Int_t> fPmtPathToIdMap;
120 std::map<Int_t, CbmRichPmtData*> fPmtIdToDataMap;
121 std::vector<Int_t> fPmtIds;
122
123 int getDetectorSetup(TString const nodePath);
124
128 void Init();
129
134
139};
140
141#endif /* RICH_DETECTOR_CBMRICHDIGIMAPMANAGER_H_ */
CbmRichDigiMapManager & operator=(const CbmRichDigiMapManager &)
Assignment operator.
std::map< std::string, Int_t > fPmtPathToIdMap
std::vector< Int_t > fPmtIds
std::vector< Int_t > GetNeighbourPixels(Int_t address, Int_t N, Bool_t horizontal=true, Bool_t vertical=true, Bool_t diagonal=true)
Return the addresses of the neighbour pixels.
void Init()
Initialize maps.
static CbmRichDigiMapManager & GetInstance()
Return Instance of CbmRichGeoManager.
int getDetectorSetup(TString const nodePath)
std::vector< Int_t > GetPmtIds()
Return ids for all pmts.
std::vector< Int_t > GetDirectNeighbourPixels(Int_t address, Bool_t horizontal=true, Bool_t vertical=true)
Return the addresses of the direct neighbour pixels.
std::vector< Int_t > fPixelAddresses
std::map< Int_t, CbmRichPixelData * > fPixelAddressToDataMap
std::vector< Int_t > GetNxNNeighbourPixels(Int_t address, Int_t n)
Return the addresses of pixels in a (2n+1)*(2n+1) grid, with the address pixel in the center of the g...
Int_t GetRandomPixelAddress()
Return random address. Needed for noise digi.
std::map< std::string, Int_t > fPixelPathToAddressMap
std::vector< Int_t > GetPixelAddresses()
Return addresses of all pixels.
CbmRichPixelData * GetPixelDataByAddress(Int_t address)
Return CbmRichDataPixel by digi address.
CbmRichDigiMapManager(const CbmRichDigiMapManager &)
Copy constructor.
std::vector< Int_t > GetDiagonalNeighbourPixels(Int_t address)
Return the addresses of the diagonal neighbour pixels.
CbmRichPmtData * GetPmtDataById(Int_t id)
Return CbmRichDataPmt by id.
std::map< Int_t, CbmRichPmtData * > fPmtIdToDataMap
Int_t GetPixelAddressByPath(const std::string &path)
Return digi address by path to node.