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.

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 == 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 }

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

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

Member Data Documentation

◆ mItems

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

Definition at line 154 of file HcalDcsMap.h.

HcalDcsDetId::DCSUNKNOWN
Definition: HcalDcsDetId.h:42
HcalDcsDetId
Definition: HcalDcsDetId.h:27
HcalDcsDetId::ring
int ring() const
Definition: HcalDcsDetId.h:55
HcalDcsMapAddons::Helper::mItems
std::set< HcalDcsMap::Item, LessByDcsId > mItems
Definition: HcalDcsMap.h:154
edm::LogWarning
Definition: MessageLogger.h:141
HcalDcsDetId::subchannel
int subchannel() const
Definition: HcalDcsDetId.h:58
HcalDcsDetId::slice
int slice() const
Definition: HcalDcsDetId.h:56
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
HcalOtherDetId::subdet
HcalOtherSubdetector subdet() const
get the category
Definition: HcalOtherDetId.h:30
HcalDcsMap::Item
Definition: HcalDcsMap.h:36