LDMX Software
ldmx::CaloCluster Class Reference

Stores cluster information from the ECal. More...

#include <CaloCluster.h>

Public Member Functions

 CaloCluster ()=default
 Class constructor.
 
virtual ~CaloCluster ()
 Class destructor.
 
void clear ()
 Reset the CaloCluster object.
 
void addHits (const std::vector< const ldmx::CalorimeterHit * > hitsVec)
 Take in the hits that make up the cluster.
 
void setEnergy (double energy)
 Sets total energy for the cluster.
 
void setNHits (int nHits)
 Sets total number of hits in the cluster.
 
void setIDs (std::vector< unsigned int > &hitIDs)
 Sets a sorted vector for the IDs of the hits_ that make up the cluster.
 
void setHitValsX (std::vector< float > &x_)
 
void setHitValsY (std::vector< float > &x_)
 
void setHitValsZ (std::vector< float > &x_)
 
void setHitValsE (std::vector< float > &x_)
 
void setCentroidXYZ (double centroid_x, double centroid_y, double centroid_z)
 Sets the three coordinates of the cluster centroid.
 
void setLayer (int layer)
 
void setRMSXYZ (double rms_x, double rms_y, double rms_z)
 
void setDXDZ (double dxdz)
 
void setDYDZ (double dydz)
 
void setEDXDZ (double err_dxdz)
 
void setEDYDZ (double err_dydz)
 
double getEnergy () const
 
int getNHits () const
 
double getCentroidX () const
 centroid x-location
 
double getCentroidY () const
 centroid y-location
 
double getCentroidZ () const
 centroid z-location
 
int getLayer () const
 layer of the cluster centroid
 
double getRMSX () const
 rms in x
 
double getRMSY () const
 rms in y
 
double getRMSZ () const
 rms in z
 
double getDXDZ () const
 Delta in x-z plane.
 
double getDYDZ () const
 Delta in y-z plane.
 
double getEDXDZ () const
 Delta unc on unc in x-z plane.
 
double getEDYDZ () const
 Delta unc on unc in y-z plane.
 
const std::vector< unsigned int > & getHitIDs () const
 
const std::vector< float > & getHitX () const
 
const std::vector< float > & getHitY () const
 
const std::vector< float > & getHitZ () const
 
const std::vector< float > & getHitE () const
 
bool operator< (const CaloCluster &rhs) const
 

Protected Attributes

std::vector< unsigned int > hit_ids_
 
double energy_ {0}
 
int n_hits_ {0}
 
double centroid_x_ {0}
 
double centroid_y_ {0}
 
double centroid_z_ {0}
 
int layer_ {-1}
 
double rms_x_ {0}
 
double rms_y_ {0}
 
double rms_z_ {0}
 
double dxdz_ {0}
 
double dydz_ {0}
 
double err_dxdz_ {0}
 
double err_dydz_ {0}
 
std::vector< float > hit_x_
 
std::vector< float > hit_y_
 
std::vector< float > hit_z_
 
std::vector< float > hit_e_
 

Private Member Functions

 ClassDef (CaloCluster, 3)
 

Friends

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

Detailed Description

Stores cluster information from the ECal.

Definition at line 26 of file CaloCluster.h.

Constructor & Destructor Documentation

◆ ~CaloCluster()

ldmx::CaloCluster::~CaloCluster ( )
virtual

Class destructor.

Definition at line 7 of file CaloCluster.cxx.

7{ clear(); }
void clear()
Reset the CaloCluster object.

References clear().

Member Function Documentation

◆ addHits()

void ldmx::CaloCluster::addHits ( const std::vector< const ldmx::CalorimeterHit * > hitsVec)

Take in the hits that make up the cluster.

Parameters
hitThe digi hit's entry number in the events digi collection.

Definition at line 31 of file CaloCluster.cxx.

31 {
32 std::vector<unsigned int> vec_ids;
33 for (unsigned int i_hit = 0; i_hit < hitsVec.size(); i_hit++) {
34 vec_ids.push_back(hitsVec[i_hit]->getID());
35 }
36 setIDs(vec_ids);
37}
void setIDs(std::vector< unsigned int > &hitIDs)
Sets a sorted vector for the IDs of the hits_ that make up the cluster.
Definition CaloCluster.h:72

References setIDs().

◆ clear()

void ldmx::CaloCluster::clear ( )

Reset the CaloCluster object.

Definition at line 14 of file CaloCluster.cxx.

14 {
15 hit_ids_.clear();
16 energy_ = 0;
17 n_hits_ = 0;
18 centroid_x_ = 0;
19 centroid_y_ = 0;
20 centroid_z_ = 0;
21 layer_ = -1;
22 rms_x_ = 0;
23 rms_y_ = 0;
24 rms_z_ = 0;
25 dxdz_ = 0;
26 dydz_ = 0;
27 err_dxdz_ = 0;
28 err_dydz_ = 0;
29}

Referenced by ldmx::HcalCluster::clear(), ~CaloCluster(), and ldmx::EcalCluster::~EcalCluster().

◆ getCentroidX()

double ldmx::CaloCluster::getCentroidX ( ) const
inline

centroid x-location

Definition at line 116 of file CaloCluster.h.

116{ return centroid_x_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getCentroidY()

double ldmx::CaloCluster::getCentroidY ( ) const
inline

centroid y-location

Definition at line 118 of file CaloCluster.h.

118{ return centroid_y_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getCentroidZ()

double ldmx::CaloCluster::getCentroidZ ( ) const
inline

centroid z-location

Definition at line 120 of file CaloCluster.h.

120{ return centroid_z_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getDXDZ()

double ldmx::CaloCluster::getDXDZ ( ) const
inline

Delta in x-z plane.

Definition at line 130 of file CaloCluster.h.

130{ return dxdz_; }

◆ getDYDZ()

double ldmx::CaloCluster::getDYDZ ( ) const
inline

Delta in y-z plane.

Definition at line 132 of file CaloCluster.h.

132{ return dydz_; }

◆ getEDXDZ()

double ldmx::CaloCluster::getEDXDZ ( ) const
inline

Delta unc on unc in x-z plane.

Definition at line 134 of file CaloCluster.h.

134{ return err_dxdz_; }

◆ getEDYDZ()

double ldmx::CaloCluster::getEDYDZ ( ) const
inline

Delta unc on unc in y-z plane.

Definition at line 136 of file CaloCluster.h.

136{ return err_dydz_; }

◆ getEnergy()

double ldmx::CaloCluster::getEnergy ( ) const
inline

Definition at line 109 of file CaloCluster.h.

109{ return energy_; }

◆ getHitE()

const std::vector< float > & ldmx::CaloCluster::getHitE ( ) const
inline

Definition at line 145 of file CaloCluster.h.

145{ return hit_e_; }

◆ getHitIDs()

const std::vector< unsigned int > & ldmx::CaloCluster::getHitIDs ( ) const
inline

Definition at line 139 of file CaloCluster.h.

139{ return hit_ids_; }

◆ getHitX()

const std::vector< float > & ldmx::CaloCluster::getHitX ( ) const
inline

Definition at line 142 of file CaloCluster.h.

142{ return hit_x_; }

◆ getHitY()

const std::vector< float > & ldmx::CaloCluster::getHitY ( ) const
inline

Definition at line 143 of file CaloCluster.h.

143{ return hit_y_; }

◆ getHitZ()

const std::vector< float > & ldmx::CaloCluster::getHitZ ( ) const
inline

Definition at line 144 of file CaloCluster.h.

144{ return hit_z_; }

◆ getLayer()

int ldmx::CaloCluster::getLayer ( ) const
inline

layer of the cluster centroid

Definition at line 122 of file CaloCluster.h.

122{ return layer_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getNHits()

int ldmx::CaloCluster::getNHits ( ) const
inline

Definition at line 112 of file CaloCluster.h.

112{ return n_hits_; }

◆ getRMSX()

double ldmx::CaloCluster::getRMSX ( ) const
inline

rms in x

Definition at line 124 of file CaloCluster.h.

124{ return rms_x_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getRMSY()

double ldmx::CaloCluster::getRMSY ( ) const
inline

rms in y

Definition at line 126 of file CaloCluster.h.

126{ return rms_y_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ getRMSZ()

double ldmx::CaloCluster::getRMSZ ( ) const
inline

rms in z

Definition at line 128 of file CaloCluster.h.

128{ return rms_z_; }

Referenced by ecal::EcalClusterProducer::produce().

◆ operator<()

bool ldmx::CaloCluster::operator< ( const CaloCluster & rhs) const
inline

Definition at line 147 of file CaloCluster.h.

147 {
148 return this->getEnergy() < rhs.getEnergy();
149 }

◆ setCentroidXYZ()

void ldmx::CaloCluster::setCentroidXYZ ( double centroid_x,
double centroid_y,
double centroid_z )
inline

Sets the three coordinates of the cluster centroid.

Parameters
xThe x coordinate.
yThe y coordinate.
zThe z coordinate.

Definition at line 85 of file CaloCluster.h.

85 {
86 centroid_x_ = centroid_x;
87 centroid_y_ = centroid_y;
88 centroid_z_ = centroid_z;
89 }

Referenced by ecal::EcalClusterProducer::produce(), and hcal::HcalClusterProducer::produce().

◆ setDXDZ()

void ldmx::CaloCluster::setDXDZ ( double dxdz)
inline

Definition at line 98 of file CaloCluster.h.

98{ dxdz_ = dxdz; }

◆ setDYDZ()

void ldmx::CaloCluster::setDYDZ ( double dydz)
inline

Definition at line 100 of file CaloCluster.h.

100{ dydz_ = dydz; }

◆ setEDXDZ()

void ldmx::CaloCluster::setEDXDZ ( double err_dxdz)
inline

Definition at line 102 of file CaloCluster.h.

102{ err_dxdz_ = err_dxdz; }

◆ setEDYDZ()

void ldmx::CaloCluster::setEDYDZ ( double err_dydz)
inline

Definition at line 104 of file CaloCluster.h.

104{ err_dydz_ = err_dydz; }

◆ setEnergy()

void ldmx::CaloCluster::setEnergy ( double energy)
inline

Sets total energy for the cluster.

Parameters
energyThe total energy of the cluster.

Definition at line 59 of file CaloCluster.h.

59{ energy_ = energy; }

Referenced by ecal::EcalClusterProducer::produce(), and hcal::HcalClusterProducer::produce().

◆ setHitValsE()

void ldmx::CaloCluster::setHitValsE ( std::vector< float > & x_)
inline

Definition at line 77 of file CaloCluster.h.

77{ hit_e_ = x_; }

◆ setHitValsX()

void ldmx::CaloCluster::setHitValsX ( std::vector< float > & x_)
inline

Definition at line 74 of file CaloCluster.h.

74{ hit_x_ = x_; }

◆ setHitValsY()

void ldmx::CaloCluster::setHitValsY ( std::vector< float > & x_)
inline

Definition at line 75 of file CaloCluster.h.

75{ hit_y_ = x_; }

◆ setHitValsZ()

void ldmx::CaloCluster::setHitValsZ ( std::vector< float > & x_)
inline

Definition at line 76 of file CaloCluster.h.

76{ hit_z_ = x_; }

◆ setIDs()

void ldmx::CaloCluster::setIDs ( std::vector< unsigned int > & hitIDs)
inline

Sets a sorted vector for the IDs of the hits_ that make up the cluster.

Parameters
IDsSorted vector of hit IDs.

Definition at line 72 of file CaloCluster.h.

72{ hit_ids_ = hitIDs; }

Referenced by addHits(), ldmx::EcalCluster::addHits(), and ldmx::HcalCluster::addHits().

◆ setLayer()

void ldmx::CaloCluster::setLayer ( int layer)
inline

Definition at line 92 of file CaloCluster.h.

92{ layer_ = layer; }

◆ setNHits()

void ldmx::CaloCluster::setNHits ( int nHits)
inline

Sets total number of hits in the cluster.

Parameters
nHitsThe total number of hits_.

Definition at line 65 of file CaloCluster.h.

65{ n_hits_ = nHits; }

Referenced by ecal::EcalClusterProducer::produce(), and hcal::HcalClusterProducer::produce().

◆ setRMSXYZ()

void ldmx::CaloCluster::setRMSXYZ ( double rms_x,
double rms_y,
double rms_z )
inline

Definition at line 93 of file CaloCluster.h.

93 {
94 rms_x_ = rms_x;
95 rms_y_ = rms_y;
96 rms_z_ = rms_z;
97 }

Friends And Related Symbol Documentation

◆ operator<<

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

Print a description of this object.

Definition at line 9 of file CaloCluster.cxx.

9 {
10 return o << "CaloCluster { " << "Energy: " << c.energy_ << ", "
11 << "Number of hits_: " << c.n_hits_ << " }";
12}

Member Data Documentation

◆ centroid_x_

double ldmx::CaloCluster::centroid_x_ {0}
protected

Definition at line 155 of file CaloCluster.h.

155{0};

◆ centroid_y_

double ldmx::CaloCluster::centroid_y_ {0}
protected

Definition at line 156 of file CaloCluster.h.

156{0};

◆ centroid_z_

double ldmx::CaloCluster::centroid_z_ {0}
protected

Definition at line 157 of file CaloCluster.h.

157{0};

◆ dxdz_

double ldmx::CaloCluster::dxdz_ {0}
protected

Definition at line 162 of file CaloCluster.h.

162{0};

◆ dydz_

double ldmx::CaloCluster::dydz_ {0}
protected

Definition at line 163 of file CaloCluster.h.

163{0};

◆ energy_

double ldmx::CaloCluster::energy_ {0}
protected

Definition at line 153 of file CaloCluster.h.

153{0};

◆ err_dxdz_

double ldmx::CaloCluster::err_dxdz_ {0}
protected

Definition at line 164 of file CaloCluster.h.

164{0};

◆ err_dydz_

double ldmx::CaloCluster::err_dydz_ {0}
protected

Definition at line 165 of file CaloCluster.h.

165{0};

◆ hit_e_

std::vector<float> ldmx::CaloCluster::hit_e_
protected

Definition at line 169 of file CaloCluster.h.

◆ hit_ids_

std::vector<unsigned int> ldmx::CaloCluster::hit_ids_
protected

Definition at line 152 of file CaloCluster.h.

◆ hit_x_

std::vector<float> ldmx::CaloCluster::hit_x_
protected

Definition at line 166 of file CaloCluster.h.

◆ hit_y_

std::vector<float> ldmx::CaloCluster::hit_y_
protected

Definition at line 167 of file CaloCluster.h.

◆ hit_z_

std::vector<float> ldmx::CaloCluster::hit_z_
protected

Definition at line 168 of file CaloCluster.h.

◆ layer_

int ldmx::CaloCluster::layer_ {-1}
protected

Definition at line 158 of file CaloCluster.h.

158{-1};

◆ n_hits_

int ldmx::CaloCluster::n_hits_ {0}
protected

Definition at line 154 of file CaloCluster.h.

154{0};

◆ rms_x_

double ldmx::CaloCluster::rms_x_ {0}
protected

Definition at line 159 of file CaloCluster.h.

159{0};

◆ rms_y_

double ldmx::CaloCluster::rms_y_ {0}
protected

Definition at line 160 of file CaloCluster.h.

160{0};

◆ rms_z_

double ldmx::CaloCluster::rms_z_ {0}
protected

Definition at line 161 of file CaloCluster.h.

161{0};

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