10 #ifndef OVERRIDDENCLUSTERPARAMSALG_H
11 #define OVERRIDDENCLUSTERPARAMSALG_H
15 #include <type_traits>
68 template <
typename AlgoBase>
71 "OverriddenClusterParamsAlg template parameter must derive"
72 " from ClusterParamsAlgBase");
97 template <
typename... Args>
115 values[(size_t)param] = value;
163 std::vector<recob::Hit const*>
const& hits)
override
165 algo.SetHits(gser, hits);
177 algo.SetHits(gser, hits);
185 algo.SetVerbose(level);
344 template <
typename Func,
typename... Args>
351 return values[(size_t)param];
379 MultiValue::operator size_t()
const
394 MultiValue::operator float()
const
417 #endif // OVERRIDDENCLUSTERPARAMSALG_H
float Width(util::GeometryUtilities const &gser) override
Computes the width of the cluster.
void SetHits(util::GeometryUtilities const &gser, std::vector< recob::Hit > const &hits) override
Sets the list of input hits.
double std(const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample)
Measure_t EndCharge(util::GeometryUtilities const &gser) override
void SetHits(util::GeometryUtilities const &gser, std::vector< recob::Hit const * > const &hits) override
Sets the list of input hits.
std::bitset< NParameters > overridden_set
bits for overriding
bool isOverridden(ParameterType_t param) const
Returns whether the specified parameter is currently overridden.
Measure_t StartCharge(util::GeometryUtilities const &gser) override
Computes the charge on the first and last wire of the track.
std::vector< details::MultiValue > values
the overridden values
Class holding a value of one among some selected types...
Measure_t Integral() override
Computes the total charge of the cluster from Hit::Integral()
virtual void SetVerbose(int level=1)
Set the verbosity level.
Measure_t StartOpeningAngle() override
Computes the opening angle at the start or end of the cluster.
Measure_t(Algo_t::*)( MeasureFunction_t)
Measure_t StartAngle() override
Computes the angle of the cluster.
OverriddenClusterParamsAlg< AlgoBase > This_t
Algo_t algo
an instance of the wrapped algorithm class
Measure_t EndAngle() override
Algorithm collection class computing cluster parameters.
Measure_t EndOpeningAngle() override
float MultipleHitDensity() override
Fraction of wires in the cluster with more than one hit.
size_t NHits() override
Returns the number of hits in the cluster.
float(Algo_t::*)( ValueFunction_t)
typename AlgoBase::Measure_t Measure_t
Measure_t IntegralStdDev() override
Computes the standard deviation on the charge of the cluster hits.
This_t & ReleaseParameter(ParameterType_t param)
Cancels the override of the specified cluster parameter.
cluster::details::Measure_t< float > Measure_t
MultiValue & operator=(T)
Sets the value from a value of type T; undefined by default.
OverriddenClusterParamsAlg(Args &&...args)
Constructor; just forwards the arguments to the base class.
Interface for a algorithm class computing cluster parameters.
Measure_t SummedADC() override
Computes the total charge of the cluster from Hit::SummedADC()
void SetVerbose(int level=1) override
Set the verbosity level;.
Algorithm collection class computing cluster parameters.
Measure_t SummedADCStdDev() override
Computes the standard deviation on the charge of the cluster hits.
void Clear() override
Restores the class to post-configuration, pre-initialization state.
total number of supported parameters
This_t & OverrideParameter(ParameterType_t param, Measure_t value)
Overrides the specified cluster parameter.
auto ReturnValue(ParameterType_t param, Func func, Args &&...args) -> decltype((algo.*func)(args...))