/home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/core/include/RAT/GLG4HitPhoton.hh Source File

Ratpac-two: /home/docs/checkouts/readthedocs.org/user_builds/ratpac/checkouts/latest/src/core/include/RAT/GLG4HitPhoton.hh Source File
Ratpac-two
GLG4HitPhoton.hh
Go to the documentation of this file.
1 #ifndef __GLG4HitPhoton_hh__
2 #define __GLG4HitPhoton_hh__
12 #include <iostream>
13 
31  public:
32  GLG4HitPhoton() { fPrepulse = false; }
33 
34  void SetPMTID(int id) { fPMTID = id; }
35  void SetTime(double t) { fTime = t; }
36  void SetCreationTime(double t) { fCreationTime = t; }
37  void SetKineticEnergy(double KE);
38  void SetWavelength(double wl);
39  void SetPosition(double x, double y, double z);
40  void SetMomentum(double x, double y, double z);
41  void SetPolarization(double x, double y, double z);
42  void SetCount(int count) { fCount = count; }
43  void AddCount(int dcount) { fCount += dcount; }
44  void SetTrackID(int trackID) { fTrackID = trackID; }
45  void SetCreatorProcess(std::string process) { fCreatorProcess = process; }
46  void SetPrepulse(bool prepulse) { fPrepulse = prepulse; }
47 
48  int GetPMTID() const { return fPMTID; }
49  double GetTime() const { return fTime; }
50  double GetCreationTime() const { return fCreationTime; }
51  double GetKineticEnergy() const;
52  double GetWavelength() const;
53  template <class T>
54  inline void GetPosition(T &x, T &y, T &z) const;
55  template <class T>
56  inline void GetMomentum(T &x, T &y, T &z) const;
57  template <class T>
58  inline void GetPolarization(T &x, T &y, T &z) const;
59  int GetCount() const { return fCount; }
60  int GetTrackID() const { return fTrackID; }
61  std::string GetCreatorProcess() const { return fCreatorProcess; }
62  bool GetPrepulse() const { return fPrepulse; }
63 
64  void Print(std::ostream &) const;
65 
66  private:
67  double fTime; // time of hit
68  double fCreationTime;
69  int fPMTID; // ID number of PMT the HitPhoton hit
70  double fKE; // kinetic energy
71  double fPosition[3]; // x,y,z components of position
72  double fMomentum[3]; // x,y,z components of momentum (normalized?)
73  double fPolarization[3]; // x,y,z components of polarization
74  int fCount; // count of photons, often 1
75  int fTrackID; // ID number of track which generated this photoelectron
76  std::string fCreatorProcess; // Process that created the photon
77  bool fPrepulse; // if this photon was transmitted through the
78  // the photocathode and a photoelectron was created
79  // at the first dynode, we will choose from the
80  // time and charge distributions for prepulses
81 };
82 
83 template <class T>
84 inline void GLG4HitPhoton::GetPosition(T &x, T &y, T &z) const {
85  x = fPosition[0];
86  y = fPosition[1];
87  z = fPosition[2];
88 }
89 
90 template <class T>
91 inline void GLG4HitPhoton::GetMomentum(T &x, T &y, T &z) const {
92  x = fMomentum[0];
93  y = fMomentum[1];
94  z = fMomentum[2];
95 }
96 
97 template <class T>
98 inline void GLG4HitPhoton::GetPolarization(T &x, T &y, T &z) const {
99  x = fPolarization[0];
100  y = fPolarization[1];
101  z = fPolarization[2];
102 }
103 
107  return a->GetTime() < b->GetTime();
108 }
109 
110 #endif // __GLG4HitPhoton_hh__
bool Compare_HitPhotonPtr_TimeAscending(const GLG4HitPhoton *a, const GLG4HitPhoton *b)
Definition: GLG4HitPhoton.hh:106
Definition: GLG4HitPhoton.hh:30
void SetWavelength(double wl)
set wavelength and kinetic energy of photon
Definition: GLG4HitPhoton.cc:18
void SetKineticEnergy(double KE)
set kinetic energy and wavelength of photon.
Definition: GLG4HitPhoton.cc:15