23 #include <boost/shared_ptr.hpp>
86 produces<edm::HepMCProduct>(
"unsmeared");
115 HepMC::GenEvent *evt =
new HepMC::GenEvent();
116 HepMC::GenVertex*
v =
new HepMC::GenVertex();
121 v->add_particle_in(gp1);
124 v->add_particle_in(gp2);
125 evt->set_beam_particles(gp1, gp2);
127 LogWarning(
"LHE2HepMCConverter") <<
"Could not retrieve the LHERunInfoProduct for this event. You'll miss the beam particles in your HepMC product." ;
131 for (
int i = 0;
i < lheEventSrc->hepeup().NUP; ++
i) {
132 if (lheEventSrc->hepeup().ISTUP[
i] != 1) {
136 HepMC::FourVector
p(lheEventSrc->hepeup().PUP[
i][0], lheEventSrc->hepeup().PUP[
i][1],
137 lheEventSrc->hepeup().PUP[
i][2], lheEventSrc->hepeup().PUP[
i][3]);
139 gp->set_generated_mass(lheEventSrc->hepeup().PUP[
i][4]);
140 v->add_particle_out(gp);
143 std::auto_ptr<HepMCProduct> pOut(
new HepMCProduct(evt));
144 iEvent.
put(pOut,
"unsmeared");
155 if (lheRunSrcHandle.
isValid()) {
161 if (lheRunSrcHandle.
isValid()) {
163 edm::LogInfo(
"LHE2HepMCConverter") <<
"Taking LHERunInfoproduct from source";
166 edm::LogWarning(
"LHE2HepMCConverter") <<
"No LHERunInfoProduct from source";
T getParameter(std::string const &) const
bool getByLabel(std::string const &label, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::pair< double, double > EBMUP
virtual void produce(edm::Event &, const edm::EventSetup &) override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::pair< int, int > IDBMUP
edm::InputTag _lheRunSrcTag
const lhef::HEPRUP & heprup() const
LHE2HepMCConverter(const edm::ParameterSet &)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag _lheEventSrcTag
const LHERunInfoProduct * _lheRunSrc
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void beginRun(edm::Run const &, edm::EventSetup const &) override
T const * product() const