Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:28

0001 #ifndef HLTSmartSinglet_h
0002 #define HLTSmartSinglet_h
0003 
0004 /** \class HLTSmartSinglet
0005  *
0006  *
0007  *  This class is an HLTFilter (-> EDFilter) implementing a smart HLT
0008  *  trigger cut, specified as a string such as "pt>15 && -3<eta<3",
0009  *  for single objects of the same physics type, allowing to cut on
0010  *  variables relating to both the base class T and the derived actual
0011  *  class
0012  *
0013  *
0014  *  \author Martin Grunewald
0015  *
0016  */
0017 
0018 #include "HLTrigger/HLTcore/interface/HLTFilter.h"
0019 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0020 #include <vector>
0021 
0022 #include "CommonTools/Utils/interface/StringCutObjectSelector.h"
0023 #include <string>
0024 
0025 //
0026 // class declaration
0027 //
0028 
0029 template <typename T>
0030 class HLTSmartSinglet : public HLTFilter {
0031 public:
0032   explicit HLTSmartSinglet(const edm::ParameterSet&);
0033   ~HLTSmartSinglet() override;
0034   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0035   bool hltFilter(edm::Event&,
0036                  const edm::EventSetup&,
0037                  trigger::TriggerFilterObjectWithRefs& filterproduct) const override;
0038 
0039 private:
0040   edm::InputTag inputTag_;                        // input tag identifying product
0041   edm::EDGetTokenT<std::vector<T> > inputToken_;  // token identifying product
0042   int triggerType_;                               // triggerType
0043   std::string cut_;                               // smart cut
0044   int min_N_;                                     // number of objects passing cuts required
0045 
0046   StringCutObjectSelector<T, true> select_;  // smart selector
0047 };
0048 
0049 #endif  //HLTSmartSinglet_h