HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
HttValidTausProducer.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "Artus/KappaAnalysis/interface/Producers/ValidTausProducer.h"
5 
6 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
7 
15 class HttValidTausProducer: public ValidTausProducer
16 {
17 public:
18 
19  typedef typename KappaTypes::event_type event_type;
20  typedef typename KappaTypes::product_type product_type;
21  typedef typename KappaTypes::setting_type setting_type;
22  typedef typename KappaTypes::metadata_type metadata_type;
27 
28 protected:
29 
30  virtual void Init(setting_type const& settings, metadata_type& metadata) override {
31 
32  ValidTausProducer::Init(settings, metadata);
33 
34  HttSettings const& specSettings = static_cast<HttSettings const&>(settings);
35  MvaIsolationCutsByIndex = Utility::ParseMapTypes<size_t, float>(Utility::ParseVectorToMap(specSettings.GetTauDiscriminatorMvaIsolation()), MvaIsolationCutsByName);
36 
37  // add possible quantities for the lambda ntuples consumers
38  LambdaNtupleConsumer<HttTypes>::AddFloatQuantity(static_cast<spec_metadata_type&>(metadata), "leadingTauIso", [this](spec_event_type const& event, spec_product_type const& product) {
39  return product.m_validTaus.size() >=1 ? SafeMap::GetWithDefault(product.m_tauIsolation, product.m_validTaus[0], DefaultValues::UndefinedDouble) : DefaultValues::UndefinedDouble;
40  });
41  LambdaNtupleConsumer<HttTypes>::AddFloatQuantity(static_cast<spec_metadata_type&>(metadata), "leadingTauIsoOverPt", [this](spec_event_type const& event, spec_product_type const& product) {
42  return product.m_validTaus.size() >=1 ? SafeMap::GetWithDefault(product.m_tauIsolationOverPt, product.m_validTaus[0], DefaultValues::UndefinedDouble) : DefaultValues::UndefinedDouble;
43  });
44  LambdaNtupleConsumer<HttTypes>::AddFloatQuantity(static_cast<spec_metadata_type&>(metadata), "trailingTauIso", [this](spec_event_type const& event, spec_product_type const& product) {
45  return product.m_validTaus.size() >=2 ? SafeMap::GetWithDefault(product.m_tauIsolation, product.m_validTaus[1], DefaultValues::UndefinedDouble) : DefaultValues::UndefinedDouble;
46  });
47  LambdaNtupleConsumer<HttTypes>::AddFloatQuantity(static_cast<spec_metadata_type&>(metadata), "trailingTauIsoOverPt", [this](spec_event_type const& event, spec_product_type const& product) {
48  return product.m_validTaus.size() >=2 ? SafeMap::GetWithDefault(product.m_tauIsolationOverPt, product.m_validTaus[1], DefaultValues::UndefinedDouble) : DefaultValues::UndefinedDouble;
49  });
50  }
51 
52  // Htautau specific additional definitions
53  virtual bool AdditionalCriteria(KTau* tau, event_type const& event,
54  product_type& product, setting_type const& settings, metadata_type const& metadata) const override;
55 
56 
57 private:
58  bool ApplyCustomMvaIsolationCut(KTau* tau, event_type const& event,
59  std::vector<float>) const;
60  bool ApplyCustomElectronRejection(KTau* tau, event_type const& event,
61  HttSettings const& settings) const;
62 
63  std::map<size_t, std::vector<float> > MvaIsolationCutsByIndex;
64  std::map<std::string, std::vector<float> > MvaIsolationCutsByName;
65 
66 };
67 
Reads settings for all parts of the KappaAnalysis code from a prepared json configuration file...
Definition: HttSettings.h:15
KappaTypes::event_type event_type
Definition: HttValidTausProducer.h:19
virtual bool AdditionalCriteria(KTau *tau, event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: HttValidTausProducer.cc:5
std::map< KTau *, double > m_tauIsolation
Definition: HttProduct.h:88
Definition: HttMetadata.h:9
HttTypes::setting_type spec_setting_type
Definition: HttValidTausProducer.h:25
HttTypes::event_type spec_event_type
Definition: HttValidTausProducer.h:23
HttTypes::metadata_type spec_metadata_type
Definition: HttValidTausProducer.h:26
KappaTypes::metadata_type metadata_type
Definition: HttValidTausProducer.h:22
GlobalProducer, for valid taus. Config tags:
Definition: HttValidTausProducer.h:15
KappaTypes::setting_type setting_type
Definition: HttValidTausProducer.h:21
std::map< KTau *, double > m_tauIsolationOverPt
Definition: HttProduct.h:89
Definition: HttEvent.h:14
HttTypes::product_type spec_product_type
Definition: HttValidTausProducer.h:24
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: HttValidTausProducer.h:30
Definition: HttProduct.h:17
KappaTypes::product_type product_type
Definition: HttValidTausProducer.h:20