AmpGen 2.1
Loading...
Searching...
No Matches
ParticleProperties.h
Go to the documentation of this file.
1#ifndef AMPGEN_PARTICLEPROPERTIES_H
2#define AMPGEN_PARTICLEPROPERTIES_H
3// author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4// status: Mon 9 Feb 2009 19:18:04 GMT
5
6#include <iostream>
7#include <string>
8
10#include "AmpGen/Units.h"
11
12namespace AmpGen
13{
24
25
27 {
28 public:
29 explicit ParticleProperties( const std::string& pdg_string = "" );
30 double mass() const { return m_mass * MeV; }
31 double mErrPlus() const { return m_mErrPlus * MeV; }
32 double mErrMinus() const { return m_mErrMinus * MeV; }
33 double width() const { return m_width * MeV; }
34 double wErrPlus() const { return m_wErrPlus * MeV; }
35 double wErrMinus() const { return m_wErrMinus * MeV; }
36 double radius() const;
37 double lifetime() const;
38
39 int G() const { return m_Gparity; }
40 int P() const { return m_parity; }
41 int C() const { return m_Cparity; }
42 int R() const { return m_Rexist; }
43 int pdgID() const { return m_pdgID; }
44 int twoSpin() const { return m_twoSpin; }
45 int charge() const { return m_charge; }
46 char S() const { return m_status; }
47 std::string I() const { return m_isospin; }
48 std::string J() const;
49 std::string label() const { return m_texName; }
50 std::string name() const;
51 std::string spinName() const;
52 bool isValid() const { return m_isValid; }
53 bool hasDistinctAnti() const;
54 bool isNonResonant() const;
55 bool isFermion() const;
56 bool isBoson() const;
57 bool isNeutrino() const;
58
59 bool isPhoton() const;
60 void setProperty(const std::string& key, const std::string& value);
61 const QuarkContent& quarkContent() const { return m_quarkContent; }
62
63 void setLabel( const std::string& label ) { m_texName = label; }
64 void setName( const std::string& name ) {
65 m_customName = true;
66 m_name = name; }
67
68 void removeDistinctAnti(){ m_Aformat = ' '; }
69 void print( std::ostream& out = std::cout ) const;
70
71 bool operator==( const ParticleProperties& rhs ) const;
72 bool operator< ( const ParticleProperties& rhs ) const;
73 bool operator> ( const ParticleProperties& rhs ) const;
74 bool operator<=( const ParticleProperties& rhs ) const;
75 bool operator>=( const ParticleProperties& rhs ) const;
76
77 bool antiThis();
79
80 static const ParticleProperties* get( const std::string& name, const bool& quiet=false );
81 std::vector<int> polarisations() const;
82 private:
83 double m_mass{0};
84 double m_mErrPlus{0};
85 double m_mErrMinus{0};
86 double m_width{0};
87 double m_wErrPlus{0};
88 double m_wErrMinus{0};
89 double m_radius{0};
90 int m_Gparity{0};
91 int m_parity{0};
92 int m_Cparity{0};
93 int m_pdgID{0};
94 int m_Rexist{0};
95 int m_charge{0};
96 int m_twoSpin{0};
97 std::string m_isospin{""};
98 std::string m_name{""};
99 std::string m_texName{""};
100 std::string m_chargeString{""};
101 char m_Aformat;
102 char m_status;
103 QuarkContent m_quarkContent;
104 bool m_isValid;
105 bool m_customName = {false};
106 void antiQuarks();
107 void antiCharge();
108 int chargeFromString( const std::string& ch, bool& status ) const;
109 };
110 std::ostream& operator<<( std::ostream& out, const AmpGen::ParticleProperties& pp );
111}
112
113#endif
114//
Class that contains the PDG properties (mass, width, charges, etc.) for a single particle species,...
double width() const
Returns width of particle in MeV.
bool operator==(const ParticleProperties &rhs) const
int G() const
Returns the G-parity of the particle.
bool isBoson() const
Check if the particle is a boson, i.e. if the spin 0, 1, 2...
std::string label() const
Returns the LaTeX formatted label for the particle.
const QuarkContent & quarkContent() const
Returns the particle's quark content.
double radius() const
Returns the effective interaction radius of the particle, i.e. for the Blatt-Weisskopf factors.
std::string spinName() const
Returns the name of the particles spin.
bool isFermion() const
Check if the particle is a fermion, i.e. if the spin 1/2, 3/2, ...
bool operator<=(const ParticleProperties &rhs) const
bool isPhoton() const
Check if the particle is a photon.
void setProperty(const std::string &key, const std::string &value)
set a propery of a particle by key
bool isNeutrino() const
Check if the particle is a neutrino.
bool isValid() const
Check if the particle properties have been configured correctly.
double mErrPlus() const
Returns +ve uncertainty on particle mass in MeV.
void print(std::ostream &out=std::cout) const
ParticleProperties anti() const
Return the antiparticle of this particle.
int pdgID() const
Returns the PDG id of the particle.
bool operator>=(const ParticleProperties &rhs) const
std::string J() const
void setLabel(const std::string &label)
Set the LaTeX label of the particle.
int P() const
Returns the parity of the particle.
int R() const
Returns the R-parity of the particle.
bool operator>(const ParticleProperties &rhs) const
int twoSpin() const
Returns twice the spin of the particle.
double lifetime() const
Returns the lifetime of the particle in ns.
double wErrMinus() const
Returns -ve uncertainty on particle width in MeV.
bool isNonResonant() const
Check is this is a nonresonant ‘quasi-particle’.
ParticleProperties(const std::string &pdg_string="")
Constructor from a string formatted by the PDG convention.
std::vector< int > polarisations() const
bool hasDistinctAnti() const
Check if the particle has a distinct antiparticle.
static const ParticleProperties * get(const std::string &name, const bool &quiet=false)
std::string I() const
Returns the isospin of the particle as a string.
double wErrPlus() const
Returns +ve uncertainty on particle width in MeV.
char S() const
Returns the existence status of the particle, i.e. whether it is confirmed by multiple experiments.
bool antiThis()
Change this particle to its antiparticle.
void setName(const std::string &name)
Set the name of the particle.
std::string name() const
Returns the particle name.
double mass() const
Returns mass of particle in MeV.
bool operator<(const ParticleProperties &rhs) const
int C() const
Returns the C-parity of the particle.
int charge() const
Returns the (electrical) charge of the particle.
double mErrMinus() const
Returns -ve uncertainty on particle mass in MeV.
std::ostream & operator<<(std::ostream &os, const CompiledExpressionBase &expression)
static const double MeV
Definition Units.h:9