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();
119 int readoutSector = rodId - 1;
124 if (sswMap.
empty()) {
128 std::unique_ptr<TGCModuleId> ssw = sswMap.
popModule(sswId);
137 if (slbMap.
empty()) {
141 for (
auto& [
id, module] : slbMap) {
143 if (slb && slb->getSBLoc() == sbLoc) {
153 int rodId,
int sswId,
157 int readoutSector = rodId - 1;
162 if (sswMap.
empty()) {
166 std::unique_ptr<TGCModuleId> ssw = sswMap.
popModule(sswId);
175 if (slbMap.
empty()) {
185 int& sswId,
int& sbLoc)
const {
197 if (sswMap.
empty()) {
202 std::unique_ptr<TGCModuleId>& ssw = sswMap.
begin()->second;
208 sswId = ssw->getId();
215 if (slbMap.
empty()) {
221 for (
auto& [
id, module] : slbMap) {
227 if (slb.getModuleType() == pSlb->getModuleType()) {
228 sbLoc = pSlb->getSBLoc();
234 sbLoc = pSlb->getSBLoc();
246 if (rodMap.
empty()) {
251 std::unique_ptr<TGCModuleId>& rod = rodMap.
begin()->second;
254 rodId = rod->getId();
263 bool orChannel)
const {
271 int readoutSector = (rodId - 1);
272 int sector = sectorInReadout;
281 }
else if (rodId < 20) {
298 std::unique_ptr<TGCChannelId> slbout =
300 if (!slbout || !slbout->isValid()) {
303 std::unique_ptr<TGCChannelId> slbin =
309 channel = slbin->getChannel();
311 auto slb = slbin->getModule();
320 sideType, rodid, sswId, sbLoc);
329 int& hpbId,
int& block,
int& hitId,
int& pos)
const {
332 sectorInReadout = -1;
347 std::unique_ptr<TGCChannelId> hpbin =
349 if (!hpbin || !hpbin->isValid()) {
352 signal = hpbin->getSignalType();
353 region = hpbin->getRegionType();
354 sectorInReadout = hpbin->getSectorInReadout();
355 hpbId = hpbin->getId();
356 block = hpbin->getBlock();
357 pos = hpbin->getChannel() % 2;
358 hitId = (hpbin->getChannel() - pos) / 2;
365 int sswId,
int sbLoc,
366 int& channel,
int block,
367 int pos,
bool flag)
const {
368 bool orChannel = flag;
377 slb->
getId(), block, pos);
379 std::unique_ptr<TGCChannelId> slbin =
386 channel = slbin->getChannel();
393 int sswId,
int sbLoc,
394 int channel,
int& block,
395 int& pos,
bool middle)
const {
409 std::unique_ptr<TGCChannelId> slbout =
415 block = slbout->getBlock();
416 pos = slbout->getChannel();
424 bool orChannel)
const {
443 int& sswId,
int& sbLoc,
int& channel,
444 bool orChannel)
const {
453 std::unique_ptr<TGCChannelId> slbin{
459 channel = slbin->getChannel();
461 auto slb = slbin->getModule();
468 rodId, sswId, sbLoc);
473 bool orChannel)
const {
474 switch (channelId.getChannelIdType()) {
480 std::unique_ptr<TGCChannelId> asdout =
482 if (!asdout || !asdout->isValid()) {
486 std::unique_ptr<TGCChannelId> ppin =
488 if (!ppin || !ppin->isValid()) {
491 std::unique_ptr<TGCChannelId> ppout =
493 if (!ppout || !ppout->isValid()) {
508 std::unique_ptr<TGCChannelId> ppin =
510 if (!ppin || !ppin->isValid()) {
514 std::unique_ptr<TGCChannelId> ppout =
516 if (!ppout || !ppout->isValid()) {
528 return m_cableInPP->getChannel(channelId, orChannel);
533 return m_cableInPP->getChannel(channelId, orChannel);
544 std::unique_ptr<TGCChannelId> slbout =
546 if (!slbout || !slbout->isValid()) {
556 std::unique_ptr<TGCChannelId> ppout =
558 if (!ppout || !ppout->isValid()) {
562 std::unique_ptr<TGCChannelId> ppin =
564 if (!ppin || !ppin->isValid()) {
570 std::unique_ptr<TGCChannelId> ppout =
572 if (!ppout || !ppout->isValid()) {
575 std::unique_ptr<TGCChannelId> ppin =
577 if (!ppin || !ppin->isValid()) {
580 std::unique_ptr<TGCChannelId> asdout =
582 if (!asdout || !asdout->isValid()) {
598 std::unique_ptr<TGCChannelId> slbout =
600 if (!slbout || !slbout->isValid()) {
669 const int sbLoc)
const {
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 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
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.