LDMX Software
ldmx::FiducialFlag Class Reference

Holds truth-level fiduciality flags on the signal recoil electron. More...

#include <FiducialFlag.h>

Public Member Functions

 FiducialFlag ()=default
 Class constructor.
 
virtual ~FiducialFlag ()=default
 Class destructor.
 
void clear ()
 Reset the FiducialFlag object.
 
bool isFiducial () const
 Return true/false if event is fiducial.
 
int getFiducialFlag () const
 Return fiducial flag bit mask.
 
bool hasEcalHit () const
 Return true/false if event has ecal hit.
 
bool hasHcalHit () const
 Return true/false if event has hcal hit.
 
bool hasMinTrackerHits () const
 Return true/false if event has min.
 
bool hasMinEnergy () const
 Return true/false if event has min.
 
double getAlgoVar (int element) const
 Return algorithm variable i (see algorithm code for details).
 
double getAlgoVar0 () const
 Return algorithm variable 0 (see algorithm code for details).
 
double getAlgoVar1 () const
 Return algorithm variable 1 (see algorithm code for details).
 
double getAlgoVar2 () const
 Return algorithm variable 2 (see algorithm code for details).
 
double getAlgoVar3 () const
 Return algorithm variable 3 (see algorithm code for details).
 
double getAlgoVar4 () const
 Return algorithm variable 4 (see algorithm code for details).
 
void setFiducialFlag (int fiducial_flag, int nvar)
 Set fiduciality bit mask.
 
void setIsFiducial (bool is_fiducial)
 Set fiduciality flag.
 
void setHasEcalHit (bool has_ecal_hit)
 Set ecal hit flag.
 
void setHasHcalHit (bool has_hcal_hit)
 Set hcal hit flag.
 
void setHasMinTrackerHits (bool has_min_tracker_hits)
 Set tracker hit flag.
 
void setHasMinEnergy (bool has_min_energy)
 Set recoil min.
 
void setAlgoVar (int element, double value)
 Set an algorithm variable.
 

Private Member Functions

 ClassDef (FiducialFlag, 2)
 

Private Attributes

int fiducial_flag_ {0}
 
bool is_fiducial_ {false}
 
bool has_ecal_hit_ {false}
 
bool has_hcal_hit_ {false}
 
bool has_min_tracker_hits_ {false}
 
bool has_min_energy_ {false}
 
TArrayD variables_
 

Friends

std::ostream & operator<< (std::ostream &o, const FiducialFlag &d)
 Print a description of this object.
 

Detailed Description

Holds truth-level fiduciality flags on the signal recoil electron.

Definition at line 25 of file FiducialFlag.h.

Member Function Documentation

◆ clear()

void ldmx::FiducialFlag::clear ( )

Reset the FiducialFlag object.

Definition at line 20 of file FiducialFlag.cxx.

20 {
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}

◆ getAlgoVar()

double ldmx::FiducialFlag::getAlgoVar ( int element) const
inline

Return algorithm variable i (see algorithm code for details).

Parameters
elementThe index of the variable.
Returns
Algorithm variable at the index_.

Definition at line 88 of file FiducialFlag.h.

88{ return variables_[element]; }

◆ getAlgoVar0()

double ldmx::FiducialFlag::getAlgoVar0 ( ) const
inline

Return algorithm variable 0 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 0.

Definition at line 95 of file FiducialFlag.h.

95 {
96 return (variables_.GetSize() < 1) ? (0) : (variables_[0]);
97 }

◆ getAlgoVar1()

double ldmx::FiducialFlag::getAlgoVar1 ( ) const
inline

Return algorithm variable 1 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 1.

Definition at line 104 of file FiducialFlag.h.

104 {
105 return (variables_.GetSize() < 2) ? (0) : (variables_[1]);
106 }

◆ getAlgoVar2()

double ldmx::FiducialFlag::getAlgoVar2 ( ) const
inline

Return algorithm variable 2 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 2.

Definition at line 113 of file FiducialFlag.h.

113 {
114 return (variables_.GetSize() < 3) ? (0) : (variables_[2]);
115 }

◆ getAlgoVar3()

double ldmx::FiducialFlag::getAlgoVar3 ( ) const
inline

Return algorithm variable 3 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 3.

Definition at line 122 of file FiducialFlag.h.

122 {
123 return (variables_.GetSize() < 4) ? (0) : (variables_[3]);
124 }

◆ getAlgoVar4()

double ldmx::FiducialFlag::getAlgoVar4 ( ) const
inline

Return algorithm variable 4 (see algorithm code for details).

Note
Provided for interactive ROOT use.
Returns
Algorithm variable 4.

Definition at line 131 of file FiducialFlag.h.

131 {
132 return (variables_.GetSize() < 5) ? (0) : (variables_[4]);
133 }

◆ getFiducialFlag()

int ldmx::FiducialFlag::getFiducialFlag ( ) const
inline

Return fiducial flag bit mask.

Returns
Fiducial flag bit mask.

Definition at line 57 of file FiducialFlag.h.

57{ return fiducial_flag_; }

◆ hasEcalHit()

bool ldmx::FiducialFlag::hasEcalHit ( ) const
inline

Return true/false if event has ecal hit.

Returns
True if ecal hit.

Definition at line 63 of file FiducialFlag.h.

63{ return has_ecal_hit_; }

◆ hasHcalHit()

bool ldmx::FiducialFlag::hasHcalHit ( ) const
inline

Return true/false if event has hcal hit.

Returns
True if hcal hit.

Definition at line 69 of file FiducialFlag.h.

69{ return has_hcal_hit_; }

◆ hasMinEnergy()

bool ldmx::FiducialFlag::hasMinEnergy ( ) const
inline

Return true/false if event has min.

recoil energy at production.

Returns
True if >= min energy.

Definition at line 81 of file FiducialFlag.h.

81{ return has_min_energy_; }

◆ hasMinTrackerHits()

bool ldmx::FiducialFlag::hasMinTrackerHits ( ) const
inline

Return true/false if event has min.

number of tracker hits_.

Returns
True if >= min tracker hits_.

Definition at line 75 of file FiducialFlag.h.

75{ return has_min_tracker_hits_; }

◆ isFiducial()

bool ldmx::FiducialFlag::isFiducial ( ) const
inline

Return true/false if event is fiducial.

Returns
True if fiducial.

Definition at line 51 of file FiducialFlag.h.

51{ return is_fiducial_; }

◆ setAlgoVar()

void ldmx::FiducialFlag::setAlgoVar ( int element,
double value )

Set an algorithm variable.

Parameters
elementThe index of the variable.
valueThe variable's new value.

Definition at line 41 of file FiducialFlag.cxx.

41 {
42 if (element >= 0 && element < variables_.GetSize()) {
43 variables_[element] = value;
44 }
45}

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setFiducialFlag()

void ldmx::FiducialFlag::setFiducialFlag ( int fiducial_flag,
int nvar )

Set fiduciality bit mask.

Parameters
fiducial_flagBit-mask holding fiduciality conditions.
nvarThe number of algorithm variables.

Definition at line 33 of file FiducialFlag.cxx.

33 {
34 fiducial_flag_ = fiducial_flag;
35
36 if (nvar > variables_.GetSize()) {
37 variables_.Set(nvar);
38 }
39}

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setHasEcalHit()

void ldmx::FiducialFlag::setHasEcalHit ( bool has_ecal_hit)
inline

Set ecal hit flag.

Parameters
has_ecal_hitTrue/false if event has ecal hit.

Definition at line 152 of file FiducialFlag.h.

152{ has_ecal_hit_ = has_ecal_hit; }

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setHasHcalHit()

void ldmx::FiducialFlag::setHasHcalHit ( bool has_hcal_hit)
inline

Set hcal hit flag.

Parameters
has_hcal_hitTrue/false if event has hcal hit.

Definition at line 158 of file FiducialFlag.h.

158{ has_hcal_hit_ = has_hcal_hit; }

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setHasMinEnergy()

void ldmx::FiducialFlag::setHasMinEnergy ( bool has_min_energy)
inline

Set recoil min.

energy flag.

Parameters
has_min_energyTrue/false if event has >= min. recoil energy.

Definition at line 172 of file FiducialFlag.h.

172 {
173 has_min_energy_ = has_min_energy;
174 }

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setHasMinTrackerHits()

void ldmx::FiducialFlag::setHasMinTrackerHits ( bool has_min_tracker_hits)
inline

Set tracker hit flag.

Parameters
has_min_tracker_hitsTrue/false if event has >= min. tracker hits_.

Definition at line 164 of file FiducialFlag.h.

164 {
165 has_min_tracker_hits_ = has_min_tracker_hits;
166 }

Referenced by recon::RecoilFiducialityProcessor::produce().

◆ setIsFiducial()

void ldmx::FiducialFlag::setIsFiducial ( bool is_fiducial)
inline

Set fiduciality flag.

Parameters
is_fiducialTrue/false if event is fiducial.

Definition at line 146 of file FiducialFlag.h.

146{ is_fiducial_ = is_fiducial; }

Referenced by recon::RecoilFiducialityProcessor::produce().

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
const FiducialFlag & d )
friend

Print a description of this object.

Definition at line 7 of file FiducialFlag.cxx.

7 {
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}

Member Data Documentation

◆ fiducial_flag_

int ldmx::FiducialFlag::fiducial_flag_ {0}
private

Definition at line 185 of file FiducialFlag.h.

185{0};

◆ has_ecal_hit_

bool ldmx::FiducialFlag::has_ecal_hit_ {false}
private

Definition at line 191 of file FiducialFlag.h.

191{false};

◆ has_hcal_hit_

bool ldmx::FiducialFlag::has_hcal_hit_ {false}
private

Definition at line 194 of file FiducialFlag.h.

194{false};

◆ has_min_energy_

bool ldmx::FiducialFlag::has_min_energy_ {false}
private

Definition at line 200 of file FiducialFlag.h.

200{false};

◆ has_min_tracker_hits_

bool ldmx::FiducialFlag::has_min_tracker_hits_ {false}
private

Definition at line 197 of file FiducialFlag.h.

197{false};

◆ is_fiducial_

bool ldmx::FiducialFlag::is_fiducial_ {false}
private

Definition at line 188 of file FiducialFlag.h.

188{false};

◆ variables_

TArrayD ldmx::FiducialFlag::variables_
private

Definition at line 203 of file FiducialFlag.h.


The documentation for this class was generated from the following files: