10 #ifndef OVERRIDDENCLUSTERPARAMSALG_H 11 #define OVERRIDDENCLUSTERPARAMSALG_H 15 #include <type_traits> 69 template <
typename AlgoBase>
72 "OverriddenClusterParamsAlg template parameter must derive" 73 " from ClusterParamsAlgBase");
98 template <
typename... Args>
115 overridden_set.set((
size_t)param);
116 values[(size_t)param] = value;
129 overridden_set.set((
size_t)param);
137 return overridden_set.test((
size_t)param);
164 std::vector<recob::Hit const*>
const& hits)
override 166 algo.SetHits(gser, hits);
178 algo.SetHits(gser, hits);
186 algo.SetVerbose(
level);
201 return ReturnValue(cpStartCharge, &Algo_t::StartCharge, gser);
206 return ReturnValue(cpEndCharge, &Algo_t::EndCharge, gser);
223 return ReturnValue(cpStartAngle, &Algo_t::StartAngle);
229 return ReturnValue(cpEndAngle, &Algo_t::EndAngle);
242 return ReturnValue(cpStartOpeningAngle, &Algo_t::StartOpeningAngle);
247 return ReturnValue(cpEndOpeningAngle, &Algo_t::EndOpeningAngle);
262 return ReturnValue(cpIntegral, &Algo_t::Integral);
274 return ReturnValue(cpIntegralStdDev, &Algo_t::IntegralStdDev);
286 return ReturnValue(cpSummedADC, &Algo_t::SummedADC);
298 return ReturnValue(cpSummedADCStdDev, &Algo_t::SummedADCStdDev);
307 return ReturnValue(cpNHits, &Algo_t::NHits);
318 return ReturnValue(cpMultipleHitDensity, &Algo_t::MultipleHitDensity);
345 template <
typename Func,
typename... Args>
349 if (isOverridden(param)) {
352 return values[(size_t)param];
380 MultiValue::operator size_t()
const 395 MultiValue::operator
float()
const 418 #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.
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.
double Width(Resonance_t res)
resonance width (GeV)
Cluster finding and building.
Measure_t StartAngle() override
Computes the angle of the cluster.
Algo_t algo
an instance of the wrapped algorithm class
Measure_t EndAngle() override
Algorithm collection class computing cluster parameters.
auto ReturnValue(ParameterType_t param, Func func, Args &&...args) -> decltype((algo.*func)(args...))
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.
details::Measure_t< float > Measure_t
Type used to return values with errors.
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.
This_t & OverrideParameter(ParameterType_t param, Measure_t value)
Overrides the specified cluster parameter.