4 #include <boost/shared_ptr.hpp>
5 #include <sigc++/signal.h>
7 #include <HepMC/GenEvent.h>
8 #include <HepMC/SimpleVector.h>
34 edm::one::WatchRuns> {
41 virtual void endJob()
override;
48 double matching(
const HepMC::GenEvent *event,
bool shower)
const;
50 bool showeredEvent(
const boost::shared_ptr<HepMC::GenEvent> &event);
52 void onBeforeHadronisation();
72 eventsToPrint(params.getUntrackedParameter<unsigned int>(
"eventsToPrint", 0)),
73 extCrossSect(params.getUntrackedParameter<double>(
"crossSection", -1.0)),
74 extFilterEff(params.getUntrackedParameter<double>(
"filterEfficiency", -1.0)),
80 if (params.
exists(
"removeResonances"))
85 std::set<std::string> matchingCapabilities;
86 if (params.
exists(
"jetMatching")) {
92 matchingCapabilities = jetMatching->capabilities();
96 produces<edm::HepMCProduct>();
97 produces<GenEventInfoProduct>();
98 produces<GenRunInfoProduct, edm::InRun>();
102 "preferShowerVetoCallback",
true))
112 matchSummary = matchingCapabilities.count(
"matchSummary");
114 produces< std::vector<double> >(
"matchDeltaR");
115 produces< std::vector<double> >(
"matchDeltaPRel");
120 for(
int i = 0;
i < 6;
i++)
122 for(
int i = 9;
i < 23;
i++)
159 crossSection =
runInfo->xsec();
165 runInfo->setInternalXSec(
167 crossSection.
error));
181 event.getByLabel(
"source", product);
189 std::auto_ptr<LHEEvent::PDF>(
199 std::auto_ptr<HepMC::GenEvent> hadronLevel(
hadronisation->hadronize());
201 if (!hadronLevel.get()) {
217 <<
"Event got rejected by the "
218 "jet matching." << std::endl;
220 if (hadronLevel.get()) {
226 if (!hadronLevel.get()) {
228 std::auto_ptr<GenEventInfoProduct>
info(
236 hadronLevel->set_event_number(++
index);
240 hadronLevel->print();
243 std::auto_ptr<GenEventInfoProduct>
info(
245 result->addHepMCData(hadronLevel.release());
250 std::auto_ptr< std::vector<double> > matchDeltaR(
251 new std::vector<double>);
252 std::auto_ptr< std::vector<double> > matchDeltaPRel(
253 new std::vector<double>);
255 typedef std::vector<JetMatching::JetPartonMatch> Matches;
258 for(Matches::const_iterator iter = matches.begin();
259 iter != matches.end(); ++iter) {
260 if (!iter->isMatch())
263 matchDeltaR->push_back(iter->delta);
264 matchDeltaPRel->push_back(iter->jet.rho() /
265 iter->parton.rho() - 1.0);
268 event.put(matchDeltaR,
"matchDeltaR");
269 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
#define DEFINE_LHE_JETMATCHING_PLUGIN(T)
virtual void endJob() override
virtual void beginJob() override
std::auto_ptr< JetMatching > jetMatching
void put(std::auto_ptr< PROD > product)
Put a new product.
boost::shared_ptr< LHERunInfo > runInfo
unsigned int eventsToPrint
std::auto_ptr< Hadronisation > hadronisation
bool showeredEvent(const boost::shared_ptr< HepMC::GenEvent > &event)