9 #ifndef ThePEG_HepMCTraits_H
10 #define ThePEG_HepMCTraits_H
12 #include "HepMC/GenEvent.h"
42 template <
typename HepMCEventT,
typename HepMCParticleT,
43 typename HepMCVertexT,
typename HepMCPolarizationT,
44 typename HepMCPdfInfoT>
65 const map<string,double>& optionalWeights) {
67 e->set_event_number(evno);
68 e->weights().push_back(weight);
69 for ( map<string,double>::const_iterator w = optionalWeights.begin();
70 w != optionalWeights.end(); ++w ) {
71 #ifdef HEPMC_HAS_NAMED_WEIGHTS
72 e->weights()[w->first] = w->second;
74 e->weights().push_back(w->second);
82 const map<string,double>& optionalWeights) {
83 e->set_event_number(evno);
85 e->weights().push_back(weight);
86 for ( map<string,double>::const_iterator w = optionalWeights.begin();
87 w != optionalWeights.end(); ++w ) {
88 #ifdef HEPMC_HAS_NAMED_WEIGHTS
89 e->weights()[w->first] = w->second;
91 e->weights().push_back(w->second);
100 #ifdef HEPMC_HAS_UNITS
111 #ifndef HEPMC_HAS_UNITS
114 return HepMC::Units::default_momentum_unit() == HepMC::Units::GEV? GeV: MeV;
122 #ifndef HEPMC_HAS_UNITS
125 return HepMC::Units::default_length_unit() == HepMC::Units::MM?
126 millimeter: 10.0*millimeter;
135 #ifdef HEPMC_HAS_UNITS
136 return e.momentum_unit() == HepMC::Units::MEV? MeV: GeV;
147 #ifdef HEPMC_HAS_UNITS
148 return e.length_unit() == HepMC::Units::CM? centimeter: millimeter;
158 #ifdef HEPMC_HAS_UNITS
160 e.use_units(momu == MeV? HepMC::Units::MEV: HepMC::Units::GEV,
161 lenu == centimeter? HepMC::Units::CM: HepMC::Units::MM);
172 double aS,
double aEM,
Energy unit) {
173 e.set_event_scale(sqrt(scale)/unit);
180 e.set_signal_process_vertex(v);
193 long id,
int status,
Energy unit) {
198 genp->setGeneratedMass(p.
mass()/unit);
211 p.set_flow(indx, coline);
221 v.add_particle_in(p);
226 v.add_particle_out(p);
233 v.set_position(p_scaled);
238 e.set_beam_particles(p1,p2);
244 #ifdef HEPMC_HAS_PDF_INFO
246 double scale,
double xf1,
double xf2) {
247 e.set_pdf_info(
PdfInfoT(id1, id2, x1, x2, scale, xf1, xf2));
251 double,
double,
double) {}
255 #ifdef HEPMC_HAS_CROSS_SECTION
257 HepMC::GenCrossSection x;
258 x.set_cross_section(xs, xserr);
259 ev.set_cross_section(x);
280 template <
typename HepMCEventT>