CMS 3D CMS Logo

HcalCalibrationWidthsSet.cc
Go to the documentation of this file.
4 #include <algorithm>
5 #include <iostream>
6 #include <utility>
7 
9 
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 }
18 
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 }
29 
31 
32 std::vector<DetId> HcalCalibrationWidthsSet::getAllChannels() const {
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 }
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalGenericDetId.h
HcalCalibrationWidthsSet::getCalibrationWidths
const HcalCalibrationWidths & getCalibrationWidths(const DetId id) const
Definition: HcalCalibrationWidthsSet.cc:10
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
HcalCalibrationWidthsSet::getAllChannels
std::vector< DetId > getAllChannels() const
Definition: HcalCalibrationWidthsSet.cc:32
DetId
Definition: DetId.h:17
HcalCalibrationWidthsSet::HcalCalibrationWidthsSet
HcalCalibrationWidthsSet()
Definition: HcalCalibrationWidthsSet.cc:8
hcalTransformedId
DetId hcalTransformedId(const DetId &aid)
Definition: HcalDetIdRelationship.cc:11
HcalCalibrationWidthsSet::mItems
std::unordered_map< uint32_t, CalibWidthSetObject > mItems
Definition: HcalCalibrationWidthsSet.h:34
HcalCalibrationWidthsSet.h
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
Exception.h
mps_fire.result
result
Definition: mps_fire.py:311
HcalCalibrationWidths
Definition: HcalCalibrationWidths.h:9
HcalCalibrationWidthsSet::clear
void clear()
Definition: HcalCalibrationWidthsSet.cc:30
HcalCalibrationWidthsSet::setCalibrationWidths
void setCalibrationWidths(const DetId id, const HcalCalibrationWidths &ca)
Definition: HcalCalibrationWidthsSet.cc:19