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 ( )

Member Function Documentation

◆ mapEId2chId()

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

Definition at line 182 of file HcalElectronicsMap.cc.

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 }

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

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

◆ mapEId2tId()

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

Definition at line 166 of file HcalElectronicsMap.cc.

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 }

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

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

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.

HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalElectronicsMapAddons::Helper::mTItems
std::vector< HcalElectronicsMap::TriggerItem > mTItems
Definition: HcalElectronicsMap.h:145
edm::LogWarning
Definition: MessageLogger.h:141
HcalElectronicsMap::TriggerItem
Definition: HcalElectronicsMap.h:43
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
HcalElectronicsId::maxLinearIndex
static const int maxLinearIndex
Definition: HcalElectronicsId.h:115
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
HcalElectronicsId::linearIndex
constexpr int linearIndex() const
get a fast, compact, unique index for linear lookups
Definition: HcalElectronicsId.h:111
HcalElectronicsId::rawId
constexpr uint32_t rawId() const
Definition: HcalElectronicsId.h:59
HcalElectronicsMapAddons::Helper::mPItems
std::vector< HcalElectronicsMap::PrecisionItem > mPItems
Definition: HcalElectronicsMap.h:144
HcalElectronicsMap::PrecisionItem
Definition: HcalElectronicsMap.h:33
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14