CMS 3D CMS Logo

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

#include <HcalCalibrationWidthsSet.h>

Classes

struct  CalibWidthSetObject
 

Public Member Functions

void clear ()
 
std::vector< DetIdgetAllChannels () const
 
const HcalCalibrationWidthsgetCalibrationWidths (const DetId id) const
 
 HcalCalibrationWidthsSet ()
 
void setCalibrationWidths (const DetId id, const HcalCalibrationWidths &ca)
 

Private Types

typedef CalibWidthSetObject Item
 

Private Attributes

HcalCalibrationWidths dummy
 
std::unordered_map< uint32_t, CalibWidthSetObjectmItems
 

Detailed Description

Author
R.Ofierzynski

Definition at line 16 of file HcalCalibrationWidthsSet.h.

Member Typedef Documentation

◆ Item

Definition at line 32 of file HcalCalibrationWidthsSet.h.

Constructor & Destructor Documentation

◆ HcalCalibrationWidthsSet()

HcalCalibrationWidthsSet::HcalCalibrationWidthsSet ( )

Definition at line 8 of file HcalCalibrationWidthsSet.cc.

8 {}

Member Function Documentation

◆ clear()

void HcalCalibrationWidthsSet::clear ( )

Definition at line 30 of file HcalCalibrationWidthsSet.cc.

30 { mItems.clear(); }

References mItems.

Referenced by BeautifulSoup.Tag::setString().

◆ getAllChannels()

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

Definition at line 32 of file HcalCalibrationWidthsSet.cc.

32  {
33  std::vector<DetId> channels;
34  channels.reserve(mItems.size());
35  for (const auto& tmp : mItems) {
36  channels.push_back(tmp.second.id);
37  }
38  return channels;
39 }

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

◆ getCalibrationWidths()

const HcalCalibrationWidths & HcalCalibrationWidthsSet::getCalibrationWidths ( const DetId  id) const

Definition at line 10 of file HcalCalibrationWidthsSet.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")
15  << "Unavailable HcalCalibrationWidths for cell " << HcalGenericDetId(fId);
16  return cell->second.calib;
17 }

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

◆ setCalibrationWidths()

void HcalCalibrationWidthsSet::setCalibrationWidths ( const DetId  id,
const HcalCalibrationWidths ca 
)

Definition at line 19 of file HcalCalibrationWidthsSet.cc.

19  {
20  DetId fId2(hcalTransformedId(fId));
21  auto cell = mItems.find(fId2);
22  if (cell == mItems.end()) {
23  auto result = mItems.emplace(fId2, fId2);
24  result.first->second.calib = ca;
25  return;
26  }
27  cell->second.calib = ca;
28 }

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

Member Data Documentation

◆ dummy

HcalCalibrationWidths HcalCalibrationWidthsSet::dummy
private

Definition at line 33 of file HcalCalibrationWidthsSet.h.

◆ mItems

std::unordered_map<uint32_t, CalibWidthSetObject> HcalCalibrationWidthsSet::mItems
private
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
HcalCalibrationWidthsSet::mItems
std::unordered_map< uint32_t, CalibWidthSetObject > mItems
Definition: HcalCalibrationWidthsSet.h:34
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