5#ifndef RECON_WORKINGCLUSTER_H_
6#define RECON_WORKINGCLUSTER_H_
25template <
class HitType>
63 void add(
const HitType* hit) {
66 double hit_e = hit->getEnergy();
67 double hit_x = hit->getXPos();
68 double hit_y = hit->getYPos();
69 double hit_z = hit->getZPos();
70 double hit_t = hit->getTime();
93 void add(
const HitType& hit) {
add(&hit); }
106 void add(
const HitType* hit,
double x,
double y,
double z) {
109 double hit_e = hit->getEnergy();
110 double hit_t = hit->getTime();
124 hits_.push_back(hit);
151 for (
const auto* hit : other.
hits_) {
152 hits_.push_back(hit);
184 const std::vector<const HitType*>&
hits()
const {
return hits_; }
An in-memory representation of a cluster being built during reconstruction.
double centroid_e_
Total energy.
double time() const
Get the time of the cluster (latest hit time).
double centroid_x_
Centroid X position (energy-weighted)
const std::vector< const HitType * > & hits() const
Get the list of hits in this cluster.
bool empty() const
Check if the cluster is empty.
double centroidY() const
Get the centroid Y position (energy-weighted).
double centroidX() const
Get the centroid X position (energy-weighted).
void setLayer(int layer)
Set the layer of the cluster.
double time_
Time (latest hit time)
double centroid_y_
Centroid Y position (energy-weighted)
void add(const HitType *hit, double x, double y, double z)
Add a hit to the cluster with explicit position.
std::vector< const HitType * > hits_
The hits in this cluster.
~WorkingCluster()=default
Default destructor.
double centroidZ() const
Get the centroid Z position (energy-weighted).
void clear()
Clear all hits from the cluster.
WorkingCluster(const HitType &hit)
Construct a cluster from a single hit (reference version).
void setCentroid(double x, double y, double z, double e)
Set the centroid position and energy explicitly.
void add(const WorkingCluster< HitType > &other)
Merge another cluster into this one.
void setTime(double t)
Set the time explicitly.
double energy() const
Get the total energy of the cluster.
double centroid_z_
Centroid Z position (energy-weighted)
int layer() const
Get the layer of the cluster.
WorkingCluster(const HitType *hit)
Construct a cluster from a single hit.
void add(const HitType &hit)
Add a hit to the cluster using its stored position (reference version).
WorkingCluster()=default
Default constructor.
void add(const HitType *hit)
Add a hit to the cluster using its stored position.