LDMX Software
CaloCluster.cxx
2
3ClassImp(ldmx::CaloCluster);
4
5namespace ldmx {
6
8
9std::ostream& operator<<(std::ostream& o, const CaloCluster& c) {
10 return o << "CaloCluster { " << "Energy: " << c.energy_ << ", "
11 << "Number of hits_: " << c.n_hits_ << " }";
12}
13
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}
30
31void CaloCluster::addHits(const std::vector<const CalorimeterHit*> hitsVec) {
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}
38
39} // namespace ldmx
Class that stores calorimeter cluster information.
Stores cluster information from the ECal.
Definition CaloCluster.h:26
void addHits(const std::vector< const ldmx::CalorimeterHit * > hitsVec)
Take in the hits that make up the cluster.
void clear()
Reset the CaloCluster object.
virtual ~CaloCluster()
Class destructor.
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