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 132 of file HcalElectronicsMap.h.

Constructor & Destructor Documentation

HcalElectronicsMapAddons::Helper::Helper ( )

Definition at line 161 of file HcalElectronicsMap.cc.

161  :
164 {}
std::vector< HcalElectronicsMap::TriggerItem > mTItems
std::vector< HcalElectronicsMap::PrecisionItem > mPItems
static const int maxLinearIndex

Member Function Documentation

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

Definition at line 181 of file HcalElectronicsMap.cc.

References HcalElectronicsId::linearIndex(), HcalElectronicsMap::PrecisionItem::mElId, HcalElectronicsMap::PrecisionItem::mId, mPItems, DetId::rawId(), and HcalElectronicsId::rawId().

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

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

Definition at line 166 of file HcalElectronicsMap.cc.

References HcalElectronicsId::linearIndex(), HcalElectronicsMap::TriggerItem::mElId, mTItems, HcalElectronicsMap::TriggerItem::mTrigId, DetId::rawId(), and HcalElectronicsId::rawId().

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

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

Member Data Documentation

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

Definition at line 139 of file HcalElectronicsMap.h.

Referenced by mapEId2chId(), and HcalElectronicsMap::sortById().

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

Definition at line 140 of file HcalElectronicsMap.h.

Referenced by mapEId2tId(), and HcalElectronicsMap::sortByTriggerId().