29 cfg.fileNameASDtoPP, cfg.fileNameASDtoPPdiff)},
55 int indexFromReadoutWithoutChannel =
57 const auto it = m_slbModuleIdMap.find(indexFromReadoutWithoutChannel);
58 if (it != m_slbModuleIdMap.end()) {
61 return it->second.get();
65 int readoutSector = rodId - 1;
71 m_slbModuleIdMap.insert(
72 std::make_pair(indexFromReadoutWithoutChannel,
nullptr));
76 std::unique_ptr<TGCModuleId> ssw = sswMap.
popModule(sswId);
78 m_slbModuleIdMap.insert(
79 std::make_pair(indexFromReadoutWithoutChannel,
nullptr));
88 m_slbModuleIdMap.insert(
89 std::make_pair(indexFromReadoutWithoutChannel,
nullptr));
93 std::unique_ptr<TGCModuleId> slb{};
94 for (
auto& [
id, module] : slbMap) {
95 const auto* SLB =
dynamic_cast<TGCModuleSLB*
>(
module.get());
96 if (SLB && SLB->getSBLoc() == sbLoc) {
97 slb = std::move(module);
103 m_slbModuleIdMap.insert(
104 std::make_pair(indexFromReadoutWithoutChannel,
nullptr));
108 return m_slbModuleIdMap
109 .insert(std::make_pair(indexFromReadoutWithoutChannel, std::move(slb)))
110 .first->second.get();
115 int rodId,
int sswId,
119 int readoutSector = rodId - 1;
124 if (sswMap.
empty()) {
128 std::unique_ptr<TGCModuleId> ssw = sswMap.
popModule(sswId);
137 if (slbMap.
empty()) {
147 int& sswId,
int& sbLoc)
const {
159 if (sswMap.
empty()) {
164 std::unique_ptr<TGCModuleId>& ssw = sswMap.
begin()->second;
170 sswId = ssw->getId();
177 if (slbMap.
empty()) {
183 for (
auto& [
id, module] : slbMap) {
189 if (slb.getModuleType() == pSlb->getModuleType()) {
190 sbLoc = pSlb->getSBLoc();
196 sbLoc = pSlb->getSBLoc();
208 if (rodMap.
empty()) {
213 std::unique_ptr<TGCModuleId>& rod = rodMap.
begin()->second;
216 rodId = rod->getId();
225 bool orChannel)
const {
233 int readoutSector = (rodId - 1);
234 int sector = sectorInReadout;
243 }
else if (rodId < 20) {
260 std::unique_ptr<TGCChannelId> slbout =
262 if (!slbout || !slbout->isValid()) {
265 std::unique_ptr<TGCChannelId> slbin =
271 channel = slbin->getChannel();
273 auto slb = slbin->getModule();
282 sideType, rodid, sswId, sbLoc);
291 int& hpbId,
int& block,
int& hitId,
int& pos)
const {
294 sectorInReadout = -1;
309 std::unique_ptr<TGCChannelId> hpbin =
311 if (!hpbin || !hpbin->isValid()) {
314 signal = hpbin->getSignalType();
315 region = hpbin->getRegionType();
316 sectorInReadout = hpbin->getSectorInReadout();
317 hpbId = hpbin->getId();
318 block = hpbin->getBlock();
319 pos = hpbin->getChannel() % 2;
320 hitId = (hpbin->getChannel() - pos) / 2;
327 int sswId,
int sbLoc,
328 int& channel,
int block,
329 int pos,
bool flag)
const {
330 bool orChannel = flag;
339 slb->
getId(), block, pos);
341 std::unique_ptr<TGCChannelId> slbin =
348 channel = slbin->getChannel();
356 bool orChannel)
const {
375 int& sswId,
int& sbLoc,
int& channel,
376 bool orChannel)
const {
385 std::unique_ptr<TGCChannelId> slbin{
391 channel = slbin->getChannel();
393 auto slb = slbin->getModule();
400 rodId, sswId, sbLoc);
405 bool orChannel)
const {
406 switch (channelId.getChannelIdType()) {
412 std::unique_ptr<TGCChannelId> asdout =
414 if (!asdout || !asdout->isValid()) {
418 std::unique_ptr<TGCChannelId> ppin =
420 if (!ppin || !ppin->isValid()) {
423 std::unique_ptr<TGCChannelId> ppout =
425 if (!ppout || !ppout->isValid()) {
440 std::unique_ptr<TGCChannelId> ppin =
442 if (!ppin || !ppin->isValid()) {
446 std::unique_ptr<TGCChannelId> ppout =
448 if (!ppout || !ppout->isValid()) {
460 return m_cableInPP->getChannel(channelId, orChannel);
465 return m_cableInPP->getChannel(channelId, orChannel);
476 std::unique_ptr<TGCChannelId> slbout =
478 if (!slbout || !slbout->isValid()) {
488 std::unique_ptr<TGCChannelId> ppout =
490 if (!ppout || !ppout->isValid()) {
494 std::unique_ptr<TGCChannelId> ppin =
496 if (!ppin || !ppin->isValid()) {
502 std::unique_ptr<TGCChannelId> ppout =
504 if (!ppout || !ppout->isValid()) {
507 std::unique_ptr<TGCChannelId> ppin =
509 if (!ppin || !ppin->isValid()) {
512 std::unique_ptr<TGCChannelId> asdout =
514 if (!asdout || !asdout->isValid()) {
530 std::unique_ptr<TGCChannelId> slbout =
532 if (!slbout || !slbout->isValid()) {
601 const int sbLoc)
const {
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
bool getModule(std::istream &s, RegSelModule &m)
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
bool getHighPtIDFromReadout(TGCId::SideType side, int rodId, int sswId, int sbLoc, int channel, TGCId::SignalType &signal, TGCId::RegionType ®ion, int §orInReadout, 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
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
std::unique_ptr< TGCCableSLBToSSW > m_cableSLBToSSW
std::unique_ptr< TGCModuleId > getSLBFromRxId(TGCId::SideType side, int rodId, int sswId, int rxId) const
std::unique_ptr< TGCCableSLBToHPB > m_cableSLBToHPB
int getIndexFromReadoutWithoutChannel(const TGCId::SideType side, const int rodId, const int sswId, const int sbLoc) const
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
std::unique_ptr< TGCCableInASD > m_cableInASD
std::unique_ptr< TGCCableHPBToSL > m_cableHPBToSL
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
virtual bool isValid() const override
virtual bool isValid() const override
ModuleType getModuleType() const
static constexpr int NUM_ENDCAP_SECTOR
RegionType getRegionType() const
static constexpr int N_RODS
virtual int getSector() const
SideType getSideType() const
static constexpr int NUM_FORWARD_SECTOR
ModuleIdType getModuleIdType() const
Store_t::const_iterator begin() const
Returns the begin iterator of the underlying map.
std::unique_ptr< TGCModuleId > popModule(const int connector)
Return a certain module and remove it from the map.