LDMX Software
CaloCluster.cxx
2
3ClassImp(ldmx::CaloCluster)
4
5 namespace ldmx {
7
9
10 void CaloCluster::Print() const {
11 std::cout << "CaloCluster { "
12 << "Energy: " << energy_ << ", "
13 << "Number of hits: " << nHits_ << " }" << std::endl;
14 }
15
16 void CaloCluster::Clear() {
17 hitIDs_.clear();
18 energy_ = 0;
19 nHits_ = 0;
20 centroidX_ = 0;
21 centroidY_ = 0;
22 centroidZ_ = 0;
23 rmsX_ = 0;
24 rmsY_ = 0;
25 rmsZ_ = 0;
26 DXDZ_ = 0;
27 DYDZ_ = 0;
28 errDXDZ_ = 0;
29 errDYDZ_ = 0;
30 }
31
32 void CaloCluster::addHits(const std::vector<const CalorimeterHit *> hitsVec) {
33 std::vector<unsigned int> vecIDs;
34 for (unsigned int iHit = 0; iHit < hitsVec.size(); iHit++) {
35 vecIDs.push_back(hitsVec[iHit]->getID());
36 }
37 setIDs(vecIDs);
38 }
39
40} // namespace ldmx
Class that stores calorimeter cluster information.
Stores cluster information from the ECal.
Definition CaloCluster.h:26
void Print() const
Print a description of this object.
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
CaloCluster()
Class constructor.