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 161 of file HcalDcsMap.h.

Constructor & Destructor Documentation

HcalDcsMapAddons::Helper::Helper ( )

Definition at line 156 of file HcalDcsMap.cc.

157 {
158 }

Member Function Documentation

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

Definition at line 160 of file HcalDcsMap.cc.

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

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

160  {
161  // DCS type is a part of DcsDetId but it does not make sense to keep
162  // duplicate records in the map for DCS channels where only type is different.
163  // Hence, the type in HcalDcsDetId is always forced to DCSUNKNOWN
164  HcalDcsDetId fDcsId_notype(fDcsId.subdet(),
165  fDcsId.ring(), // side is included
166  fDcsId.slice(),
168  fDcsId.subchannel());
169  HcalDcsMap::Item target(fId, fDcsId_notype);
170  auto iter = mItems.find(target);
171  if(iter != mItems.end() and iter->mId == fId){
172  edm::LogWarning("HCAL") << "HcalDcsMap::mapGeomId2DcsId-> Geom channel " << fId
173  << " already mapped to DCS channel " << fDcsId_notype;
174  return false; // element already exists
175  }
176  mItems.insert(target);
177 
178  return true;
179 }
int subchannel() const
Definition: HcalDcsDetId.h:49
HcalOtherSubdetector subdet() const
get the category
int slice() const
Definition: HcalDcsDetId.h:47
int ring() const
Definition: HcalDcsDetId.h:46
std::set< HcalDcsMap::Item, LessByDcsId > mItems
Definition: HcalDcsMap.h:171

Member Data Documentation

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

Definition at line 171 of file HcalDcsMap.h.