BasicTrigger.h
Go to the documentation of this file.
1 // BasicTrigger.h
2 //
3 // Michael Baird
4 // March 2016
5 //
6 // Basic trigger data product class for the DAQ trigger service framework.
7 //
8 
9 #ifndef BASICTRIGGER_H
10 #define BASICTRIGGER_H
11 
12 // DUNETPC specific includes
15 
16 // Framework includes
17 
18 // C++ includes
19 #include <vector>
20 #include <iostream>
21 
22 #ifndef __GCCXML__
23 #include <iosfwd> // std::ostream
24 #endif
25 
26 
27 namespace triggersim {
28 
29  class BasicTrigger {
30 
31  public:
32 
33  // Constructor...
34  BasicTrigger(bool trigdecision = false,
35  unsigned int trigtype = kNullTrigger,
36  unsigned int trigsubtype = kNullTrigger,
38 
39  // Destructor...
40  ~BasicTrigger();
41 
42  // Set and Get functions for the trigger type
43  void setTrigType(unsigned int trigtype);
44  unsigned int TrigType() const;
45 
46  // Set and Get functions for the trigger sub-type
47  void setTrigSubType(unsigned int trigsubtype);
48  unsigned int TrigSubType() const;
49 
50  // Set and Get functions for the trigger decision variable
51  void setTrigDecision(bool trigdecision);
52  bool TrigDecision() const;
53 
54  // Set and Get functions for the trigger algorithm performance metrics
55  void setMetrics(std::vector<double> metrics);
56  void setMetric(double metric);
57  std::vector<double> Metrics() const;
58  double Metric(unsigned int i) const;
59 
60  void setTrigHardwareID(Hardware::HardwareID hardwareid){ fTrigHardwareID = hardwareid; }
62 
63 
64 #ifndef __GCCXML__
65  friend std::ostream& operator << (std::ostream& o, BasicTrigger const& bt);
66  friend bool operator < (BasicTrigger const& a, BasicTrigger const& b);
67 #endif //__GCCXML__
68 
69  private:
70 
71 
72  // Parameters:
73  bool fTrigDecision; ///< did the trigger algorithm decide to keep this event?
74  unsigned int fTrigType; ///< trigger type (types and subtypes are defined in TriggerTypes.h)
75  unsigned int fTrigSubType; ///< trigger subtype (types and subtypes are defined in TriggerTypes.h)
77 
78  std::vector<double> fMetrics; ///< a vector to store trigger algorithm performance metrics
79  };
80 } // end namespace triggersim
81 
82 #endif
unsigned int fTrigType
trigger type (types and subtypes are defined in TriggerTypes.h)
Definition: BasicTrigger.h:74
std::vector< double > Metrics() const
unsigned int TrigSubType() const
BasicTrigger(bool trigdecision=false, unsigned int trigtype=kNullTrigger, unsigned int trigsubtype=kNullTrigger, Hardware::HardwareID hardwareid=Hardware::UnknownID)
Hardware::HardwareID const & TrigHardwareID() const
Definition: BasicTrigger.h:61
friend bool operator<(BasicTrigger const &a, BasicTrigger const &b)
void setMetrics(std::vector< double > metrics)
unsigned int fTrigSubType
trigger subtype (types and subtypes are defined in TriggerTypes.h)
Definition: BasicTrigger.h:75
const unsigned int kNullTrigger
Definition: TriggerTypes.h:14
Hardware::HardwareID fTrigHardwareID
Definition: BasicTrigger.h:76
void setTrigType(unsigned int trigtype)
static const HardwareID UnknownID
bt
Definition: tracks.py:83
void setTrigSubType(unsigned int trigsubtype)
void setTrigHardwareID(Hardware::HardwareID hardwareid)
Definition: BasicTrigger.h:60
const double a
void setTrigDecision(bool trigdecision)
friend std::ostream & operator<<(std::ostream &o, BasicTrigger const &bt)
bool TrigDecision() const
std::vector< double > fMetrics
a vector to store trigger algorithm performance metrics
Definition: BasicTrigger.h:78
static bool * b
Definition: config.cpp:1043
unsigned int TrigType() const
void setMetric(double metric)
metrics
Definition: train.py:350
double Metric(unsigned int i) const
bool fTrigDecision
did the trigger algorithm decide to keep this event?
Definition: BasicTrigger.h:73