LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Algorithm collection class computing cluster parameters. More...
#include "ClusterParamsAlgBase.h"
Public Types | |
using | Measure_t = details::Measure_t< float > |
Type used to return values with errors. More... | |
Public Member Functions | |
virtual | ~ClusterParamsAlgBase () |
Virtual destructor. Override freely. More... | |
virtual void | Clear () |
Restores the class to post-configuration, pre-initialization state. More... | |
virtual void | SetHits (std::vector< recob::Hit const * > const &hits)=0 |
Sets the list of input hits. More... | |
virtual void | SetHits (std::vector< recob::Hit > const &hits) |
Sets the list of input hits. More... | |
virtual void | SetVerbose (int level=1) |
Set the verbosity level. More... | |
virtual size_t | NHits () |
Returns the number of hits in the cluster. More... | |
virtual float | MultipleHitDensity () |
Fraction of wires in the cluster with more than one hit. More... | |
virtual float | Width () |
Computes the width of the cluster. More... | |
virtual Measure_t | StartCharge () |
Computes the charge on the first and last wire of the track. More... | |
virtual Measure_t | EndCharge () |
Computes the charge on the first and last wire of the track. More... | |
virtual Measure_t | StartAngle () |
Computes the angle at the start or end of the cluster. More... | |
virtual Measure_t | EndAngle () |
Computes the angle at the start or end of the cluster. More... | |
virtual Measure_t | StartOpeningAngle () |
Computes the opening angle at the start or end of the cluster. More... | |
virtual Measure_t | EndOpeningAngle () |
Computes the opening angle at the start or end of the cluster. More... | |
Cluster charge | |
virtual Measure_t | Integral () |
Computes the total charge of the cluster from Hit::Integral() More... | |
virtual Measure_t | IntegralStdDev () |
Computes the standard deviation on the charge of the cluster hits. More... | |
virtual Measure_t | SummedADC () |
Computes the total charge of the cluster from Hit::SummedADC() More... | |
virtual Measure_t | SummedADCStdDev () |
Computes the standard deviation on the charge of the cluster hits. More... | |
Static Protected Member Functions | |
static std::logic_error | NotImplemented (std::string function_name) |
Protected Attributes | |
int | verbose = 0 |
verbosity level: 0 is normal, negative is even quieter More... | |
Algorithm collection class computing cluster parameters.
This class is an interface only. The implementing classes should implement constructors able to read the necessary information from hit lists, and any of the virtual algorithms.
The interface allows for the single extraction of the information required in recob::Cluster version 14. The implementation can compute and cache different variables at once. The accessor functions are non-const, allowing the caching of the quantity after computation (without using mutable cache members).
The default algorithm functions throw an exception.
The algorithms require a list of hits as input. The structure chosen for this interface is recob::Hit from LArSoft, since it is complete by definition and it does not carry deep dependences (in fact, recob::Hit version 14 has only larreco/SimpleTypesAndConstants.h as compile-time dependency, and no external link-time dependency beside standard C++).
Definition at line 80 of file ClusterParamsAlgBase.h.
using cluster::ClusterParamsAlgBase::Measure_t = details::Measure_t<float> |
Type used to return values with errors.
Definition at line 84 of file ClusterParamsAlgBase.h.
|
inlinevirtual |
|
inlinevirtual |
Restores the class to post-configuration, pre-initialization state.
This function is expected to be called before SetHits(), and the implementation might call it in SetHits() itself.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::LazyClusterParamsAlg, and cluster::StandardClusterParamsAlg.
Definition at line 98 of file ClusterParamsAlgBase.h.
References hits().
|
inlinevirtual |
Computes the angle at the start or end of the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 166 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the charge on the first and last wire of the track.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 157 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the opening angle at the start or end of the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 175 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the total charge of the cluster from Hit::Integral()
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 186 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the standard deviation on the charge of the cluster hits.
Hit charge is obtained by recob::Hit::Integral().
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 195 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Fraction of wires in the cluster with more than one hit.
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 in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 229 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Returns the number of hits in the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 217 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinestaticprotected |
Definition at line 243 of file ClusterParamsAlgBase.h.
|
pure virtual |
Sets the list of input hits.
hits | list of pointers to hits |
undefined | in case of error, this method can throw (anything) |
The hits are in the LArSoft format of recob::Hits, that should have enough information for all the algorithms. The hits are passed as constant pointers. The implementation is expected to either copy the vector (not just to keep a reference to it, since the vector might be temporary) or to translated the required information from the hits into its own internal format. The hits are expected to exist as long as this object is used, until the next Clear() call. It is recommended that this method call Clear() at the beginning. This is left to the implementation, that might still implement a different strategy.
Implemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Referenced by lar_pandora::LArPandoraOutput::BuildCluster(), and cluster::StandardClusterParamsAlg::SetHits().
|
inlinevirtual |
Sets the list of input hits.
hits | list of hits (hits will not be modified) |
undefined | in case of error, this method can throw (anything) |
The same general directions apply as for SetHits() version with pointers. This version takes a list of recob::Hit, rather than their pointers. It can simplify upstream handling when the original list is not recob::Hit and creation of temporary recob::Hit is needed. In that case, managing to obtain pointers to these temporary objects can be inefficient.
The default implementation provided here is not efficient either, since it just creates an additional vector of recob::Hit pointers and uses it. If an implementation is concerned with efficiency, it can reimplement this to initialize the algorithm in a more direct way.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, and cluster::StandardClusterParamsAlg.
Definition at line 137 of file ClusterParamsAlgBase.h.
|
inlinevirtual |
Set the verbosity level.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, and cluster::StandardClusterParamsAlg.
Definition at line 148 of file ClusterParamsAlgBase.h.
Referenced by cluster::StandardClusterParamsAlg::SetVerbose(), and cluster::OverriddenClusterParamsAlg< AlgoBase >::SetVerbose().
|
inlinevirtual |
Computes the angle at the start or end of the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 165 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the charge on the first and last wire of the track.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 156 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the opening angle at the start or end of the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 174 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the total charge of the cluster from Hit::SummedADC()
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 202 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the standard deviation on the charge of the cluster hits.
Hit charge is obtained by recob::Hit::SummedADC().
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 211 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
inlinevirtual |
Computes the width of the cluster.
Reimplemented in cluster::OverriddenClusterParamsAlg< AlgoBase >, cluster::StandardClusterParamsAlg, and cluster::LazyClusterParamsAlg.
Definition at line 236 of file ClusterParamsAlgBase.h.
Referenced by cluster::ClusterCreator::CreateCluster().
|
protected |
verbosity level: 0 is normal, negative is even quieter
Definition at line 241 of file ClusterParamsAlgBase.h.