All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 135 of file ClusterCreator.h.

136  {
137  return cluster;
138  }
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 53 of file ClusterCreator.cxx.

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

116  {
117  return std::move(cluster);
118  }
recob::Cluster cluster
Local instance of the cluster being constructed.

Member Data Documentation

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

Local instance of the cluster being constructed.

Definition at line 142 of file ClusterCreator.h.


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