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.

References mItems.

30 { mItems.clear(); }
std::unordered_map< uint32_t, CalibWidthSetObject > mItems

◆ getAllChannels()

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

Definition at line 32 of file HcalCalibrationWidthsSet.cc.

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

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 }
std::unordered_map< uint32_t, CalibWidthSetObject > mItems
tmp
align.sh
Definition: createJobs.py:716

◆ getCalibrationWidths()

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

Definition at line 10 of file HcalCalibrationWidthsSet.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")
15  << "Unavailable HcalCalibrationWidths for cell " << HcalGenericDetId(fId);
16  return cell->second.calib;
17 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
DetId hcalTransformedId(const DetId &aid)
Definition: DetId.h:17
std::unordered_map< uint32_t, CalibWidthSetObject > mItems

◆ setCalibrationWidths()

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

Definition at line 19 of file HcalCalibrationWidthsSet.cc.

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

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 }
DetId hcalTransformedId(const DetId &aid)
Definition: DetId.h:17
std::unordered_map< uint32_t, CalibWidthSetObject > mItems

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