9 #ifndef ThePEG_ParticleTraits_H
10 #define ThePEG_ParticleTraits_H
13 #include "ThePEG/Config/ThePEG.h"
19 template <
typename PType>
38 static PType &
ref(PType & p) {
82 return p.data().iCharge();
91 struct ParticleTraits<
PPtr>:
public TraitsType {
104 return p->momentum();
140 return p->data().iCharge();
146 struct ParticleTraits<
cPPtr>:
public TraitsType {
159 return p->momentum();
173 return p->data().iCharge();
179 struct ParticleTraits<
tPPtr>:
public TraitsType {
192 return p->momentum();
228 return p->data().iCharge();
234 struct ParticleTraits<
tcPPtr>:
public TraitsType {
247 return p->momentum();
261 return p->data().iCharge();
266 template <
typename T>
267 struct ParticleTraits<T*>:
public TraitsType {
272 static Particle & ref(T * p) {
286 static Energy mass(T * p) {
293 static void transform(T * p,
const LorentzRotation & r) {
300 static void set5Momentum(T * p,
const Lorentz5Momentum & q) {
308 static void set3Momentum(T * p,
const Momentum3 & q) {
315 static int iCharge(T * p) {
322 template <
typename T>
323 struct ParticleTraits<const T *>:
public TraitsType {
328 static const Particle & ref(
const T * p) {
342 static Energy mass(
const T * p) {
349 static int iCharge(
const T * p) {
377 static Energy mass(
const LorentzMomentum & p) {
384 static void transform(LorentzMomentum & p,
const LorentzRotation & r) {
391 static void set5Momentum(LorentzMomentum & p,
const Lorentz5Momentum & q) {
399 static void set3Momentum(LorentzMomentum & p,
const Momentum3 & q) {
427 static Energy mass(
const Lorentz5Momentum & p) {
434 static void transform(Lorentz5Momentum & p,
const LorentzRotation & r) {
441 static void set5Momentum(Lorentz5Momentum & p,
const Lorentz5Momentum & q) {
449 static void set3Momentum(Lorentz5Momentum & p,
const Momentum3 & q) {
465 template <
typename PType>
476 #ifndef ThePEG_TEMPLATES_IN_CC_FILE
ThePEG::Ptr< Particle >::pointer PPtr
Alias for a reference counted pointer to Particle .
static Energy mass(const PType &p)
Return the mass of particle p.
static PType & ref(PType &p)
Return a reference to the particle.
static void transform(PType &p, const LorentzRotation &r)
Perform a Lorentz transformation on particle p.
static void set3Momentum(PType &p, const Momentum3 &q)
Set the 3-momentum of a particle.
TraitsType is an empty, non-polymorphic, base class.
static int iCharge(const PType &p)
Return charge of particle p in units of e/3.
LorentzVector< Energy > LorentzMomentum
A momentum in four-dimensional space-time.
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Lorentz5Vector< Energy > Lorentz5Momentum
A momentum in four-dimensional space-time with an explicit invariant mass component.
This is the main namespace within which all identifiers in ThePEG are declared.
ThePEG::Ptr< Particle >::const_pointer cPPtr
Alias for a reference counted pointer to a const Particle .
QTY< 0, 1, 0 >::Type Energy
Energy.
static void set5Momentum(PType &p, const Lorentz5Momentum &q)
Set the momentum and mass of a particle.
ThePEG::Ptr< Particle >::transient_pointer tPPtr
Alias for a transient pointer to Particle .
ThePEG::Ptr< Particle >::transient_const_pointer tcPPtr
Alias for a transient pointer to a const Particle .
static LorentzMomentum momentum(const PType &p)
Return the momentum of particle p.
ParticleTraits is a templated class defining a general interface to any particle class.