Skip to content
Snippets Groups Projects

Herwig HepMC3 interface

Merged Andrii Verbytskyi requested to merge averbyts/athena:hepmc3_herwig7 into master
1 file
+ 12
13
Compare changes
  • Side-by-side
  • Inline
@@ -50,32 +50,33 @@ namespace ThePEG {
unit before given to the GenEvent. */
static void setScaleAndAlphas(HepMC3::GenEvent & e, Energy2 scale,
double aS, double aEM, Energy unit) {
// e.set_event_scale(sqrt(scale)/unit);
// e.set_alphaQCD(aS);
// e.set_alphaQED(aEM);
e.add_attribute("event_scale",std::make_shared<HepMC3::DoubleAttribute>(sqrt(scale)/unit));
e.add_attribute("alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(aS));
e.add_attribute("alphaQED",std::make_shared<HepMC3::DoubleAttribute>(aEM));
}
/** Set the primary vertex, \a v, for the event \a e. */
static void setSignalProcessVertex(HepMC3::GenEvent & e, HepMC3::GenVertexPtr v) {
// e.set_signal_process_vertex(v);
e.add_attribute("signal_process_vertex",std::make_shared<HepMC3::IntAttribute>(v->id()));
}
/** Set the polarization directions, \a the and \a phi, for particle
\a p. */
static void setPolarization(HepMC3::GenParticle & genp, double the, double phi) {
//genp.set_polarization(PolarizationT(the, phi));
genp.add_attribute("theta",std::make_shared<HepMC3::DoubleAttribute>(the));
genp.add_attribute("phi",std::make_shared<HepMC3::DoubleAttribute>(phi));
}
/** Set the colour line (with index \a indx) to \a coline for
particle \a p. */
static void setColourLine(HepMC3::GenParticle & p, int indx, int coline) {
//p.set_flow(indx, coline);
p.add_attribute("flow"+std::to_string(indx),std::make_shared<HepMC3::IntAttribute>(coline));
}
/** Set the beam particles for the event.*/
static void setBeamParticles(HepMC3::GenEvent & e, HepMC3::GenParticlePtr p1, HepMC3::GenParticlePtr p2) {
// e.set_beam_particles(p1,p2);
p1->set_status(4);
p2->set_status(4);
e.set_beam_particles(p1,p2);
}
static HepMC3::GenParticlePtr newParticle(const Lorentz5Momentum & p,
@@ -83,23 +84,21 @@ namespace ThePEG {
// Note that according to the documentation the momentum is stored in a
// HepLorentzVector in GeV (event though the CLHEP standard is MeV).
LorentzVector<double> p_scalar = p/unit;
HepMC3::GenParticlePtr genp;// =
//new ParticleT(p_scalar, id, status);
//genp->setGeneratedMass(p.mass()/unit);
HepMC3::GenParticlePtr genp = std::make_shared<HepMC3::GenParticle>(HepMC::FourVector(p_scalar.x(),p_scalar.y(),p_scalar.z(),p_scalar.e()), id, status);
genp->set_generated_mass(p.mass()/unit);
return genp;
}
/** Set the position \a p for the vertex, \a v. The length will be
scaled with \a unit which normally should be millimeters. */
static void setPosition( HepMC3::GenVertex & v, const LorentzPoint & p, Length unit) {
LorentzVector<double> p_scaled = p/unit;
// v.set_position(p_scaled);
v.set_position(HepMC::FourVector(p_scaled.x(),p_scaled.y(),p_scaled.z(),p_scaled.t()));
}
/** Create a new vertex. */
static HepMC3::GenVertexPtr newVertex() {
return HepMC3::GenVertexPtr();
return std::make_shared<HepMC3::GenVertex>();
}
};
}
#else
Loading