LDMX Software
FiducialFlag.h
Go to the documentation of this file.
1
8#ifndef RECON_EVENT_FIDUCIALFLAG_H_
9#define RECON_EVENT_FIDUCIALFLAG_H_
10
11// ROOT
12#include "TArrayD.h"
13#include "TObject.h" //ClassDef
14#include "TString.h"
15
16// STL
17#include <iostream>
18
19namespace ldmx {
20
26 public:
31
35 virtual ~FiducialFlag() = default;
36
40 void Print() const;
41
45 void Clear();
46
51 bool isFiducial() const { return is_fiducial_; }
52
57 int getFiducialFlag() const { return fiducial_flag_; }
58
63 bool hasEcalHit() const { return has_ecal_hit_; }
64
69 bool hasHcalHit() const { return has_hcal_hit_; }
70
75 bool hasMinTrackerHits() const { return has_min_tracker_hits_; }
76
81 bool hasMinEnergy() const { return has_min_energy_; }
82
88 double getAlgoVar(int element) const { return variables_[element]; }
89
95 double getAlgoVar0() const {
96 return (variables_.GetSize() < 1) ? (0) : (variables_[0]);
97 }
98
104 double getAlgoVar1() const {
105 return (variables_.GetSize() < 2) ? (0) : (variables_[1]);
106 }
107
113 double getAlgoVar2() const {
114 return (variables_.GetSize() < 3) ? (0) : (variables_[2]);
115 }
116
122 double getAlgoVar3() const {
123 return (variables_.GetSize() < 4) ? (0) : (variables_[3]);
124 }
125
131 double getAlgoVar4() const {
132 return (variables_.GetSize() < 5) ? (0) : (variables_[4]);
133 }
134
140 void setFiducialFlag(int fiducial_flag, int nvar);
141
146 void setIsFiducial(bool is_fiducial) { is_fiducial_ = is_fiducial; }
147
152 void setHasEcalHit(bool has_ecal_hit) { has_ecal_hit_ = has_ecal_hit; }
153
158 void setHasHcalHit(bool has_hcal_hit) { has_hcal_hit_ = has_hcal_hit; }
159
164 void setHasMinTrackerHits(bool has_min_tracker_hits) {
165 has_min_tracker_hits_ = has_min_tracker_hits;
166 }
167
172 void setHasMinEnergy(bool has_min_energy) {
173 has_min_energy_ = has_min_energy;
174 }
175
181 void setAlgoVar(int element, double value);
182
183 private:
184 /* Bit-mask that represents fiduciality conditions. */
185 int fiducial_flag_{0};
186
187 /* True if event is fiducial. */
188 bool is_fiducial_{false};
189
190 /* True if recoil electron has ecal hit. */
191 bool has_ecal_hit_{false};
192
193 /* True if recoil electron has hcal hit. */
194 bool has_hcal_hit_{false};
195
196 /* True if recoil electron has >= min tracker hits. */
197 bool has_min_tracker_hits_{false};
198
199 /* True if recoil electron has >= min energy at production. */
200 bool has_min_energy_{false};
201
202 /* Variable results from the fiduciality decision. */
203 TArrayD variables_;
204
205 ClassDef(FiducialFlag, 1);
206};
207} // namespace ldmx
208
209#endif
Holds truth-level fiduciality flags on the signal recoil electron.
void Print() const
Print a description of this object.
double getAlgoVar(int element) const
Return algorithm variable i (see algorithm code for details).
double getAlgoVar2() const
Return algorithm variable 2 (see algorithm code for details).
void setHasHcalHit(bool has_hcal_hit)
Set hcal hit flag.
double getAlgoVar4() const
Return algorithm variable 4 (see algorithm code for details).
int getFiducialFlag() const
Return fiducial flag bit mask.
bool isFiducial() const
Return true/false if event is fiducial.
void setAlgoVar(int element, double value)
Set an algorithm variable.
virtual ~FiducialFlag()=default
Class destructor.
void Clear()
Reset the FiducialFlag object.
bool hasMinTrackerHits() const
Return true/false if event has min.
void setHasMinTrackerHits(bool has_min_tracker_hits)
Set tracker hit flag.
bool hasMinEnergy() const
Return true/false if event has min.
bool hasEcalHit() const
Return true/false if event has ecal hit.
void setIsFiducial(bool is_fiducial)
Set fiduciality flag.
double getAlgoVar1() const
Return algorithm variable 1 (see algorithm code for details).
bool hasHcalHit() const
Return true/false if event has hcal hit.
FiducialFlag()
Class constructor.
double getAlgoVar0() const
Return algorithm variable 0 (see algorithm code for details).
void setFiducialFlag(int fiducial_flag, int nvar)
Set fiduciality bit mask.
void setHasEcalHit(bool has_ecal_hit)
Set ecal hit flag.
void setHasMinEnergy(bool has_min_energy)
Set recoil min.
double getAlgoVar3() const
Return algorithm variable 3 (see algorithm code for details).