HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
DiLeptonVetoProducers.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Kappa/DataFormats/interface/Kappa.h"
5 
6 #include "Artus/Core/interface/ProducerBase.h"
7 
8 #include <Math/VectorUtil.h>
9 
10 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
11 
12 
15 template<class TLepton>
16 class DiLeptonVetoProducerBase: public ProducerBase<HttTypes> {
17 public:
18 
19  DiLeptonVetoProducerBase(std::vector<TLepton*> product_type::*leptons,
20  float (setting_type::*GetDiLeptonMinDeltaRCut)(void) const,
21  int product_type::*nDiLeptonVetoPairsOS,
22  int product_type::*nDiLeptonVetoPairsSS) :
23  ProducerBase<HttTypes>(),
24  m_leptons(leptons),
25  GetDiLeptonMinDeltaRCut(GetDiLeptonMinDeltaRCut),
26  m_nDiLeptonVetoPairsOS(nDiLeptonVetoPairsOS),
27  m_nDiLeptonVetoPairsSS(nDiLeptonVetoPairsSS)
28  {
29  }
30 
31  virtual void Init(setting_type const& settings, metadata_type& metadata) override
32  {
33  ProducerBase<HttTypes>::Init(settings, metadata);
34 
35  }
36 
37  virtual void Produce(event_type const& event, product_type& product, setting_type const& settings, metadata_type const& metadata) const override
38  {
39  (product.*m_nDiLeptonVetoPairsOS) = 0;
40  (product.*m_nDiLeptonVetoPairsSS) = 0;
41 
42  for (typename std::vector<TLepton*>::const_iterator lepton1 = (product.*m_leptons).begin(); lepton1 != (product.*m_leptons).end(); ++lepton1)
43  {
44  for (typename std::vector<TLepton*>::const_iterator lepton2 = lepton1+1; lepton2 != (product.*m_leptons).end(); ++lepton2)
45  {
46 
47  if (((settings.*GetDiLeptonMinDeltaRCut)() < 0.0f) ||
48  (ROOT::Math::VectorUtil::DeltaR((*lepton1)->p4, (*lepton2)->p4) > (double)(settings.*GetDiLeptonMinDeltaRCut)()))
49  {
50  if ((*lepton1)->charge() * (*lepton2)->charge() < 0.0)
51  {
52  (product.*m_nDiLeptonVetoPairsOS) += 1;
53  }
54  else
55  {
56  (product.*m_nDiLeptonVetoPairsSS) += 1;
57  }
58  }
59  }
60  }
61  }
62 
63 
64 private:
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;
69 
70 };
71 
72 
78 public:
79 
80  virtual std::string GetProducerId() const override;
81 
83 
84  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
85 };
86 
87 
93 public:
94 
95  virtual std::string GetProducerId() const override;
96 
98 
99  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
100 };
101 
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
tuple f
Definition: convertEfficienciesToArtusRootInput.py:62
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