LDMX Software
FiducialFlag.cxx
2
3ClassImp(ldmx::FiducialFlag);
4
5namespace ldmx {
6
7std::ostream& operator<<(std::ostream& o, const FiducialFlag& c) {
8 return o << "FiducialFlag { " << "fiducialFlag: " << c.fiducial_flag_ << ", "
9 << "isFiducial: " << c.is_fiducial_ << ", "
10 << "hasEcalHit: " << c.has_ecal_hit_ << ", "
11 << "hasHcalHit: " << c.has_hcal_hit_ << ", "
12 << "hasMinTrackerHits: " << c.has_min_tracker_hits_ << ", "
13 << "hasMinEnergy: " << c.has_min_energy_ << " }";
14
15 for (int i = 0; i < c.variables_.GetSize(); ++i) {
16 std::cout << "Element " << i << " : " << c.variables_[i] << std::endl;
17 }
18}
19
21 fiducial_flag_ = 0;
22 is_fiducial_ = false;
23 has_ecal_hit_ = false;
24 has_hcal_hit_ = false;
25 has_min_tracker_hits_ = false;
26 has_min_energy_ = false;
27
28 for (int i = 0; i < variables_.GetSize(); ++i) {
29 variables_[i] = 0;
30 }
31}
32
33void FiducialFlag::setFiducialFlag(int fiducial_flag, int nvar) {
34 fiducial_flag_ = fiducial_flag;
35
36 if (nvar > variables_.GetSize()) {
37 variables_.Set(nvar);
38 }
39}
40
41void FiducialFlag::setAlgoVar(int element, double value) {
42 if (element >= 0 && element < variables_.GetSize()) {
43 variables_[element] = value;
44 }
45}
46} // namespace ldmx
Class that holds truth-level fiduciality flags on the signal recoil electron.
Holds truth-level fiduciality flags on the signal recoil electron.
void setAlgoVar(int element, double value)
Set an algorithm variable.
void clear()
Reset the FiducialFlag object.
void setFiducialFlag(int fiducial_flag, int nvar)
Set fiduciality bit mask.