#ifndef TG4HitCheren_hxx_seen #define TG4HitCheren_hxx_seen #include #include "IG4VHit.hxx" #include "IG4Trajectory.hxx" #include "IHandle.hxx" namespace COMET { class IG4HitCheren; } /// DO NOT USE THIS CLASS IN ANALYSIS CODE. /// /// This is a base class used to save cherenkov counter hits into a ROOT file. class COMET::IG4HitCheren: public IG4VHit { public: IG4HitCheren(); IG4HitCheren(const IG4HitCheren& rhs); virtual ~IG4HitCheren(); /// Get the charge associated with this particle double GetCharge(void) const {return fCharge;} /// Get the beta factor of this particle double GetBeta(void) const {return fBeta;} /// The X position of the hit double GetStartX(void) const {return fStartPos.vX;} /// The Y position of the hit double GetStartY(void) const {return fStartPos.vY;} /// The Z position of the hit double GetStartZ(void) const {return fStartPos.vZ;} /// The time of the hit double GetStartT(void) const {return fStartPos.vT;} /// The X position of the hit double GetStopX(void) const {return fStopPos.vX;} /// The Y position of the hit double GetStopY(void) const {return fStopPos.vY;} /// The Z position of the hit double GetStopZ(void) const {return fStopPos.vZ;} /// The time of the hit double GetStopT(void) const {return fStopPos.vT;} // Get the length of the hit double GetHitLength(void) const; /// The X position of the hit double GetPosX(void) const {return (fStartPos.vX + fStopPos.vX)/2.;} /// The Y position of the hit double GetPosY(void) const {return (fStartPos.vY + fStopPos.vY)/2.;} /// The Z position of the hit double GetPosZ(void) const {return (fStartPos.vZ + fStopPos.vZ)/2.;} /// The time of the hit double GetPosT(void) const {return (fStartPos.vT + fStopPos.vT)/2.;} /// The X component of the momentum vector of the track double GetMomentumX(void) const {return fMomentum.vX;} /// The Y component of the momentum vector of the track double GetMomentumY(void) const {return fMomentum.vY;} /// The Z component of the momentum vector of the track double GetMomentumZ(void) const {return fMomentum.vZ;} /// The Z component of the momentum vector of the track double GetTotalEnergy(void) const {return fMomentum.vT;} /// The magnitude of the momentum double GetMomentumMag(void) const {return TVector3(fMomentum.vX, fMomentum.vY, fMomentum.vZ).Mag();} /// Print the hit information. virtual void ls(Option_t * = "") const; /// Light weight struct for storing 4-vectors values struct FourVector { Float_t vX; Float_t vY; Float_t vZ; Float_t vT; FourVector(): vX(0), vY(0), vZ(0), vT(0) {}; FourVector(double x, double y, double z, double t): vX(x), vY(y), vZ(z), vT(t) {}; FourVector(const FourVector& rhs): vX(rhs.vX), vY(rhs.vY), vZ(rhs.vZ), vT(rhs.vT) {}; }; protected: /// The charge of the associated particle in units of e/3 Float_t fCharge; /// The beta factor of the particle, i.e. v/c Float_t fBeta; /// The start position of the cherenkov hit FourVector fStartPos; /// The end position of the cherenkov hit FourVector fStopPos; /// The four momentum at the start point FourVector fMomentum; ClassDef(IG4HitCheren,1); }; #endif