#ifndef OAEVENT_ISINGLEHIT_HXX #define OAEVENT_ISINGLEHIT_HXX #include "IHit.hxx" #include "IChannelId.hxx" class TGeoManager; namespace COMET { class ISingleHit; class IMCHit; class IDataHit; class IWritableMCHit; class IWritableDataHit; } /// A single hit. This cannot be directly instantiated. class COMET::ISingleHit: public IHit { private: friend class IMCHit; friend class IDataHit; friend class IWritableMCHit; friend class IWritableDataHit; // The ISingleHit class can't be directly instantiated. It is created // using the IWritableMCHit, or IWritableDataHit classes and is accessed // as a IHit class. ISingleHit(); ISingleHit(const ISingleHit&); public: virtual ~ISingleHit(); /// Return the calibrated "charge" for the hit. virtual double GetCharge(void) const; /// Return the calibrated "time" for the hit. virtual double GetTime(void) const; /// The center of the volume associated with this hit. virtual const TVector3& GetPosition(void) const; /// Return true if this hit has useful X information. virtual bool IsXHit(void) const; /// Return true if this hit has useful Y information. virtual bool IsYHit(void) const; /// Return true if this hit has useful Z information. virtual bool IsZHit(void) const; /// Return the "spread" of the hit position. This is the extent in the X, /// Y, and Z directions. For instance, a P0D bar is about /// (3cm)x(2m)x(1.5cm), so the spread is (1.3cm)x(1m)x(0.75cm) virtual const TVector3& GetSpread(void) const; /// Return the "uncertainty" of the hit position. This is the position /// resolution of the hit. virtual const TVector3& GetUncertainty(void) const; /// Return the "uncertainty" for the time measurement. This is the timing /// resolution of the sensor. virtual double GetTimeUncertainty(void) const; /// Return the channel identifier associated with this hit. If the hit /// has an associated channel identifier, then this will return a valid /// IChannelId. If there isn't an associated hit, this will return an /// invalid value (check with IChannelId::IsValid). If the index is out /// of range, then this will throw an EHitOutOfRange exception. This /// information is also available through the digit, and it is an error /// condition if the two values disagree. virtual IChannelId GetChannelID(int i=0) const; /// Return the number of channel identifiers associated with the hit. virtual int GetChannelIDCount() const; private: /// Fill all of the geometry related fields from the geometry data base. void Initialize(); /// A helper routine to handle the generic geometry data base (for now, /// this is everything except the TPC. bool InitializeGeneric(); protected: /// The measured "charge" for this hit. Float_t fCharge; /// The measured "time" for this hit. Float_t fTime; /// The channel id associated with this hit. COMET::IChannelId fChannelID; /// This is set to true if the fast access fields below have been /// initialized. bool fInitialized; //! Don't Save /// The position of the hit. #ifdef TSINGLE_HIT_SAVE_POSITION // Define TSINGLE_HIT_SAVE_POSITION to save the hit position in the output // file. Otherwise, the hit position is found from the TGeoManager. This // flag should not be defined unless you are debugging the geometry code // since it prevents the calibration system from applying corrections to // the geometry. #warning This object is being compiled with the hit position saved in the \ output because the TSINGLE_HIT_SAVE_POSITION cflag was defined. The position \ should only be saved if your a debugging the oaEvent hit geometry interface, \ and MUST NOT be saved for normal data. Saving the position with the event \ by defining the TSINGLE_HIT_SAVE_POSITION flag may prevent the calibration \ system from applying corrections to the geometry. TVector3 fPosition; #else TVector3 fPosition; //! Don't Save #endif /// Flags for what type of position information is available. bool fIsXHit; //! Don't Save bool fIsYHit; //! Don't Save bool fIsZHit; //! Don't Save /// The spread of the hit position. TVector3 fSpread; //! Don't Save /// The uncertainty of the hit position. TVector3 fUncertainty; //! Don't Save /// The uncertainty for the timing. double fTimeUncertainty; //! Don't Save. ClassDef(ISingleHit,6); }; #endif