File indexing completed on 2024-04-06 12:02:15
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
0013 const unsigned lindex = hbheChannelMap().linearIndex(id.depth(), id.ieta(), id.iphi());
0014 const unsigned grN = groups_.getGroup(lindex);
0015
0016
0017 return pulses_[grN];
0018 }