4 #include <boost/algorithm/string.hpp>
5 #include <boost/algorithm/string/trim.hpp>
7 #include "Kappa/DataFormats/interface/Kappa.h"
9 #include "Artus/Core/interface/FilterBase.h"
11 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
12 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttEnumTypes.h"
17 template<
class TLepton>
39 std::string (setting_type::*GetDiLeptonVetoMode)(
void)
const) :
41 GetDiLeptonVetoMode(GetDiLeptonVetoMode)
45 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
47 FilterBase<HttTypes>::Init(settings, metadata);
49 vetoMode =
ToVetoMode(boost::algorithm::to_lower_copy(boost::algorithm::trim_copy((settings.*GetDiLeptonVetoMode)())));
52 virtual bool DoesEventPass(event_type
const& event, product_type
const& product,
53 setting_type
const& settings, metadata_type
const& metadata)
const override
59 ((product.*m_leptons).size() < 2))
68 for (
typename std::vector<TLepton*>::const_iterator lepton = (product.*m_leptons).begin();
69 lepton != (product.*m_leptons).end(); ++lepton)
71 if ((
int)((*lepton)->charge()) > 0)
81 ((nPosLeptons > 0) && (nNegLeptons > 0))
87 ((nPosLeptons > 1) || (nNegLeptons > 1))
103 std::vector<TLepton*> product_type::*m_leptons;
104 std::string (setting_type::*GetDiLeptonVetoMode)(void)
const;
119 return "DiVetoElectronVetoFilter";
134 return "DiVetoMuonVetoFilter";
virtual bool DoesEventPass(event_type const &event, product_type const &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: DiLeptonVetoFilters.h:52
DiVetoElectronVetoFilter()
Definition: DiLeptonVetoFilters.cc:5
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DiLeptonVetoFilters.h:45
Definition: DiLeptonVetoFilters.h:115
VetoMode
Definition: DiLeptonVetoFilters.h:21
virtual std::string GetFilterId() const override
Definition: DiLeptonVetoFilters.h:133
virtual std::string GetFilterId() const override
Definition: DiLeptonVetoFilters.h:118
Definition: DiLeptonVetoFilters.h:130
DiVetoMuonVetoFilter()
Definition: DiLeptonVetoFilters.cc:11
Definition: DiLeptonVetoFilters.h:18
static VetoMode ToVetoMode(std::string const &vetoMode)
Definition: DiLeptonVetoFilters.h:29
DiLeptonVetoFilterBase(std::vector< TLepton * > product_type::*leptons, std::string(setting_type::*GetDiLeptonVetoMode)(void) const)
Definition: DiLeptonVetoFilters.h:38