Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport of feature needed to Higgs Template Cross Section in 94x #24753

Merged
merged 7 commits into from Oct 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 10 additions & 17 deletions GeneratorInterface/RivetInterface/plugins/HTXSRivetProducer.cc
Expand Up @@ -6,7 +6,7 @@
*
*/

#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/one/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/Run.h"
Expand All @@ -28,7 +28,7 @@ using namespace Rivet;
using namespace edm;
using namespace std;

class HTXSRivetProducer : public edm::stream::EDProducer<> {
class HTXSRivetProducer : public edm::one::EDProducer<edm::one::WatchRuns> {
public:

explicit HTXSRivetProducer(const edm::ParameterSet& cfg) :
Expand All @@ -44,16 +44,14 @@ class HTXSRivetProducer : public edm::stream::EDProducer<> {
produces<HTXS::HiggsClassification>("HiggsClassification").setBranchAlias("HiggsClassification");

}
~HTXSRivetProducer() override;
~HTXSRivetProducer() ;

private:

void beginJob();
void produce( edm::Event&, const edm::EventSetup&) override;
void endJob();
void produce( edm::Event&, const edm::EventSetup&) ;

void beginRun(edm::Run const& iRun, edm::EventSetup const& es) override;
void endRun(edm::Run const& iRun, edm::EventSetup const& es) override;
void beginRun(edm::Run const& iRun, edm::EventSetup const& es) override ;
void endRun(edm::Run const& iRun, edm::EventSetup const& es) override ;

edm::EDGetTokenT<edm::HepMCProduct> _hepmcCollection;
edm::EDGetTokenT<LHERunInfoProduct> _lheRunInfo;
Expand All @@ -72,10 +70,6 @@ class HTXSRivetProducer : public edm::stream::EDProducer<> {
HTXSRivetProducer::~HTXSRivetProducer(){
}

void HTXSRivetProducer::beginJob(){
_analysisHandler.addAnalysis(_HTXS);
}

void HTXSRivetProducer::produce( edm::Event & iEvent, const edm::EventSetup & ) {

//get the hepmc product from the event
Expand Down Expand Up @@ -130,6 +124,8 @@ void HTXSRivetProducer::produce( edm::Event & iEvent, const edm::EventSetup & )

if (_isFirstEvent){

_analysisHandler.addAnalysis(_HTXS);

// set the production mode if not done already
if ( _prodMode == "GGF" ) m_HiggsProdMode = HTXS::GGF;
else if ( _prodMode == "VBF" ) m_HiggsProdMode = HTXS::VBF;
Expand All @@ -150,7 +146,7 @@ void HTXSRivetProducer::produce( edm::Event & iEvent, const edm::EventSetup & )

// at this point the production mode must be known
if (m_HiggsProdMode == HTXS::UNKNOWN) {
edm::LogInfo ("HTXSRivetProducer") << "HTXSRivetProducer WARNING: HiggsProduction mode is UNKNOWN" << endl;
edm::LogInfo ("HTXSRivetProducer") << "HTXSRivetProducer WARNING: HiggsProduction mode is UNKNOWN" << endl;
}

// initialize rivet analysis
Expand All @@ -169,12 +165,9 @@ void HTXSRivetProducer::produce( edm::Event & iEvent, const edm::EventSetup & )
}
}

void HTXSRivetProducer::endJob(){
_HTXS->printClassificationSummary();
}

void HTXSRivetProducer::endRun(edm::Run const& iRun, edm::EventSetup const& es)
{
_HTXS->printClassificationSummary();
}

void HTXSRivetProducer::beginRun(edm::Run const& iRun, edm::EventSetup const& es) {
Expand Down