All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cluster::ClusterAndHitMerger Class Reference

Class merging clusters: recomputes start and end position and hit list. More...

Inheritance diagram for cluster::ClusterAndHitMerger:
cluster::ClusterMerger

Public Types

using HitPtr_t = art::Ptr< recob::Hit >
 type of pointer to hits More...
 
using HitVector_t = std::vector< HitPtr_t >
 vector of pointers to hits More...
 
- Public Types inherited from cluster::ClusterMerger
using HitPtr_t = art::Ptr< recob::Hit >
 type of pointer to hits More...
 
using HitVector_t = std::vector< HitPtr_t >
 vector of pointers to hits More...
 
using ID_t = recob::Cluster::ID_t
 Type of cluster ID. More...
 
using ClusterEnds_t = recob::Cluster::ClusterEnds_t
 

Public Member Functions

 ClusterAndHitMerger ()=default
 
 ClusterAndHitMerger (recob::Cluster const &cluster, HitVector_t const &cluster_hits)
 
bool Add (recob::Cluster const &cluster, HitVector_t const &cluster_hits, bool prepend=false)
 Merges a single cluster into this object. More...
 
Accessors
HitVector_t const & Hits () const
 Returns a constant reference to the current list of hits. More...
 
unsigned int NHits () const
 Number of hits in the cluster. More...
 
- Public Member Functions inherited from cluster::ClusterMerger
 ClusterMerger ()=default
 
 ClusterMerger (recob::Cluster const &cluster)
 
bool Add (recob::Cluster const &cluster)
 Merges a single cluster into this object. More...
 
float StartWire () const
 Returns the wire coordinate of the start of the cluster. More...
 
float StartTick () const
 Returns the tick coordinate of the start of the cluster. More...
 
float SigmaStartWire () const
 Returns the uncertainty on wire coordinate of the start of the cluster. More...
 
float SigmaStartTick () const
 
float EndWire () const
 Returns the wire coordinate of the end of the cluster. More...
 
float EndTick () const
 Returns the tick coordinate of the end of the cluster. More...
 
float SigmaEndWire () const
 Returns the uncertainty on wire coordinate of the end of the cluster. More...
 
float SigmaEndTick () const
 Returns the uncertainty on tick coordinate of the end of the cluster. More...
 
float WireCoord (ClusterEnds_t side) const
 Returns the wire coordinate of one of the end sides of the cluster. More...
 
float TickCoord (ClusterEnds_t side) const
 Returns the tick coordinate of one of the end sides of the cluster. More...
 
float SigmaWireCoord (ClusterEnds_t side) const
 Returns the uncertainty on wire coordinate of one of the end sides of the cluster. More...
 
float SigmaTickCoord (ClusterEnds_t side) const
 Returns the uncertainty on tick coordinate of one of the end sides of the cluster. More...
 
float StartCharge () const
 Returns the charge on the first wire of the cluster. More...
 
float StartAngle () const
 Returns the starting angle of the cluster. More...
 
float StartOpeningAngle () const
 Returns the opening angle at the start of the cluster. More...
 
float EndCharge () const
 Returns the charge on the last wire of the cluster. More...
 
float EndAngle () const
 Returns the ending angle of the cluster. More...
 
float EndOpeningAngle () const
 Returns the opening angle at the end of the cluster. More...
 
float EdgeCharge (ClusterEnds_t side) const
 Returns the charge on the first or last wire of the cluster. More...
 
float Angle (ClusterEnds_t side) const
 Returns the angle at either end of the cluster. More...
 
float OpeningAngle (ClusterEnds_t side) const
 Returns the opening angle at either end of the cluster. More...
 
float Width () const
 A measure of the cluster width, in homogenized units. More...
 
geo::View_t View () const
 Returns the view for this cluster. More...
 
geo::PlaneID Plane () const
 Returns the plane ID this cluster lies on. More...
 
bool hasPlane () const
 Returns whether geometry plane is valid. More...
 

Protected Member Functions

void AddHits (HitVector_t const &cluster_hits, bool prepend)
 
- Protected Member Functions inherited from cluster::ClusterMerger
void AdoptEnd (recob::Cluster const &cluster, ClusterEnds_t iEnd)
 Imports all the member of the corresponding end. More...
 

Protected Attributes

HitVector_t hits
 hits in the cluster More...
 
- Protected Attributes inherited from cluster::ClusterMerger
float fEndWires [ClusterEnds_t::NEnds]
 Data referring to start and end of the cluster. More...
 
float fSigmaEndWires [ClusterEnds_t::NEnds]
 Uncertainty on wire coordinate of the start and end of the cluster. More...
 
float fEndTicks [ClusterEnds_t::NEnds]
 Tick coordinate of the start and end of the cluster. More...
 
float fSigmaEndTicks [ClusterEnds_t::NEnds]
 Uncertainty on tick coordinate of the start and end of the cluster. More...
 
float fEndCharges [ClusterEnds_t::NEnds]
 Charge on the start and end wire of the cluster. More...
 
float fAngles [ClusterEnds_t::NEnds]
 Angle of the start and end of the cluster, defined in [-pi,pi]. More...
 
float fOpeningAngles [ClusterEnds_t::NEnds]
 Opening angle of the cluster shape at the start and end of the cluster. More...
 
float fWidth
 A measure of the cluster width, in homogenized units. More...
 
geo::View_t fView
 View for this cluster. More...
 
geo::PlaneID fPlaneID
 Location of the start of the cluster. More...
 
unsigned int n_clusters = 0
 number of clusters added so far More...
 

Detailed Description

Class merging clusters: recomputes start and end position and hit list.

Definition at line 394 of file LineMerger_module.cc.

Member Typedef Documentation

type of pointer to hits

Definition at line 399 of file LineMerger_module.cc.

vector of pointers to hits

Definition at line 400 of file LineMerger_module.cc.

Constructor & Destructor Documentation

cluster::ClusterAndHitMerger::ClusterAndHitMerger ( )
default
cluster::ClusterAndHitMerger::ClusterAndHitMerger ( recob::Cluster const &  cluster,
HitVector_t const &  cluster_hits 
)
inline

Definition at line 404 of file LineMerger_module.cc.

405  {
406  Add(cluster, cluster_hits);
407  }
process_name cluster
Definition: cheaterreco.fcl:51
bool Add(recob::Cluster const &cluster, HitVector_t const &cluster_hits, bool prepend=false)
Merges a single cluster into this object.

Member Function Documentation

bool cluster::ClusterAndHitMerger::Add ( recob::Cluster const &  cluster,
HitVector_t const &  cluster_hits,
bool  prepend = false 
)

Merges a single cluster into this object.

Parameters
clusterthe cluster to be merged
cluster_hitsthe list of hits in this cluster
prependif true, hits are inserted at the beginning of the list
Returns
whether the addition was successful
See Also
ClusterMerger::Add()

The two ends of the cluster are merged into this one, that gets extended. Hit lists are merged too: no check on existing hits nor double addition.

Note that this code is crap unless the cluster is track-like.

Definition at line 455 of file LineMerger_module.cc.

459  {
460  if (!ClusterMerger::Add(cluster)) return false;
461 
462  AddHits(cluster_hits, prepend);
463  return true;
464  } // ClusterAndHitMerger::Add()
process_name cluster
Definition: cheaterreco.fcl:51
void AddHits(HitVector_t const &cluster_hits, bool prepend)
bool Add(recob::Cluster const &cluster)
Merges a single cluster into this object.
void cluster::ClusterAndHitMerger::AddHits ( HitVector_t const &  cluster_hits,
bool  prepend 
)
inlineprotected

Definition at line 447 of file LineMerger_module.cc.

448  {
449  hits.insert(prepend ? hits.begin() : hits.end(), cluster_hits.begin(), cluster_hits.end());
450  } // AddHits()
HitVector_t hits
hits in the cluster
HitVector_t const& cluster::ClusterAndHitMerger::Hits ( ) const
inline

Returns a constant reference to the current list of hits.

Definition at line 429 of file LineMerger_module.cc.

430  {
431  return hits;
432  }
HitVector_t hits
hits in the cluster
unsigned int cluster::ClusterAndHitMerger::NHits ( ) const
inline

Number of hits in the cluster.

Definition at line 436 of file LineMerger_module.cc.

437  {
438  return hits.size();
439  }
HitVector_t hits
hits in the cluster

Member Data Documentation

HitVector_t cluster::ClusterAndHitMerger::hits
protected

hits in the cluster

Definition at line 444 of file LineMerger_module.cc.


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