All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
cluster::LazyClusterParamsAlg Class Reference

Algorithm class inheriting cluster parameters. More...

#include <LazyClusterParamsAlg.h>

Inheritance diagram for cluster::LazyClusterParamsAlg:
cluster::ClusterParamsAlgBase

Public Types

using Measure_t = ClusterParamsAlgBase::Measure_t
 
- Public Types inherited from cluster::ClusterParamsAlgBase
using Measure_t = details::Measure_t< float >
 Type used to return values with errors. More...
 

Public Member Functions

 LazyClusterParamsAlg (cluster_params const &new_params)
 Constructor: references to the parameters (no copy is performed!) More...
 
void Clear () override
 Restores the class to post-configuration, pre-initialization state; dummy. More...
 
void SetHits (util::GeometryUtilities const &gser, std::vector< recob::Hit const * > const &hits) override
 Sets the list of input hits. More...
 
size_t NHits () override
 Returns the number of hits in the cluster. More...
 
float MultipleHitDensity () override
 Fraction of wires in the cluster with more than one hit. More...
 
float Width (util::GeometryUtilities const &) override
 Computes the width of the cluster. More...
 
cluster_params const & GetParams () const
 Returns the original precomputed parameters. More...
 
Measure_t StartCharge (util::GeometryUtilities const &gser) override
 Computes the charge on the first and last wire of the track. More...
 
Measure_t EndCharge (util::GeometryUtilities const &gser) override
 
Measure_t StartAngle () override
 Computes the angle of the cluster. More...
 
Measure_t EndAngle () override
 
Measure_t StartOpeningAngle () override
 Computes the opening angle at the start or end of the cluster. More...
 
Measure_t EndOpeningAngle () override
 
Cluster charge
Measure_t Integral () override
 Computes the total charge of the cluster from Hit::Integral() More...
 
Measure_t IntegralStdDev () override
 Computes the standard deviation on the charge of the cluster hits. More...
 
Measure_t SummedADC () override
 Computes the total charge of the cluster from Hit::SummedADC() More...
 
Measure_t SummedADCStdDev () override
 Computes the standard deviation on the charge of the cluster hits. More...
 
- Public Member Functions inherited from cluster::ClusterParamsAlgBase
virtual ~ClusterParamsAlgBase ()=default
 
virtual void SetHits (util::GeometryUtilities const &gser, std::vector< recob::Hit > const &hits)
 Sets the list of input hits. More...
 
virtual void SetVerbose (int level=1)
 Set the verbosity level. More...
 

Protected Attributes

cluster_params const & params
 the parameters, already computed More...
 
- Protected Attributes inherited from cluster::ClusterParamsAlgBase
int verbose = 0
 verbosity level: 0 is normal, negative is even quieter More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from cluster::ClusterParamsAlgBase
static std::logic_error NotImplemented (std::string function_name)
 

Detailed Description

Algorithm class inheriting cluster parameters.

See Also
ClusterParamsAlg

This class wraps ClusterParamsAlg class, designed in the context of shower reconstruction, to expose a standard ClusterParamsBaseAlg interface. All the information is supposed to have been computed already.

In addition to the standard interface, GetParams() is also available.

Definition at line 38 of file LazyClusterParamsAlg.h.

Member Typedef Documentation

Definition at line 40 of file LazyClusterParamsAlg.h.

Constructor & Destructor Documentation

cluster::LazyClusterParamsAlg::LazyClusterParamsAlg ( cluster_params const &  new_params)
inline

Constructor: references to the parameters (no copy is performed!)

Definition at line 43 of file LazyClusterParamsAlg.h.

43 : params(new_params) {}
cluster_params const & params
the parameters, already computed

Member Function Documentation

void cluster::LazyClusterParamsAlg::Clear ( )
inlineoverridevirtual

Restores the class to post-configuration, pre-initialization state; dummy.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 47 of file LazyClusterParamsAlg.h.

48  {}
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::EndAngle ( )
overridevirtual

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 44 of file LazyClusterParamsAlg.cxx.

45 {
46  return StartAngle();
47 }
Measure_t StartAngle() override
Computes the angle of the cluster.
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::EndCharge ( util::GeometryUtilities const &  gser)
overridevirtual

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 30 of file LazyClusterParamsAlg.cxx.

31 {
32  return {(float)params.end_charge};
33 }
cluster_params const & params
the parameters, already computed
double end_charge
Charge at the (other) end of the cluster.
Definition: ClusterParams.h:45
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::EndOpeningAngle ( )
overridevirtual

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 58 of file LazyClusterParamsAlg.cxx.

59 {
60  return {(float)params.closing_angle_charge_wgt};
61 }
double closing_angle_charge_wgt
Same for charge_wgt.
Definition: ClusterParams.h:43
cluster_params const & params
the parameters, already computed
cluster_params const& cluster::LazyClusterParamsAlg::GetParams ( ) const
inline

Returns the original precomputed parameters.

Definition at line 176 of file LazyClusterParamsAlg.h.

177  {
178  return params;
179  }
cluster_params const & params
the parameters, already computed
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::Integral ( )
overridevirtual

Computes the total charge of the cluster from Hit::Integral()

Returns
total charge of the cluster, in ADC count units
See Also
IntegralStdDev(), SummedADC()

ClusterParamsAlg computes the sum from all hits.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 65 of file LazyClusterParamsAlg.cxx.

66 {
67  return {(float)params.sum_charge};
68 }
cluster_params const & params
the parameters, already computed
double sum_charge
Sum charge of hits in ADC.
Definition: ClusterParams.h:26
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::IntegralStdDev ( )
overridevirtual

Computes the standard deviation on the charge of the cluster hits.

Returns
the standard deviation of charge of hits, in ADC count units
See Also
Integral()

ClusterParamsAlg computes the standard deviation of the sample of charges from all hits. Hit charge is obtained by recob::Hit::Integral().

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 72 of file LazyClusterParamsAlg.cxx.

73 {
74  return {(float)params.rms_charge};
75 }
double rms_charge
RMS (standard deviation of sample) of charge of hits in ADC.
Definition: ClusterParams.h:28
cluster_params const & params
the parameters, already computed
float cluster::LazyClusterParamsAlg::MultipleHitDensity ( )
overridevirtual

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

Returns
fraction of wires with more than one hit, or 0 if no wires

Returns a quantity defined as NMultiHitWires / NWires, where NWires is the number of wires hosting at least one hit of this cluster, and NMultiHitWires is the number of wires which have more than just one hit.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 101 of file LazyClusterParamsAlg.cxx.

102 {
104 }
cluster_params const & params
the parameters, already computed
size_t cluster::LazyClusterParamsAlg::NHits ( )
overridevirtual

Returns the number of hits in the cluster.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 94 of file LazyClusterParamsAlg.cxx.

95 {
96  return (size_t)params.N_Hits;
97 }
cluster_params const & params
the parameters, already computed
void cluster::LazyClusterParamsAlg::SetHits ( util::GeometryUtilities const &  gser,
std::vector< recob::Hit const * > const &  hits 
)
inlineoverridevirtual

Sets the list of input hits.

Parameters
hitslist of hits
Exceptions
undefinedin case of error, this method can throw (anything)

The parameters have already been computed. This function is dummy.

Implements cluster::ClusterParamsAlgBase.

Definition at line 59 of file LazyClusterParamsAlg.h.

61  {}
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::StartAngle ( )
overridevirtual

Computes the angle of the cluster.

Returns
angle of the cluster in the wire x time space, in radians

Uses the coordinates from the hits, weighted by charge (Hit::Integral()) to compute a slope in the homogenized wire x time space. The homogenized space has both wires and ticks converted into a distance (by using detector parameters: wire pitch and drift velocity).

The angle is in the $ [ -\pi, \pi ] $ range, with 0 corresponding to a cluster parallel to the wire plane and $ \pi $ to a cluster orthogonal to the wire plane, going farther from it.

Note
Both the methods return the same value.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 37 of file LazyClusterParamsAlg.cxx.

38 {
40 }
cluster_params const & params
the parameters, already computed
constexpr T DegreesToRadians(T angle)
Converts the argument angle from degrees into radians.
double cluster_angle_2d
Linear best fit to high-charge hits in the cluster.
Definition: ClusterParams.h:38
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::StartCharge ( util::GeometryUtilities const &  gser)
overridevirtual

Computes the charge on the first and last wire of the track.

Returns
the charge in ADC counts, with uncertainty

The implementation in ClusterParamsAlg provides an estimation of the charge collected in the first or last 1 cm of the cluster, using a linear fit on the deposited charge to reduce fluctuations.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 23 of file LazyClusterParamsAlg.cxx.

24 {
25  return {(float)params.start_charge};
26 }
double start_charge
Charge at the start of the cluster.
Definition: ClusterParams.h:44
cluster_params const & params
the parameters, already computed
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::StartOpeningAngle ( )
overridevirtual

Computes the opening angle at the start or end of the cluster.

Returns
angle at the start of the cluster, in radians

This algorithm returns an opening angle after weighting the hits by their charge (as defined bu Hit::Integral());

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 51 of file LazyClusterParamsAlg.cxx.

52 {
53  return {(float)params.opening_angle_charge_wgt};
54 }
cluster_params const & params
the parameters, already computed
double opening_angle_charge_wgt
Same for charge_wgt.
Definition: ClusterParams.h:41
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::SummedADC ( )
overridevirtual

Computes the total charge of the cluster from Hit::SummedADC()

Returns
total charge of the cluster, in ADC count units
See Also
SummedADCStdDev(), Integral()

ClusterParamsAlg computes the sum from all hits.

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 79 of file LazyClusterParamsAlg.cxx.

80 {
81  const double sumADC = params.sum_ADC;
82  return {(float)sumADC, (float)std::sqrt(sumADC)};
83 }
cluster_params const & params
the parameters, already computed
double sum_ADC
Sum charge of ADC counts of hits, in ADC.
Definition: ClusterParams.h:29
cluster::LazyClusterParamsAlg::Measure_t cluster::LazyClusterParamsAlg::SummedADCStdDev ( )
overridevirtual

Computes the standard deviation on the charge of the cluster hits.

Returns
the standard deviation of charge of hits, in ADC count units
See Also
SummedADC()

ClusterParamsAlg computes the standard deviation of the sample of charges from all hits. Hit charge is obtained by recob::Hit::SummedADC().

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 87 of file LazyClusterParamsAlg.cxx.

88 {
89  return {(float)params.rms_ADC};
90 }
double rms_ADC
RMS (standard deviation of sample) of ADC counts of hits in ADC.
Definition: ClusterParams.h:31
cluster_params const & params
the parameters, already computed
float cluster::LazyClusterParamsAlg::Width ( util::GeometryUtilities const &  )
overridevirtual

Computes the width of the cluster.

Returns
width of the cluster
Todo:
provide a description of the algorithm by words

Reimplemented from cluster::ClusterParamsAlgBase.

Definition at line 108 of file LazyClusterParamsAlg.cxx.

109 {
110  return params.width;
111 }
cluster_params const & params
the parameters, already computed

Member Data Documentation

cluster_params const& cluster::LazyClusterParamsAlg::params
protected

the parameters, already computed

Definition at line 182 of file LazyClusterParamsAlg.h.


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