Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:16

0001 #ifndef FWCore_Framework_TriggerResultsInserter_h
0002 #define FWCore_Framework_TriggerResultsInserter_h
0003 
0004 /*
0005   Author: Jim Kowalkowski 15-1-06
0006 
0007   This is an unusual module in that it is always present in the
0008   schedule and it is not configurable.
0009   The ownership of the bitmask is shared with the scheduler
0010   Its purpose is to create a TriggerResults instance and insert it into
0011   the event.
0012 
0013 */
0014 
0015 #include <vector>
0016 
0017 #include "FWCore/Framework/interface/global/EDProducer.h"
0018 #include "DataFormats/Provenance/interface/ParameterSetID.h"
0019 #include "FWCore/Utilities/interface/propagate_const.h"
0020 
0021 #include <memory>
0022 
0023 namespace edm {
0024   class ParameterSet;
0025   class Event;
0026   class EventSetup;
0027   class HLTGlobalStatus;
0028   class TriggerResults;
0029 
0030   class TriggerResultInserter : public edm::global::EDProducer<> {
0031   public:
0032     typedef std::shared_ptr<HLTGlobalStatus> TrigResPtr;
0033 
0034     // standard constructor not supported for this module
0035     explicit TriggerResultInserter(edm::ParameterSet const& ps);
0036 
0037     // the pset needed here is the one that defines the trigger path names
0038     TriggerResultInserter(edm::ParameterSet const& ps, unsigned int iNStreams);
0039 
0040     void setTrigResultForStream(unsigned int iStreamIndex, const TrigResPtr& trptr);
0041     void produce(StreamID id, edm::Event& e, edm::EventSetup const& c) const final;
0042 
0043   private:
0044     std::vector<edm::propagate_const<TrigResPtr>> resultsPerStream_;
0045 
0046     ParameterSetID pset_id_;
0047     EDPutTokenT<TriggerResults> token_;
0048   };
0049 }  // namespace edm
0050 #endif