5#ifndef RECON_WORKINGCLUSTER_H_
6#define RECON_WORKINGCLUSTER_H_
27template <
class HitType>
65 void add(
const HitType* hit) {
68 double hit_e = hit->getEnergy();
69 double hit_x = hit->getXPos();
70 double hit_y = hit->getYPos();
71 double hit_z = hit->getZPos();
72 double hit_t = hit->getTime();
95 void add(
const HitType& hit) {
add(&hit); }
108 void add(
const HitType* hit,
double x,
double y,
double z) {
111 double hit_e = hit->getEnergy();
112 double hit_t = hit->getTime();
126 hits_.push_back(hit);
153 for (
const auto* hit : other.
hits_) {
154 hits_.push_back(hit);
186 const std::vector<const HitType*>&
hits()
const {
return hits_; }
Class that represents a reconstructed hit in a calorimeter cell within the detector.
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.