Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HLTGenericFilter_h
0002 #define HLTGenericFilter_h
0003 
0004 /** \class HLTGenericFilter
0005  *
0006  *  \author Roberto Covarelli (CERN)
0007  *
0008  */
0009 
0010 #include "HLTrigger/HLTcore/interface/HLTFilter.h"
0011 
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "FWCore/PluginManager/interface/ModuleDef.h"
0014 
0015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0016 
0017 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidate.h"
0018 #include "DataFormats/RecoCandidate/interface/RecoEcalCandidateIsolation.h"
0019 
0020 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
0021 #include "DataFormats/RecoCandidate/interface/RecoChargedCandidateIsolation.h"
0022 
0023 #include "DataFormats/HLTReco/interface/TriggerFilterObjectWithRefs.h"
0024 
0025 namespace edm {
0026   class ConfigurationDescriptions;
0027 }
0028 
0029 //
0030 // class declaration
0031 //
0032 
0033 template <typename T1>
0034 class HLTGenericFilter : public HLTFilter {
0035   typedef std::vector<T1> T1Collection;
0036   typedef edm::Ref<T1Collection> T1Ref;
0037   typedef edm::AssociationMap<edm::OneToValue<std::vector<T1>, float> > T1IsolationMap;
0038 
0039 public:
0040   explicit HLTGenericFilter(const edm::ParameterSet&);
0041   ~HLTGenericFilter() override;
0042   bool hltFilter(edm::Event&,
0043                  const edm::EventSetup&,
0044                  trigger::TriggerFilterObjectWithRefs& filterproduct) const override;
0045   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0046 
0047 private:
0048   float getEnergy(T1Ref) const;
0049   float getEt(T1Ref) const;
0050 
0051   edm::InputTag candTag_;  // input tag identifying product that contains filtered candidates
0052   edm::InputTag varTag_;   // input tag identifying product that contains variable map
0053   edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> candToken_;
0054   edm::EDGetTokenT<T1IsolationMap> varToken_;
0055 
0056   std::vector<double> energyLowEdges_;  // lower bin edges for energy-dependent cuts
0057   bool lessThan_;                       // the cut is "<" or ">" ?
0058   bool useEt_;                          // use E or Et in relative isolation cuts
0059   bool useAbs_;                         // use the standard abs of the variable (before any rho corr)
0060   std::vector<double> thrRegularEB_;    // threshold for regular cut (x < thr) - ECAL barrel
0061   std::vector<double> thrRegularEE_;    // threshold for regular cut (x < thr) - ECAL endcap
0062   std::vector<double> thrOverEEB_;      // threshold for x/E < thr cut (isolations) - ECAL barrel
0063   std::vector<double> thrOverEEE_;      // threshold for x/E < thr cut (isolations) - ECAL endcap
0064   std::vector<double> thrOverE2EB_;     // threshold for x/E^2 < thr cut (isolations) - ECAL barrel
0065   std::vector<double> thrOverE2EE_;     // threshold for x/E^2 < thr cut (isolations) - ECAL endcap
0066   int ncandcut_;                        // number of candidates required
0067 
0068   edm::InputTag l1EGTag_;
0069 
0070   edm::InputTag rhoTag_;  // input tag identifying rho producer
0071   edm::EDGetTokenT<double> rhoToken_;
0072   bool doRhoCorrection_;
0073   double rhoMax_;
0074   double rhoScale_;
0075   std::vector<double> effectiveAreas_;
0076   std::vector<double> absEtaLowEdges_;
0077 };
0078 
0079 #endif  //HLTGenericFilter_h