4 #include <boost/shared_ptr.hpp>
5 #include <sigc++/signal.h>
7 #include <HepMC/GenEvent.h>
8 #include <HepMC/SimpleVector.h>
40 virtual void endJob();
46 double matching(
const HepMC::GenEvent *event,
bool shower)
const;
48 bool showeredEvent(
const boost::shared_ptr<HepMC::GenEvent> &event);
50 void onBeforeHadronisation();
70 eventsToPrint(params.getUntrackedParameter<unsigned int>(
"eventsToPrint", 0)),
71 extCrossSect(params.getUntrackedParameter<double>(
"crossSection", -1.0)),
72 extFilterEff(params.getUntrackedParameter<double>(
"filterEfficiency", -1.0)),
78 if (params.
exists(
"removeResonances"))
83 std::set<std::string> matchingCapabilities;
84 if (params.
exists(
"jetMatching")) {
90 matchingCapabilities = jetMatching->capabilities();
94 produces<edm::HepMCProduct>();
95 produces<GenEventInfoProduct>();
96 produces<GenRunInfoProduct, edm::InRun>();
100 "preferShowerVetoCallback",
true))
110 matchSummary = matchingCapabilities.count(
"matchSummary");
112 produces< std::vector<double> >(
"matchDeltaR");
113 produces< std::vector<double> >(
"matchDeltaPRel");
118 for(
int i = 0;
i < 6;
i++)
120 for(
int i = 9;
i < 23;
i++)
156 crossSection =
runInfo->xsec();
162 runInfo->setInternalXSec(
164 crossSection.
error()));
180 event.getByLabel(
"source", product);
188 std::auto_ptr<LHEEvent::PDF>(
198 std::auto_ptr<HepMC::GenEvent> hadronLevel(
hadronisation->hadronize());
200 if (!hadronLevel.get()) {
216 <<
"Event got rejected by the "
217 "jet matching." << std::endl;
219 if (hadronLevel.get()) {
225 if (!hadronLevel.get()) {
227 std::auto_ptr<GenEventInfoProduct>
info(
235 hadronLevel->set_event_number(++
index);
239 hadronLevel->print();
242 std::auto_ptr<GenEventInfoProduct>
info(
244 result->addHepMCData(hadronLevel.release());
249 std::auto_ptr< std::vector<double> > matchDeltaR(
250 new std::vector<double>);
251 std::auto_ptr< std::vector<double> > matchDeltaPRel(
252 new std::vector<double>);
254 typedef std::vector<JetMatching::JetPartonMatch> Matches;
257 for(Matches::const_iterator iter = matches.begin();
258 iter != matches.end(); ++iter) {
259 if (!iter->isMatch())
262 matchDeltaR->push_back(iter->delta);
263 matchDeltaPRel->push_back(iter->jet.rho() /
264 iter->parton.rho() - 1.0);
267 event.put(matchDeltaR,
"matchDeltaR");
268 event.put(matchDeltaPRel,
"matchDeltaPRel");
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)
#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
virtual bool endRun(edm::Run &run, const edm::EventSetup &es)
void onBeforeHadronisation()
LHEProducer(const edm::ParameterSet ¶ms)
double matching(const HepMC::GenEvent *event, bool shower) const
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)
std::auto_ptr< JetMatching > jetMatching
void put(std::auto_ptr< PROD > product)
Put a new product.
virtual bool beginRun(edm::Run &run, const edm::EventSetup &es)
boost::shared_ptr< LHERunInfo > runInfo
unsigned int eventsToPrint
std::auto_ptr< Hadronisation > hadronisation
bool showeredEvent(const boost::shared_ptr< HepMC::GenEvent > &event)