#ifndef TTriggerContainer_hxx_seen #define TTriggerContainer_hxx_seen #include #include #include "EoaCore.hxx" #include "IDatum.hxx" #include "ITrigger.hxx" namespace COMET { class ITrigger; class ITriggerContainer; OA_EXCEPTION(ETriggerContainer, EoaCore); /// An invalid hit was added to the hit selection. This exception can be /// caught and continue, with the ITriggerContainer object intact. OA_EXCEPTION(EInvalidTrigger, ETriggerContainer); } /// A container for ITrigger objects. The ITriggerContainer /// class holds a representation of the uncalibrated electronics data and is /// generated from two sources. For data, the ITriggerContainer is dynamically /// generated from the MIDAS information saved in ICOMETRawEvent. For Monte /// Carlo, the ITriggerContainer is saved with the event (instead of saving a /// ICOMETRawEvent). The information inside of the ITriggerContainer is usually /// only accessed by the calibration routines, but can be accessed from the /// final TTriggerObjects using the ITriggerProxy which references the contributing /// ITrigger. class COMET::ITriggerContainer : public COMET::IDatum, public std::vector { public: ITriggerContainer(const char* name = "triggers", const char* title = "Trigger Pointers"); ~ITriggerContainer(); /// This is the usual std::vector::push_back, but enhanced to make /// sure that only valid hits are inserted into the ITriggerContainer. virtual void push_back(COMET::ITrigger* trigger); /// A convenience method to make sure that a hit is only added to the /// ITriggerContainer once. The AddTrigger 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 AddTrigger(COMET::ITrigger* trigger); /// A convenience method to make sure that a hit is not in a /// ITriggerContainer. virtual void RemoveTrigger(const COMET::ITrigger* trigger); /// Print the datum information. virtual void ls(Option_t* opt = "") const; ClassDef(ITriggerContainer,1); }; #endif