Set of hits with a 2D structure. More...
#include <Cluster.h>
Classes | |
struct | SentryArgument_t |
Type of sentry argument. More... | |
Public Types | |
enum | ClusterEnds_t { clStart, clEnd, NEnds, clFirstEnd = 0 } |
enum | ChargeMode_t { cmFit, cmADC, NChargeModes, cmFirstMode = 0 } |
typedef int | ID_t |
Type of cluster ID. More... | |
Public Member Functions | |
Cluster () | |
Default constructor: an empty cluster. More... | |
Cluster (float start_wire, float sigma_start_wire, float start_tick, float sigma_start_tick, float start_charge, float start_angle, float start_opening, float end_wire, float sigma_end_wire, float end_tick, float sigma_end_tick, float end_charge, float end_angle, float end_opening, float integral, float integral_stddev, float summedADC, float summedADC_stddev, unsigned int n_hits, float multiple_hit_density, float width, ID_t ID, geo::View_t view, geo::PlaneID const &plane, SentryArgument_t sentry=Sentry) | |
Constructor: assigns all the fields. More... | |
Cluster (Cluster const &)=default | |
Copy constructor: automatically generated. More... | |
Cluster (Cluster &&from) | |
Move constructor: as copy, but source cluster gets an invalid ID. More... | |
Cluster & | operator= (Cluster const &)=default |
Copy assignment: automatically generated. More... | |
Cluster & | operator= (Cluster &&from) |
Move assignment: as copy, but source cluster gets an invalid ID. More... | |
~Cluster ()=default | |
Destructor: automatically generated. More... | |
float | StartCharge () const |
Returns the charge on the first wire of the cluster. More... | |
float | StartAngle () const |
Returns the starting angle of the cluster. More... | |
float | StartOpeningAngle () const |
Returns the opening angle at the start of the cluster. More... | |
float | EndCharge () const |
Returns the charge on the last wire of the cluster. More... | |
float | EndAngle () const |
Returns the ending angle of the cluster. More... | |
float | EndOpeningAngle () const |
Returns the opening angle at the end of the cluster. More... | |
float | Integral () const |
Returns the total charge of the cluster from hit shape. More... | |
float | IntegralStdDev () const |
Returns the standard deviation of the charge of the cluster hits. More... | |
float | IntegralAverage () const |
Returns the average charge of the cluster hits. More... | |
float | SummedADC () const |
Returns the total charge of the cluster from signal ADC counts. More... | |
float | SummedADCstdDev () const |
Returns the standard deviation of the signal ADC counts of the cluster hits. More... | |
float | SummedADCaverage () const |
Returns the average signal ADC counts of the cluster hits. More... | |
float | MultipleHitDensity () const |
Density of wires in the cluster with more than one hit. More... | |
float | Width () const |
A measure of the cluster width, in homogenized units. More... | |
ID_t | ID () const |
Identifier of this cluster. More... | |
geo::View_t | View () const |
Returns the view for this cluster. More... | |
geo::PlaneID | Plane () const |
Returns the plane ID this cluster lies on. More... | |
bool | hasPlane () const |
Returns whether geometry plane is valid. More... | |
bool | isValid () const |
Returns if the cluster is valid (that is, if its ID is not invalid) More... | |
Accessors | |
unsigned int | NHits () const |
Number of hits in the cluster. More... | |
float | StartWire () const |
Returns the wire coordinate of the start of the cluster. More... | |
float | StartTick () const |
Returns the tick coordinate of the start of the cluster. More... | |
float | SigmaStartWire () const |
Returns the uncertainty on wire coordinate of the start of the cluster. More... | |
float | SigmaStartTick () const |
Returns the uncertainty on tick coordinate of the start of the cluster. More... | |
float | EndWire () const |
Returns the wire coordinate of the end of the cluster. More... | |
float | EndTick () const |
Returns the tick coordinate of the end of the cluster. More... | |
float | SigmaEndWire () const |
Returns the uncertainty on wire coordinate of the end of the cluster. More... | |
float | SigmaEndTick () const |
Returns the uncertainty on tick coordinate of the end of the cluster. More... | |
float | WireCoord (ClusterEnds_t side) const |
Returns the wire coordinate of one of the end sides of the cluster. More... | |
float | WireCoord (unsigned int side) const |
float | TickCoord (ClusterEnds_t side) const |
Returns the tick coordinate of one of the end sides of the cluster. More... | |
float | TickCoord (unsigned int side) const |
float | SigmaWireCoord (ClusterEnds_t side) const |
Returns the uncertainty on wire coordinate of one of the end sides of the cluster. More... | |
float | SigmaWireCoord (unsigned int side) const |
float | SigmaTickCoord (ClusterEnds_t side) const |
Returns the uncertainty on tick coordinate of one of the end sides of the cluster. More... | |
float | SigmaTickCoord (unsigned int side) const |
float | EdgeCharge (ClusterEnds_t side) const |
Returns the charge on the first or last wire of the cluster. More... | |
float | EdgeCharge (unsigned int side) const |
float | Angle (ClusterEnds_t side) const |
Returns the angle at either end of the cluster. More... | |
float | Angle (unsigned int side) const |
float | OpeningAngle (ClusterEnds_t side) const |
Returns the opening angle at either end of the cluster. More... | |
float | OpeningAngle (unsigned int side) const |
float | Charge (ChargeMode_t mode) const |
Returns the total charge of the cluster. More... | |
float | Charge (unsigned int mode) const |
float | ChargeStdDev (ChargeMode_t mode) const |
Returns the standard deviation of charge of the cluster hits. More... | |
float | ChargeStdDev (unsigned int mode) const |
float | ChargeAverage (ChargeMode_t mode) const |
Returns the average charge of the cluster hits. More... | |
float | ChargeAverage (unsigned int mode) const |
Static Public Attributes | |
static constexpr ID_t | InvalidID = -1 |
Value for an invalid cluster ID. More... | |
static const SentryArgument_t | Sentry |
An instance of the sentry object. More... | |
Private Attributes | |
unsigned int | fNHits |
Number of hits in the cluster. More... | |
float | fMultipleHitDensity |
Density of wires in the cluster with more than one hit. More... | |
float | fWidth |
A measure of the cluster width, in homogenized units. More... | |
ID_t | fID |
geo::View_t | fView |
View for this cluster. More... | |
geo::PlaneID | fPlaneID |
Location of the start of the cluster. More... | |
Data referring to start and end of the cluster | |
Wire coordinate of the start and end of the cluster (may lie between wires); index is intended to be of type ClusterEnds_t. | |
float | fEndWires [NEnds] |
float | fSigmaEndWires [NEnds] |
float | fEndTicks [NEnds] |
float | fSigmaEndTicks [NEnds] |
float | fEndCharges [NEnds] |
float | fAngles [NEnds] |
float | fOpeningAngles [NEnds] |
Data derived from hit charge | |
Sum of the charge of all hits in the cluster. Index is intended to be of type ChargeMode_t | |
float | fChargeSum [NChargeModes] |
float | fChargeStdDev [NChargeModes] |
float | fChargeAverage [NChargeModes] |
Friends | |
std::ostream & | operator<< (std::ostream &o, Cluster const &c) |
bool | operator< (Cluster const &a, Cluster const &b) |
Set of hits with a 2D structure.
A cluster is a set of reconstructed hits supposed to originate from the same physical entity. A cluster lies in a single plane (of a single TPC).
Clusters provide the base of reconstructed 3D objects: tracks and showers. The cluster class contains information that helps characterizing the originating particle and discriminating its signature as track-like or shower-like.
A cluster is supposed to describe the reconstruction of a transiting particle, and can therefore be thought as having a start, the location where it is first seen in time, and an end, the location where it is seen last. In practice, it is often hard to determine by the shape which tip is which, and in case of showers the end might be hard to determine. As a consequence, although the two tips are called "start" and "end", their order is not unerringly; the tip labelled "start" is still deemed to be more likely the beginning of the cluster rather than the end. In the extreme case the "end" should be considered just as an alternative cluster start.
typedef int recob::Cluster::ID_t |
Enumerator | |
---|---|
clStart |
Represents the most likely start of the cluster. |
clEnd |
Represents the end, or the alternative start, of the cluster. |
NEnds |
End count. |
clFirstEnd |
Just an alias for loops. |
Definition at line 77 of file Cluster.h.
recob::Cluster::Cluster | ( | ) |
Default constructor: an empty cluster.
Definition at line 35 of file Cluster.cxx.
recob::Cluster::Cluster | ( | float | start_wire, |
float | sigma_start_wire, | ||
float | start_tick, | ||
float | sigma_start_tick, | ||
float | start_charge, | ||
float | start_angle, | ||
float | start_opening, | ||
float | end_wire, | ||
float | sigma_end_wire, | ||
float | end_tick, | ||
float | sigma_end_tick, | ||
float | end_charge, | ||
float | end_angle, | ||
float | end_opening, | ||
float | integral, | ||
float | integral_stddev, | ||
float | summedADC, | ||
float | summedADC_stddev, | ||
unsigned int | n_hits, | ||
float | multiple_hit_density, | ||
float | width, | ||
ID_t | ID, | ||
geo::View_t | view, | ||
geo::PlaneID const & | plane, | ||
SentryArgument_t | sentry = Sentry |
||
) |
Constructor: assigns all the fields.
start_wire | wire coordinate of the start of the cluster |
sigma_start_wire | uncertainty on start_wire |
start_tick | tick coordinate of the start of the cluster |
sigma_start_tick | uncertainty on start_tick |
start_charge | charge on the start wire |
start_angle | angle of the start of the cluster, in [-pi,pi] |
start_opening | opening angle at the start of the cluster |
end_wire | wire coordinate of the end of the cluster |
sigma_end_wire | uncertainty on end_wire |
end_tick | tick coordinate of the end of the cluster |
sigma_end_tick | uncertainty on end_tick |
end_charge | charge on the end wire |
end_angle | angle of the end of the cluster, in [-pi,pi] |
end_opening | opening angle at the end of the cluster |
integral | total charge from fitted shape of hits |
integral_stddev | standard deviation of hit charge from fitted shape |
summedADC | total charge from signal ADC of hits |
summedADC_stddev | standard deviation of signal ADC of hits |
n_hits | number of hits in the cluster |
multiple_hit_density | density of wires with more than one hit |
width | a measure of the cluster width |
ID | cluster ID |
view | view for this cluster |
plane | location of the start of the cluster |
sentry | a sentry instance |
Coordinates are in homogenized units.
See the documentation of the relative data members for more details on the definition and constraints of the various constructor arguments.
Definition at line 56 of file Cluster.cxx.
|
default |
Copy constructor: automatically generated.
|
inline |
Move constructor: as copy, but source cluster gets an invalid ID.
Definition at line 255 of file Cluster.h.
|
default |
Destructor: automatically generated.
|
inline |
Returns the angle at either end of the cluster.
side | clStart for start, clEnd for end of the cluster |
The angle of the group of hits at the specified position of the cluster is returned, defined and so that (or, more precisely, angle = atan2(dT, dW)
). The elements are expressed in physical distances and therefore this represents a physical angle on the plane orthogonal to the wires in the view and containing the drift direction ("x"); the angle is 0 or when lying on the wire plane, when pointing into/from the wire plane. The angle is pointing so that increasing wire number yields positive . This value can be result of extrapolation or average from a range of hits.
Definition at line 569 of file Cluster.h.
|
inline |
|
inline |
Returns the total charge of the cluster.
mode | cmFit to use fitted hit shape, cmADC for signal ADCs |
The total charge is computed as the sum of the charge of all the hits. The charge of a single hit comes from the fitted hit shape (recob::Hit::Integral()) for cmFit, and signal ADC counts (recob::Hit::SummedADC()) for cmADC.
Charge()
with Charge(cmFit)
should do the trick. The recommended update is to use Integral()
instead. Definition at line 676 of file Cluster.h.
|
inline |
|
inline |
Returns the average charge of the cluster hits.
The charge of a single hit comes from the fitted hit shape (recob::Hit::Integral()) for cmFit, and signal ADC counts (recob::Hit::SummedADC()) for cmADC. It should return 0 if no hit is available.
Definition at line 708 of file Cluster.h.
|
inline |
|
inline |
Returns the standard deviation of charge of the cluster hits.
The charge of a single hit comes from the fitted hit shape (recob::Hit::Integral()) for cmFit, and signal ADC counts (recob::Hit::SummedADC()) for cmADC. It should return 0 if less than two hits are available.
Definition at line 691 of file Cluster.h.
|
inline |
|
inline |
Returns the charge on the first or last wire of the cluster.
side | clStart for start, clEnd for end of the cluster |
The returned value is in unit of ADC count, although it may be fractional. This value can be result of extrapolation or average from a range of hits.
Definition at line 544 of file Cluster.h.
|
inline |
|
inline |
Returns the ending angle of the cluster.
The angle of the group of hits at the end position of the cluster is returned, defined and so that (or, more precisely, angle = atan2(dT, dW)
). The elements are expressed in physical distances and therefore this represents a physical angle on the plane orthogonal to the wires in the view and containing the drift direction ("x"); the angle is 0 or when lying on the wire plane, when pointing into/from the wire plane. The angle is pointing toward the outside of the cluster (that is, is positive going toward the last wire). This value can be result of extrapolation or average from a range of hits.
Definition at line 519 of file Cluster.h.
|
inline |
Returns the charge on the last wire of the cluster.
The returned value is in unit of ADC count, although it may be fractional. This value can be result of extrapolation or average from a range of hits.
Definition at line 498 of file Cluster.h.
|
inline |
Returns the opening angle at the end of the cluster.
The returned value is from homogenized coordinates and in the range .
Definition at line 529 of file Cluster.h.
|
inline |
Returns the tick coordinate of the end of the cluster.
The "end" of the cluster is, in the more ambiguous cluster shapes, defined as an alternative cluster start. The tick coordinate is in tick units (the homogenized coordinate), but can have a fractional part describing the relative time from the previous tick.
Definition at line 342 of file Cluster.h.
|
inline |
Returns the wire coordinate of the end of the cluster.
The "end" of the cluster is, in the more ambiguous cluster shapes, defined as an alternative cluster start. The wire coordinate is in wire units (the homogenized coordinate), but can have a fractional part describing the relative distance from the previous wire.
Definition at line 329 of file Cluster.h.
|
inline |
Returns whether geometry plane is valid.
Definition at line 749 of file Cluster.h.
|
inline |
Identifier of this cluster.
The identifier should be unique per event and per algorithm. An invalid cluster can be defined by having an ID Cluster::InvalidID.
Definition at line 738 of file Cluster.h.
|
inline |
Returns the total charge of the cluster from hit shape.
The total charge is computed as the sum of the charge of all the hits. The charge of a single hit includes the hit shape (fit) and is obtained by recob::Hit::Integral().
Definition at line 600 of file Cluster.h.
|
inline |
Returns the average charge of the cluster hits.
The charge of a single hit includes the hit shape (fit) and is obtained by recob::Hit::Integral(). It should return 0 if no hit is available.
Definition at line 622 of file Cluster.h.
|
inline |
Returns the standard deviation of the charge of the cluster hits.
The charge of a single hit includes the hit shape (fit) and is obtained by recob::Hit::Integral(). It should return 0 if less than two hits are available.
Definition at line 611 of file Cluster.h.
|
inline |
Returns if the cluster is valid (that is, if its ID is not invalid)
Definition at line 753 of file Cluster.h.
|
inline |
Density of wires in the cluster with more than one hit.
Returns a quantity defined as NMultiHitWires / Length, where NMultiHitWires is the number of wires which have more than just one hit amd Length is an estimation of the length of the cluster, in centimetres.
Definition at line 723 of file Cluster.h.
|
inline |
|
inline |
Returns the opening angle at either end of the cluster.
The returned value is from homogenized coordinates and in the range . This value can be result of extrapolation or average from a range of hits.
Definition at line 584 of file Cluster.h.
|
inline |
Copy assignment: automatically generated.
Move assignment: as copy, but source cluster gets an invalid ID.
Definition at line 261 of file Cluster.h.
|
inline |
Returns the plane ID this cluster lies on.
Definition at line 744 of file Cluster.h.
|
inline |
Returns the uncertainty on tick coordinate of the end of the cluster.
The tick uncertainty is in tick units (as for EndTick()).
Definition at line 360 of file Cluster.h.
|
inline |
Returns the uncertainty on wire coordinate of the end of the cluster.
The wire uncertainty is in wire units (as for EndWire()).
Definition at line 351 of file Cluster.h.
|
inline |
Returns the uncertainty on tick coordinate of the start of the cluster.
The tick uncertainty is in tick units (as for StartTick()).
Definition at line 315 of file Cluster.h.
|
inline |
Returns the uncertainty on wire coordinate of the start of the cluster.
The wire uncertainty is in wire units (as for StartWire()).
Definition at line 306 of file Cluster.h.
|
inline |
Returns the uncertainty on tick coordinate of one of the end sides of the cluster.
side | clStart for start, clEnd for end of the cluster |
Usage of this method is similar to TimeCoord().
Definition at line 440 of file Cluster.h.
|
inline |
|
inline |
Returns the uncertainty on wire coordinate of one of the end sides of the cluster.
side | clStart for start, clEnd for end of the cluster |
Usage of this method is similar to WireCoord().
Definition at line 427 of file Cluster.h.
|
inline |
|
inline |
Returns the starting angle of the cluster.
The angle of the group of hits at the start position of the cluster is returned, defined and so that (or, more precisely, angle = atan2(dT, dW)
). The elements are expressed in physical distances and therefore this represents a physical angle on the plane orthogonal to the wires in the view and containing the drift direction ("x"); the angle is 0 or when lying on the wire plane, when pointing into/from the wire plane. The angle is pointing toward the inside of the cluster (that is, is positive going from the first wire on). This value can be result of extrapolation or average from a range of hits.
Definition at line 475 of file Cluster.h.
|
inline |
Returns the charge on the first wire of the cluster.
The returned value is in unit of ADC count, although it may be fractional. This value can be result of extrapolation or average from a range of hits.
Definition at line 454 of file Cluster.h.
|
inline |
Returns the opening angle at the start of the cluster.
The returned value is from physical coordinates and in the range .
Definition at line 485 of file Cluster.h.
|
inline |
Returns the tick coordinate of the start of the cluster.
The tick coordinate is in tick units (the homogenized coordinate), but can have a fractional part describing the relative time from the previous tick.
Definition at line 297 of file Cluster.h.
|
inline |
Returns the wire coordinate of the start of the cluster.
The wire coordinate is in wire units (the homogenized coordinate), but can have a fractional part describing the relative distance from the previous wire.
Definition at line 286 of file Cluster.h.
|
inline |
Returns the total charge of the cluster from signal ADC counts.
The total charge is computed as the sum of the charge of all the hits. The charge of a single hit includes the signal ADC counts and is obtained by recob::Hit::SummedADC().
Definition at line 634 of file Cluster.h.
|
inline |
Returns the average signal ADC counts of the cluster hits.
The charge of a single hit includes the signal ADC counts and is obtained by recob::Hit::SummedADC(). It should return 0 if no hit is available.
Definition at line 656 of file Cluster.h.
|
inline |
Returns the standard deviation of the signal ADC counts of the cluster hits.
The charge of a single hit includes the signal ADC counts and is obtained by recob::Hit::SummedADC(). It should return 0 if less than two hits are available.
Definition at line 645 of file Cluster.h.
|
inline |
Returns the tick coordinate of one of the end sides of the cluster.
side | clStart for start, clEnd for end of the cluster |
The tick coordinate is in tick units (the homogenized coordinate), but can have a fractional part describing the relative time from the previous tick.
For algorithms not distinguishing start and end, all the ends can be tested by the loop:
for (unsigned int side = recob::Cluster::clFirstEnd; side < recob::Cluster::NEnds; ++side) { float wire = cluster.WireCoord(side); float tick = cluster.TickCoord(side); // ... } // for
Definition at line 413 of file Cluster.h.
|
inline |
|
inline |
|
inline |
A measure of the cluster width, in homogenized units.
Definition at line 727 of file Cluster.h.
|
inline |
Returns the wire coordinate of one of the end sides of the cluster.
side | clStart for start, clEnd for end of the cluster |
The wire coordinate is in wire units (the homogenized coordinate), but can have a fractional part describing the relative distance from the previous wire.
For algorithms not distinguishing start and end, all the ends can be tested by the loop:
for (unsigned int side = recob::Cluster::clFirstEnd; side < recob::Cluster::NEnds; ++side) { float wire = cluster.WireCoord(side); float tick = cluster.TickCoord(side); // ... } // for
Definition at line 386 of file Cluster.h.
|
inline |
Definition at line 196 of file Cluster.cxx.
|
friend |
Definition at line 173 of file Cluster.cxx.
|
private |
Angle of the start and end of the cluster, defined in [-pi,pi] and so that tan(angle) = dT/dW (or, more precisely, angle = atan2(dT, dW)
). The elements are expressed in physical distances and therefore this represents a physical angle on the plane orthogonal to the wires in the view and containing the drift direction ("x"); the angle is 0 or when lying on the wire plane, when pointing into/from the wire plane. Index is intended to be of type ClusterEnds_t.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Identifier of this cluster. It should be unique per event and per algorithm. An invalid cluster can be defined by having an ID Cluster::InvalidID.
|
private |
|
private |
|
private |
Opening angle of the cluster shape at the start and end of the cluster. The coordinates are expressed in physical distances and therefore this represents a physical opening angle on the plane orthogonal to the wires in the view and containing the drift direction ("x"). Index is intended to be of type ClusterEnds_t.
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |