All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LazyClusterParamsAlg.cxx
Go to the documentation of this file.
1 /** ****************************************************************************
2  * @file LazyClusterParamsAlg.cxx
3  * @brief Implementation of interface to class computing cluster parameters
4  * @author petrillo@fnal.gov
5  * @date January 22, 2015
6  * @see LazyClusterParamsAlg.h
7  *
8  * ****************************************************************************/
9 
10 // C/C++ standard library
11 #include <cmath>
12 
13 // LArSoft libraries
14 #include "larcoreobj/SimpleTypesAndConstants/PhysicalConstants.h" // util::DegreesToRadians()
17 
18 //==============================================================================
19 //=== cluster::LazyClusterParamsAlg
20 
21 //------------------------------------------------------------------------------
24 {
25  return {(float)params.start_charge};
26 }
27 
28 //------------------------------------------------------------------------------
31 {
32  return {(float)params.end_charge};
33 }
34 
35 //------------------------------------------------------------------------------
38 {
39  return {(float)util::DegreesToRadians(params.cluster_angle_2d)};
40 }
41 
42 //------------------------------------------------------------------------------
45 {
46  return StartAngle();
47 }
48 
49 //------------------------------------------------------------------------------
52 {
53  return {(float)params.opening_angle_charge_wgt};
54 }
55 
56 //------------------------------------------------------------------------------
59 {
60  return {(float)params.closing_angle_charge_wgt};
61 }
62 
63 //------------------------------------------------------------------------------
66 {
67  return {(float)params.sum_charge};
68 }
69 
70 //------------------------------------------------------------------------------
73 {
74  return {(float)params.rms_charge};
75 }
76 
77 //------------------------------------------------------------------------------
80 {
81  const double sumADC = params.sum_ADC;
82  return {(float)sumADC, (float)std::sqrt(sumADC)};
83 }
84 
85 //------------------------------------------------------------------------------
88 {
89  return {(float)params.rms_ADC};
90 }
91 
92 //------------------------------------------------------------------------------
93 size_t
95 {
96  return (size_t)params.N_Hits;
97 }
98 
99 //------------------------------------------------------------------------------
100 float
102 {
103  return params.N_Wires ? params.multi_hit_wires / params.N_Wires : 0.;
104 }
105 
106 //------------------------------------------------------------------------------
107 float
109 {
110  return params.width;
111 }
Algorithm class inheriting pre-computed results.
size_t NHits() override
Returns the number of hits in the cluster.
double start_charge
Charge at the start of the cluster.
Definition: ClusterParams.h:44
Measure_t SummedADC() override
Computes the total charge of the cluster from Hit::SummedADC()
cluster_params const & params
the parameters, already computed
Measure_t Integral() override
Computes the total charge of the cluster from Hit::Integral()
constexpr T DegreesToRadians(T angle)
Converts the argument angle from degrees into radians.
Type for a simple measurement: value and error.
Measure_t SummedADCStdDev() override
Computes the standard deviation on the charge of the cluster hits.
float MultipleHitDensity() override
Fraction of wires in the cluster with more than one hit.
Measure_t IntegralStdDev() override
Computes the standard deviation on the charge of the cluster hits.
Measure_t StartOpeningAngle() override
Computes the opening angle at the start or end of the cluster.
Measure_t StartAngle() override
Computes the angle of the cluster.
Measure_t StartCharge(util::GeometryUtilities const &gser) override
Computes the charge on the first and last wire of the track.
Measure_t EndCharge(util::GeometryUtilities const &gser) override
Collection of Physical constants used in LArSoft.
float Width(util::GeometryUtilities const &) override
Computes the width of the cluster.