4 #include <boost/shared_ptr.hpp>
5 #include <sigc++/signal.h>
7 #include "HepMC/GenEvent.h"
8 #include "HepMC/SimpleVector.h"
35 edm::one::WatchRuns> {
42 virtual void endJob()
override;
49 double matching(
const HepMC::GenEvent *event,
bool shower)
const;
51 bool showeredEvent(
const boost::shared_ptr<HepMC::GenEvent> &event);
53 void onBeforeHadronisation();
73 eventsToPrint(params.getUntrackedParameter<unsigned int>(
"eventsToPrint", 0)),
74 extCrossSect(params.getUntrackedParameter<double>(
"crossSection", -1.0)),
75 extFilterEff(params.getUntrackedParameter<double>(
"filterEfficiency", -1.0)),
81 if (params.
exists(
"removeResonances"))
86 std::set<std::string> matchingCapabilities;
87 if (params.
exists(
"jetMatching")) {
93 matchingCapabilities = jetMatching->capabilities();
97 produces<edm::HepMCProduct>();
98 produces<GenEventInfoProduct>();
99 produces<GenRunInfoProduct, edm::InRun>();
103 "preferShowerVetoCallback",
true))
113 matchSummary = matchingCapabilities.count(
"matchSummary");
115 produces< std::vector<double> >(
"matchDeltaR");
116 produces< std::vector<double> >(
"matchDeltaPRel");
121 for(
int i = 0;
i < 6;
i++)
123 for(
int i = 9;
i < 23;
i++)
160 crossSection =
runInfo->xsec();
166 runInfo->setInternalXSec(
168 crossSection.
error));
184 event.getByLabel(
"source", product);
192 std::auto_ptr<LHEEvent::PDF>(
202 std::auto_ptr<HepMC::GenEvent> hadronLevel(
hadronisation->hadronize());
204 if (!hadronLevel.get()) {
220 <<
"Event got rejected by the "
221 "jet matching." << std::endl;
223 if (hadronLevel.get()) {
229 if (!hadronLevel.get()) {
231 std::auto_ptr<GenEventInfoProduct>
info(
239 hadronLevel->set_event_number(++
index);
243 hadronLevel->print();
246 std::auto_ptr<GenEventInfoProduct>
info(
248 result->addHepMCData(hadronLevel.release());
253 std::auto_ptr< std::vector<double> > matchDeltaR(
254 new std::vector<double>);
255 std::auto_ptr< std::vector<double> > matchDeltaPRel(
256 new std::vector<double>);
258 typedef std::vector<JetMatching::JetPartonMatch> Matches;
261 for(Matches::const_iterator
iter = matches.begin();
263 if (!
iter->isMatch())
266 matchDeltaR->push_back(
iter->delta);
267 matchDeltaPRel->push_back(
iter->jet.rho() /
268 iter->parton.rho() - 1.0);
271 event.put(matchDeltaR,
"matchDeltaR");
272 event.put(matchDeltaPRel,
"matchDeltaPRel");
virtual void endRun(edm::Run const &run, const edm::EventSetup &es) override
T getParameter(std::string const &) const
bool getByLabel(std::string const &label, Handle< PROD > &result) const
T getUntrackedParameter(std::string const &, T const &) const
void set(int pdgId, bool both=true, double value=1.0)
virtual bool filter(edm::Event &event, const edm::EventSetup &es) override
#define DEFINE_FWK_MODULE(type)
double getFactor(const Hadronisation *hadronisation, const boost::shared_ptr< LHEEvent > &event) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< int > removeResonances
BranchingRatios branchingRatios
void onBeforeHadronisation()
virtual void beginRun(edm::Run const &run, const edm::EventSetup &es) override
LHEProducer(const edm::ParameterSet ¶ms)
double matching(const HepMC::GenEvent *event, bool shower) const
virtual void endRunProduce(edm::Run &run, const edm::EventSetup &es) override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
boost::shared_ptr< LHEEvent > partonLevel
virtual void endJob() override
virtual void beginJob() override
std::auto_ptr< JetMatching > jetMatching
void put(std::auto_ptr< PROD > product)
Put a new product.
DEFINE_LHE_JETMATCHING_PLUGIN(JetMatchingMLM)
volatile std::atomic< bool > shutdown_flag false
boost::shared_ptr< LHERunInfo > runInfo
unsigned int eventsToPrint
std::auto_ptr< Hadronisation > hadronisation
bool showeredEvent(const boost::shared_ptr< HepMC::GenEvent > &event)