LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
cluster::ClusterCreator Class Reference

Class managing the creation of a new recob::Cluster object. More...

#include "ClusterCreator.h"

Public Member Functions

 ClusterCreator (util::GeometryUtilities const &gser, ClusterParamsAlgBase &algo, float start_wire, float sigma_start_wire, float start_tick, float sigma_start_tick, float end_wire, float sigma_end_wire, float end_tick, float sigma_end_tick, recob::Cluster::ID_t ID, geo::View_t view, geo::PlaneID const &plane, recob::Cluster::SentryArgument_t sentry=recob::Cluster::Sentry)
 Constructor: computes some information from hit list. More...
 
recob::Cluster && move ()
 Prepares the constructed hit to be moved away. More...
 
recob::Cluster const & copy () const
 Returns the constructed wire. More...
 

Protected Member Functions

recob::Cluster CreateCluster (util::GeometryUtilities const &gser, ClusterParamsAlgBase &algo, float start_wire, float sigma_start_wire, float start_tick, float sigma_start_tick, float end_wire, float sigma_end_wire, float end_tick, float sigma_end_tick, recob::Cluster::ID_t ID, geo::View_t view, geo::PlaneID const &plane, recob::Cluster::SentryArgument_t sentry=recob::Cluster::Sentry)
 Creates a cluster from direct information and a hit list. More...
 

Protected Attributes

recob::Cluster cluster
 Local instance of the cluster being constructed. More...
 

Detailed Description

Class managing the creation of a new recob::Cluster object.


A Creator is a class that creates a temporary data product, and at the end it yields it to the caller for storage. This last step should be by move construction, although a copy method is also provided.

An example of creating a Cluster object:

Todo:
Add the example!
cluster::ClusterCreator cluster(...);
cluster.push_back(cluster.move()); // cluster content becomes invalid

This is a one-step creation object: the cluster is constructed at the same time the ClusterCreator is, and no facility is offered to modify the constructed cluster, or to create another one.

Definition at line 46 of file ClusterCreator.h.

Constructor & Destructor Documentation

cluster::ClusterCreator::ClusterCreator ( util::GeometryUtilities const &  gser,
ClusterParamsAlgBase algo,
float  start_wire,
float  sigma_start_wire,
float  start_tick,
float  sigma_start_tick,
float  end_wire,
float  sigma_end_wire,
float  end_tick,
float  sigma_end_tick,
recob::Cluster::ID_t  ID,
geo::View_t  view,
geo::PlaneID const &  plane,
recob::Cluster::SentryArgument_t  sentry = recob::Cluster::Sentry 
)

Constructor: computes some information from hit list.

Parameters
algoa configured and initialized algorithm set
start_wirewire coordinate of the start of the cluster
sigma_start_wireuncertainty on start_wire
start_ticktick coordinate of the start of the cluster
sigma_start_tickuncertainty on start_tick
end_wirewire coordinate of the end of the cluster
sigma_end_wireuncertainty on end_wire
end_ticktick coordinate of the end of the cluster
sigma_end_tickuncertainty on end_tick
IDcluster ID
viewview for this cluster
planelocation of the start of the cluster
sentrya check-point variable, optional

The algorithm set algo will compute and return:

  • start_charge: charge on the start wire
  • start_angle: angle of the start of the cluster, in $ [ -\pi, \pi ] $
  • start_opening: opening angle at the start of the cluster
  • sigma_end_tick: uncertainty on end_tick
  • end_charge: charge on the end wire
  • end_angle: angle of the end of the cluster, in $ [ -\pi, \pi ] $
  • end_opening: opening angle at the end of the cluster
  • integral: total charge from fitted shape of hits
  • integral_stddev: standard deviation of hit charge from fitted shape
  • summedADC: total charge from signal ADC of hits
  • summedADC_stddev: standard deviation of signal ADC of hits
  • n_hits: number of hits in the cluster
  • multiple_hit_density: wires covered by cluster divided by number of hits
  • width: a measure of the cluster width

Definition at line 19 of file ClusterCreator.cxx.

35  : cluster(CreateCluster(gser,
36  algo,
37  start_wire,
38  sigma_start_wire,
39  start_tick,
40  sigma_start_tick,
41  end_wire,
42  sigma_end_wire,
43  end_tick,
44  sigma_end_tick,
45  ID,
46  view,
47  plane,
48  sentry))
49  {} // ClusterCreator::ClusterCreator()
recob::Cluster cluster
Local instance of the cluster being constructed.
recob::Cluster CreateCluster(util::GeometryUtilities const &gser, ClusterParamsAlgBase &algo, float start_wire, float sigma_start_wire, float start_tick, float sigma_start_tick, float end_wire, float sigma_end_wire, float end_tick, float sigma_end_tick, recob::Cluster::ID_t ID, geo::View_t view, geo::PlaneID const &plane, recob::Cluster::SentryArgument_t sentry=recob::Cluster::Sentry)
Creates a cluster from direct information and a hit list.

Member Function Documentation

recob::Cluster const& cluster::ClusterCreator::copy ( ) const
inline

Returns the constructed wire.

Returns
a constant reference to the constructed wire

Despite the name, no copy happens in this function. Copy takes place in the caller code as proper; for example:

// be cluster a ClusterCreator instance:
std::vector<recob::Cluster> Clusters;
cluster.copy();                        // nothing happens
Clusters.push_back(cluster.copy());    // here a copy happens
recob::Cluster single_cluster(cluster.copy()); // copied again

Definition at line 130 of file ClusterCreator.h.

130 { return cluster; }
recob::Cluster cluster
Local instance of the cluster being constructed.
recob::Cluster cluster::ClusterCreator::CreateCluster ( util::GeometryUtilities const &  gser,
ClusterParamsAlgBase algo,
float  start_wire,
float  sigma_start_wire,
float  start_tick,
float  sigma_start_tick,
float  end_wire,
float  sigma_end_wire,
float  end_tick,
float  sigma_end_tick,
recob::Cluster::ID_t  ID,
geo::View_t  view,
geo::PlaneID const &  plane,
recob::Cluster::SentryArgument_t  sentry = recob::Cluster::Sentry 
)
protected

Creates a cluster from direct information and a hit list.

Parameters
algoa configured and initialized algorithm set
start_wirewire coordinate of the start of the cluster
sigma_start_wireuncertainty on start_wire
start_ticktick coordinate of the start of the cluster
sigma_start_tickuncertainty on start_tick
end_wirewire coordinate of the end of the cluster
sigma_end_wireuncertainty on end_wire
end_ticktick coordinate of the end of the cluster
sigma_end_tickuncertainty on end_tick
IDcluster ID
viewview for this cluster
planelocation of the start of the cluster
sentrya check-point variable, optional

The algorithm set algo will compute and return:

  • start_charge: charge on the start wire
  • start_angle: angle of the start of the cluster, in $ [ -\pi, \pi ] $
  • start_opening: opening angle at the start of the cluster
  • sigma_end_tick: uncertainty on end_tick
  • end_charge: charge on the end wire
  • end_angle: angle of the end of the cluster, in $ [ -\pi, \pi ] $
  • end_opening: opening angle at the end of the cluster
  • integral: total charge from fitted shape of hits
  • integral_stddev: standard deviation of hit charge from fitted shape
  • summedADC: total charge from signal ADC of hits
  • summedADC_stddev: standard deviation of signal ADC of hits
  • n_hits: number of hits in the cluster
  • multiple_hit_density: wires covered by cluster divided by number of hits
  • width: a measure of the cluster width

Definition at line 52 of file ClusterCreator.cxx.

References cluster::ClusterParamsAlgBase::EndAngle(), cluster::ClusterParamsAlgBase::EndCharge(), cluster::ClusterParamsAlgBase::EndOpeningAngle(), cluster::ClusterParamsAlgBase::Integral(), cluster::ClusterParamsAlgBase::IntegralStdDev(), cluster::ClusterParamsAlgBase::MultipleHitDensity(), cluster::ClusterParamsAlgBase::NHits(), cluster::ClusterParamsAlgBase::StartAngle(), cluster::ClusterParamsAlgBase::StartCharge(), cluster::ClusterParamsAlgBase::StartOpeningAngle(), cluster::ClusterParamsAlgBase::SummedADC(), cluster::ClusterParamsAlgBase::SummedADCStdDev(), cluster::details::Measure_t< T >::value(), and cluster::ClusterParamsAlgBase::Width().

68  {
69  return recob::Cluster(start_wire,
70  sigma_start_wire,
71  start_tick,
72  sigma_start_tick,
73  algo.StartCharge(gser).value(),
74  algo.StartAngle().value(),
75  algo.StartOpeningAngle().value(),
76  end_wire,
77  sigma_end_wire,
78  end_tick,
79  sigma_end_tick,
80  algo.EndCharge(gser).value(),
81  algo.EndAngle().value(),
82  algo.EndOpeningAngle().value(),
83  algo.Integral().value(),
84  algo.IntegralStdDev().value(),
85  algo.SummedADC().value(),
86  algo.SummedADCStdDev().value(),
87  algo.NHits(),
88  algo.MultipleHitDensity(),
89  algo.Width(gser),
90  ID,
91  view,
92  plane,
93  sentry);
94  } // ClusterCreator::CreateCluster()
Set of hits with a 2D structure.
Definition: Cluster.h:69
recob::Cluster&& cluster::ClusterCreator::move ( )
inline

Prepares the constructed hit to be moved away.

Returns
a right-value reference to the constructed hit

Despite the name, no move happens in this function. Move takes place in the caller code as proper; for example:

// be cluster a ClusterCreator instance:
std::vector<recob::Cluster> Clusters;
cluster.move();                        // nothing happens
Clusters.push_back(cluster.move());    // here the move happens
recob::Cluster single_cluster(cluster.move()); // wrong! cluster is empty now

Definition at line 114 of file ClusterCreator.h.

Referenced by lar_pandora::LArPandoraOutput::BuildCluster().

114 { return std::move(cluster); }
Cluster finding and building.

Member Data Documentation

recob::Cluster cluster::ClusterCreator::cluster
protected

Local instance of the cluster being constructed.

Definition at line 134 of file ClusterCreator.h.


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