#ifndef TG4HitGas_hxx_seen #define TG4HitGas_hxx_seen #include "IG4VHit.hxx" #include namespace COMET { class IG4HitGas; } /** * @brief Hit class used to save gas-detector hits into a root output file. * In one event, one HitGas is kept for each track entering a cell. * * If a track enters a cell more than once, more than one instance of * HitGas are created by the COMETGasSD, one for every entry. * */ class COMET::IG4HitGas: public IG4VHit { public: IG4HitGas(); virtual ~IG4HitGas(); /// @name Position at the point of closest approach /// For gaseous hits, the position is defined as the /// position of closest approach of a track onto the /// associated wire. /// @{ double GetPosX() const; double GetPosY() const; double GetPosZ() const; double GetPosT() const; const TVector3& GetPosition() const; /// @} /// @name Momentum at the point of closest approach /// @{ double GetMomX() const; double GetMomY() const; double GetMomZ() const; double GetMomentumMag() const; const TVector3& GetMomentum() const; /// @} /// @name Position, time and momentum when the track enters the cell /// @{ const TVector3& GetFirstPosition() const; double GetFirstTime() const; const TVector3& GetFirstMomentum() const; /// @} /// @name Position, time and momentum when the track exits the cell /// @{ const TVector3& GetLastPosition() const; double GetLastTime() const; const TVector3& GetLastMomentum() const; /// @} /// Energy deposit is defined as the energy deposited by a /// track by continuous processes, i.e. without the production /// of secondaries or delta rays. double GetEnergyDeposit() const { return fEnergyDeposit; } int GetPDGEncoding() const { return fPDGEncoding; } /// Distance of closest approach from the track to the wire double GetDOCA() const; /// Point of closest approach from the track to the wire const TVector3& GetPOCA() const; /// Point on the wire that was closest to the track const TVector3& GetPOCAOnWire() const; /// Total distance travelled by particle inside cell double GetLength() const; /// Print the hit information. virtual void ls(Option_t* = "") const; virtual void Print(Option_t* = "") const; /// Auxiliary point containing position, time and energy deposited /// information about the track which produced the hit. This additional /// info will be stored if the DetailedCDCSD is enabled. struct Auxiliary { TVector3 fPosition; double fTime; double fEnergyDeposit; }; const std::vector& GetAuxiliaryPoints() const; protected: /// @name Track position and momentum /// Triad of position, time and momentum for the entry point, exit point /// and point of closest approach of the track to the wire of the CDC cell. /// @{ /// Point of closest approach of the track to the wire. TVector3 fPOCA; /// Point on the wire that was closest to the track TVector3 fPOCAOnWire; /// Time at the point of closest approach of the track to the wire. double fTime; /// Momentum at the point of closest approach of the track to the wire. TVector3 fMomentum; /// Position of the track as it enters (or is born inside) the cell. TVector3 fFirstPosition; /// Time as the track enters (or is born inside) the cell. double fFirstTime; /// Momentum of the track as it enters (or is born inside) the cell. TVector3 fFirstMomentum; /// Position of the track as it exits (or dies inside) the cell. TVector3 fLastPosition; /// Time as the track exits (or dies inside) the cell. double fLastTime; /// Momentum of the track as it exits (or dies inside) the cell. TVector3 fLastMomentum; /// @} /// Total distance travelled by particle inside cell. double fLength; /// Energy deposited by this track in the cell through continuous processes. /// This energy is lost to the medium and is the quantity of interest for /// reconstruction. double fEnergyDeposit; /// Particle ID int fPDGEncoding; /// Vector of auxiliary points containing additional /// position, time and energy deposit information about the track which /// produced the hit. This vector is filled by the DetailedCDCSD if enabled. std::vector fAuxiliaryPoints; ClassDef(IG4HitGas,2); }; #endif