CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Attributes
HcalCalibrationsSet Class Reference

#include <HcalCalibrationsSet.h>

Classes

struct  CalibSetObject
 

Public Member Functions

void clear ()
 
std::vector< DetIdgetAllChannels () const
 
const HcalCalibrationsgetCalibrations (const DetId id) const
 
 HcalCalibrationsSet ()
 
void setCalibrations (const DetId id, const HcalCalibrations &ca)
 

Private Types

typedef CalibSetObject Item
 

Private Attributes

HcalCalibrations dummy
 
std::unordered_map< uint32_t, CalibSetObjectmItems
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 16 of file HcalCalibrationsSet.h.

Member Typedef Documentation

◆ Item

Definition at line 32 of file HcalCalibrationsSet.h.

Constructor & Destructor Documentation

◆ HcalCalibrationsSet()

HcalCalibrationsSet::HcalCalibrationsSet ( )

Definition at line 8 of file HcalCalibrationsSet.cc.

8 {}

Member Function Documentation

◆ clear()

void HcalCalibrationsSet::clear ( )

Definition at line 29 of file HcalCalibrationsSet.cc.

References mItems.

Referenced by BeautifulSoup.Tag::setString().

29 { mItems.clear(); }
std::unordered_map< uint32_t, CalibSetObject > mItems

◆ getAllChannels()

std::vector< DetId > HcalCalibrationsSet::getAllChannels ( ) const

Definition at line 31 of file HcalCalibrationsSet.cc.

References ewkTauDQM_cfi::channels, mItems, and createJobs::tmp.

31  {
32  std::vector<DetId> channels;
33  channels.reserve(mItems.size());
34  for (const auto& tmp : mItems) {
35  channels.push_back(tmp.second.id);
36  }
37  return channels;
38 }
std::unordered_map< uint32_t, CalibSetObject > mItems
tmp
align.sh
Definition: createJobs.py:716

◆ getCalibrations()

const HcalCalibrations & HcalCalibrationsSet::getCalibrations ( const DetId  id) const

Definition at line 10 of file HcalCalibrationsSet.cc.

References Exception, hcalEqualDetId(), hcalTransformedId(), and mItems.

10  {
11  DetId fId2(hcalTransformedId(fId));
12  auto cell = mItems.find(fId2);
13  if ((cell == mItems.end()) || (!hcalEqualDetId(cell->first, fId2)))
14  throw cms::Exception("Conditions not found") << "Unavailable HcalCalibrations for cell " << HcalGenericDetId(fId);
15  return cell->second.calib;
16 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
DetId hcalTransformedId(const DetId &aid)
std::unordered_map< uint32_t, CalibSetObject > mItems
Definition: DetId.h:17

◆ setCalibrations()

void HcalCalibrationsSet::setCalibrations ( const DetId  id,
const HcalCalibrations ca 
)

Definition at line 18 of file HcalCalibrationsSet.cc.

References hcalTransformedId(), mItems, and mps_fire::result.

18  {
19  DetId fId2(hcalTransformedId(fId));
20  auto cell = mItems.find(fId2);
21  if (cell == mItems.end()) {
22  auto result = mItems.emplace(fId2, fId2);
23  result.first->second.calib = ca;
24  return;
25  }
26  cell->second.calib = ca;
27 }
DetId hcalTransformedId(const DetId &aid)
std::unordered_map< uint32_t, CalibSetObject > mItems
Definition: DetId.h:17

Member Data Documentation

◆ dummy

HcalCalibrations HcalCalibrationsSet::dummy
private

Definition at line 33 of file HcalCalibrationsSet.h.

◆ mItems

std::unordered_map<uint32_t, CalibSetObject> HcalCalibrationsSet::mItems
private

Definition at line 34 of file HcalCalibrationsSet.h.

Referenced by clear(), getAllChannels(), getCalibrations(), and setCalibrations().