thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT > Struct Template Reference

HepMCTraitsBase is a convenient base class for specializing the HepMCTraits class to deal with different flavours of HepMC in the HepMCConverter class. More...

#include <HepMCTraits.h>

Inheritance diagram for ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >:

Public Types

typedef HepMCParticleT ParticleT
 Typedef of the particle class.
 
typedef HepMCEventT EventT
 Typedef of the event class.
 
typedef HepMCVertexT VertexT
 Typedef of the vertex class.
 
typedef HepMCPolarizationT PolarizationT
 Typedef of the polarization class.
 
typedef HepMCPdfInfoT PdfInfoT
 Typedef of the PdfInfo class.
 
typedef HepMCParticlePtrT ParticlePtrT
 Typedef of a particle pointer.
 
typedef HepMCVertexPtrT VertexPtrT
 Typedef of a vertex pointer.
 

Static Public Member Functions

static EventTnewEvent (long evno, double weight, const map< string, double > &optionalWeights)
 Create an event object with number evno and weight.
 
static void resetEvent (EventT *e, long evno, double weight, const map< string, double > &optionalWeights)
 Reset event weight and number of a re-used GenEvent.
 
static bool hasUnits ()
 Return true if this version of HepMC accept user-defined units.
 
static Energy defaultEnergyUnit ()
 Return the energy unit used in the installed version of HepMC.
 
static Length defaultLengthUnit ()
 Return the length unit used in the installed version of HepMC.
 
static Energy momentumUnit (const EventT &e)
 Return the momentum unit used by a given GenEvent object.
 
static Length lengthUnit (const EventT &e)
 Return the length unit used by a given GenEvent object.
 
static void setUnits (EventT &, Energy, Length)
 Set the units to be used by the given GenEvent object.
 
static void setScaleAndAlphas (EventT &e, Energy2 scale, double aS, double aEM, Energy unit)
 Set the scale, \(\alpha_S\) (aS) and \(\alpha_{EM}\) (aEM) for the event e.
 
static void setSignalProcessVertex (EventT &e, VertexPtrT v)
 Set the primary vertex, v, for the event e.
 
static void addVertex (EventT &e, VertexPtrT v)
 Set a vertex, v, for the event e.
 
static ParticlePtrT newParticle (const Lorentz5Momentum &p, long id, int status, Energy unit)
 Create a new particle object with momentum p, PDG number id and status code status.
 
static void setPolarization (ParticleT &genp, double the, double phi)
 Set the polarization directions, the and phi, for particle p.
 
static void setColourLine (ParticleT &p, int indx, int coline)
 Set the colour line (with index indx) to coline for particle p.
 
static VertexPtrT newVertex ()
 Create a new vertex.
 
static void addIncoming (VertexT &v, ParticlePtrT p)
 Add an incoming particle, p, to the vertex, v.
 
static void addOutgoing (VertexT &v, ParticlePtrT p)
 Add an outgoing particle, p, to the vertex, v.
 
static void setPosition (VertexT &v, const LorentzPoint &p, Length unit)
 Set the position p for the vertex, v.
 
static void setBeamParticles (EventT &e, ParticlePtrT p1, ParticlePtrT p2)
 Set the beam particles for the event.
 
static void setPdfInfo (EventT &, int, int, double, double, double, double, double)
 Set the PDF info for the event.
 
static void setCrossSection (EventT &, double, double)
 Set the cross section info for the event.
 

Detailed Description

template<typename HepMCEventT, typename HepMCParticleT, typename HepMCParticlePtrT, typename HepMCVertexT, typename HepMCVertexPtrT, typename HepMCPolarizationT, typename HepMCPdfInfoT>
struct ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >

HepMCTraitsBase is a convenient base class for specializing the HepMCTraits class to deal with different flavours of HepMC in the HepMCConverter class.

The default version will work for the CLHEP implementation of HepMC. To use the HepMCConverter class for any flavour of HepMC you have to specialize the HepMCTraits class accordingly, possibly inheriting the functionality from the HepMCTraitsBase class and only overriding the functions and typedefs which are different. For the CLHEP flavour of HepMC you only need to do template<> struct HepMCTraits<HepMC::GenEvent>: public HepMCTraitsBase<HepMC::GenEvent,HepMC::GenParticle,HepMC::GenVertex, HepMC::Polarization> {}; somewhere inside the ThePEG namespace. The boolean template argument determines whether the HepMC implementation is specifying units or not.

Definition at line 63 of file HepMCTraits.h.

Member Typedef Documentation

◆ EventT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCEventT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::EventT

Typedef of the event class.

Definition at line 69 of file HepMCTraits.h.

◆ ParticlePtrT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCParticlePtrT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::ParticlePtrT

Typedef of a particle pointer.

Definition at line 81 of file HepMCTraits.h.

◆ ParticleT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCParticleT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::ParticleT

Typedef of the particle class.

Definition at line 66 of file HepMCTraits.h.

◆ PdfInfoT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCPdfInfoT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::PdfInfoT

Typedef of the PdfInfo class.

Definition at line 78 of file HepMCTraits.h.

◆ PolarizationT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCPolarizationT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::PolarizationT

Typedef of the polarization class.

Definition at line 75 of file HepMCTraits.h.

◆ VertexPtrT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCVertexPtrT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::VertexPtrT

Typedef of a vertex pointer.

Definition at line 84 of file HepMCTraits.h.

◆ VertexT

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
typedef HepMCVertexT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::VertexT

Typedef of the vertex class.

Definition at line 72 of file HepMCTraits.h.

Member Function Documentation

◆ addIncoming()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::addIncoming ( VertexT v,
ParticlePtrT  p 
)
inlinestatic

Add an incoming particle, p, to the vertex, v.

Definition at line 275 of file HepMCTraits.h.

◆ addOutgoing()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::addOutgoing ( VertexT v,
ParticlePtrT  p 
)
inlinestatic

Add an outgoing particle, p, to the vertex, v.

Definition at line 280 of file HepMCTraits.h.

◆ addVertex()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::addVertex ( EventT e,
VertexPtrT  v 
)
inlinestatic

Set a vertex, v, for the event e.

Definition at line 238 of file HepMCTraits.h.

◆ defaultEnergyUnit()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static Energy ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::defaultEnergyUnit ( )
inlinestatic

Return the energy unit used in the installed version of HepMC.

Definition at line 164 of file HepMCTraits.h.

◆ defaultLengthUnit()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static Length ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::defaultLengthUnit ( )
inlinestatic

Return the length unit used in the installed version of HepMC.

Definition at line 175 of file HepMCTraits.h.

◆ hasUnits()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static bool ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::hasUnits ( )
inlinestatic

Return true if this version of HepMC accept user-defined units.

Definition at line 153 of file HepMCTraits.h.

◆ lengthUnit()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static Length ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::lengthUnit ( const EventT e)
inlinestatic

Return the length unit used by a given GenEvent object.

If HepMC does not support units this must return millimeter.

Definition at line 200 of file HepMCTraits.h.

◆ momentumUnit()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static Energy ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::momentumUnit ( const EventT e)
inlinestatic

Return the momentum unit used by a given GenEvent object.

If HepMC does not support units this must return GeV.

Definition at line 188 of file HepMCTraits.h.

◆ newEvent()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static EventT * ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::newEvent ( long  evno,
double  weight,
const map< string, double > &  optionalWeights 
)
inlinestatic

Create an event object with number evno and weight.

Definition at line 87 of file HepMCTraits.h.

◆ newParticle()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static ParticlePtrT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::newParticle ( const Lorentz5Momentum p,
long  id,
int  status,
Energy  unit 
)
inlinestatic

Create a new particle object with momentum p, PDG number id and status code status.

The momentum will be scaled with unit which according to the HepMC documentation should be GeV.

Definition at line 246 of file HepMCTraits.h.

References ThePEG::Lorentz5Vector< Value >::mass().

◆ newVertex()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static VertexPtrT ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::newVertex ( )
inlinestatic

Create a new vertex.

Definition at line 270 of file HepMCTraits.h.

◆ resetEvent()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::resetEvent ( EventT e,
long  evno,
double  weight,
const map< string, double > &  optionalWeights 
)
inlinestatic

Reset event weight and number of a re-used GenEvent.

Definition at line 121 of file HepMCTraits.h.

◆ setBeamParticles()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setBeamParticles ( EventT e,
ParticlePtrT  p1,
ParticlePtrT  p2 
)
inlinestatic

Set the beam particles for the event.

Definition at line 292 of file HepMCTraits.h.

◆ setColourLine()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setColourLine ( ParticleT p,
int  indx,
int  coline 
)
inlinestatic

Set the colour line (with index indx) to coline for particle p.

Definition at line 265 of file HepMCTraits.h.

◆ setCrossSection()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setCrossSection ( EventT ,
double  ,
double   
)
inlinestatic

Set the cross section info for the event.

Definition at line 337 of file HepMCTraits.h.

◆ setPdfInfo()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setPdfInfo ( EventT ,
int  ,
int  ,
double  ,
double  ,
double  ,
double  ,
double   
)
inlinestatic

Set the PDF info for the event.

Definition at line 312 of file HepMCTraits.h.

◆ setPolarization()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setPolarization ( ParticleT genp,
double  the,
double  phi 
)
inlinestatic

Set the polarization directions, the and phi, for particle p.

Definition at line 259 of file HepMCTraits.h.

◆ setPosition()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setPosition ( VertexT v,
const LorentzPoint p,
Length  unit 
)
inlinestatic

Set the position p for the vertex, v.

The length will be scaled with unit which normally should be millimeters.

Definition at line 286 of file HepMCTraits.h.

◆ setScaleAndAlphas()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setScaleAndAlphas ( EventT e,
Energy2  scale,
double  aS,
double  aEM,
Energy  unit 
)
inlinestatic

Set the scale, \(\alpha_S\) (aS) and \(\alpha_{EM}\) (aEM) for the event e.

The scale will be scaled with unit before given to the GenEvent.

Definition at line 225 of file HepMCTraits.h.

◆ setSignalProcessVertex()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setSignalProcessVertex ( EventT e,
VertexPtrT  v 
)
inlinestatic

Set the primary vertex, v, for the event e.

Definition at line 233 of file HepMCTraits.h.

◆ setUnits()

template<typename HepMCEventT , typename HepMCParticleT , typename HepMCParticlePtrT , typename HepMCVertexT , typename HepMCVertexPtrT , typename HepMCPolarizationT , typename HepMCPdfInfoT >
static void ThePEG::HepMCTraitsBase< HepMCEventT, HepMCParticleT, HepMCParticlePtrT, HepMCVertexT, HepMCVertexPtrT, HepMCPolarizationT, HepMCPdfInfoT >::setUnits ( EventT ,
Energy  ,
Length   
)
inlinestatic

Set the units to be used by the given GenEvent object.

If HepMC does not support units this should be a no-op.

Definition at line 218 of file HepMCTraits.h.


The documentation for this struct was generated from the following file: