4 #include "Kappa/DataFormats/interface/Kappa.h"
6 #include "Artus/Core/interface/ProducerBase.h"
8 #include <Math/VectorUtil.h>
10 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
15 template<
class TLepton>
20 float (setting_type::*GetDiLeptonMinDeltaRCut)(
void)
const,
21 int product_type::*nDiLeptonVetoPairsOS,
22 int product_type::*nDiLeptonVetoPairsSS) :
25 GetDiLeptonMinDeltaRCut(GetDiLeptonMinDeltaRCut),
26 m_nDiLeptonVetoPairsOS(nDiLeptonVetoPairsOS),
27 m_nDiLeptonVetoPairsSS(nDiLeptonVetoPairsSS)
31 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override
33 ProducerBase<HttTypes>::Init(settings, metadata);
37 virtual void Produce(event_type
const& event, product_type& product, setting_type
const& settings, metadata_type
const& metadata)
const override
39 (product.*m_nDiLeptonVetoPairsOS) = 0;
40 (product.*m_nDiLeptonVetoPairsSS) = 0;
42 for (
typename std::vector<TLepton*>::const_iterator lepton1 = (product.*m_leptons).begin(); lepton1 != (product.*m_leptons).end(); ++lepton1)
44 for (
typename std::vector<TLepton*>::const_iterator lepton2 = lepton1+1; lepton2 != (product.*m_leptons).end(); ++lepton2)
47 if (((settings.*GetDiLeptonMinDeltaRCut)() < 0.0
f) ||
48 (ROOT::Math::VectorUtil::DeltaR((*lepton1)->p4, (*lepton2)->p4) > (double)(settings.*GetDiLeptonMinDeltaRCut)()))
50 if ((*lepton1)->charge() * (*lepton2)->charge() < 0.0)
52 (product.*m_nDiLeptonVetoPairsOS) += 1;
56 (product.*m_nDiLeptonVetoPairsSS) += 1;
65 std::vector<TLepton*> product_type::*m_leptons;
66 float (setting_type::*GetDiLeptonMinDeltaRCut)(void)
const;
67 int product_type::*m_nDiLeptonVetoPairsOS;
68 int product_type::*m_nDiLeptonVetoPairsSS;
84 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override;
99 virtual void Init(setting_type
const& settings, metadata_type& metadata)
override;
Definition: DiLeptonVetoProducers.h:77
Definition: DiLeptonVetoProducers.h:16
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DiLeptonVetoProducers.cc:47
DiVetoMuonVetoProducer()
Definition: DiLeptonVetoProducers.cc:39
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DiLeptonVetoProducers.cc:20
DiLeptonVetoProducerBase(std::vector< TLepton * > product_type::*leptons, float(setting_type::*GetDiLeptonMinDeltaRCut)(void) const, int product_type::*nDiLeptonVetoPairsOS, int product_type::*nDiLeptonVetoPairsSS)
Definition: DiLeptonVetoProducers.h:19
virtual std::string GetProducerId() const override
Definition: DiLeptonVetoProducers.cc:7
virtual std::string GetProducerId() const override
Definition: DiLeptonVetoProducers.cc:34
all data types which are used for Htt analyses
Definition: HttTypes.h:27
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DiLeptonVetoProducers.h:31
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: DiLeptonVetoProducers.h:37
Definition: DiLeptonVetoProducers.h:92
DiVetoElectronVetoProducer()
Definition: DiLeptonVetoProducers.cc:12