LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 #include "fhiclcpp/ParameterSet.h"
17 
18 // From this package
19 #include "TriggerTypes.hh"
20 
21 // STL
22 #include <set>
23 
24 // ROOT
25 #include <TString.h>
26 
27 namespace trigger
28 {
70 
71  public:
72 
75 
77  virtual ~TriggerAlgoBase(){};
78 
80  virtual void RunTriggerSim(const art::Event& event){
81  FillData(event);
82  SimTrigger();
83  };
84 
86  virtual void ClearTriggerInfo(){
87  _sim_done=false;
88  _timestamps.clear();
89  _time_windows.clear();
90  };
91 
93  bool HasRunTriggerSim() const { return _sim_done;};
94 
96  bool IsTriggered(trigdata::TrigTimeSlice_t time) const;
97 
99  const std::map<trigdata::TrigTimeSlice_t,trigdata::TrigTimeSlice_t>* GetTimeWindows() const {return &_time_windows;};
100 
102  const std::set<trigdata::TrigTimeSlice_t>* GetTriggerTimeStamps() const {return &_timestamps;};
103 
104 
105  protected:
106 
108  virtual void FillData(const art::Event& event)=0;
109 
111  virtual void SimTrigger();
112 
114  void Config(fhicl::ParameterSet const& pset);
115 
117  std::set<trigdata::TrigTimeSlice_t> _timestamps;
118 
120  std::map<trigdata::TrigTimeSlice_t,trigdata::TrigTimeSlice_t> _time_windows;
121 
124 
127 
130 
132  bool _sim_done;
133 
134  }; // class TriggerAlgoBase
135 
136 } //namespace trigger
137 
138 #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
const std::map< trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t > * GetTimeWindows() const
Getter to a const pointer of _time_windows std::map variable.
trigdata::TrigTimeSlice_t _preceeding_slices
preceeding readout-window from trigger time stamp
TriggerAlgoBase(fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
Default constructor with fhicl parameters.
virtual void FillData(const art::Event &event)=0
Function to fill _timestamps std::set variable ... TO BE IMPLEMENTED in children. ...
virtual ~TriggerAlgoBase()
Default destructor.
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.
virtual void SimTrigger()
Function to analyze _timestamps and store valid readout windows in _time_windows. ...
bool _sim_done
run utility boolean, set to true after trigger simulation is run
std::map< trigdata::TrigTimeSlice_t, trigdata::TrigTimeSlice_t > _time_windows
stores VALID readout trigger time windows
void Config(fhicl::ParameterSet const &pset)
Function to extract fhicl parameters.
bool IsTriggered(trigdata::TrigTimeSlice_t time) const
Function to check if "time" (input arg.) is within any of valid readout windows or not...
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.