Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:11

0001 #include "CondFormats/HcalObjects/interface/HcalInterpolatedPulseColl.h"
0002 #include "CondFormats/HcalObjects/interface/HBHELinearMap.h"
0003 
0004 HcalInterpolatedPulseColl::HcalInterpolatedPulseColl(const std::vector<HcalInterpolatedPulse>& pulses,
0005                                                      const HBHEChannelGroups& groups)
0006     : pulses_(pulses), groups_(groups) {
0007   if (!(pulses_.size() == groups_.largestGroupNumber() + 1U))
0008     throw cms::Exception("Inconsistent arguments in HcalInterpolatedPulseColl constructor");
0009 }
0010 
0011 const HcalInterpolatedPulse& HcalInterpolatedPulseColl::getChannelPulse(const HcalDetId& id) const {
0012   // Figure out the group number for this channel
0013   const unsigned lindex = hbheChannelMap().linearIndex(id.depth(), id.ieta(), id.iphi());
0014   const unsigned grN = groups_.getGroup(lindex);
0015 
0016   // Return the pulse for this group
0017   return pulses_[grN];
0018 }