18 #include "Rivet/AnalysisHandler.hh" 26 using namespace Rivet;
35 usesResource(
"Rivet");
43 produces<HTXS::HiggsClassification>(
"HiggsClassification").setBranchAlias(
"HiggsClassification");
69 bool product_exists = iEvent.
getByToken(_hepmcCollection, evt);
74 if (_prodMode ==
"AUTO") {
83 HepMC::GenVertex* HSvtx = myGenEvent->signal_process_vertex();
89 if (ptcl->pdg_id() == 23)
91 if (
abs(ptcl->pdg_id()) == 6)
93 if (
abs(ptcl->pdg_id()) == 5)
95 if (ptcl->pdg_id() == 25)
100 if (nZs == 1 && nHs == 1 && (nWs + nTs) == 0) {
102 }
else if (nWs == 1 && nHs == 1 && (nZs + nTs) == 0) {
104 }
else if (nTs == 2 && nHs == 1 && nZs == 0) {
106 }
else if (nTs == 1 && nHs == 1 && nZs == 0) {
108 }
else if (nBs == 2 && nHs == 1 && nZs == 0) {
112 _HTXS->setHiggsProdMode(m_HiggsProdMode);
117 _analysisHandler.addAnalysis(_HTXS);
120 if (_prodMode ==
"GGF")
122 else if (_prodMode ==
"VBF")
124 else if (_prodMode ==
"WH")
126 else if (_prodMode ==
"ZH")
128 else if (_prodMode ==
"QQ2ZH")
130 else if (_prodMode ==
"GG2ZH")
132 else if (_prodMode ==
"TTH")
134 else if (_prodMode ==
"BBH")
136 else if (_prodMode ==
"TH")
138 else if (_prodMode ==
"AUTO") {
140 <<
"Using AUTO for HiggsProdMode, found it to be: " << m_HiggsProdMode <<
"\n";
142 <<
"(UNKNOWN=0, GGF=1, VBF=2, WH=3, QQ2ZH=4, GG2ZH=5, TTH=6, BBH=7, TH=8)" << endl;
145 <<
"ProductionMode must be one of: GGF,VBF,WH,ZH,QQ2ZH,GG2ZH,TTH,BBH,TH,AUTO ";
147 _HTXS->setHiggsProdMode(m_HiggsProdMode);
151 edm::LogInfo(
"HTXSRivetProducer") <<
"HTXSRivetProducer WARNING: HiggsProduction mode is UNKNOWN" << endl;
155 _analysisHandler.init(*myGenEvent);
156 _isFirstEvent =
false;
160 Rivet::HiggsClassification rivet_cat = _HTXS->classifyEvent(*myGenEvent, m_HiggsProdMode);
172 if (_prodMode ==
"AUTO") {
175 if (product_exists) {
176 typedef std::vector<LHERunInfoProduct::Header>::const_iterator headers_const_iterator;
180 std::vector<std::string>
lines = iter->lines();
181 for (
unsigned int iLine = 0; iLine < lines.size(); iLine++) {
184 if (line.find(
"gg_H_quark-mass-effects") != std::string::npos) {
185 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
189 if (line.find(
"Process: HJ") != std::string::npos) {
190 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
194 if (line.find(
"Process: HJJ") != std::string::npos) {
195 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
199 if (line.find(
"VBF_H") != std::string::npos) {
200 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
204 if (line.find(
"HZJ") != std::string::npos) {
205 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
209 if (line.find(
"ggHZ") != std::string::npos) {
210 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
215 if (line.find(
"ggh012j") != std::string::npos) {
216 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
220 if (line.find(
"vbfh") != std::string::npos) {
221 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
225 if (line.find(
"zh012j") != std::string::npos) {
226 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
230 if (line.find(
"ggzh01j") != std::string::npos) {
231 edm::LogInfo(
"HTXSRivetProducer") << iLine <<
" " << line << std::endl;
T getParameter(std::string const &) const
bool getByLabel(std::string const &label, Handle< PROD > &result) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
headers_const_iterator headers_end() const
HiggsProdMode
Higgs production modes, corresponding to input sample.
HTXS::HiggsProdMode m_HiggsProdMode
Rivet::AnalysisHandler _analysisHandler
Rivet::HiggsTemplateCrossSections * _HTXS
#define DEFINE_FWK_MODULE(type)
headers_const_iterator headers_begin() const
Abs< T >::type abs(const T &t)
void produce(edm::Event &, const edm::EventSetup &) override
const HepMC::GenEvent * GetEvent() const
void beginRun(edm::Run const &iRun, edm::EventSetup const &es) override
T const * product() const
Rivet routine for classifying MC events according to the Higgs template cross section categories...
edm::EDGetTokenT< edm::HepMCProduct > _hepmcCollection
HTXS::HiggsClassification Rivet2Root(category const &htxs_cat_rivet)
HTXS::HiggsClassification cat_
void endRun(edm::Run const &iRun, edm::EventSetup const &es) override
HTXSRivetProducer(const edm::ParameterSet &cfg)
edm::EDGetTokenT< LHERunInfoProduct > _lheRunInfo