HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
HttValidGenTausProducer.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
5 #include "Artus/Utility/interface/Utility.h"
6 #include <Math/VectorUtil.h>
7 
13 class HttValidGenTausProducer: public ProducerBase<HttTypes>
14 {
15 
16 public:
17 
18  virtual std::string GetProducerId() const override
19  {
20  return "HttValidGenTausProducer";
21  }
22 
23  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
24  virtual void Produce(event_type const& event, product_type& product,
25  setting_type const& settings, metadata_type const& metadata) const override;
26 
27  template <typename T>
28  bool DoesGenRecoMatch(std::vector<T> const recoTaus, std::vector<KGenTau*> const genTaus) const
29  {
30  if (recoTaus.size() != genTaus.size())
31  return false;
32 
33  for (unsigned int i = 0; i < recoTaus.size(); i++)
34  {
35  float deltaR = ROOT::Math::VectorUtil::DeltaR(recoTaus.at(i)->p4, genTaus.at(i)->visible.p4);
36  if (deltaR > m_deltaR)
37  return false;
38  }
39  return true;
40  }
41 
42 private:
43  double m_deltaR;
44  bool m_validateMatching;
45  bool m_swapIfNecessary;
46  void ValidateMatching(event_type const& event, product_type& product,
47  setting_type const& settings, metadata_type const& metadata) const;
48  void SortVectors(event_type const& event, product_type& product,
49  setting_type const& settings, metadata_type const& metadata) const;
50  void CopyVectors(event_type const& event, product_type& product,
51  setting_type const& settings, metadata_type const& metadata) const;
52 
53 };
54 
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: HttValidGenTausProducer.cc:5
Fill lists of generator taus in compareable to the Lists of reconstructed particles This producer nee...
Definition: HttValidGenTausProducer.h:13
virtual std::string GetProducerId() const override
Definition: HttValidGenTausProducer.h:18
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: HttValidGenTausProducer.cc:15
bool DoesGenRecoMatch(std::vector< T > const recoTaus, std::vector< KGenTau * > const genTaus) const
Definition: HttValidGenTausProducer.h:28