Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:13

0001 #ifndef CondFormats_HcalObjects_HcalInterpolatedPulseColl_h_
0002 #define CondFormats_HcalObjects_HcalInterpolatedPulseColl_h_
0003 
0004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0005 #include "CondFormats/HcalObjects/interface/HcalInterpolatedPulse.h"
0006 #include "CondFormats/HcalObjects/interface/HBHEChannelGroups.h"
0007 
0008 class HcalInterpolatedPulseColl {
0009 public:
0010   HcalInterpolatedPulseColl(const std::vector<HcalInterpolatedPulse>& pulses, const HBHEChannelGroups& groups);
0011 
0012   // Get the pulse from channel HcalDetId
0013   const HcalInterpolatedPulse& getChannelPulse(const HcalDetId& id) const;
0014 
0015   // Get the pulse by linearized HCAL channel number
0016   inline const HcalInterpolatedPulse& getChannelPulse(const unsigned i) const { return pulses_[groups_.getGroup(i)]; }
0017 
0018   inline bool operator==(const HcalInterpolatedPulseColl& r) { return pulses_ == r.pulses_ && groups_ == r.groups_; }
0019 
0020   inline bool operator!=(const HcalInterpolatedPulseColl& r) { return !(*this == r); }
0021 
0022 private:
0023   std::vector<HcalInterpolatedPulse> pulses_;
0024   HBHEChannelGroups groups_;
0025 
0026 public:
0027   // Default constructor needed for serialization.
0028   // Do not use in application code.
0029   inline HcalInterpolatedPulseColl() {}
0030 
0031 private:
0032   friend class boost::serialization::access;
0033 
0034   template <class Archive>
0035   inline void serialize(Archive& ar, unsigned /* version */) {
0036     ar& pulses_& groups_;
0037   }
0038 };
0039 
0040 BOOST_CLASS_VERSION(HcalInterpolatedPulseColl, 1)
0041 
0042 #endif  // CondFormats_HcalObjects_HcalInterpolatedPulseColl_h_