#ifndef OAEVENT_IDATAHIT_HXX #define OAEVENT_IDATAHIT_HXX #include #include #include #include "IDigitProxy.hxx" namespace COMET { class IDataHit; class IWritableDataHit; } /// A single calibrated hit detector element. This corresponds to a real /// measurement inside the detector, after it has been fully calibrated. The /// hit is associated with a particular geometric element inside of the /// detector. /// /// If the MC has written digitized data (derived from IMCDigit), then a /// IDataHit will be used to hold the calibrated MC IHit objects. You can get /// associated MC information using the IDigitProxy saved in the hit. class COMET::IDataHit : public ISingleHit { public: IDataHit(); IDataHit(const IWritableDataHit& val); virtual ~IDataHit(); /// Return a proxy to the digit that generated this hit. The IDigitProxy /// will be valid if a IDigitContainer is available, and if the digit /// being accessed is in the first 131,000 hits (2^17). Accessing hits /// with an invalid index, missing IDigitContainer, or outside of that /// range will cause a EHitOutOfRange exception. For specialized studies, /// digits after the first 131,000 can be accessed by using GetChannelID() /// and then searching for the appropriate hit in the IDigitContainer. /// This search requires knowledge of how the digits are translated into /// hits. virtual const COMET::IDigitProxy& GetDigit(int i=0) const; /// Return the number of digits that contribute to this hit. virtual int GetDigitCount() const; protected: /// The digit that generated this hit. IDigitProxy fProxy; ClassDef(IDataHit,6); }; /// Provide a writable interface to a IDataHit that can be used to fill the /// object. class COMET::IWritableDataHit : public IDataHit { public: IWritableDataHit(); IWritableDataHit(const IWritableDataHit& h); virtual ~IWritableDataHit(); void SetGeomID(COMET::IGeometryId id); void SetCharge(double q); void SetTime(double t); void SetChargeValidity(bool valid); void SetTimeValidity(bool valid); /// Set the digit and channel id for this hit. If the proxy can access a /// valid digit, then this also sets the channel id. void SetDigit(COMET::IDigitProxy proxy); /// Explicitly set the channel id (shouldn't be required since also done /// by SetDigit). void SetChannelID(COMET::IChannelId id); ClassDef(IWritableDataHit,5); }; #endif