13#include "ThePEG/EventRecord/Event.h"
14#include "ThePEG/EventRecord/SubProcess.h"
15#include "ThePEG/Handlers/XComb.h"
16#include "ThePEG/Handlers/EventHandler.h"
17#include "ThePEG/PDF/PDF.h"
19#include "Herwig/API/HerwigAPI.h"
24#define HEPMC_HAS_CROSS_SECTION
25#define HEPMC_HAS_PDF_INFO
27#include "ThePEG/Vectors/HepMCConverter.h"
30#include "HepMC3/GenEvent.h"
31#include "HepMC3/GenParticle.h"
32#include "HepMC3/GenVertex.h"
35 struct HepMCTraits<HepMC3::GenEvent>
36 :
public HepMCTraitsBase<HepMC3::GenEvent,
38 HepMC3::GenParticlePtr,
41 std::pair<double,double>,
44 static bool hasUnits() {
52 static void setScaleAndAlphas(HepMC3::GenEvent & e, Energy2 scale,
54 e.add_attribute(
"event_scale",std::make_shared<HepMC3::DoubleAttribute>(sqrt(scale)/
unit));
55 e.add_attribute(
"alphaQCD",std::make_shared<HepMC3::DoubleAttribute>(aS));
56 e.add_attribute(
"alphaQED",std::make_shared<HepMC3::DoubleAttribute>(aEM));
60 static void setSignalProcessVertex(HepMC3::GenEvent & e, HepMC3::GenVertexPtr v) {
61 e.add_attribute(
"signal_process_vertex",std::make_shared<HepMC3::IntAttribute>(v->id()));
66 static void setPolarization(HepMC3::GenParticle & genp,
double the,
double phi) {
67 genp.add_attribute(
"theta",std::make_shared<HepMC3::DoubleAttribute>(the));
68 genp.add_attribute(
"phi",std::make_shared<HepMC3::DoubleAttribute>(
phi));
73 static void setColourLine(HepMC3::GenParticle & p,
int indx,
int coline) {
74 p.add_attribute(
"flow"+std::to_string(indx),std::make_shared<HepMC3::IntAttribute>(coline));
77 static void setBeamParticles(HepMC3::GenEvent & e, HepMC3::GenParticlePtr p1, HepMC3::GenParticlePtr p2) {
80 e.set_beam_particles(std::move(p1),std::move(p2));
83 static HepMC3::GenParticlePtr newParticle(
const Lorentz5Momentum & p,
87 LorentzVector<double> p_scalar = p/
unit;
88 HepMC3::GenParticlePtr genp = std::make_shared<HepMC3::GenParticle>(HepMC::FourVector(p_scalar.x(),p_scalar.y(),p_scalar.z(),p_scalar.e()),
id, status);
89 genp->set_generated_mass(p.mass()/
unit);
94 static void setPosition( HepMC3::GenVertex & v,
const LorentzPoint & p, Length
unit) {
95 LorentzVector<double> p_scaled = p/
unit;
96 v.set_position(HepMC::FourVector(p_scaled.x(),p_scaled.y(),p_scaled.z(),p_scaled.t()));
100 static HepMC3::GenVertexPtr newVertex() {
101 return std::make_shared<HepMC3::GenVertex>();
108 struct HepMCTraits<HepMC::GenEvent>
109 :
public HepMCTraitsBase<HepMC::GenEvent,
111 HepMC::GenParticle *,
117 static bool hasUnits() {
127 :
public HepMCTraitsBase<HepMC::GenEvent,
140void convert_to_HepMC(
const ThePEG::Event & event, HepMC::GenEvent & evt,
bool nocopies,ThePEG::Energy eunit, ThePEG::Length lunit){
141 ThePEG::HepMCConverter<HepMC::GenEvent>::convert(event, evt, nocopies, eunit, lunit);
Scalar phi() const
phi method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
std::vector< double > Energy
void convert_to_HepMC(const ThePEG::Event &event, HepMC::GenEvent &evt, bool nocopies, ThePEG::Energy eunit, ThePEG::Length lunit)