#ifndef THitSelection_hxx_seen #define THitSelection_hxx_seen #include #include #include #include #include "EoaCore.hxx" #include "IDatum.hxx" #include "IHit.hxx" namespace COMET { class IHitSelection; OA_EXCEPTION(EHitSelection,EoaCore); /// An invalid hit was added to the hit selection. This exception can be /// caught and continue, with the IHitSelection object intact. OA_EXCEPTION(EInvalidHit, EHitSelection); } /// A container of THitHandle objects for the hit detector information. This /// is an enhanced vector that works well with ROOT. class COMET::IHitSelection : public IDatum, public std::vector< IHandle > { public: IHitSelection(const char* name="hits", const char* title="Hit Handles"); virtual ~IHitSelection(); /// This is the usual std::vector::push_back, but enhanced to make /// sure that only valid hits are inserted into the IHitSelection. virtual void push_back(const COMET::IHandle& hit); /// A convenience method to make sure that a hit is only added to the /// IHitSelection once. The AddHit method is much slower than a /// push_back(), so it should only be used when the hit might already be /// in the selection. virtual void AddHit(const COMET::IHandle&); /// A convenience method to make sure that a hit is not in a /// IHitSelection. virtual void RemoveHit(const COMET::IHandle&); /// Print the data vector information. virtual void ls(Option_t* opt = "") const; private: ClassDef(IHitSelection,2); }; #endif