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.

29 { mItems.clear(); }

References mItems.

Referenced by BeautifulSoup.Tag::setString().

◆ getAllChannels()

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

Definition at line 31 of file HcalCalibrationsSet.cc.

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 }

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

◆ getCalibrations()

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

Definition at line 10 of file HcalCalibrationsSet.cc.

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 }

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

◆ setCalibrations()

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

Definition at line 18 of file HcalCalibrationsSet.cc.

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 }

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

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().

HcalGenericDetId
Definition: HcalGenericDetId.h:15
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
DetId
Definition: DetId.h:17
hcalTransformedId
DetId hcalTransformedId(const DetId &aid)
Definition: HcalDetIdRelationship.cc:11
hcalEqualDetId
bool hcalEqualDetId(Item *cell, const DetId &fId)
Definition: HcalDetIdRelationship.h:11
Exception
Definition: hltDiff.cc:246
ewkTauDQM_cfi.channels
channels
Definition: ewkTauDQM_cfi.py:14
mps_fire.result
result
Definition: mps_fire.py:311
HcalCalibrationsSet::mItems
std::unordered_map< uint32_t, CalibSetObject > mItems
Definition: HcalCalibrationsSet.h:34