CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
HcalElectronicsMapAddons::Helper Class Reference

#include <HcalElectronicsMap.h>

Public Member Functions

 Helper ()
 
bool mapEId2chId (HcalElectronicsId fElectronicsId, DetId fId)
 
bool mapEId2tId (HcalElectronicsId fElectronicsId, HcalTrigTowerDetId fTriggerId)
 

Public Attributes

std::vector< HcalElectronicsMap::PrecisionItemmPItems
 
std::vector< HcalElectronicsMap::TriggerItemmTItems
 

Detailed Description

Definition at line 137 of file HcalElectronicsMap.h.

Constructor & Destructor Documentation

◆ Helper()

HcalElectronicsMapAddons::Helper::Helper ( )

Definition at line 163 of file HcalElectronicsMap.cc.

std::vector< HcalElectronicsMap::TriggerItem > mTItems
std::vector< HcalElectronicsMap::PrecisionItem > mPItems
static const int maxLinearIndex

Member Function Documentation

◆ mapEId2chId()

bool HcalElectronicsMapAddons::Helper::mapEId2chId ( HcalElectronicsId  fElectronicsId,
DetId  fId 
)

Definition at line 182 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, HcalElectronicsId::linearIndex(), DetId::rawId(), and HcalElectronicsId::rawId().

Referenced by HcalDbASCIIIO::createObject< HcalElectronicsMap >(), HcalLogicalMap::generateHcalElectronicsMap(), and HcalDbHardcode::makeHardcodeMap().

182  {
184 
185  if (item.mElId == 0)
186  item.mElId = fElectronicsId.rawId();
187  if (item.mId == 0) {
188  item.mId = fId.rawId();
189  } else if (item.mId != fId.rawId()) {
190  edm::LogWarning("HCAL") << "HcalElectronicsMap::Helper::mapEId2tId-> Electronics channel " << fElectronicsId
191  << " already mapped to channel " << HcalGenericDetId(item.mId) << ". New value "
192  << HcalGenericDetId(fId) << " is ignored";
193  return false;
194  }
195  return true;
196 }
constexpr int32_t linearIndex() const
get a fast, compact, unique index for linear lookups
std::vector< HcalElectronicsMap::PrecisionItem > mPItems
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr uint32_t rawId() const
Log< level::Warning, false > LogWarning

◆ mapEId2tId()

bool HcalElectronicsMapAddons::Helper::mapEId2tId ( HcalElectronicsId  fElectronicsId,
HcalTrigTowerDetId  fTriggerId 
)

Definition at line 166 of file HcalElectronicsMap.cc.

References B2GTnPMonitor_cfi::item, HcalElectronicsId::linearIndex(), DetId::rawId(), and HcalElectronicsId::rawId().

Referenced by HcalDbASCIIIO::createObject< HcalElectronicsMap >(), HcalLogicalMap::generateHcalElectronicsMap(), and HcalDbHardcode::makeHardcodeMap().

166  {
168 
169  if (item.mElId == 0)
170  item.mElId = fElectronicsId.rawId();
171  if (item.mTrigId == 0) {
172  item.mTrigId = fTriggerId.rawId(); // just cast avoiding long machinery
173  } else if (item.mTrigId != fTriggerId.rawId()) {
174  edm::LogWarning("HCAL") << "HcalElectronicsMap::Helper::mapEId2tId-> Electronics channel " << fElectronicsId
175  << " already mapped to trigger channel " << (HcalTrigTowerDetId(item.mTrigId))
176  << ". New value " << fTriggerId << " is ignored";
177  return false;
178  }
179  return true;
180 }
std::vector< HcalElectronicsMap::TriggerItem > mTItems
constexpr int32_t linearIndex() const
get a fast, compact, unique index for linear lookups
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
constexpr uint32_t rawId() const
Log< level::Warning, false > LogWarning

Member Data Documentation

◆ mPItems

std::vector<HcalElectronicsMap::PrecisionItem> HcalElectronicsMapAddons::Helper::mPItems

Definition at line 144 of file HcalElectronicsMap.h.

◆ mTItems

std::vector<HcalElectronicsMap::TriggerItem> HcalElectronicsMapAddons::Helper::mTItems

Definition at line 145 of file HcalElectronicsMap.h.