File indexing completed on 2024-04-06 12:12:16
0001
0002 #include "FWCore/Framework/src/TriggerResultInserter.h"
0003 #include "DataFormats/Common/interface/TriggerResults.h"
0004 #include "FWCore/Framework/interface/Event.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006
0007 #include <memory>
0008
0009 namespace edm {
0010 TriggerResultInserter::TriggerResultInserter(const ParameterSet& pset, unsigned int iNStreams)
0011 : resultsPerStream_(iNStreams), pset_id_(pset.id()), token_{produces()} {}
0012
0013 void TriggerResultInserter::setTrigResultForStream(unsigned int iStreamIndex, const TrigResPtr& trptr) {
0014 resultsPerStream_[iStreamIndex] = trptr;
0015 }
0016
0017 void TriggerResultInserter::produce(StreamID id, edm::Event& e, edm::EventSetup const&) const {
0018 e.emplace(token_, *resultsPerStream_[id.value()], pset_id_);
0019 }
0020 }