00001 #ifndef __GLG4HitPhoton_hh__
00002 #define __GLG4HitPhoton_hh__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 class GLG4HitPhoton {
00031 public:
00032 GLG4HitPhoton() { }
00033
00034 void SetPMTID(int id) { fPMTID= id; }
00035 void SetTime(double t) { fTime= t; }
00036 void SetKineticEnergy(double KE);
00037 void SetWavelength(double wl);
00038 void SetPosition(double x, double y, double z);
00039 void SetMomentum(double x, double y, double z);
00040 void SetPolarization(double x, double y, double z);
00041 void SetCount(int count) { fCount= count; }
00042 void AddCount(int dcount) { fCount+= dcount; }
00043
00044 int GetPMTID() const { return fPMTID; }
00045 double GetTime() const { return fTime; }
00046 double GetKineticEnergy() const;
00047 double GetWavelength() const;
00048 template <class T> inline void GetPosition(T &x, T &y, T &z) const;
00049 template <class T> inline void GetMomentum(T &x, T &y, T &z) const;
00050 template <class T> inline void GetPolarization(T &x, T &y, T &z) const;
00051 int GetCount() const { return fCount; }
00052 void Print(std::ostream &) const;
00053
00054 private:
00055 double fTime;
00056 int fPMTID;
00057 float fKE;
00058 float fPosition[3];
00059 float fMomentum[3];
00060 float fPolarization[3];
00061 int fCount;
00062 };
00063
00064 template <class T> inline void
00065 GLG4HitPhoton::GetPosition(T &x, T &y, T &z) const {
00066 x= fPosition[0];
00067 y= fPosition[1];
00068 z= fPosition[2];
00069 }
00070
00071 template <class T> inline void
00072 GLG4HitPhoton::GetMomentum(T &x, T &y, T &z) const {
00073 x= fMomentum[0];
00074 y= fMomentum[1];
00075 z= fMomentum[2];
00076 }
00077
00078 template <class T> inline void
00079 GLG4HitPhoton::GetPolarization(T &x, T &y, T &z) const {
00080 x= fPolarization[0];
00081 y= fPolarization[1];
00082 z= fPolarization[2];
00083 }
00084
00085
00086
00087
00088 inline bool
00089 Compare_HitPhotonPtr_TimeAscending(const GLG4HitPhoton *a,
00090 const GLG4HitPhoton *b)
00091 {
00092 return a->GetTime() < b->GetTime();
00093 }
00094
00095 #endif // __GLG4HitPhoton_hh__