LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
cluster::ClusterCreator Class Reference

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

#include "ClusterCreator.h"

Public Member Functions

 ClusterCreator (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 (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 44 of file ClusterCreator.h.

Constructor & Destructor Documentation

cluster::ClusterCreator::ClusterCreator ( 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 29 of file ClusterCreator.cxx.

43  :
45  algo,
46  start_wire,
47  sigma_start_wire,
48  start_tick,
49  sigma_start_tick,
50  end_wire,
51  sigma_end_wire,
52  end_tick,
53  sigma_end_tick,
54  ID,
55  view,
56  plane,
57  sentry
58  ))
59  {} // ClusterCreator::ClusterCreator()
recob::Cluster cluster
Local instance of the cluster being constructed.
recob::Cluster CreateCluster(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 132 of file ClusterCreator.h.

References cluster.

132 { return cluster; }
recob::Cluster cluster
Local instance of the cluster being constructed.
recob::Cluster cluster::ClusterCreator::CreateCluster ( 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 63 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().

77  {
78  return recob::Cluster(
79  start_wire,
80  sigma_start_wire,
81  start_tick,
82  sigma_start_tick,
83  algo.StartCharge().value(), // start_charge
84  algo.StartAngle().value(), // start_angle
85  algo.StartOpeningAngle().value(), // start_opening
86  end_wire,
87  sigma_end_wire,
88  end_tick,
89  sigma_end_tick,
90  algo.EndCharge().value(), // end_charge
91  algo.EndAngle().value(), // end_angle
92  algo.EndOpeningAngle().value(), // end_opening
93  algo.Integral().value(), // integral
94  algo.IntegralStdDev().value(), // integral_stddev
95  algo.SummedADC().value(), // summedADC
96  algo.SummedADCStdDev().value(), // summedADC_stddev
97  algo.NHits(), // n_hits
98  algo.MultipleHitDensity(), // multiple_hit_density
99  algo.Width(), // width
100  ID,
101  view,
102  plane,
103  sentry
104  );
105  } // 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.

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

115 { 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 137 of file ClusterCreator.h.

Referenced by copy().


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