LDMX Software
TriggerResult.h
Go to the documentation of this file.
1
8#ifndef RECON_EVENT_TRIGGERRESULT_H_
9#define RECON_EVENT_TRIGGERRESULT_H_
10
11// ROOT
12#include <Rtypes.h> // For ClassDef
13
14#include "TArrayD.h"
15#include "TString.h"
16
17// STL
18#include <iostream>
19
20namespace ldmx {
21
27 public:
31 TriggerResult() = default;
32
36 virtual ~TriggerResult();
37
41 friend std::ostream& operator<<(std::ostream& o, const TriggerResult& d);
42
46 void clear();
47
52 const TString& getName() const { return name_; }
53
58 bool passed() const { return pass_; }
59
65 double getAlgoVar(int element) const { return variables_[element]; }
66
72 double getAlgoVar0() const {
73 return (variables_.GetSize() < 1) ? (0) : (variables_[0]);
74 }
75
81 double getAlgoVar1() const {
82 return (variables_.GetSize() < 2) ? (0) : (variables_[1]);
83 }
84
90 double getAlgoVar2() const {
91 return (variables_.GetSize() < 3) ? (0) : (variables_[2]);
92 }
93
99 double getAlgoVar3() const {
100 return (variables_.GetSize() < 4) ? (0) : (variables_[3]);
101 }
102
108 double getAlgoVar4() const {
109 return (variables_.GetSize() < 5) ? (0) : (variables_[4]);
110 }
111
118 void set(const TString& name, bool pass, int nvar);
119
125 void setAlgoVar(int element, double value);
126
127 private:
129 TString name_{};
130
131 /* Represents the pass/fail trigger decision. */
132 bool pass_{false};
133
134 /* Algorithm variable results from the trigger decision. */
135 TArrayD variables_;
136
137 ClassDef(TriggerResult, 2);
138};
139} // namespace ldmx
140
141#endif
Represents the trigger decision (pass/fail) for reconstruction.
const TString & getName() const
Return the name of the trigger.
bool passed() const
Return pass/fail status of the trigger.
double getAlgoVar1() const
Return algorithm variable 1 (see algorithm code for details).
void clear()
Reset the TriggerResult object.
friend std::ostream & operator<<(std::ostream &o, const TriggerResult &d)
Print a description of this object.
virtual ~TriggerResult()
Class destructor.
void set(const TString &name, bool pass, int nvar)
Set name and pass of trigger.
TString name_
Name of the trigger algorithm.
double getAlgoVar2() const
Return algorithm variable 2 (see algorithm code for details).
double getAlgoVar4() const
Return algorithm variable 4 (see algorithm code for details).
double getAlgoVar0() const
Return algorithm variable 0 (see algorithm code for details).
TriggerResult()=default
Class constructor.
double getAlgoVar(int element) const
Return algorithm variable i (see algorithm code for details).
double getAlgoVar3() const
Return algorithm variable 3 (see algorithm code for details).
void setAlgoVar(int element, double value)
Set an algorithm variable.