24 #include <boost/shared_ptr.hpp>
87 produces<edm::HepMCProduct>();
116 HepMC::GenEvent *evt =
new HepMC::GenEvent();
117 HepMC::GenVertex*
v =
new HepMC::GenVertex();
122 v->add_particle_in(gp1);
125 v->add_particle_in(gp2);
126 evt->set_beam_particles(gp1, gp2);
128 LogWarning(
"LHE2HepMCConverter") <<
"Could not retrieve the LHERunInfoProduct for this event. You'll miss the beam particles in your HepMC product." ;
132 for (
int i = 0;
i < lheEventSrc->hepeup().NUP; ++
i) {
133 if (lheEventSrc->hepeup().ISTUP[
i] != 1) {
137 HepMC::FourVector
p(lheEventSrc->hepeup().PUP[
i][0], lheEventSrc->hepeup().PUP[
i][1],
138 lheEventSrc->hepeup().PUP[
i][2], lheEventSrc->hepeup().PUP[
i][3]);
140 gp->set_generated_mass(lheEventSrc->hepeup().PUP[
i][4]);
141 v->add_particle_out(gp);
144 std::auto_ptr<HepMCProduct> pOut(
new HepMCProduct(evt));
156 if (lheRunSrcHandle.
isValid()) {
162 if (lheRunSrcHandle.
isValid()) {
164 edm::LogInfo(
"LHE2HepMCConverter") <<
"Taking LHERunInfoproduct from source";
167 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