ATLAS Offline Software
Loading...
Searching...
No Matches
TGCCabling.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONTGC_CABLING_TGCCABLING_HH
6#define MUONTGC_CABLING_TGCCABLING_HH
7
8#include <map>
9#include <mutex>
10#include <string>
11
15
16namespace MuonTGC_Cabling {
17
18class TGCCableASDToPP;
19class TGCCableHPBToSL;
20class TGCCableInASD;
21class TGCCableInPP;
22class TGCCableInSLB;
23class TGCCablePPToSLB;
28class TGCChannelId;
29class TGCModuleMap;
30class TGCModuleSLB;
31
33 public:
34 //
35 TGCCabling(const TGCCabling&) = delete;
36 //
37 TGCCabling& operator=(const TGCCabling&) = delete;
38
39 struct Config {
40 std::string fileNameASDtoPP{"MuonTGC_Cabling_ASD2PP.db"};
41 std::string fileNameInPP{"MuonTGC_Cabling_PP.db"};
42 std::string fileNamePPtoSL{"MuonTGC_Cabling_PP2SL.db"};
43 std::string fileNameSLBtoROD{"MuonTGC_Cabling_SLB2ROD.db"};
44 std::string fileNameASDtoPPdiff{"ASD2PP_diff_12_ONL.db"};
45 };
46 // Constructor & Destructor
47 TGCCabling(const Config& cfg);
48
49 virtual ~TGCCabling();
50
63
64 // slbIn --> AsdOut
65 std::unique_ptr<TGCChannelId> getASDOutChannel(
66 const TGCChannelId& slb_in) const;
67
69 // readout ID -> SLB Module
70 const TGCModuleId* getSLBFromReadout(TGCId::SideType side, int rodId,
71 int sswId, int sbLoc) const;
72
73 // readoutID -> RxID
74 int getRxIdFromReadout(TGCId::SideType side, int rodId, int sswId,
75 int sbLoc) const;
76
77 // SSW ID/RX ID-> SLB Module
78 std::unique_ptr<TGCModuleId> getSLBFromRxId(TGCId::SideType side, int rodId,
79 int sswId, int rxId) const;
80
81 // SLB Module -> readout ID
82 bool getReadoutFromSLB(const TGCModuleSLB& slb, TGCId::SideType& side,
83 int& rodId, int& sswId, int& sbLoc) const;
84
85 // readout channel -> chamber channel
86 std::unique_ptr<TGCChannelId> getASDOutFromReadout(
87 TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel,
88 bool orChannel = false) const;
89
90 // chamber channel -> readout channel
91 bool getReadoutFromASDOut(const TGCChannelASDOut& asdout,
92 TGCId::SideType& side, int& rodId, int& sswId,
93 int& sbLoc, int& channel,
94 bool orChannel = false) const;
95
96 // readout channel -> coincidence channel
97 bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId,
98 int sbLoc, int channel,
99 TGCId::SignalType& signal,
100 TGCId::RegionType& region, int& sectorInReadout,
101 int& hpbId, int& block, int& hitId,
102 int& pos) const;
103
104 // coincidence channel -> readout channel
105 bool getReadoutFromHighPtID(TGCId::SideType side, int rodId, int& sswId,
106 int& sbLoc, int& channel,
107 TGCId::SignalType signal,
108 TGCId::RegionType region, int sectorInReadout,
109 int hpbId, int block, int hitId, int pos,
110 TGCId::ModuleType moduleType,
111 bool orChannel) const;
112
113 // readout channel -> coincidence channel
115 int sswId, int sbLoc, int channel,
116 int& block, int& pos,
117 bool middle = false) const;
118
119 // coincidence channel -> readout channel
121 int sswId, int sbLoc, int& channel,
122 int block, int pos,
123 bool middle = false) const;
124
125 // channel connection
126 std::unique_ptr<TGCChannelId> getChannel(const TGCChannelId& channelId,
128 bool orChannel = false) const;
129 // module connection
130 TGCModuleMap getModule(const TGCModuleId& moduleId,
132
133 private:
134 std::unique_ptr<TGCCableInASD> m_cableInASD{};
135 std::unique_ptr<TGCCableASDToPP> m_cableASDToPP{};
136 std::unique_ptr<TGCCableInPP> m_cableInPP{};
137 std::unique_ptr<TGCCablePPToSLB> m_cablePPToSLB{};
138 std::unique_ptr<TGCCableInSLB> m_cableInSLB{};
139 std::unique_ptr<TGCCableSLBToHPB> m_cableSLBToHPB{};
140 std::unique_ptr<TGCCableHPBToSL> m_cableHPBToSL{};
141 std::unique_ptr<TGCCableSLBToSSW> m_cableSLBToSSW{};
142 std::unique_ptr<TGCCableSSWToROD> m_cableSSWToROD{};
143
144 // Protected by mutex.
145 mutable std::map<int, std::unique_ptr<TGCModuleId>> m_slbModuleIdMap
147 mutable std::mutex m_mutex;
148
150 const int rodId, const int sswId,
151 const int sbLoc) const;
152};
153
154} // namespace MuonTGC_Cabling
155
156#endif
Define macros for attributes used to control the static checker.
bool getReadoutFromLowPtCoincidence(TGCId::SideType side, int rodId, int sswId, int sbLoc, int &channel, int block, int pos, bool middle=false) const
bool getLowPtCoincidenceFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, int &block, int &pos, bool middle=false) const
bool getReadoutFromSLB(const TGCModuleSLB &slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
int getRxIdFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
std::unique_ptr< TGCCableInPP > m_cableInPP
Definition TGCCabling.h:136
bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType &region, int &sectorInReadout, int &hpbId, int &block, int &hitId, int &pos) const
std::unique_ptr< TGCChannelId > getASDOutFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, bool orChannel=false) const
TGCCabling(const TGCCabling &)=delete
std::unique_ptr< TGCCableSSWToROD > m_cableSSWToROD
Definition TGCCabling.h:142
bool getReadoutFromASDOut(const TGCChannelASDOut &asdout, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc, int &channel, bool orChannel=false) const
std::unique_ptr< TGCCablePPToSLB > m_cablePPToSLB
Definition TGCCabling.h:137
std::unique_ptr< TGCCableSLBToSSW > m_cableSLBToSSW
Definition TGCCabling.h:141
std::unique_ptr< TGCModuleId > getSLBFromRxId(TGCId::SideType side, int rodId, int sswId, int rxId) const
std::unique_ptr< TGCCableSLBToHPB > m_cableSLBToHPB
Definition TGCCabling.h:139
int getIndexFromReadoutWithoutChannel(const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
TGCCabling & operator=(const TGCCabling &)=delete
std::unique_ptr< TGCChannelId > getChannel(const TGCChannelId &channelId, TGCChannelId::ChannelIdType type, bool orChannel=false) const
TGCModuleMap getModule(const TGCModuleId &moduleId, TGCModuleId::ModuleIdType type) const
std::unique_ptr< TGCCableInSLB > m_cableInSLB
Definition TGCCabling.h:138
std::unique_ptr< TGCCableInASD > m_cableInASD
Definition TGCCabling.h:134
std::unique_ptr< TGCCableHPBToSL > m_cableHPBToSL
Definition TGCCabling.h:140
std::map< int, std::unique_ptr< TGCModuleId > > m_slbModuleIdMap ATLAS_THREAD_SAFE
Definition TGCCabling.h:146
std::unique_ptr< TGCChannelId > getASDOutChannel(const TGCChannelId &slb_in) const
bool getReadoutFromHighPtID(TGCId::SideType side, int rodId, int &sswId, int &sbLoc, int &channel, TGCId::SignalType signal, TGCId::RegionType region, int sectorInReadout, int hpbId, int block, int hitId, int pos, TGCId::ModuleType moduleType, bool orChannel) const
const TGCModuleId * getSLBFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc) const
std::unique_ptr< TGCCableASDToPP > m_cableASDToPP
Definition TGCCabling.h:135