24 #include <boost/shared_ptr.hpp>
92 produces<edm::HepMCProduct>();
121 HepMC::GenEvent *evt =
new HepMC::GenEvent();
122 HepMC::GenVertex*
v =
new HepMC::GenVertex();
127 v->add_particle_in(gp1);
130 v->add_particle_in(gp2);
131 evt->set_beam_particles(gp1, gp2);
133 LogWarning(
"LHE2HepMCConverter") <<
"Could not retrieve the LHERunInfoProduct for this event. You'll miss the beam particles in your HepMC product." ;
137 for (
int i = 0;
i < lheEventSrc->hepeup().NUP; ++
i) {
138 if (lheEventSrc->hepeup().ISTUP[
i] != 1) {
142 HepMC::FourVector
p(lheEventSrc->hepeup().PUP[
i][0], lheEventSrc->hepeup().PUP[
i][1],
143 lheEventSrc->hepeup().PUP[
i][2], lheEventSrc->hepeup().PUP[
i][3]);
145 gp->set_generated_mass(lheEventSrc->hepeup().PUP[
i][4]);
146 v->add_particle_out(gp);
149 std::auto_ptr<HepMCProduct> pOut(
new HepMCProduct(evt));
172 if (lheRunSrcHandle.
isValid()) {
178 if (lheRunSrcHandle.
isValid()) {
180 edm::LogInfo(
"LHE2HepMCConverter") <<
"Taking LHERunInfoproduct from source";
183 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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::pair< int, int > IDBMUP
edm::InputTag _lheRunSrcTag
const lhef::HEPRUP & heprup() const
LHE2HepMCConverter(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &)
void addDefault(ParameterSetDescription const &psetDescription)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::InputTag _lheEventSrcTag
virtual void beginLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
const LHERunInfoProduct * _lheRunSrc
virtual void endRun(edm::Run &, edm::EventSetup const &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void endLuminosityBlock(edm::LuminosityBlock &, edm::EventSetup const &)
T const * product() const
virtual void beginRun(edm::Run &, edm::EventSetup const &)