HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
MELAProducers.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 #include "HiggsAnalysis/KITHiggsToTauTau/interface/Utility/SvfitTools.h"
7 
8 // https://github.com/cms-analysis/HiggsAnalysis-ZZMatrixElement/tree/v2.1.1/MELA
9 // https://twiki.cern.ch/twiki/bin/viewauth/CMS/MELAProject
10 // http://hroskes.web.cern.ch/hroskes/JHUGen/manJHUGenerator.pdf
11 #include "ZZMatrixElement/MELA/interface/Mela.h"
12 
13 
14 class MELAProducer: public ProducerBase<HttTypes>
15 {
16 public:
17 
19  std::string name="",
20  SvfitResults product_type::*m_svfitResultsMember=&product_type::m_svfitResults,
21 
22  float product_type::*m_melaProbCPEvenGGHMember = &product_type::m_melaProbCPEvenGGH,
23  float product_type::*m_melaProbCPOddGGHMember = &product_type::m_melaProbCPOddGGH,
24  float product_type::*m_melaProbCPMixGGHMember = &product_type::m_melaProbCPMixGGH,
25  float product_type::*m_melaDiscriminatorD0MinusGGHMember = &product_type::m_melaDiscriminatorD0MinusGGH,
26  float product_type::*m_melaDiscriminatorDCPGGHMember = &product_type::m_melaDiscriminatorDCPGGH,
27 
28  float product_type::*m_melaProbCPEvenVBFMember = &product_type::m_melaProbCPEvenVBF,
29  float product_type::*m_melaProbCPOddVBFMember = &product_type::m_melaProbCPOddVBF,
30  float product_type::*m_melaProbCPMixVBFMember = &product_type::m_melaProbCPMixVBF,
31  float product_type::*m_melaDiscriminatorD0MinusVBFMember = &product_type::m_melaDiscriminatorD0MinusVBF,
32  float product_type::*m_melaDiscriminatorDCPVBFMember = &product_type::m_melaDiscriminatorDCPVBF
33 
34  /*
35  float product_type::*m_melaProbCPEvenWlepHMember = &product_type::m_melaProbCPEvenWlepH,
36  float product_type::*m_melaProbCPOddWlepHMember = &product_type::m_melaProbCPOddWlepH,
37  float product_type::*m_melaProbCPMixWlepHMember = &product_type::m_melaProbCPMixWlepH,
38  float product_type::*m_melaDiscriminatorD0MinusWlepHMember = &product_type::m_melaDiscriminatorD0MinusWlepH,
39  float product_type::*m_melaDiscriminatorDCPWlepHMember = &product_type::m_melaDiscriminatorDCPWlepH,
40 
41  float product_type::*m_melaProbCPEvenWhadHMember = &product_type::m_melaProbCPEvenWhadH,
42  float product_type::*m_melaProbCPOddWhadHMember = &product_type::m_melaProbCPOddWhadH,
43  float product_type::*m_melaProbCPMixWhadHMember = &product_type::m_melaProbCPMixWhadH,
44  float product_type::*m_melaDiscriminatorD0MinusWhadHMember = &product_type::m_melaDiscriminatorD0MinusWhadH,
45  float product_type::*m_melaDiscriminatorDCPWhadHMember = &product_type::m_melaDiscriminatorDCPWhadH,
46 
47  float product_type::*m_melaProbCPEvenZlepHMember = &product_type::m_melaProbCPEvenZlepH,
48  float product_type::*m_melaProbCPOddZlepHMember = &product_type::m_melaProbCPOddZlepH,
49  float product_type::*m_melaProbCPMixZlepHMember = &product_type::m_melaProbCPMixZlepH,
50  float product_type::*m_melaDiscriminatorD0MinusZlepHMember = &product_type::m_melaDiscriminatorD0MinusZlepH,
51  float product_type::*m_melaDiscriminatorDCPZlepHMember = &product_type::m_melaDiscriminatorDCPZlepH,
52 
53  float product_type::*m_melaProbCPEvenZhadHMember = &product_type::m_melaProbCPEvenZhadH,
54  float product_type::*m_melaProbCPOddZhadHMember = &product_type::m_melaProbCPOddZhadH,
55  float product_type::*m_melaProbCPMixZhadHMember = &product_type::m_melaProbCPMixZhadH,
56  float product_type::*m_melaDiscriminatorD0MinusZhadHMember = &product_type::m_melaDiscriminatorD0MinusZhadH,
57  float product_type::*m_melaDiscriminatorDCPZhadHMember = &product_type::m_melaDiscriminatorDCPZhadH
58  */
59  );
60 
61  virtual std::string GetProducerId() const override;
62 
63  virtual void Init(setting_type const& settings, metadata_type& metadata) override;
64 
65  virtual void Produce(event_type const& event, product_type& product,
66  setting_type const& settings, metadata_type const& metadata) const override;
67 
68 private:
69 
70  std::string m_name = "";
71  SvfitResults product_type::*m_svfitResultsMember;
72 
73  float product_type::*m_melaProbCPEvenGGHMember;
74  float product_type::*m_melaProbCPOddGGHMember;
75  float product_type::*m_melaProbCPMixGGHMember;
76  float product_type::*m_melaDiscriminatorD0MinusGGHMember;
77  float product_type::*m_melaDiscriminatorDCPGGHMember;
78 
79  float product_type::*m_melaProbCPEvenVBFMember;
80  float product_type::*m_melaProbCPOddVBFMember;
81  float product_type::*m_melaProbCPMixVBFMember;
82  float product_type::*m_melaDiscriminatorD0MinusVBFMember;
83  float product_type::*m_melaDiscriminatorDCPVBFMember;
84 
85  /*
86  float product_type::*m_melaProbCPEvenWlepHMember;
87  float product_type::*m_melaProbCPOddWlepHMember;
88  float product_type::*m_melaProbCPMixWlepHMember;
89  float product_type::*m_melaDiscriminatorD0MinusWlepHMember;
90  float product_type::*m_melaDiscriminatorDCPWlepHMember;
91 
92  float product_type::*m_melaProbCPEvenWhadHMember;
93  float product_type::*m_melaProbCPOddWhadHMember;
94  float product_type::*m_melaProbCPMixWhadHMember;
95  float product_type::*m_melaDiscriminatorD0MinusWhadHMember;
96  float product_type::*m_melaDiscriminatorDCPWhadHMember;
97 
98  float product_type::*m_melaProbCPEvenZlepHMember;
99  float product_type::*m_melaProbCPOddZlepHMember;
100  float product_type::*m_melaProbCPMixZlepHMember;
101  float product_type::*m_melaDiscriminatorD0MinusZlepHMember;
102  float product_type::*m_melaDiscriminatorDCPZlepHMember;
103 
104  float product_type::*m_melaProbCPEvenZhadHMember;
105  float product_type::*m_melaProbCPOddZhadHMember;
106  float product_type::*m_melaProbCPMixZhadHMember;
107  float product_type::*m_melaDiscriminatorD0MinusZhadHMember;
108  float product_type::*m_melaDiscriminatorDCPZhadHMember;
109  */
110 
111  std::unique_ptr<Mela> m_mela;
112 
113  void CalculateProbabilitiesGGH(float& probCPEven, float& probCPOdd, float& probCPMix) const;
114  void CalculateProbabilitiesVBF(float& probCPEven, float& probCPOdd, float& probCPMix) const;
115  void CalculateProbabilitiesWlepH(float& probCPEven, float& probCPOdd, float& probCPMix) const;
116  void CalculateProbabilitiesWhadH(float& probCPEven, float& probCPOdd, float& probCPMix) const;
117  void CalculateProbabilitiesZlepH(float& probCPEven, float& probCPOdd, float& probCPMix) const;
118  void CalculateProbabilitiesZhadH(float& probCPEven, float& probCPOdd, float& probCPMix) const;
119 
120  void CalculateDiscriminators(float probCPEven, float probCPOdd, float probCPMix,
121  float& discriminatorD0Minus, float& discriminatorDCP) const;
122 
123 };
124 
125 
127 {
128 public:
129 
131 
132  virtual std::string GetProducerId() const override;
133 
134 };
135 
virtual void Produce(event_type const &event, product_type &product, setting_type const &settings, metadata_type const &metadata) const override
Definition: MELAProducers.cc:239
tuple name
Definition: correlation_SampleProducer.py:359
virtual std::string GetProducerId() const override
Definition: MELAProducers.cc:463
Definition: MELAProducers.h:126
MELAProducer(std::string name="", SvfitResults product_type::*m_svfitResultsMember=&product_type::m_svfitResults, float product_type::*m_melaProbCPEvenGGHMember=&product_type::m_melaProbCPEvenGGH, float product_type::*m_melaProbCPOddGGHMember=&product_type::m_melaProbCPOddGGH, float product_type::*m_melaProbCPMixGGHMember=&product_type::m_melaProbCPMixGGH, float product_type::*m_melaDiscriminatorD0MinusGGHMember=&product_type::m_melaDiscriminatorD0MinusGGH, float product_type::*m_melaDiscriminatorDCPGGHMember=&product_type::m_melaDiscriminatorDCPGGH, float product_type::*m_melaProbCPEvenVBFMember=&product_type::m_melaProbCPEvenVBF, float product_type::*m_melaProbCPOddVBFMember=&product_type::m_melaProbCPOddVBF, float product_type::*m_melaProbCPMixVBFMember=&product_type::m_melaProbCPMixVBF, float product_type::*m_melaDiscriminatorD0MinusVBFMember=&product_type::m_melaDiscriminatorD0MinusVBF, float product_type::*m_melaDiscriminatorDCPVBFMember=&product_type::m_melaDiscriminatorDCPVBF)
Definition: MELAProducers.cc:9
virtual void Init(setting_type const &settings, metadata_type &metadata) override
Definition: MELAProducers.cc:100
Definition: SvfitTools.h:145
virtual std::string GetProducerId() const override
Definition: MELAProducers.cc:95
MELAM125Producer()
Definition: MELAProducers.cc:416
Definition: MELAProducers.h:14