LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TriggerAlgoBase.h
Go to the documentation of this file.
1 // \file TriggerAlgoBase.h
3 //
4 // \brief Trigger logic base class.
5 //
6 // \author kazuhiro@nevis.columbia.edu
7 //
9 
10 #ifndef TRIGGERALGOBASE_H
11 #define TRIGGERALGOBASE_H
12 
13 // ART includes
14 namespace art {
15  class Event;
16 }
17 namespace fhicl {
18  class ParameterSet;
19 }
20 
21 // From this package
22 #include "TriggerTypes.hh"
23 
24 // STL
25 #include <map>
26 #include <set>
27 
28 namespace trigger {
70 
71  public:
73  virtual ~TriggerAlgoBase() = default;
74 
76  virtual void RunTriggerSim(const art::Event& event)
77  {
78  FillData(event);
79  SimTrigger();
80  };
81 
83  virtual void ClearTriggerInfo()
84  {
85  _sim_done = false;
86  _timestamps.clear();
87  _time_windows.clear();
88  };
89 
91  bool HasRunTriggerSim() const { return _sim_done; };
92 
94  bool IsTriggered(trigdata::TrigTimeSlice_t time) const;
95 
97  const std::map<trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t>* GetTimeWindows() const
98  {
99  return &_time_windows;
100  };
101 
103  const std::set<trigdata::TrigTimeSlice_t>* GetTriggerTimeStamps() const
104  {
105  return &_timestamps;
106  };
107 
108  protected:
110  virtual void FillData(const art::Event& event) = 0;
111 
113  virtual void SimTrigger();
114 
116  void Config(fhicl::ParameterSet const& pset);
117 
119  std::set<trigdata::TrigTimeSlice_t> _timestamps;
120 
122  std::map<trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t> _time_windows;
123 
126 
129 
132 
134  bool _sim_done;
135 
136  }; // class TriggerAlgoBase
137 
138 } //namespace trigger
139 
140 #endif
uint64_t TrigTimeSlice_t
A unit of time used in trigger logic.
Definition: TriggerTypes.hh:9
std::set< trigdata::TrigTimeSlice_t > _timestamps
stores CANDIDATE readout trigger timestamps
trigdata::TrigTimeSlice_t _proceeding_slices
proceeding readout-window from trigger time stamp
trigdata::TrigTimeSlice_t _preceeding_slices
preceeding readout-window from trigger time stamp
parameter set interface
std::map< trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t > _time_windows
stores VALID readout trigger time windows
virtual void RunTriggerSim(const art::Event &event)
Function to run trigger simulation ... children class may be override.
bool HasRunTriggerSim() const
Getter for a boolean which "true" value indicates trigger simulation is run already.
bool _sim_done
run utility boolean, set to true after trigger simulation is run
const std::map< trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t > * GetTimeWindows() const
Getter to a const pointer of _time_windows std::map variable.
Definition: MVAAlg.h:12
const std::set< trigdata::TrigTimeSlice_t > * GetTriggerTimeStamps() const
Getter to a const pointer of _timestamps std::set variable.
trigdata::TrigTimeSlice_t _deadtime
trigger deadtime AFTER each valid trigger timestamps
virtual void ClearTriggerInfo()
Function to clear simulated trigger information.
Event finding and building.