Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-09-21 02:12:21

0001 #include "DataFormats/PatCandidates/interface/PackedTriggerPrescales.h"
0002 #include "DataFormats/Common/interface/RefProd.h"
0003 
0004 pat::PackedTriggerPrescales::PackedTriggerPrescales(const edm::Handle<edm::TriggerResults> &handle)
0005     : prescaleValues_(), triggerResults_(edm::RefProd<edm::TriggerResults>(handle).refCore()), triggerNames_(nullptr) {
0006   prescaleValues_.resize(handle->size(), 0);
0007 }
0008 
0009 void pat::PackedTriggerPrescales::addPrescaledTrigger(int index, double prescale) {
0010   if (unsigned(index) >= triggerResults().size())
0011     throw cms::Exception("InvalidReference", "Index out of bounds");
0012   prescaleValues_[index] = prescale;
0013 }