18 #include "Rivet/AnalysisHandler.hh"
28 using namespace Rivet;
37 usesResource(
"Rivet");
38 _prodMode =
cfg.getParameter<
string>(
"ProductionMode");
41 _analysisHandler =
nullptr;
42 produces<HTXS::HiggsClassification>(
"HiggsClassification").setBranchAlias(
"HiggsClassification");
67 bool product_exists =
iEvent.getByToken(_hepmcCollection, evt);
72 if (_prodMode ==
"AUTO") {
81 HepMC::GenVertex* HSvtx = myGenEvent->signal_process_vertex();
87 if (ptcl->pdg_id() == 23)
89 if (
abs(ptcl->pdg_id()) == 6)
91 if (
abs(ptcl->pdg_id()) == 5)
93 if (ptcl->pdg_id() == 25)
98 if (nZs == 1 && nHs == 1 && (nWs + nTs) == 0) {
100 }
else if (nWs == 1 && nHs == 1 && (nZs + nTs) == 0) {
102 }
else if (nTs == 2 && nHs == 1 && nZs == 0) {
104 }
else if (nTs == 1 && nHs == 1 && nZs == 0) {
106 }
else if (nBs == 2 && nHs == 1 && nZs == 0) {
112 if (!_HTXS || !_HTXS->hasProjection(
"FS")) {
113 _analysisHandler = std::make_unique<Rivet::AnalysisHandler>();
115 _analysisHandler->addAnalysis(_HTXS);
118 if (_prodMode ==
"GGF")
120 else if (_prodMode ==
"VBF")
122 else if (_prodMode ==
"WH")
124 else if (_prodMode ==
"ZH")
126 else if (_prodMode ==
"QQ2ZH")
128 else if (_prodMode ==
"GG2ZH")
130 else if (_prodMode ==
"TTH")
132 else if (_prodMode ==
"BBH")
134 else if (_prodMode ==
"TH")
136 else if (_prodMode ==
"AUTO") {
138 <<
"Using AUTO for HiggsProdMode, found it to be: " << m_HiggsProdMode <<
"\n";
140 <<
"(UNKNOWN=0, GGF=1, VBF=2, WH=3, QQ2ZH=4, GG2ZH=5, TTH=6, BBH=7, TH=8)" << endl;
143 <<
"ProductionMode must be one of: GGF,VBF,WH,ZH,QQ2ZH,GG2ZH,TTH,BBH,TH,AUTO ";
145 _HTXS->setHiggsProdMode(m_HiggsProdMode);
149 edm::LogInfo(
"HTXSRivetProducer") <<
"HTXSRivetProducer WARNING: HiggsProduction mode is UNKNOWN" << endl;
153 _analysisHandler->init(*myGenEvent);
157 Rivet::HiggsClassification rivet_cat = _HTXS->classifyEvent(*myGenEvent, m_HiggsProdMode);
169 if (_prodMode ==
"AUTO") {
172 if (product_exists) {
173 typedef std::vector<LHERunInfoProduct::Header>::const_iterator headers_const_iterator;
177 std::vector<std::string>
lines = iter->lines();
178 for (
unsigned int iLine = 0; iLine <
lines.size(); iLine++) {
181 if (
line.find(
"gg_H_quark-mass-effects") != std::string::npos) {
186 if (
line.find(
"Process: HJ") != std::string::npos) {
191 if (
line.find(
"Process: HJJ") != std::string::npos) {
196 if (
line.find(
"VBF_H") != std::string::npos) {
201 if (
line.find(
"HZJ") != std::string::npos) {
206 if (
line.find(
"ggHZ") != std::string::npos) {
212 if (
line.find(
"ggh012j") != std::string::npos) {
217 if (
line.find(
"vbfh") != std::string::npos) {
222 if (
line.find(
"zh012j") != std::string::npos) {
227 if (
line.find(
"ggzh01j") != std::string::npos) {