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 // SSW ID/RX ID-> SLB Module
74 std::unique_ptr<TGCModuleId> getSLBFromRxId(TGCId::SideType side, int rodId,
75 int sswId, int rxId) const;
76
77 // SLB Module -> readout ID
78 bool getReadoutFromSLB(const TGCModuleSLB& slb, TGCId::SideType& side,
79 int& rodId, int& sswId, int& sbLoc) const;
80
81 // readout channel -> chamber channel
82 std::unique_ptr<TGCChannelId> getASDOutFromReadout(
83 TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel,
84 bool orChannel = false) const;
85
86 // chamber channel -> readout channel
87 bool getReadoutFromASDOut(const TGCChannelASDOut& asdout,
88 TGCId::SideType& side, int& rodId, int& sswId,
89 int& sbLoc, int& channel,
90 bool orChannel = false) const;
91
92 // readout channel -> coincidence channel
93 bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId,
94 int sbLoc, int channel,
95 TGCId::SignalType& signal,
96 TGCId::RegionType& region, int& sectorInReadout,
97 int& hpbId, int& block, int& hitId,
98 int& pos) const;
99
100 // coincidence channel -> readout channel
101 bool getReadoutFromHighPtID(TGCId::SideType side, int rodId, int& sswId,
102 int& sbLoc, int& channel,
103 TGCId::SignalType signal,
104 TGCId::RegionType region, int sectorInReadout,
105 int hpbId, int block, int hitId, int pos,
106 TGCId::ModuleType moduleType,
107 bool orChannel) const;
108
109 // coincidence channel -> readout channel
111 int sswId, int sbLoc, int& channel,
112 int block, int pos,
113 bool middle = false) const;
114
115 // channel connection
116 std::unique_ptr<TGCChannelId> getChannel(const TGCChannelId& channelId,
118 bool orChannel = false) const;
119 // module connection
120 TGCModuleMap getModule(const TGCModuleId& moduleId,
122
123 private:
124 std::unique_ptr<TGCCableInASD> m_cableInASD{};
125 std::unique_ptr<TGCCableASDToPP> m_cableASDToPP{};
126 std::unique_ptr<TGCCableInPP> m_cableInPP{};
127 std::unique_ptr<TGCCablePPToSLB> m_cablePPToSLB{};
128 std::unique_ptr<TGCCableInSLB> m_cableInSLB{};
129 std::unique_ptr<TGCCableSLBToHPB> m_cableSLBToHPB{};
130 std::unique_ptr<TGCCableHPBToSL> m_cableHPBToSL{};
131 std::unique_ptr<TGCCableSLBToSSW> m_cableSLBToSSW{};
132 std::unique_ptr<TGCCableSSWToROD> m_cableSSWToROD{};
133
134 // Protected by mutex.
135 mutable std::map<int, std::unique_ptr<TGCModuleId>> m_slbModuleIdMap
137 mutable std::mutex m_mutex;
138
140 const int rodId, const int sswId,
141 const int sbLoc) const;
142};
143
144} // namespace MuonTGC_Cabling
145
146#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 getReadoutFromSLB(const TGCModuleSLB &slb, TGCId::SideType &side, int &rodId, int &sswId, int &sbLoc) const
std::unique_ptr< TGCCableInPP > m_cableInPP
Definition TGCCabling.h:126
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:132
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:127
std::unique_ptr< TGCCableSLBToSSW > m_cableSLBToSSW
Definition TGCCabling.h:131
std::unique_ptr< TGCModuleId > getSLBFromRxId(TGCId::SideType side, int rodId, int sswId, int rxId) const
std::unique_ptr< TGCCableSLBToHPB > m_cableSLBToHPB
Definition TGCCabling.h:129
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:128
std::unique_ptr< TGCCableInASD > m_cableInASD
Definition TGCCabling.h:124
std::unique_ptr< TGCCableHPBToSL > m_cableHPBToSL
Definition TGCCabling.h:130
std::map< int, std::unique_ptr< TGCModuleId > > m_slbModuleIdMap ATLAS_THREAD_SAFE
Definition TGCCabling.h:136
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:125