Classes | Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends | List of all members
recob::Cluster Class Reference

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...
 
Clusteroperator= (Cluster const &)=default
 Copy assignment: automatically generated. More...
 
Clusteroperator= (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)
 

Detailed Description

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.

Note
A cluster lives in a plane of inhomogeneous coordinates: wire number and tick number. Different ways to make them homogeneous are available. For example, knowing the drift velocity (assuming it constant) and the wire pitch, it is possible to convert both coordinates in a measure of distance. Where the wire and time coordinates need to be compared, they are converted into physical distances. Wire coordinate includes the wire pitch information and it can be defined as the distance (in centimetres) from the wire #0 (and negative if it lies on the opposite side than wire #0 with respect to wire #0) of the point. The tick coordinate is converted into a distance from the wire plane (in centimetres) by including the drift velocity. The absolute time for which this coordinate is 0 is defined to be as an "absolute trigger time". This is still ambiguous enough, but matter of fact there should be no need of absolute wire or tick coordinates but only of their difference; for example, to define angles, dT/dW (or some similar quantity) is used. More advanced knowledge of the geometry or status of the detector may lead to different wire pitch or drift velocity: in that case, these quantities need to be recomputed, although it is conceivable that the ones with simple constant pitch and drift are often an approximation close enough.

Definition at line 71 of file Cluster.h.

Member Typedef Documentation

typedef int recob::Cluster::ID_t

Type of cluster ID.

Definition at line 74 of file Cluster.h.

Member Enumeration Documentation

Enumerator
cmFit 

Sums from the fitted hit values.

cmADC 

Sums directly from ADC counts.

NChargeModes 

End count.

cmFirstMode 

Just an alias for loops.

Definition at line 84 of file Cluster.h.

84  {
85  cmFit, ///< Sums from the fitted hit values
86  cmADC, ///< Sums directly from ADC counts
87  NChargeModes, ///< End count
88  cmFirstMode = 0 ///< Just an alias for loops
89  } ChargeMode_t; ///< Used to decide which style of charge sum to use
Sums from the fitted hit values.
Definition: Cluster.h:85
Just an alias for loops.
Definition: Cluster.h:88
Sums directly from ADC counts.
Definition: Cluster.h:86
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.

77  {
78  clStart, ///< Represents the most likely start of the cluster
79  clEnd, ///< Represents the end, or the alternative start, of the cluster
80  NEnds, ///< End count
81  clFirstEnd = 0 ///< Just an alias for loops
82  } ClusterEnds_t; ///< Used to decide which end to use
End count.
Definition: Cluster.h:80
Represents the most likely start of the cluster.
Definition: Cluster.h:78
Just an alias for loops.
Definition: Cluster.h:81
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79

Constructor & Destructor Documentation

recob::Cluster::Cluster ( )

Default constructor: an empty cluster.

Definition at line 35 of file Cluster.cxx.

36  : fNHits(0)
37  , fEndWires{ 0., 0. }
38  , fSigmaEndWires{ 0., 0. }
39  , fEndTicks{ 0., 0. }
40  , fSigmaEndTicks{ 0., 0. }
41  , fEndCharges{ 0., 0. }
42  , fAngles{ 0., 0. }
43  , fOpeningAngles{ 0., 0. }
44  , fChargeSum{ 0., 0. }
45  , fChargeStdDev{ 0., 0. }
46  , fChargeAverage{ 0., 0. }
48  , fWidth(0.)
49  , fID(InvalidID)
51  , fPlaneID()
52  {} // Cluster::Cluster()
float fWidth
A measure of the cluster width, in homogenized units.
Definition: Cluster.h:160
static constexpr ID_t InvalidID
Value for an invalid cluster ID.
Definition: Cluster.h:179
float fMultipleHitDensity
Density of wires in the cluster with more than one hit.
Definition: Cluster.h:157
float fEndTicks[NEnds]
Definition: Cluster.h:111
Unknown view.
Definition: geo_types.h:136
float fEndCharges[NEnds]
Definition: Cluster.h:120
float fEndWires[NEnds]
Definition: Cluster.h:103
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
geo::PlaneID fPlaneID
Location of the start of the cluster.
Definition: Cluster.h:170
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float fAngles[NEnds]
Definition: Cluster.h:130
unsigned int fNHits
Number of hits in the cluster.
Definition: Cluster.h:97
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
geo::View_t fView
View for this cluster.
Definition: Cluster.h:168
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.

Parameters
start_wirewire coordinate of the start of the cluster
sigma_start_wireuncertainty on start_wire
start_ticktick coordinate of the start of the cluster
sigma_start_tickuncertainty on start_tick
start_chargecharge on the start wire
start_angleangle of the start of the cluster, in [-pi,pi]
start_openingopening angle at the start of the cluster
end_wirewire coordinate of the end of the cluster
sigma_end_wireuncertainty on end_wire
end_ticktick coordinate of the end of the cluster
sigma_end_tickuncertainty on end_tick
end_chargecharge on the end wire
end_angleangle of the end of the cluster, in [-pi,pi]
end_openingopening angle at the end of the cluster
integraltotal charge from fitted shape of hits
integral_stddevstandard deviation of hit charge from fitted shape
summedADCtotal charge from signal ADC of hits
summedADC_stddevstandard deviation of signal ADC of hits
n_hitsnumber of hits in the cluster
multiple_hit_densitydensity of wires with more than one hit
widtha measure of the cluster width
IDcluster ID
viewview for this cluster
planelocation of the start of the cluster
sentrya 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.

Note
The sentry parameter can be optionally specified so that the compiler will realize if the number of parameters in the constructor has varied.

Definition at line 56 of file Cluster.cxx.

83  : fNHits(n_hits)
84  , fEndWires{ start_wire, end_wire }
85  , fSigmaEndWires{ sigma_start_wire, sigma_end_wire }
86  , fEndTicks{ start_tick, end_tick }
87  , fSigmaEndTicks{ sigma_start_tick, sigma_end_tick }
88  , fEndCharges{ start_charge, end_charge }
89  , fAngles{ start_angle, end_angle }
90  , fOpeningAngles{ start_opening, end_opening }
91  , fChargeSum{ integral, summedADC }
92  , fChargeStdDev{ integral_stddev, summedADC_stddev }
93  , fChargeAverage{}
94  , fMultipleHitDensity(multiple_hit_density)
95  , fWidth(width)
96  , fID(ID)
97  , fView(view)
98  , fPlaneID(plane)
99  {
100 
101  for (unsigned int mode = cmFirstMode; mode < NChargeModes; ++mode)
102  fChargeAverage[mode] = (fNHits > 0)? fChargeSum[mode] / fNHits: 0.;
103 
104  } // Cluster::Cluster(float...)
float fWidth
A measure of the cluster width, in homogenized units.
Definition: Cluster.h:160
float fMultipleHitDensity
Density of wires in the cluster with more than one hit.
Definition: Cluster.h:157
Just an alias for loops.
Definition: Cluster.h:88
float fEndTicks[NEnds]
Definition: Cluster.h:111
float fEndCharges[NEnds]
Definition: Cluster.h:120
float fEndWires[NEnds]
Definition: Cluster.h:103
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
geo::PlaneID fPlaneID
Location of the start of the cluster.
Definition: Cluster.h:170
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float fAngles[NEnds]
Definition: Cluster.h:130
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:738
unsigned int fNHits
Number of hits in the cluster.
Definition: Cluster.h:97
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
geo::View_t fView
View for this cluster.
Definition: Cluster.h:168
recob::Cluster::Cluster ( Cluster const &  )
default

Copy constructor: automatically generated.

recob::Cluster::Cluster ( Cluster &&  from)
inline

Move constructor: as copy, but source cluster gets an invalid ID.

Definition at line 255 of file Cluster.h.

255 : Cluster(from) { from.fID = InvalidID; }
static constexpr ID_t InvalidID
Value for an invalid cluster ID.
Definition: Cluster.h:179
Cluster()
Default constructor: an empty cluster.
Definition: Cluster.cxx:35
recob::Cluster::~Cluster ( )
default

Destructor: automatically generated.

Member Function Documentation

float recob::Cluster::Angle ( ClusterEnds_t  side) const
inline

Returns the angle at either end of the cluster.

Parameters
sideclStart for start, clEnd for end of the cluster
Returns
angle in radians
See also
StartAngle(), EndAngle()

The angle of the group of hits at the specified position of the cluster is returned, defined $ \alpha \in [ -\pi, \pi ]$ and so that $ \tan(\alpha) = 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 $ \pi $ when lying on the wire plane, $ \pm\pi/2 $ when pointing into/from the wire plane. The angle is pointing so that increasing wire number yields positive $ dW $. This value can be result of extrapolation or average from a range of hits.

Definition at line 569 of file Cluster.h.

569 { return fAngles[side]; }
float fAngles[NEnds]
Definition: Cluster.h:130
float recob::Cluster::Angle ( unsigned int  side) const
inline

Definition at line 570 of file Cluster.h.

570 { return fAngles[side]; }
float fAngles[NEnds]
Definition: Cluster.h:130
float recob::Cluster::Charge ( ChargeMode_t  mode) const
inline

Returns the total charge of the cluster.


Parameters
modecmFit to use fitted hit shape, cmADC for signal ADCs
Returns
total charge of the cluster, in ADC counts
See also
ChargeStdDev(), ChargeAverage(), SummedADC(), Integral()

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.

Note
Cluster class older than version 14 had a Charge() method too; the new one is not strictly equivalent, although in practice replacing the old Charge() with Charge(cmFit) should do the trick. The recommended update is to use Integral() instead.

Definition at line 676 of file Cluster.h.

676 { return fChargeSum[mode]; }
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float recob::Cluster::Charge ( unsigned int  mode) const
inline

Definition at line 677 of file Cluster.h.

677 { return fChargeSum[mode]; }
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float recob::Cluster::ChargeAverage ( ChargeMode_t  mode) const
inline

Returns the average charge of the cluster hits.

Returns
average of the charge of the cluster hits, in ADC counts
See also
Charge(), ChargeStdDev(), SummedADCaverage(), IntegralAverage()

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.

709  { return fChargeAverage[mode]; }
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float recob::Cluster::ChargeAverage ( unsigned int  mode) const
inline

Definition at line 710 of file Cluster.h.

711  { return fChargeAverage[mode]; }
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float recob::Cluster::ChargeStdDev ( ChargeMode_t  mode) const
inline

Returns the standard deviation of charge of the cluster hits.

Returns
standard deviation of charge of the cluster hits, in ADC counts
See also
Charge(), ChargeAverage(), SummedADCstdDev(), IntegralStdDev()

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.

692  { return fChargeStdDev[mode]; }
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
float recob::Cluster::ChargeStdDev ( unsigned int  mode) const
inline

Definition at line 693 of file Cluster.h.

694  { return fChargeStdDev[mode]; }
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
float recob::Cluster::EdgeCharge ( ClusterEnds_t  side) const
inline

Returns the charge on the first or last wire of the cluster.

Parameters
sideclStart for start, clEnd for end of the cluster
Returns
charge on the requested wire in ADC counts, negative if not available
See also
StartCharge(), EndCharge()

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.

544 { return fEndCharges[side]; }
float fEndCharges[NEnds]
Definition: Cluster.h:120
float recob::Cluster::EdgeCharge ( unsigned int  side) const
inline

Definition at line 545 of file Cluster.h.

545 { return fEndCharges[side]; }
float fEndCharges[NEnds]
Definition: Cluster.h:120
float recob::Cluster::EndAngle ( ) const
inline

Returns the ending angle of the cluster.

Returns
angle in radians
See also
StartAngle(), Angle()

The angle of the group of hits at the end position of the cluster is returned, defined $ \alpha \in [ -\pi, \pi ]$ and so that $ \tan(\alpha) = 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 $ \pi $ when lying on the wire plane, $ \pm\pi/2 $ when pointing into/from the wire plane. The angle is pointing toward the outside of the cluster (that is, $ dW $ 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.

519 { return fAngles[clEnd]; }
float fAngles[NEnds]
Definition: Cluster.h:130
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::EndCharge ( ) const
inline

Returns the charge on the last wire of the cluster.

Returns
charge on the last wire in ADC counts, negative if not available
See also
StartCharge(), EdgeCharge()

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.

498 { return fEndCharges[clEnd]; }
float fEndCharges[NEnds]
Definition: Cluster.h:120
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::EndOpeningAngle ( ) const
inline

Returns the opening angle at the end of the cluster.

Returns
opening angle in radians
See also
StartOpeningAngle(), OpeningAngle()

The returned value is from homogenized coordinates and in the range $[ 0, \pi ]$.

Definition at line 529 of file Cluster.h.

529 { return fOpeningAngles[clEnd]; }
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::EndTick ( ) const
inline

Returns the tick coordinate of the end of the cluster.

Returns
tick coordinate of the end of the cluster (may be fractional)
See also
StartTick(), TickCoord(), EndWire()

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.

342 { return fEndTicks[clEnd]; }
float fEndTicks[NEnds]
Definition: Cluster.h:111
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::EndWire ( ) const
inline

Returns the wire coordinate of the end of the cluster.


Returns
wire coordinate of the end of the cluster (may lie between wires)
See also
StartWire(), WireCoord(), EndTick()

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.

329 { return fEndWires[clEnd]; }
float fEndWires[NEnds]
Definition: Cluster.h:103
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
bool recob::Cluster::hasPlane ( ) const
inline

Returns whether geometry plane is valid.

Definition at line 749 of file Cluster.h.

749 { return fPlaneID.isValid; }
bool isValid
Whether this ID points to a valid element.
Definition: geo_types.h:211
geo::PlaneID fPlaneID
Location of the start of the cluster.
Definition: Cluster.h:170
ID_t recob::Cluster::ID ( ) const
inline

Identifier of this cluster.

Returns
the identifier of this cluster
See also
isValid()

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.

738 { return fID; }
float recob::Cluster::Integral ( ) const
inline

Returns the total charge of the cluster from hit shape.


Returns
total charge of the cluster from hit shape, in ADC counts
See also
IntegralStdDev(), IntegralAverage(), SummedADC(), Charge()

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.

600 { return fChargeSum[cmFit]; }
Sums from the fitted hit values.
Definition: Cluster.h:85
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float recob::Cluster::IntegralAverage ( ) const
inline

Returns the average charge of the cluster hits.

Returns
average of the charge of the cluster hits, in ADC counts
See also
Integral(), IntegralStdDev(), SummedADCaverage(), ChargeAverage()

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.

622 { return fChargeAverage[cmFit]; }
Sums from the fitted hit values.
Definition: Cluster.h:85
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float recob::Cluster::IntegralStdDev ( ) const
inline

Returns the standard deviation of the charge of the cluster hits.

Returns
standard deviation of the charge of the cluster hits, in ADC counts
See also
Integral(), IntegralAverage(), SummedADCstdDev(), ChargeStdDev()

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.

611 { return fChargeStdDev[cmFit]; }
Sums from the fitted hit values.
Definition: Cluster.h:85
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
bool recob::Cluster::isValid ( ) const
inline

Returns if the cluster is valid (that is, if its ID is not invalid)

Definition at line 753 of file Cluster.h.

753 { return ID() != InvalidID; }
static constexpr ID_t InvalidID
Value for an invalid cluster ID.
Definition: Cluster.h:179
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:738
float recob::Cluster::MultipleHitDensity ( ) const
inline

Density of wires in the cluster with more than one hit.

Returns
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.

723 { return fMultipleHitDensity; }
float fMultipleHitDensity
Density of wires in the cluster with more than one hit.
Definition: Cluster.h:157
unsigned int recob::Cluster::NHits ( ) const
inline

Number of hits in the cluster.

Definition at line 275 of file Cluster.h.

275 { return fNHits; }
unsigned int fNHits
Number of hits in the cluster.
Definition: Cluster.h:97
float recob::Cluster::OpeningAngle ( ClusterEnds_t  side) const
inline

Returns the opening angle at either end of the cluster.

Returns
opening angle in radians
See also
StartOpeningAngle(), EndOpeningAngle()

The returned value is from homogenized coordinates and in the range $[ 0, \pi ]$. This value can be result of extrapolation or average from a range of hits.

Definition at line 584 of file Cluster.h.

585  { return fOpeningAngles[side]; }
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
float recob::Cluster::OpeningAngle ( unsigned int  side) const
inline

Definition at line 586 of file Cluster.h.

587  { return fOpeningAngles[side]; }
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
Cluster& recob::Cluster::operator= ( Cluster const &  )
default

Copy assignment: automatically generated.

Cluster& recob::Cluster::operator= ( Cluster &&  from)
inline

Move assignment: as copy, but source cluster gets an invalid ID.

Definition at line 261 of file Cluster.h.

262  {
263  if (&from != this) { operator=(from); from.fID = InvalidID; }
264  return *this;
265  }
static constexpr ID_t InvalidID
Value for an invalid cluster ID.
Definition: Cluster.h:179
Cluster & operator=(Cluster const &)=default
Copy assignment: automatically generated.
geo::PlaneID recob::Cluster::Plane ( ) const
inline

Returns the plane ID this cluster lies on.

Definition at line 744 of file Cluster.h.

744 { return fPlaneID; }
geo::PlaneID fPlaneID
Location of the start of the cluster.
Definition: Cluster.h:170
float recob::Cluster::SigmaEndTick ( ) const
inline

Returns the uncertainty on tick coordinate of the end of the cluster.

Returns
uncertainty on tick coordinate of the end of the cluster
See also
EndTick()

The tick uncertainty is in tick units (as for EndTick()).

Definition at line 360 of file Cluster.h.

360 { return fSigmaEndTicks[clEnd]; }
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::SigmaEndWire ( ) const
inline

Returns the uncertainty on wire coordinate of the end of the cluster.

Returns
uncertainty on wire coordinate of the end of the cluster
See also
EndWire()

The wire uncertainty is in wire units (as for EndWire()).

Definition at line 351 of file Cluster.h.

351 { return fSigmaEndWires[clEnd]; }
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
Represents the end, or the alternative start, of the cluster.
Definition: Cluster.h:79
float recob::Cluster::SigmaStartTick ( ) const
inline

Returns the uncertainty on tick coordinate of the start of the cluster.

Returns
uncertainty on tick coordinate of the start of the cluster
See also
StartTick()

The tick uncertainty is in tick units (as for StartTick()).

Definition at line 315 of file Cluster.h.

315 { return fSigmaEndTicks[clStart]; }
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float recob::Cluster::SigmaStartWire ( ) const
inline

Returns the uncertainty on wire coordinate of the start of the cluster.

Returns
uncertainty on wire coordinate of the start of the cluster
See also
StartWire()

The wire uncertainty is in wire units (as for StartWire()).

Definition at line 306 of file Cluster.h.

306 { return fSigmaEndWires[clStart]; }
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float recob::Cluster::SigmaTickCoord ( ClusterEnds_t  side) const
inline

Returns the uncertainty on tick coordinate of one of the end sides of the cluster.

Parameters
sideclStart for start, clEnd for end of the cluster
Returns
uncertainty on tick coordinate of the requested end of the cluster
See also
SigmaStartTick(), SigmaEndTick(), SigmaWireCoord(), TimeCoord()

Usage of this method is similar to TimeCoord().

Definition at line 440 of file Cluster.h.

440 { return fSigmaEndTicks[side]; }
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
float recob::Cluster::SigmaTickCoord ( unsigned int  side) const
inline

Definition at line 441 of file Cluster.h.

441 { return fSigmaEndTicks[side]; }
float fSigmaEndTicks[NEnds]
Definition: Cluster.h:115
float recob::Cluster::SigmaWireCoord ( ClusterEnds_t  side) const
inline

Returns the uncertainty on wire coordinate of one of the end sides of the cluster.

Parameters
sideclStart for start, clEnd for end of the cluster
Returns
uncertainty on wire coordinate of the requested end of the cluster
See also
SigmaStartWire(), SigmaEndWire(), SigmaTickCoord(), TimeCoord()

Usage of this method is similar to WireCoord().

Definition at line 427 of file Cluster.h.

427 { return fSigmaEndWires[side]; }
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
float recob::Cluster::SigmaWireCoord ( unsigned int  side) const
inline

Definition at line 428 of file Cluster.h.

428 { return fSigmaEndWires[side]; }
float fSigmaEndWires[NEnds]
Definition: Cluster.h:107
float recob::Cluster::StartAngle ( ) const
inline

Returns the starting angle of the cluster.

Returns
angle in radians
See also
EndAngle(), Angle()

The angle of the group of hits at the start position of the cluster is returned, defined $ \alpha \in [ -\pi, \pi ]$ and so that $ \tan(\alpha) = 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 $ \pi $ when lying on the wire plane, $ \pm\pi/2 $ when pointing into/from the wire plane. The angle is pointing toward the inside of the cluster (that is, $ dW $ 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.

475 { return fAngles[clStart]; }
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float fAngles[NEnds]
Definition: Cluster.h:130
float recob::Cluster::StartCharge ( ) const
inline

Returns the charge on the first wire of the cluster.


Returns
charge on the first wire in ADC counts, negative if not available
See also
EndCharge(), EdgeCharge()

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.

454 { return fEndCharges[clStart]; }
float fEndCharges[NEnds]
Definition: Cluster.h:120
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float recob::Cluster::StartOpeningAngle ( ) const
inline

Returns the opening angle at the start of the cluster.

Returns
opening angle in radians
See also
EndOpeningAngle(), OpeningAngle()

The returned value is from physical coordinates and in the range $[ 0, \pi ]$.

Definition at line 485 of file Cluster.h.

485 { return fOpeningAngles[clStart]; }
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float fOpeningAngles[NEnds]
Definition: Cluster.h:137
float recob::Cluster::StartTick ( ) const
inline

Returns the tick coordinate of the start of the cluster.

Returns
tick coordinate of the start of the cluster (may br fractional)
See also
EndTick(), TickCoord(), StartWire()

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.

297 { return fEndTicks[clStart]; }
float fEndTicks[NEnds]
Definition: Cluster.h:111
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float recob::Cluster::StartWire ( ) const
inline

Returns the wire coordinate of the start of the cluster.


Returns
wire coordinate of the start of the cluster (may lie between wires)
See also
EndWire(), WireCoord(), StartTick()

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.

286 { return fEndWires[clStart]; }
float fEndWires[NEnds]
Definition: Cluster.h:103
Represents the most likely start of the cluster.
Definition: Cluster.h:78
float recob::Cluster::SummedADC ( ) const
inline

Returns the total charge of the cluster from signal ADC counts.


Returns
total charge of the cluster from signal ADC, in ADC counts
See also
SummedADCstdDev(), SummedADCaverage(), Integral(), Charge()

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.

634 { return fChargeSum[cmADC]; }
Sums directly from ADC counts.
Definition: Cluster.h:86
float fChargeSum[NChargeModes]
Definition: Cluster.h:145
float recob::Cluster::SummedADCaverage ( ) const
inline

Returns the average signal ADC counts of the cluster hits.

Returns
average of the signal of the cluster hits, in ADC counts
See also
SummedADC(), SummedADCstdDev(), IntegralAverage(), ChargeAverage()

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.

656 { return fChargeAverage[cmADC]; }
Sums directly from ADC counts.
Definition: Cluster.h:86
float fChargeAverage[NChargeModes]
Definition: Cluster.h:153
float recob::Cluster::SummedADCstdDev ( ) const
inline

Returns the standard deviation of the signal ADC counts of the cluster hits.

Returns
standard deviation of the signal of the cluster hits, in ADC counts
See also
SummedADC(), SummedADCaverage(), IntegralStdDev(), ChargeStdDev()

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.

645 { return fChargeStdDev[cmADC]; }
Sums directly from ADC counts.
Definition: Cluster.h:86
float fChargeStdDev[NChargeModes]
Definition: Cluster.h:149
float recob::Cluster::TickCoord ( ClusterEnds_t  side) const
inline

Returns the tick coordinate of one of the end sides of the cluster.

Parameters
sideclStart for start, clEnd for end of the cluster
Returns
tick coordinate of the requested end of the cluster (may be fractional)
See also
StartTick(), EndTick(), WireCoord()

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.

413 { return fEndTicks[side]; }
float fEndTicks[NEnds]
Definition: Cluster.h:111
float recob::Cluster::TickCoord ( unsigned int  side) const
inline

Definition at line 414 of file Cluster.h.

414 { return fEndTicks[side]; }
float fEndTicks[NEnds]
Definition: Cluster.h:111
geo::View_t recob::Cluster::View ( ) const
inline

Returns the view for this cluster.

Definition at line 741 of file Cluster.h.

741 { return fView; }
geo::View_t fView
View for this cluster.
Definition: Cluster.h:168
float recob::Cluster::Width ( ) const
inline

A measure of the cluster width, in homogenized units.

Definition at line 727 of file Cluster.h.

727 { return fWidth; }
float fWidth
A measure of the cluster width, in homogenized units.
Definition: Cluster.h:160
float recob::Cluster::WireCoord ( ClusterEnds_t  side) const
inline

Returns the wire coordinate of one of the end sides of the cluster.


Parameters
sideclStart for start, clEnd for end of the cluster
Returns
wire coordinate of the requested end of the cluster (may lie between wires)
See also
StartWire(), EndWire(), TickCoord()

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.

386 { return fEndWires[side]; }
float fEndWires[NEnds]
Definition: Cluster.h:103
float recob::Cluster::WireCoord ( unsigned int  side) const
inline

Definition at line 387 of file Cluster.h.

387 { return fEndWires[side]; }
float fEndWires[NEnds]
Definition: Cluster.h:103

Friends And Related Function Documentation

bool operator< ( Cluster const &  a,
Cluster const &  b 
)
friend

Definition at line 196 of file Cluster.cxx.

196  {
197 
198  if (a.hasPlane() && b.hasPlane() && a.Plane() != b.Plane())
199  return a.Plane() < b.Plane();
200  if (a.View() != b.View())
201  return a.View() < b.View();
202  if (a.ID() != b. ID())
203  return a.ID() < b.ID();
204  if (a.StartTick() != b.StartTick())
205  return a.StartTick() < b.StartTick();
206  if (a.EndTick() != b.EndTick())
207  return a.EndTick() < b.EndTick();
208 
209  return false; // they are equal enough
210  } // operator < (Cluster, Cluster)
const double a
ID_t ID() const
Identifier of this cluster.
Definition: Cluster.h:738
static bool * b
Definition: config.cpp:1043
std::ostream& operator<< ( std::ostream &  o,
Cluster const &  c 
)
friend

Definition at line 173 of file Cluster.cxx.

173  {
174  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
175  o << "Cluster ID " << std::setw(5) << std::right << c.ID()
176  << " : Cryo = " << std::setw(3) << std::right << c.Plane().Cryostat
177  << " TPC = " << std::setw(3) << std::right << c.Plane().TPC
178  << " Plane = " << std::setw(3) << std::right << c.Plane().Plane
179  << " View = " << std::setw(3) << std::right << c.View()
180  << " StartWire = " << std::setw(7) << std::right << c.StartWire()
181  << " EndWire = " << std::setw(7) << std::right << c.EndWire()
182  << " StartTime = " << std::setw(9) << std::right << c.StartTick()
183  << " EndTime = " << std::setw(9) << std::right << c.EndTick()
184  << " N hits = " << std::setw(5) << std::right << c.NHits()
185  << " Width = " << std::setw(5) << std::right << c.Width()
186  << " Charge(fit) = " << std::setw(10) << std::right << c.Integral()
187  << " Charge(ADC) = " << std::setw(10) << std::right << c.SummedADC()
188  ;
189  return o;
190  } // operator<< (ostream, Cluster)
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331

Member Data Documentation

float recob::Cluster::fAngles[NEnds]
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 $ \pi $ when lying on the wire plane, $ \pm\pi/2 $ when pointing into/from the wire plane. Index is intended to be of type ClusterEnds_t.

Definition at line 130 of file Cluster.h.

float recob::Cluster::fChargeAverage[NChargeModes]
private

Definition at line 153 of file Cluster.h.

float recob::Cluster::fChargeStdDev[NChargeModes]
private

Standard deviation of the charge of hits. Index is intended to be of type ChargeMode_t Average of the charge of all hits in the cluster (fChargeSum/NHits()). Index is intended to be of type ChargeMode_t

Definition at line 149 of file Cluster.h.

float recob::Cluster::fChargeSum[NChargeModes]
private

Definition at line 145 of file Cluster.h.

float recob::Cluster::fEndCharges[NEnds]
private

Charge on the start and end wire of the cluster. This value can be result of extrapolation or average from a range of hits. index is intended to be of type ClusterEnds_t.

Definition at line 120 of file Cluster.h.

float recob::Cluster::fEndTicks[NEnds]
private

Tick coordinate of the start and end of the cluster (may be set between ticks); index is intended to be of type ClusterEnds_t.

Definition at line 111 of file Cluster.h.

float recob::Cluster::fEndWires[NEnds]
private

Definition at line 103 of file Cluster.h.

ID_t recob::Cluster::fID
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.

Definition at line 165 of file Cluster.h.

float recob::Cluster::fMultipleHitDensity
private

Density of wires in the cluster with more than one hit.

Definition at line 157 of file Cluster.h.

unsigned int recob::Cluster::fNHits
private

Number of hits in the cluster.

Definition at line 97 of file Cluster.h.

float recob::Cluster::fOpeningAngles[NEnds]
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.

Definition at line 137 of file Cluster.h.

geo::PlaneID recob::Cluster::fPlaneID
private

Location of the start of the cluster.

Definition at line 170 of file Cluster.h.

float recob::Cluster::fSigmaEndTicks[NEnds]
private

Uncertainty on tick coordinate of the start and end of the cluster; index is intended to be of type ClusterEnds_t.

Definition at line 115 of file Cluster.h.

float recob::Cluster::fSigmaEndWires[NEnds]
private

Uncertainty on wire coordinate of the start and end of the cluster; index is intended to be of type ClusterEnds_t.

Definition at line 107 of file Cluster.h.

geo::View_t recob::Cluster::fView
private

View for this cluster.

Definition at line 168 of file Cluster.h.

float recob::Cluster::fWidth
private

A measure of the cluster width, in homogenized units.

Definition at line 160 of file Cluster.h.

constexpr ID_t recob::Cluster::InvalidID = -1
static

Value for an invalid cluster ID.

Definition at line 179 of file Cluster.h.

const Cluster::SentryArgument_t recob::Cluster::Sentry
static

An instance of the sentry object.

Definition at line 182 of file Cluster.h.


The documentation for this class was generated from the following files: