CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
DetId hcalTransformedId(const DetId &aid)
std::vector< DetId > getAllChannels() const
tuple result
Definition: mps_fire.py:311
void setCalibrationWidths(const DetId id, const HcalCalibrationWidths &ca)
const HcalCalibrationWidths & getCalibrationWidths(const DetId id) const
Definition: DetId.h:17
std::unordered_map< uint32_t, CalibWidthSetObject > mItems
tmp
align.sh
Definition: createJobs.py:716