Particle.h
Go to the documentation of this file.
1 #ifndef _utl_Particle_h_
2 #define _utl_Particle_h_
3 
4 #include <utl/VParticleProperties.h>
5 #include <utl/Point.h>
6 #include <utl/TimeInterval.h>
7 #include <utl/Vector.h>
8 #include <utl/AugerException.h>
9 
10 #include <iostream>
11 #include <string>
12 
13 #include <boost/shared_ptr.hpp>
14 
15 
16 namespace utl {
17 
26  class Particle {
27 
28  public:
29  // Enumerations
30 
31  enum Source {
35  eShowerFromLocalHadron, // for universality parametrization
36  eCornerClipping // for UMD injection disctintion
37  };
38 
48  enum Type {
50  eElectron = 11, ePositron = -11,
52  eMuon = 13, eAntiMuon = -13,
53  eNuMuon = 14, eAntiNuMuon = -14,
54  eTau = 15, eAntiTau = -15,
55  eNuTau = 16, eAntiNuTau = -16,
56  ePhoton = 22,
57  // PDG codes 81-100 are reserved for special/pseudo particles
59  ePiZero = 111,
60  eRhoZero = 113,
61  ePiPlus = 211, ePiMinus = -211,
62  eRhoPlus = 213, eRhoMinus = -213,
63  eEta = 221,
64  eOmegaMeson = 223,
65  eKaon0L = 130, eKaon0S = 310,
67  eKaonPlus = 321, eKaonMinus = -321,
69  ePhi = 333,
70  eDeltaMinus = 1114, eAntiDeltaPlus = -1114,
71  eNeutron = 2112, eAntiNeutron = -2112,
72  eDeltaZero = 2114, eAntiDeltaZero = -2114,
73  eProton = 2212, eAntiProton = -2212,
74  eDeltaPlus = 2214, eAntiDeltaMinus = -2214,
76  eLambda = 3122, eAntiLambda = -3122,
77  eSigmaPlus = 3222, eSigmaZero = 3212, eSigmaMinus = 3112,
78  eAntiSigmaPlus = -3222, eAntiSigmaZero = -3212, eAntiSigmaMinus = -3112,
79  eXiZero = 3322, eXiMinus = 3312,
80  eAntiXiZero = -3322, eAntiXiMinus = -3312,
81  eOmegaMinus = 3332, eAntiOmegaMinus = -3332,
82  eLambdac = 4122,
83  // Selected nuclei.
84  // Note: This is an inconsistency left in for historical reasons only.
85  // Cf. utl::NucleusProperties instead!
86  // Usage example thereof can be found in CONEXFile.cc.
87  eIron = 1000026056
88  };
89 
91  Particle(const int type, const Source& source, const Point& position,
92  const Vector& direction, const TimeInterval& time,
93  const double weight, const double kineticEnergy);
94 
96  Particle(const int type, const Source& source, const Point& position,
97  const Vector& momentum, const TimeInterval& time,
98  const double weight);
99 
100  // why not return by enum??
101  int GetType() const { return fProperties->GetType(); }
102 
104  std::string GetName() const { return fProperties->GetName(); }
105 
107  Source GetSource() const { return fSource; }
108 
110  const Point& GetPosition() const { return fPosition; }
111  void SetPosition(const utl::Point& position) { fPosition = position; }
112 
114  const Vector& GetDirection() const { return fDirection; }
115  void SetDirection(const utl::Vector& direction) { fDirection = direction; }
116 
118  Vector GetMomentum() const;
119  void SetMomentum(const utl::Vector& momentum);
120 
122  const TimeInterval& GetTime() const { return fTime; }
123  void SetTime(const TimeInterval& time) { fTime = time; }
124 
126  double GetWeight() const { return fWeight; }
127  void SetWeight(const double weight) { fWeight = weight; }
128 
130  double GetKineticEnergy() const { return fKineticEnergy; }
131 
133  void SetKineticEnergy(const double ke) { fKineticEnergy = ke; }
134 
136  double GetTotalEnergy() const { return fKineticEnergy + GetMass(); }
137 
139  void SetTotalEnergy(const double totE) { fKineticEnergy = totE - GetMass(); }
140 
142  double GetMass() const { return fProperties->GetMass(); }
143 
145  static int NucleusCode(const int charge, const int atomicNumber);
146 
147  bool HasParent() const { return bool(fParent); }
148  Particle& GetParent() { return *fParent.get(); }
149  const Particle& GetParent() const { return *fParent.get(); }
150  void SetParent(Particle& parent) { fParent.reset(new Particle(parent)); }
151 
152  bool HasProductionPoint() const { return bool(fProductionPoint); }
153  const utl::Point& GetProductionPoint() const { return *fProductionPoint.get(); }
154  void SetProductionPoint(const utl::Point& point) { fProductionPoint.reset(new utl::Point(point)); }
155 
156  private:
157  // This is to handle Corsika's history option.
158  boost::shared_ptr<Particle> fParent;
159  boost::shared_ptr<const utl::Point> fProductionPoint;
160 
161  // General information
164 
167 
169  double fWeight = 0;
170  double fKineticEnergy = 0;
171 
172  };
173 
174 
181 
182  public:
184  ParticleTypeException(const std::string message = std::string())
185  : AugerException(message) { }
186 
188  virtual std::string GetExceptionName() const
189  { return "Unknown Particle Type exception"; }
190 
191  };
192 
193 }
194 
195 
196 #endif
void SetTime(const TimeInterval &time)
Definition: Particle.h:123
const utl::Point & GetProductionPoint() const
Definition: Particle.h:153
Point object.
Definition: Point.h:32
boost::shared_ptr< const utl::Point > fProductionPoint
Definition: Particle.h:159
const TimeInterval & GetTime() const
Arrival time delay at the ground.
Definition: Particle.h:122
double fKineticEnergy
Definition: Particle.h:170
bool HasProductionPoint() const
Definition: Particle.h:152
Base class for all exceptions used in the auger offline code.
void SetPosition(const utl::Point &position)
Definition: Particle.h:111
std::string GetName() const
string with particle name
Definition: Particle.h:104
static int NucleusCode(const int charge, const int atomicNumber)
Calculate particle type code for a given (A, Z)
Definition: Particle.cc:74
Describes a particle for Simulation.
Definition: Particle.h:26
void SetDirection(const utl::Vector &direction)
Definition: Particle.h:115
utl::Point fPosition
Definition: Particle.h:165
const Particle & GetParent() const
Definition: Particle.h:149
void SetMomentum(const utl::Vector &momentum)
Definition: Particle.cc:65
void SetTotalEnergy(const double totE)
Set Total (relativistic) energy.
Definition: Particle.h:139
TimeInterval fTime
Definition: Particle.h:168
Particle & GetParent()
Definition: Particle.h:148
boost::shared_ptr< const VParticleProperties > ParticlePropertiesPtr
Type
Particle types.
Definition: Particle.h:48
void SetProductionPoint(const utl::Point &point)
Definition: Particle.h:154
Particle(const int type, const Source &source, const Point &position, const Vector &direction, const TimeInterval &time, const double weight, const double kineticEnergy)
Constructor using kinetic energy.
Definition: Particle.cc:25
Source fSource
Definition: Particle.h:163
void SetWeight(const double weight)
Definition: Particle.h:127
boost::shared_ptr< Particle > fParent
Definition: Particle.h:158
utl::Vector fDirection
Definition: Particle.h:166
Base class to report non-existing particle id&#39;s.
Definition: Particle.h:180
ParticlePropertiesPtr fProperties
Definition: Particle.h:162
bool HasParent() const
Definition: Particle.h:147
double GetKineticEnergy() const
Get kinetic energy of the particle.
Definition: Particle.h:130
double GetTotalEnergy() const
Get Total (relativistic) energy.
Definition: Particle.h:136
A TimeInterval is used to represent time elapsed between two events.
Definition: TimeInterval.h:43
double GetWeight() const
Particle weight (assigned by shower generator thinning algorithms)
Definition: Particle.h:126
double GetMass() const
Mass of the particle.
Definition: Particle.h:142
Source GetSource() const
Source of the particle (eg. shower or background)
Definition: Particle.h:107
Vector object.
Definition: Vector.h:30
int GetType() const
Definition: Particle.h:101
const Point & GetPosition() const
Position of the particle.
Definition: Particle.h:110
double fWeight
Definition: Particle.h:169
void SetParent(Particle &parent)
Definition: Particle.h:150
const Vector & GetDirection() const
Unit vector giving particle direction.
Definition: Particle.h:114
Vector GetMomentum() const
Vector giving particle momentum.
Definition: Particle.cc:55
void SetKineticEnergy(const double ke)
Set kinetic energy of the particle.
Definition: Particle.h:133

, generated on Tue Sep 26 2023.