/** \file EventTrigger EventTrigger.h "revt/EventTrigger.h" \brief %Event Trigger data \author Adrian Schmidt \version $Id$ \date 10 June 2009 \ingroup revt */ #ifndef _revt_EventTrigger_h_ #define _revt_EventTrigger_h_ #include #include #include namespace revt { /** \class EventTrigger EventTrigger.h revt/EventTrigger.h \brief Interface class to access the Event Trigger (T3) \author Harm Schoorlemmer, Adrian Schmidt \version $Id$ */ class EventTrigger { public: enum TriggerAlgorithm{ eNone, eCoincidence }; /// Get number of stations in the trigger unsigned int GetNumberOfStations() const { return fStationTimestamps.size(); } /// Get the Trigger Bit Pattern uint16_t GetBitPattern() const { return fBitPattern; } /// Set the Trigger Bit Pattern void SetBitPattern(const uint16_t BitPattern) { fBitPattern = BitPattern; } /// Get time of the event trigger utl::TimeStamp GetTime() const { return fTime; } /// Set time of the event trigger void SetTime(const utl::TimeStamp& time) { fTime = time; } /// Get the trigger time of one particular station utl::TimeStamp GetStationTime(const int stationId) const { return fStationTimestamps[stationId]; } /// Add a station with its trigger time void AddStationTime(const int stationId, const utl::TimeStamp time) { fStationTimestamps.insert(std::pair(stationId,time)); } /// Add a trigger algorithm's result void AddTriggerAlgorithm(const TriggerAlgorithm trigger, bool accepted) { fResultsOfTriggerAlgorithms.insert(std::pair(trigger,accepted)); } /// Check if a Trigger algorithm was performed bool TriggerPerformed(const TriggerAlgorithm trigger) const { return fResultsOfTriggerAlgorithms.count(trigger); } /// Check if Event was accepted by Trigger algorithm bool TriggerAccepted(const TriggerAlgorithm trigger) const { return fResultsOfTriggerAlgorithms[trigger];}; /// Set if Event was selftriggered void SetSelfTrigger (const bool trig) { fIsSelfTrigger = trig; } /// Check if Event was selftriggered bool IsSelfTrigger() const { return fIsSelfTrigger; } /// Set if Event was externally triggered void SetExternalTrigger (const bool trig) { fIsExtTrigger = trig; } /// Check if Event was externally triggered bool IsExternalTrigger() const { return fIsExtTrigger; } /// Set if Event comes from calibration trigger void SetCalibrationTrigger(const bool trig) { fIsCalibTrigger=trig;} /// Check if Event comes from calibration trigger bool IsCalibrationTrigger() const {return fIsCalibTrigger;} /// Set if Event comes from scintillator trigger void SetScintillatorTrigger(const bool trig) { fIsScintTrigger=trig;} /// Check if Event comes from scintillator trigger bool IsScintillatorTrigger() const {return fIsScintTrigger;} /// Set if Event comes from SD trigger void SetSDTrigger(const bool trig) { fIsSDTrigger=trig;} /// Check if Event comes from SD trigger bool IsSDTrigger() const {return fIsSDTrigger;} /// Set if Event comes from GUI trigger void SetGUITrigger(const bool trig) { fIsGUITrigger=trig;} /// Check if Event comes from GUI trigger bool IsGUITrigger() const {return fIsGUITrigger;} /// Set if Event comes from FD trigger void SetFDTrigger(const bool trig) { fIsFDTrigger=trig;} /// Check if Event comes from FD trigger bool IsFDTrigger() const {return fIsFDTrigger;} /// Set if Event comes from HEAT trigger void SetHEATTrigger(const bool trig) { fIsHEATTrigger=trig;} /// Check if Event comes from HEAT trigger bool IsHEATTrigger() const {return fIsHEATTrigger;} /// Set if Event comes from AERALET trigger void SetAERAletTrigger(const bool trig) { fIsAERAletTrigger=trig;} /// Check if Event comes from AERALET trigger bool IsAERAletTrigger() const {return fIsAERAletTrigger;} /// Set if Event comes from AIRPLANE trigger void SetAIRPLANETrigger(const bool trig) { fIsAIRPLANETrigger=trig;} /// Check if Event comes from AIRPLANE trigger bool IsAIRPLANETrigger() const {return fIsAIRPLANETrigger;} /// Set if Event comes from PERIODIC trigger void SetPeriodicTrigger(const bool trig) { fIsPeriodicTrigger=trig;} /// Check if Event comes from PERIODIC trigger bool IsPeriodicTrigger() const {return fIsPeriodicTrigger;} /// Set if Event comes from PASSTHROUGH trigger void SetPassThroughTrigger(const bool trig) { fIsPassThroughTrigger=trig;} /// Check if Event comes from PASSTHROUGH trigger bool IsPassThroughTrigger() const {return fIsPassThroughTrigger;} private: EventTrigger(); ~EventTrigger(); EventTrigger& operator=(const EventTrigger& evTrig); uint16_t fBitPattern; mutable std::map fStationTimestamps; mutable std::map fResultsOfTriggerAlgorithms; bool fIsSelfTrigger; bool fIsExtTrigger; bool fIsCalibTrigger; bool fIsScintTrigger; bool fIsSDTrigger; bool fIsGUITrigger; bool fIsFDTrigger; bool fIsHEATTrigger; bool fIsAERAletTrigger; bool fIsAIRPLANETrigger; bool fIsPeriodicTrigger; bool fIsPassThroughTrigger; int fPosition; utl::TimeStamp fTime; friend class REvent; friend class utl::LameShadowPtr; }; } #endif // Configure (x)emacs for this file ... // Local Variables: // mode: c++ // compile-command: "make -C .. -k" // End: