HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
DataMcScaleFactorProducers.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttTypes.h"
5 #include "HiggsAnalysis/KITHiggsToTauTau/interface/HttEnumTypes.h"
6 
7 
10 class DataMcScaleFactorProducerBase: public ProducerBase<HttTypes> {
11 public:
12 
13  DataMcScaleFactorProducerBase(std::vector<std::string>& (setting_type::*GetEfficiencyData)(void) const,
14  std::vector<std::string>& (setting_type::*GetEfficiencyMc)(void) const,
15  std::string (setting_type::*GetEfficiencyHistogram)(void) const,
16  std::string (setting_type::*GetEfficiencyMode)(void) const,
17  std::string const& weightName);
18 
19  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
20 
21  virtual void Produce(event_type const& event, product_type& product,
22  setting_type const& settings, metadata_type const& metadata) const override;
23 
24 
25 private:
26  std::vector<std::string>& (setting_type::*GetEfficiencyData)(void) const;
27  std::vector<std::string>& (setting_type::*GetEfficiencyMc)(void) const;
28  std::string (setting_type::*GetEfficiencyHistogram)(void) const;
29  std::string (setting_type::*GetEfficiencyMode)(void) const;
30  std::string m_weightName;
31 
32  std::map<std::string, std::vector<TH2F*> > efficienciesDataByHltName;
33  std::map<size_t, std::vector<TH2F*> > efficienciesDataByIndex;
34  std::map<std::string, std::vector<TH2F*> > efficienciesMcByHltName;
35  std::map<size_t, std::vector<TH2F*> > efficienciesMcByIndex;
36 
38 
39  std::vector<double> GetEfficienciesFromHistograms(std::vector<TH2F*> const& histograms, KLepton* lepton) const;
40 
41  std::vector<std::vector<double> > GetEfficiencies(
42  std::map<std::string, std::vector<TH2F*> > const& efficienciesByHltName,
43  std::map<size_t, std::vector<TH2F*> > const& efficienciesByIndex,
44  event_type const& event, product_type const& product,
45  setting_type const& settings, metadata_type const& metadata
46  ) const;
47 
48 };
49 
50 
60 public:
61 
62  virtual std::string GetProducerId() const override {
63  return "TriggerWeightProducer";
64  }
65 
67 
68 };
69 
70 
79 public:
80 
81  virtual std::string GetProducerId() const override {
82  return "IdentificationWeightProducer";
83  }
84 
86 
87 };
88 
89 
92 class LepTauScaleFactorWeightProducer: public ProducerBase<HttTypes> {
93 public:
94 
95  LepTauScaleFactorWeightProducer(std::vector<std::string>& (setting_type::*GetWeightFiles)(void) const,
96  std::vector<std::string>& (setting_type::*GetWeightHistograms)(void) const);
97 
98  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
99 
100  virtual void Produce(event_type const& event, product_type& product,
101  setting_type const& settings, metadata_type const& metadata) const override;
102 
103 private:
104  std::vector<std::string>& (setting_type::*GetWeightFiles)(void) const;
105  std::vector<std::string>& (setting_type::*GetWeightHistograms)(void) const;
106 
107  std::map<size_t, std::vector<TH1F*> > weightsByIndex;
108 };
109 
117 public:
118 
119  virtual std::string GetProducerId() const override {
120  return "EleTauFakeRateWeightProducer";
121  }
122 
124 };
125 
133 public:
134 
135  virtual std::string GetProducerId() const override {
136  return "MuonTauFakeRateWeightProducer";
137  }
138 
140 };
virtual std::string GetProducerId() const override
Definition: DataMcScaleFactorProducers.h:135
TriggerWeightProducer()
Definition: DataMcScaleFactorProducers.cc:237
Definition: DataMcScaleFactorProducers.h:78
Definition: DataMcScaleFactorProducers.h:92
MuonTauFakeRateWeightProducer()
Definition: DataMcScaleFactorProducers.cc:322
dictionary histograms
Definition: makePlots_datacardsPostfitPlots.py:98
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DataMcScaleFactorProducers.cc:268
IdentificationWeightProducer()
Definition: DataMcScaleFactorProducers.cc:247
Definition: DataMcScaleFactorProducers.h:10
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: DataMcScaleFactorProducers.cc:86
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: DataMcScaleFactorProducers.cc:291
virtual std::string GetProducerId() const override
Definition: DataMcScaleFactorProducers.h:62
virtual std::string GetProducerId() const override
Definition: DataMcScaleFactorProducers.h:81
EleTauFakeRateWeightProducer()
Definition: DataMcScaleFactorProducers.cc:316
virtual std::string GetProducerId() const override
Definition: DataMcScaleFactorProducers.h:119
DataMcScaleFactorProducerBase(std::vector< std::string > &(setting_type::*GetEfficiencyData)(void) const, std::vector< std::string > &(setting_type::*GetEfficiencyMc)(void) const, std::string(setting_type::*GetEfficiencyHistogram)(void) const, std::string(setting_type::*GetEfficiencyMode)(void) const, std::string const &weightName)
Definition: DataMcScaleFactorProducers.cc:17
Definition: DataMcScaleFactorProducers.h:116
Definition: DataMcScaleFactorProducers.h:59
Definition: DataMcScaleFactorProducers.h:132
LepTauScaleFactorWeightProducer(std::vector< std::string > &(setting_type::*GetWeightFiles)(void) const, std::vector< std::string > &(setting_type::*GetWeightHistograms)(void) const)
Definition: DataMcScaleFactorProducers.cc:258
DataMcScaleFactorProducerMode
Definition: HttEnumTypes.h:60
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: DataMcScaleFactorProducers.cc:32