LDMX Software
TrigScintCluster.cxx
1#include "TrigScint/Event/TrigScintCluster.h"
2
4
5namespace ldmx {
7
8std::ostream& operator<<(std::ostream& o, const TrigScintCluster& c) {
9 o << "TrigScintCluster { " << "Energy: " << c.energy_ << ", "
10 << "Number of hits: " << c.n_hits_ << ", " << "Seed channel " << c.seed_
11 << ", Channel centroid: " << c.centroid_ << " }";
12 o << " -- Constituent hit channel ids: { ";
13 for (const auto& idx : c.getHitIDs()) {
14 o << idx << " ";
15
16 o << "}";
17 }
18 return o;
19};
20
21void TrigScintCluster::clear(Option_t*) {
22 hit_ids_.clear();
23
24 centroid_x_ = 0;
25 centroid_y_ = 0;
26 centroid_z_ = 0;
27 setEnergy(0);
28 setNHits(0);
29 setCentroid(0);
30 setSeed(-1);
31}
32} // namespace ldmx
Stores cluster information from the trigger scintillator pads.
virtual ~TrigScintCluster()
Class destructor.
void setNHits(int nHits)
The number of hits forming the cluster.
void setEnergy(double energy)
Set the cluster energy.
void setCentroid(double centroid)
const std::vector< unsigned int > & getHitIDs() const
Get vector of channel IDs of hits forming the cluster.
void clear(Option_t *option="")
Reset the TrigScintCluster object.