Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 11:09:22

0001 #ifndef HLTStreamFilter_h
0002 #define HLTStreamFilter_h
0003 
0004 /** \class HLTStreamFilter
0005  *
0006  *
0007  *  This class derives from EDFilter and adds a few HLT specific items.
0008  *  All HLT filters that wish to save summary objects for the AOD must derive from the HLTStreamFilter class.
0009  *
0010  *
0011  *  \author Martin Grunewald
0012  *
0013  */
0014 
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/stream/EDFilter.h"
0017 #include "FWCore/Utilities/interface/StreamID.h"
0018 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0019 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0020 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
0021 
0022 #include <string>
0023 #include <utility>
0024 
0025 //
0026 // class decleration
0027 //
0028 
0029 class HLTStreamFilter : public edm::stream::EDFilter<> {
0030 public:
0031   explicit HLTStreamFilter(const edm::ParameterSet& config);
0032   static void makeHLTFilterDescription(edm::ParameterSetDescription& desc);
0033   ~HLTStreamFilter() override;
0034 
0035 private:
0036   bool filter(edm::Event& event, const edm::EventSetup& setup) final;
0037 
0038   // declared pure virtual to enforce inheriting classes to implement it
0039   virtual bool hltFilter(edm::Event& event,
0040                          const edm::EventSetup& setup,
0041                          trigger::TriggerFilterObjectWithRefs& filterobject) = 0;
0042 
0043 private:
0044   const bool saveTags_;
0045 
0046 public:
0047   bool saveTags() const { return saveTags_; }
0048 
0049 public:
0050   int path(edm::Event const&) const;
0051   int module(edm::Event const&) const;
0052   std::pair<int, int> pmid(edm::Event const&) const;
0053   const std::string* pathName(edm::Event const&) const;
0054   const std::string* moduleLabel() const;
0055 };
0056 
0057 #endif  // HLTStreamFilter_h