Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:11

0001 #ifndef CALIBFORMATS_HCALOBJECTS_HCALCALIBRATIONSSET_H
0002 #define CALIBFORMATS_HCALOBJECTS_HCALCALIBRATIONSSET_H 1
0003 
0004 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
0005 #include "CondFormats/HcalObjects/interface/HcalDetIdRelationship.h"
0006 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0007 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
0008 #include <vector>
0009 #include <unordered_map>
0010 #include <cstdint>
0011 
0012 /** \class HcalCalibrationsSet
0013   *  
0014   * \author J. Mans - Minnesota
0015   */
0016 class HcalCalibrationsSet {
0017 public:
0018   HcalCalibrationsSet();
0019   const HcalCalibrations& getCalibrations(const DetId id) const;
0020   void setCalibrations(const DetId id, const HcalCalibrations& ca);
0021   void clear();
0022   std::vector<DetId> getAllChannels() const;
0023 
0024 private:
0025   struct CalibSetObject {
0026     CalibSetObject(const DetId& aid) { id = hcalTransformedId(aid); }
0027     DetId id;
0028     HcalCalibrations calib;
0029     bool operator<(const CalibSetObject& cso) const { return id < cso.id; }
0030     bool operator==(const CalibSetObject& cso) const { return id == cso.id; }
0031   };
0032   typedef CalibSetObject Item;
0033   HcalCalibrations dummy;
0034   std::unordered_map<uint32_t, CalibSetObject> mItems;
0035 };
0036 
0037 #endif