CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
HcalCalibrationsSet.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") << "Unavailable HcalCalibrations for cell " << HcalGenericDetId(fId);
15  return cell->second.calib;
16 }
17 
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 }
28 
30 
31 std::vector<DetId> HcalCalibrationsSet::getAllChannels() const {
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 }
bool hcalEqualDetId(Item *cell, const DetId &fId)
std::vector< DetId > getAllChannels() const
DetId hcalTransformedId(const DetId &aid)
std::unordered_map< uint32_t, CalibSetObject > mItems
tuple result
Definition: mps_fire.py:311
Definition: DetId.h:17
const HcalCalibrations & getCalibrations(const DetId id) const
void setCalibrations(const DetId id, const HcalCalibrations &ca)
tmp
align.sh
Definition: createJobs.py:716