REvent/EventTrigger.h
Go to the documentation of this file.
1 #ifndef _revt_EventTrigger_h_
2 #define _revt_EventTrigger_h_
3 
4 #include <stdint.h>
5 
6 #include <utl/TimeStamp.h>
7 #include <utl/LameShadowPtr_fwd.h>
8 
9 
10 namespace revt {
11 
21  class EventTrigger {
22 
23  public:
27  };
28 
30  unsigned int GetNumberOfStations() const { return fStationTimestamps.size(); }
31 
33  uint16_t GetBitPattern() const { return fBitPattern; }
34 
36  void SetBitPattern(const uint16_t BitPattern) { fBitPattern = BitPattern; }
37 
39  utl::TimeStamp GetTime() const { return fTime; }
40 
42  void SetTime(const utl::TimeStamp& time) { fTime = time; }
43 
45  utl::TimeStamp GetStationTime(const int stationId) const { return fStationTimestamps[stationId]; }
46 
48  void AddStationTime(const int stationId, const utl::TimeStamp time) { fStationTimestamps.insert(std::pair<int, utl::TimeStamp>(stationId, time)); }
49 
51  void AddTriggerAlgorithm(const TriggerAlgorithm trigger, const bool accepted) { fResultsOfTriggerAlgorithms.insert(std::pair<TriggerAlgorithm, bool>(trigger, accepted)); }
52 
54  bool TriggerPerformed(const TriggerAlgorithm trigger) const { return fResultsOfTriggerAlgorithms.count(trigger); }
55 
57  bool TriggerAccepted(const TriggerAlgorithm trigger) const { return fResultsOfTriggerAlgorithms[trigger]; }
58 
60  void SetSelfTrigger(const bool trig) { fIsSelfTrigger = trig; }
61 
63  bool IsSelfTrigger() const { return fIsSelfTrigger; }
64 
66  void SetExternalTrigger(const bool trig) { fIsExtTrigger = trig; }
67 
69  bool IsExternalTrigger() const { return fIsExtTrigger; }
70 
72  void SetCalibrationTrigger(const bool trig) { fIsCalibTrigger = trig; }
73 
75  bool IsCalibrationTrigger() const { return fIsCalibTrigger; }
76 
78  void SetScintillatorTrigger(const bool trig) { fIsScintTrigger = trig; }
79 
81  bool IsScintillatorTrigger() const { return fIsScintTrigger; }
82 
84  void SetSDTrigger(const bool trig) { fIsSDTrigger = trig; }
85 
87  bool IsSDTrigger() const { return fIsSDTrigger; }
88 
90  void SetGUITrigger(const bool trig) { fIsGUITrigger = trig; }
91 
93  bool IsGUITrigger() const { return fIsGUITrigger; }
94 
96  void SetFDTrigger(const bool trig) { fIsFDTrigger = trig; }
97 
99  bool IsFDTrigger() const { return fIsFDTrigger; }
100 
102  void SetHEATTrigger(const bool trig) { fIsHEATTrigger = trig; }
103 
105  bool IsHEATTrigger() const { return fIsHEATTrigger; }
106 
108  void SetAERAletTrigger(const bool trig) { fIsAERAletTrigger = trig; }
109 
111  bool IsAERAletTrigger() const { return fIsAERAletTrigger; }
112 
114  void SetAIRPLANETrigger(const bool trig) { fIsAIRPLANETrigger = trig; }
115 
117  bool IsAIRPLANETrigger() const { return fIsAIRPLANETrigger; }
118 
120  void SetPeriodicTrigger(const bool trig) { fIsPeriodicTrigger = trig; }
121 
123  bool IsPeriodicTrigger() const { return fIsPeriodicTrigger; }
124 
126  void SetPassThroughTrigger(const bool trig) { fIsPassThroughTrigger = trig; }
127 
130 
131  private:
134 
135  uint16_t fBitPattern = 0;
136  mutable std::map<int, utl::TimeStamp> fStationTimestamps;
137  mutable std::map<TriggerAlgorithm, bool> fResultsOfTriggerAlgorithms;
138 
139  bool fIsSelfTrigger = false;
140  bool fIsExtTrigger = false;
141  bool fIsCalibTrigger = false;
142  bool fIsScintTrigger = false;
143  bool fIsSDTrigger = false;
144  bool fIsGUITrigger = false;
145  bool fIsFDTrigger = false;
146  bool fIsHEATTrigger = false;
147  bool fIsAERAletTrigger = false;
148  bool fIsAIRPLANETrigger = false;
149  bool fIsPeriodicTrigger = false;
150  bool fIsPassThroughTrigger = false;
151 
152  int fPosition = 0;
153 
155 
156  friend class REvent;
158 
159  };
160 
161 }
162 
163 
164 #endif
Interface class to access the Event Trigger (T3)
bool IsCalibrationTrigger() const
Check if Event comes from calibration trigger.
void SetAERAletTrigger(const bool trig)
Set if Event comes from AERALET trigger.
bool IsPassThroughTrigger() const
Check if Event comes from PASSTHROUGH trigger.
std::map< TriggerAlgorithm, bool > fResultsOfTriggerAlgorithms
void SetPeriodicTrigger(const bool trig)
Set if Event comes from PERIODIC trigger.
bool IsPeriodicTrigger() const
Check if Event comes from PERIODIC trigger.
utl::TimeStamp GetStationTime(const int stationId) const
Get the trigger time of one particular station.
Interface class to access to the Radio part of an event.
Definition: REvent.h:42
void SetBitPattern(const uint16_t BitPattern)
Set the Trigger Bit Pattern.
void SetGUITrigger(const bool trig)
Set if Event comes from GUI trigger.
bool TriggerAccepted(const TriggerAlgorithm trigger) const
Check if Event was accepted by Trigger algorithm.
bool IsGUITrigger() const
Check if Event comes from GUI trigger.
void SetAIRPLANETrigger(const bool trig)
Set if Event comes from AIRPLANE trigger.
A TimeStamp holds GPS second and nanosecond for some event.
Definition: TimeStamp.h:110
void SetCalibrationTrigger(const bool trig)
Set if Event comes from calibration trigger.
void SetExternalTrigger(const bool trig)
Set if Event was externally triggered.
void SetSelfTrigger(const bool trig)
Set if Event was selftriggered.
void SetHEATTrigger(const bool trig)
Set if Event comes from HEAT trigger.
void AddTriggerAlgorithm(const TriggerAlgorithm trigger, const bool accepted)
Add a trigger algorithm&#39;s result.
bool TriggerPerformed(const TriggerAlgorithm trigger) const
Check if a Trigger algorithm was performed.
uint16_t GetBitPattern() const
Get the Trigger Bit Pattern.
void AddStationTime(const int stationId, const utl::TimeStamp time)
Add a station with its trigger time.
void SetTime(const utl::TimeStamp &time)
Set time of the event trigger.
bool IsHEATTrigger() const
Check if Event comes from HEAT trigger.
void SetPassThroughTrigger(const bool trig)
Set if Event comes from PASSTHROUGH trigger.
void SetSDTrigger(const bool trig)
Set if Event comes from SD trigger.
bool IsSDTrigger() const
Check if Event comes from SD trigger.
bool IsExternalTrigger() const
Check if Event was externally triggered.
bool IsSelfTrigger() const
Check if Event was selftriggered.
bool IsAERAletTrigger() const
Check if Event comes from AERALET trigger.
void SetScintillatorTrigger(const bool trig)
Set if Event comes from scintillator trigger.
std::map< int, utl::TimeStamp > fStationTimestamps
utl::TimeStamp GetTime() const
Get time of the event trigger.
unsigned int GetNumberOfStations() const
Get number of stations in the trigger.
bool IsScintillatorTrigger() const
Check if Event comes from scintillator trigger.
bool IsFDTrigger() const
Check if Event comes from FD trigger.
bool IsAIRPLANETrigger() const
Check if Event comes from AIRPLANE trigger.
void SetFDTrigger(const bool trig)
Set if Event comes from FD trigger.

, generated on Tue Sep 26 2023.