The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ParticleProperty.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef GAUDIKERNEL_PARTICLEPROPERTY_H
12 #define GAUDIKERNEL_PARTICLEPROPERTY_H 1
13 // ============================================================================
14 // Include files
15 // ============================================================================
16 #include <iomanip>
17 #include <ostream>
18 #include <string>
19 // ============================================================================
20 
28 class ParticleProperty final {
29 public:
31  ParticleProperty() = default;
32 
33  ParticleProperty( std::string particle, int geantId, int jetsetId, double charge, double mass, double tlife,
34  std::string evtgenName, int pythiaId, double maxWidth )
35  : m_name( std::move( particle ) )
36  , m_idgeant( geantId )
37  , m_idjetset( jetsetId )
38  , m_charge( charge )
39  , m_mass( mass )
40  , m_tlife( tlife )
41  , m_evtgenName( std::move( evtgenName ) )
42  , m_pythiaId( pythiaId )
43  , m_maxWidth( maxWidth ) {}
44 
46  ~ParticleProperty() = default;
47 
49  const std::string& particle() const { return m_name; }
50 
53 
55  int geantID() const { return m_idgeant; }
56 
58  void setGeantID( int id ) { m_idgeant = id; }
59 
61  int pdgID() const { return m_idjetset; }
62 
64  void setPdgID( int id ) { m_idjetset = id; }
65 
67  int jetsetID() const { return m_idjetset; }
68 
70  void setJetsetID( int id ) { m_idjetset = id; }
71 
73  double charge() const { return m_charge; }
74 
76  void setCharge( double q ) { m_charge = q; }
77 
79  double mass() const { return m_mass; }
80 
82  void setMass( double m ) { m_mass = m; }
83 
85  double lifetime() const { return m_tlife; }
86 
88  void setLifetime( double t ) { m_tlife = t; }
89 
91  const std::string& evtGenName() const { return m_evtgenName; }
92 
95 
97  int pythiaID() const { return m_pythiaId; }
98 
100  void setPythiaID( int pId ) { m_pythiaId = pId; }
101 
103  double maxWidth() const { return m_maxWidth; }
104 
106  void setMaxWidth( double mW ) { m_maxWidth = mW; }
107 
109  const ParticleProperty* antiParticle() const { return m_anti; }
111  void setAntiParticle( const ParticleProperty* p ) { m_anti = p; }
112 
114  stream << "Name : " << pp.m_name << ", Geant ID : " << pp.m_idgeant << ", JetSet ID : " << pp.m_idjetset
115  << ", Charge (/e): " << pp.m_charge << ", Mass (MeV): " << pp.m_mass << ", Lifetime (ns): " << pp.m_tlife
116  << ", EvtGen Name: " << pp.m_evtgenName << ", Pythia ID: " << pp.m_pythiaId
117  << ", Max width deviation (MeV): " << pp.m_maxWidth;
118  return stream;
119  }
120 
121 private:
124 
127 
130 
132  double m_charge;
133 
135  double m_mass;
136 
138  double m_tlife;
139 
142 
145 
147  double m_maxWidth;
148 
150  const ParticleProperty* m_anti = nullptr;
151 };
152 
153 #endif
ParticleProperty::ParticleProperty
ParticleProperty(std::string particle, int geantId, int jetsetId, double charge, double mass, double tlife, std::string evtgenName, int pythiaId, double maxWidth)
Definition: ParticleProperty.h:33
ParticleProperty::charge
double charge() const
Get the particle charge.
Definition: ParticleProperty.h:73
ParticleProperty::m_name
std::string m_name
The particle name.
Definition: ParticleProperty.h:123
Write.stream
stream
Definition: Write.py:32
std::string
STL class.
ParticleProperty::jetsetID
int jetsetID() const
Get the JETSET(StdHep) ID.
Definition: ParticleProperty.h:67
ParticleProperty::~ParticleProperty
~ParticleProperty()=default
Destructor.
ParticleProperty::setMass
void setMass(double m)
Set the particle charge.
Definition: ParticleProperty.h:82
ParticleProperty::m_evtgenName
std::string m_evtgenName
The EvtGen Name.
Definition: ParticleProperty.h:141
ParticleProperty::evtGenName
const std::string & evtGenName() const
Get the EvtGen name.
Definition: ParticleProperty.h:91
ParticleProperty::m_pythiaId
int m_pythiaId
The Pythia ID.
Definition: ParticleProperty.h:144
ParticleProperty::m_idgeant
int m_idgeant
The GEANT ID.
Definition: ParticleProperty.h:126
ParticleProperty::m_tlife
double m_tlife
The lifetime.
Definition: ParticleProperty.h:138
ParticleProperty::pythiaID
int pythiaID() const
Get the Pythia ID.
Definition: ParticleProperty.h:97
ParticleProperty::setAntiParticle
void setAntiParticle(const ParticleProperty *p)
set the pointer to the antiparticle
Definition: ParticleProperty.h:111
ParticleProperty::m_anti
const ParticleProperty * m_anti
the antiparticle
Definition: ParticleProperty.h:150
ParticleProperty::particle
const std::string & particle() const
Get the particle name.
Definition: ParticleProperty.h:49
ParticleProperty::m_maxWidth
double m_maxWidth
The maximum width deviation.
Definition: ParticleProperty.h:147
bug_34121.t
t
Definition: bug_34121.py:30
ParticleProperty::setCharge
void setCharge(double q)
Set the particle charge.
Definition: ParticleProperty.h:76
ParticleProperty::setPdgID
void setPdgID(int id)
Set the PDG (= JETSET) ID.
Definition: ParticleProperty.h:64
ParticleProperty::setJetsetID
void setJetsetID(int id)
Set the JETSET(StdHep) ID.
Definition: ParticleProperty.h:70
ParticleProperty::pdgID
int pdgID() const
Get the PDG (= JETSET) ID.
Definition: ParticleProperty.h:61
ParticleProperty
Definition: ParticleProperty.h:28
TimingHistograms.name
name
Definition: TimingHistograms.py:25
Gaudi::Units::m
constexpr double m
Definition: SystemOfUnits.h:108
ParticleProperty::mass
double mass() const
Get the particle mass.
Definition: ParticleProperty.h:79
std::ostream
STL class.
ParticleProperty::maxWidth
double maxWidth() const
Get the max width deviation.
Definition: ParticleProperty.h:103
ParticleProperty::setPythiaID
void setPythiaID(int pId)
Set the Pythia ID.
Definition: ParticleProperty.h:100
ParticleProperty::antiParticle
const ParticleProperty * antiParticle() const
get the pointer to the antiparticle
Definition: ParticleProperty.h:109
ParticleProperty::lifetime
double lifetime() const
Get the particle lifetime.
Definition: ParticleProperty.h:85
ParticleProperty::geantID
int geantID() const
Get the GEANT3 ID.
Definition: ParticleProperty.h:55
ParticleProperty::setEvtGenName
void setEvtGenName(const std::string &name)
Set the EvtGen name.
Definition: ParticleProperty.h:94
ParticleProperty::setParticle
void setParticle(const std::string &particle)
Set the particle name.
Definition: ParticleProperty.h:52
ParticleProperty::ParticleProperty
ParticleProperty()=default
Constructors.
std
STL namespace.
ParticleProperty::setGeantID
void setGeantID(int id)
Set the GEANT3 ID.
Definition: ParticleProperty.h:58
ParticleProperty::m_charge
double m_charge
The charge.
Definition: ParticleProperty.h:132
compareOutputFiles.pp
pp
Definition: compareOutputFiles.py:516
ParticleProperty::setLifetime
void setLifetime(double t)
Set the particle lifetime.
Definition: ParticleProperty.h:88
ParticleProperty::setMaxWidth
void setMaxWidth(double mW)
Set the max width deviation.
Definition: ParticleProperty.h:106
ParticleProperty::m_mass
double m_mass
The mass.
Definition: ParticleProperty.h:135
ParticleProperty::operator<<
friend std::ostream & operator<<(std::ostream &stream, const ParticleProperty &pp)
Definition: ParticleProperty.h:113
ParticleProperty::m_idjetset
int m_idjetset
The Jetset ID.
Definition: ParticleProperty.h:129