Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HLTFilter_h
0002 #define HLTFilter_h
0003 
0004 /** \class HLTFilter
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 HLTFilter class.
0009  *
0010  *
0011  *  \author Martin Grunewald
0012  *
0013  */
0014 
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/global/EDFilter.h"
0017 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0018 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0019 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
0020 
0021 #include <string>
0022 #include <utility>
0023 
0024 //
0025 // class decleration
0026 //
0027 
0028 class HLTFilter : public edm::global::EDFilter<> {
0029 public:
0030   explicit HLTFilter(const edm::ParameterSet& config);
0031   static void makeHLTFilterDescription(edm::ParameterSetDescription& desc);
0032   ~HLTFilter() override;
0033 
0034 private:
0035   bool filter(edm::StreamID, edm::Event& event, const edm::EventSetup& setup) const final;
0036 
0037   // declared pure virtual to enforce inheriting classes to implement it
0038   virtual bool hltFilter(edm::Event& event,
0039                          const edm::EventSetup& setup,
0040                          trigger::TriggerFilterObjectWithRefs& filterobject) const = 0;
0041 
0042 private:
0043   const bool saveTags_;
0044 
0045 public:
0046   bool saveTags() const { return saveTags_; }
0047 
0048 public:
0049   int path(edm::Event const&) const;
0050   int module(edm::Event const&) const;
0051   std::pair<int, int> pmid(edm::Event const&) const;
0052   const std::string* pathName(edm::Event const&) const;
0053   const std::string* moduleLabel() const;
0054 };
0055 
0056 #endif  // HLTFilter_h