LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkmkr::TrackTrajectoryCreationBookKeeper Class Reference

Helper class to aid the creation of a recob::TrackTrajectory, keeping data vectors in sync. More...

#include "TrackTrajectoryCreationBookKeeper.h"

Public Member Functions

 TrackTrajectoryCreationBookKeeper (std::vector< art::Ptr< recob::Hit >> &outhits, bool hasMomenta)
 Constructor: needs reference to output hit vector, and hasMomenta bool (true if Vector_t are momenta, false if they are directions). More...
 
recob::TrackTrajectory finalizeTrackTrajectory ()
 Get the finalized recob::TrackTrajectory object; internal data vectors are moved so no more points should be added. More...
 
 TrackTrajectoryCreationBookKeeper (const TrackTrajectoryCreationBookKeeper &)=delete
 Avoid copies of this object. More...
 
 TrackTrajectoryCreationBookKeeper (TrackTrajectoryCreationBookKeeper &&)=delete
 Avoid copies of this object. More...
 
TrackTrajectoryCreationBookKeeperoperator= (const TrackTrajectoryCreationBookKeeper &)=delete
 Avoid copies of this object. More...
 
TrackTrajectoryCreationBookKeeperoperator= (TrackTrajectoryCreationBookKeeper &&)=delete
 Avoid copies of this object. More...
 
void addPoint (const Point_t &point, const Vector_t &vect, art::Ptr< recob::Hit > hit, const PointFlags_t &flag)
 Add a single point; different version of the functions are provided using const references or rvalue references. More...
 
void addPoint (Point_t &&point, Vector_t &&vect, art::Ptr< recob::Hit > hit, PointFlags_t &&flag)
 Add a single point; different version of the functions are provided using const references or rvalue references. More...
 

Private Attributes

bool hasMomenta_
 
std::vector< art::Ptr< recob::Hit > > * hits
 
std::vector< Point_tpositions
 
std::vector< Vector_tmomenta
 
std::vector< PointFlags_tflags
 

Detailed Description

Helper class to aid the creation of a recob::TrackTrajectory, keeping data vectors in sync.

Helper class to aid the creation of a recob::TrackTrajectory, keeping data vectors (Point_t, Vector_t, PointFlags_t, Hit) in sync. Elements of those vectors are added sequentially using the addPoint functions. Once all points have been added a call to the function finalizeTrackTrajectory, builds the track moving the content of the vectors.

Author
G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
1.0

Definition at line 33 of file TrackTrajectoryCreationBookKeeper.h.

Constructor & Destructor Documentation

trkmkr::TrackTrajectoryCreationBookKeeper::TrackTrajectoryCreationBookKeeper ( std::vector< art::Ptr< recob::Hit >> &  outhits,
bool  hasMomenta 
)
inline

Constructor: needs reference to output hit vector, and hasMomenta bool (true if Vector_t are momenta, false if they are directions).

Definition at line 36 of file TrackTrajectoryCreationBookKeeper.h.

References addPoint(), flags, hits, momenta, operator=(), and positions.

37  : hasMomenta_(hasMomenta), hits(&outhits)
38  {
39  hits->clear();
40  }
trkmkr::TrackTrajectoryCreationBookKeeper::TrackTrajectoryCreationBookKeeper ( const TrackTrajectoryCreationBookKeeper )
delete

Avoid copies of this object.

trkmkr::TrackTrajectoryCreationBookKeeper::TrackTrajectoryCreationBookKeeper ( TrackTrajectoryCreationBookKeeper &&  )
delete

Avoid copies of this object.

Member Function Documentation

void trkmkr::TrackTrajectoryCreationBookKeeper::addPoint ( const Point_t point,
const Vector_t vect,
art::Ptr< recob::Hit hit,
const PointFlags_t flag 
)
inline

Add a single point; different version of the functions are provided using const references or rvalue references.

Definition at line 52 of file TrackTrajectoryCreationBookKeeper.h.

Referenced by trkmkr::TrackCreationBookKeeper::addPoint(), trkmkr::TrackCreationBookKeeper::TrackCreationBookKeeper(), and TrackTrajectoryCreationBookKeeper().

56  {
57  positions.push_back(point);
58  momenta.push_back(vect);
59  hits->push_back(hit);
60  flags.push_back(flag);
61  }
void trkmkr::TrackTrajectoryCreationBookKeeper::addPoint ( Point_t &&  point,
Vector_t &&  vect,
art::Ptr< recob::Hit hit,
PointFlags_t &&  flag 
)
inline

Add a single point; different version of the functions are provided using const references or rvalue references.

Definition at line 62 of file TrackTrajectoryCreationBookKeeper.h.

References flags, hits, momenta, and positions.

63  {
64  positions.push_back(std::move(point));
65  momenta.push_back(std::move(vect));
66  hits->push_back(hit);
67  flags.push_back(std::move(flag));
68  }
recob::TrackTrajectory trkmkr::TrackTrajectoryCreationBookKeeper::finalizeTrackTrajectory ( )
inline

Get the finalized recob::TrackTrajectory object; internal data vectors are moved so no more points should be added.

Definition at line 72 of file TrackTrajectoryCreationBookKeeper.h.

References flags, hasMomenta_, momenta, and positions.

Referenced by trkmkr::TrackCreationBookKeeper::finalizeTrack(), and trkmkr::TrackCreationBookKeeper::setTotChi2().

TrackTrajectoryCreationBookKeeper& trkmkr::TrackTrajectoryCreationBookKeeper::operator= ( const TrackTrajectoryCreationBookKeeper )
delete

Avoid copies of this object.

Referenced by TrackTrajectoryCreationBookKeeper().

TrackTrajectoryCreationBookKeeper& trkmkr::TrackTrajectoryCreationBookKeeper::operator= ( TrackTrajectoryCreationBookKeeper &&  )
delete

Avoid copies of this object.

Member Data Documentation

std::vector<PointFlags_t> trkmkr::TrackTrajectoryCreationBookKeeper::flags
private
bool trkmkr::TrackTrajectoryCreationBookKeeper::hasMomenta_
private

Definition at line 79 of file TrackTrajectoryCreationBookKeeper.h.

Referenced by finalizeTrackTrajectory().

std::vector<art::Ptr<recob::Hit> >* trkmkr::TrackTrajectoryCreationBookKeeper::hits
private
std::vector<Vector_t> trkmkr::TrackTrajectoryCreationBookKeeper::momenta
private
std::vector<Point_t> trkmkr::TrackTrajectoryCreationBookKeeper::positions
private

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