CMS 3D CMS Logo

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

#include <HcalDcsMap.h>

Public Member Functions

 Helper ()
 
bool mapGeomId2DcsId (HcalDetId fId, HcalDcsDetId fDcsId)
 

Public Attributes

std::set< HcalDcsMap::Item, LessByDcsIdmItems
 

Detailed Description

Definition at line 144 of file HcalDcsMap.h.

Constructor & Destructor Documentation

◆ Helper()

HcalDcsMapAddons::Helper::Helper ( )

Definition at line 141 of file HcalDcsMap.cc.

141 {}

Member Function Documentation

◆ mapGeomId2DcsId()

bool HcalDcsMapAddons::Helper::mapGeomId2DcsId ( HcalDetId  fId,
HcalDcsDetId  fDcsId 
)

Definition at line 143 of file HcalDcsMap.cc.

References HcalDcsDetId::DCSUNKNOWN, HcalDcsMap::mItems, HcalDcsDetId::ring(), HcalDcsDetId::slice(), HcalDcsDetId::subchannel(), HcalOtherDetId::subdet(), and filterCSVwithJSON::target.

Referenced by HcalDbASCIIIO::createObject< HcalDcsMap >(), and HcalDbHardcode::makeHardcodeDcsMap().

143  {
144  // DCS type is a part of DcsDetId but it does not make sense to keep
145  // duplicate records in the map for DCS channels where only type is different.
146  // Hence, the type in HcalDcsDetId is always forced to DCSUNKNOWN
147  HcalDcsDetId fDcsId_notype(fDcsId.subdet(),
148  fDcsId.ring(), // side is included
149  fDcsId.slice(),
151  fDcsId.subchannel());
152  HcalDcsMap::Item target(fId, fDcsId_notype);
153  auto iter = mItems.find(target);
154  if (iter != mItems.end() and iter->mId == static_cast<uint32_t>(fId)) {
155  edm::LogWarning("HCAL") << "HcalDcsMap::mapGeomId2DcsId-> Geom channel " << fId << " already mapped to DCS channel "
156  << fDcsId_notype;
157  return false; // element already exists
158  }
159  mItems.insert(target);
160 
161  return true;
162 }
std::set< HcalDcsMap::Item, LessByDcsId > mItems
Definition: HcalDcsMap.h:154
int slice() const
Definition: HcalDcsDetId.h:56
int ring() const
Definition: HcalDcsDetId.h:55
int subchannel() const
Definition: HcalDcsDetId.h:58
Log< level::Warning, false > LogWarning
HcalOtherSubdetector subdet() const
get the category

Member Data Documentation

◆ mItems

std::set<HcalDcsMap::Item, LessByDcsId> HcalDcsMapAddons::Helper::mItems

Definition at line 154 of file HcalDcsMap.h.