|
LDMX Software
|
An in-memory representation of a cluster being built during reconstruction. More...
#include <WorkingCluster.h>
Public Member Functions | |
| WorkingCluster ()=default | |
| Default constructor. | |
| WorkingCluster (const HitType *hit) | |
| Construct a cluster from a single hit. | |
| WorkingCluster (const HitType &hit) | |
| Construct a cluster from a single hit (reference version). | |
| ~WorkingCluster ()=default | |
| Default destructor. | |
| void | add (const HitType *hit) |
| Add a hit to the cluster using its stored position. | |
| void | add (const HitType &hit) |
| Add a hit to the cluster using its stored position (reference version). | |
| void | add (const HitType *hit, double x, double y, double z) |
| Add a hit to the cluster with explicit position. | |
| void | add (const WorkingCluster< HitType > &other) |
| Merge another cluster into this one. | |
| double | centroidX () const |
| Get the centroid X position (energy-weighted). | |
| double | centroidY () const |
| Get the centroid Y position (energy-weighted). | |
| double | centroidZ () const |
| Get the centroid Z position (energy-weighted). | |
| double | energy () const |
| Get the total energy of the cluster. | |
| double | time () const |
| Get the time of the cluster (latest hit time). | |
| const std::vector< const HitType * > & | hits () const |
| Get the list of hits in this cluster. | |
| bool | empty () const |
| Check if the cluster is empty. | |
| void | clear () |
| Clear all hits from the cluster. | |
| void | setCentroid (double x, double y, double z, double e) |
| Set the centroid position and energy explicitly. | |
| void | setTime (double t) |
| Set the time explicitly. | |
| int | layer () const |
| Get the layer of the cluster. | |
| void | setLayer (int layer) |
| Set the layer of the cluster. | |
Private Attributes | |
| std::vector< const HitType * > | hits_ |
| The hits in this cluster. | |
| double | centroid_x_ {0} |
| Centroid X position (energy-weighted) | |
| double | centroid_y_ {0} |
| Centroid Y position (energy-weighted) | |
| double | centroid_z_ {0} |
| Centroid Z position (energy-weighted) | |
| double | centroid_e_ {0} |
| Total energy. | |
| double | time_ {0} |
| Time (latest hit time) | |
| int | layer_ {-1} |
| Layer number. | |
An in-memory representation of a cluster being built during reconstruction.
This class is a general-purpose tool for building clusters from calorimeter hits. It is templated on the hit type, which must inherit from CalorimeterHit. The cluster stores an energy-weighted centroid in (x,y,z,E) space.
| HitType | The type of hit to cluster (must inherit from CalorimeterHit) |
Definition at line 28 of file WorkingCluster.h.
|
inline |
Construct a cluster from a single hit.
| hit | Pointer to the hit to initialize the cluster with |
Definition at line 40 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::add().
|
inline |
Construct a cluster from a single hit (reference version).
| hit | Reference to the hit to initialize the cluster with |
Definition at line 51 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::add().
|
inline |
Add a hit to the cluster using its stored position (reference version).
| hit | Reference to the hit to add |
Definition at line 95 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::add().
Referenced by recon::WorkingCluster< HitType >::add().
|
inline |
Add a hit to the cluster using its stored position.
The centroid is updated using energy-weighted averaging.
| hit | Pointer to the hit to add |
Definition at line 65 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_, recon::WorkingCluster< HitType >::centroid_x_, recon::WorkingCluster< HitType >::centroid_y_, recon::WorkingCluster< HitType >::centroid_z_, recon::WorkingCluster< HitType >::hits_, and recon::WorkingCluster< HitType >::time_.
Referenced by recon::TemplatedClusterFinder< HitType, WeightClass >::add(), recon::WorkingCluster< HitType >::WorkingCluster(), and recon::WorkingCluster< HitType >::WorkingCluster().
|
inline |
Add a hit to the cluster with explicit position.
This version allows providing the position externally (e.g., from geometry).
| hit | Pointer to the hit to add |
| x | X position of the hit |
| y | Y position of the hit |
| z | Z position of the hit |
Definition at line 108 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_, recon::WorkingCluster< HitType >::centroid_x_, recon::WorkingCluster< HitType >::centroid_y_, recon::WorkingCluster< HitType >::centroid_z_, recon::WorkingCluster< HitType >::hits_, and recon::WorkingCluster< HitType >::time_.
|
inline |
Merge another cluster into this one.
| other | The cluster to merge into this one |
Definition at line 134 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_, recon::WorkingCluster< HitType >::centroid_x_, recon::WorkingCluster< HitType >::centroid_y_, recon::WorkingCluster< HitType >::centroid_z_, recon::WorkingCluster< HitType >::hits_, and recon::WorkingCluster< HitType >::time_.
|
inline |
Get the centroid X position (energy-weighted).
Definition at line 161 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_x_.
Referenced by ecal::MyClusterWeight::operator()(), and hcal::MyClusterWeight::operator()().
|
inline |
Get the centroid Y position (energy-weighted).
Definition at line 166 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_y_.
Referenced by ecal::MyClusterWeight::operator()(), and hcal::MyClusterWeight::operator()().
|
inline |
Get the centroid Z position (energy-weighted).
Definition at line 171 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_z_.
Referenced by ecal::MyClusterWeight::operator()(), and hcal::MyClusterWeight::operator()().
|
inline |
Clear all hits from the cluster.
Definition at line 196 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_, recon::WorkingCluster< HitType >::centroid_x_, recon::WorkingCluster< HitType >::centroid_y_, recon::WorkingCluster< HitType >::centroid_z_, recon::WorkingCluster< HitType >::hits_, and recon::WorkingCluster< HitType >::time_.
|
inline |
Check if the cluster is empty.
Definition at line 191 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::hits_.
|
inline |
Get the total energy of the cluster.
Definition at line 176 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_.
Referenced by recon::TemplatedClusterFinder< HitType, WeightClass >::compClusters(), ecal::MyClusterWeight::operator()(), and hcal::MyClusterWeight::operator()().
|
inline |
Get the list of hits in this cluster.
Definition at line 186 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::hits_.
|
inline |
Get the layer of the cluster.
Definition at line 223 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::layer_.
Referenced by recon::WorkingCluster< HitType >::setLayer().
|
inline |
Set the centroid position and energy explicitly.
Definition at line 208 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::centroid_e_, recon::WorkingCluster< HitType >::centroid_x_, recon::WorkingCluster< HitType >::centroid_y_, and recon::WorkingCluster< HitType >::centroid_z_.
|
inline |
Set the layer of the cluster.
Definition at line 228 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::layer(), and recon::WorkingCluster< HitType >::layer_.
|
inline |
Set the time explicitly.
Definition at line 218 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::time_.
|
inline |
Get the time of the cluster (latest hit time).
Definition at line 181 of file WorkingCluster.h.
References recon::WorkingCluster< HitType >::time_.
|
private |
Total energy.
Definition at line 244 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::clear(), recon::WorkingCluster< HitType >::energy(), and recon::WorkingCluster< HitType >::setCentroid().
|
private |
Centroid X position (energy-weighted)
Definition at line 235 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::centroidX(), recon::WorkingCluster< HitType >::clear(), and recon::WorkingCluster< HitType >::setCentroid().
|
private |
Centroid Y position (energy-weighted)
Definition at line 238 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::centroidY(), recon::WorkingCluster< HitType >::clear(), and recon::WorkingCluster< HitType >::setCentroid().
|
private |
Centroid Z position (energy-weighted)
Definition at line 241 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::centroidZ(), recon::WorkingCluster< HitType >::clear(), and recon::WorkingCluster< HitType >::setCentroid().
|
private |
The hits in this cluster.
Definition at line 232 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::clear(), recon::WorkingCluster< HitType >::empty(), and recon::WorkingCluster< HitType >::hits().
|
private |
Layer number.
Definition at line 250 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::layer(), and recon::WorkingCluster< HitType >::setLayer().
|
private |
Time (latest hit time)
Definition at line 247 of file WorkingCluster.h.
Referenced by recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::add(), recon::WorkingCluster< HitType >::clear(), recon::WorkingCluster< HitType >::setTime(), and recon::WorkingCluster< HitType >::time().