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

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

#include "TrackCreationBookKeeper.h"

Public Member Functions

 TrackCreationBookKeeper (std::vector< art::Ptr< recob::Hit >> &outhits, OptionalOutputs &optionals, int tkID, int pdgHyp, bool hasMomenta, int nfitpars=4)
 Constructor: needs reference to output hit vector, optional outputs struct, and other parameters needed when creating the track object. More...
 
void setTotChi2 (double totChi2)
 Set the total chi2 value. More...
 
 TrackCreationBookKeeper (const TrackCreationBookKeeper &)=delete
 Avoid copies of this object. More...
 
 TrackCreationBookKeeper (TrackCreationBookKeeper &&)=delete
 Avoid copies of this object. More...
 
TrackCreationBookKeeperoperator= (const TrackCreationBookKeeper &)=delete
 Avoid copies of this object. More...
 
TrackCreationBookKeeperoperator= (TrackCreationBookKeeper &&)=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, double chi2)
 Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument. More...
 
void addPoint (const Point_t &point, const Vector_t &vect, art::Ptr< recob::Hit > hit, const PointFlags_t &flag, double chi2, OptionalPointElement &ope)
 Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument. More...
 
void addPoint (Point_t &&point, Vector_t &&vect, art::Ptr< recob::Hit > hit, PointFlags_t &&flag, double chi2)
 Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument. More...
 
void addPoint (Point_t &&point, Vector_t &&vect, art::Ptr< recob::Hit > hit, PointFlags_t &&flag, double chi2, OptionalPointElement &ope)
 Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument. More...
 
recob::Track finalizeTrack (const recob::tracking::SMatrixSym55 &covStart, const recob::tracking::SMatrixSym55 &covEnd)
 Get the finalized recob::Track; needs the start and end covariance matrices. More...
 
recob::Track finalizeTrack (recob::tracking::SMatrixSym55 &&covStart, recob::tracking::SMatrixSym55 &&covEnd)
 Get the finalized recob::Track; needs the start and end covariance matrices. More...
 

Private Attributes

trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
 
int tkID_
 
int pdgHyp_
 
double totChi2_
 
OptionalOutputsopts
 
std::vector< double > chi2v
 
int nfittedpars
 

Detailed Description

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

Helper class to aid the creation of a recob::Track, keeping output data (vectors of recob::tracking::Point_t, recob::tracking::Vector_t, recob::TrackTrajectory::PointFlags_t, recob::Hit, and trkmkr::OptionalOutputs struct) in sync. It internally stores and uses a trkmkr::TrackTrajectoryCreationBookKeeper object. Elements of those vectors are added sequentially using the addPoint functions. Once all points have been added a call to the function finalizeTrack, builds the track moving the content of the vectors.

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

Definition at line 32 of file TrackCreationBookKeeper.h.

Constructor & Destructor Documentation

trkmkr::TrackCreationBookKeeper::TrackCreationBookKeeper ( std::vector< art::Ptr< recob::Hit >> &  outhits,
OptionalOutputs optionals,
int  tkID,
int  pdgHyp,
bool  hasMomenta,
int  nfitpars = 4 
)
inline

Constructor: needs reference to output hit vector, optional outputs struct, and other parameters needed when creating the track object.

Definition at line 35 of file TrackCreationBookKeeper.h.

References trkmkr::TrackTrajectoryCreationBookKeeper::addPoint(), addPoint(), chi2v, operator=(), opts, trkmkr::OptionalOutputs::reset(), totChi2_, and ttcbk_.

41  : ttcbk_(outhits, hasMomenta)
42  , tkID_(tkID)
43  , pdgHyp_(pdgHyp)
44  , totChi2_(0)
45  , opts(&optionals)
46  , nfittedpars(nfitpars)
47  {
48  opts->reset();
49  }
trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
void reset()
reset the stored vectors
Definition: TrackMaker.h:128
trkmkr::TrackCreationBookKeeper::TrackCreationBookKeeper ( const TrackCreationBookKeeper )
delete

Avoid copies of this object.

trkmkr::TrackCreationBookKeeper::TrackCreationBookKeeper ( TrackCreationBookKeeper &&  )
delete

Avoid copies of this object.

Member Function Documentation

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

Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument.

Definition at line 61 of file TrackCreationBookKeeper.h.

Referenced by addPoint(), trkf::TrackKalmanFitter::fillResult(), and TrackCreationBookKeeper().

66  {
67  ttcbk_.addPoint(point, vect, hit, flag);
68  if (chi2 >= 0) {
69  chi2v.push_back(chi2);
70  totChi2_ += chi2;
71  }
72  }
trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
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 ...
void trkmkr::TrackCreationBookKeeper::addPoint ( const Point_t point,
const Vector_t vect,
art::Ptr< recob::Hit hit,
const PointFlags_t flag,
double  chi2,
OptionalPointElement ope 
)
inline

Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument.

Definition at line 73 of file TrackCreationBookKeeper.h.

References addPoint(), trkmkr::OptionalOutputs::addPoint(), and opts.

79  {
80  addPoint(point, vect, hit, flag, chi2);
81  opts->addPoint(ope);
82  }
void addPoint(const Point_t &point, const Vector_t &vect, art::Ptr< recob::Hit > hit, const PointFlags_t &flag, double chi2)
Add a single point; different version of the functions are provided using const references or rvalue ...
void addPoint(OptionalPointElement &ope)
add one OptionalPointElement
Definition: TrackMaker.h:113
void trkmkr::TrackCreationBookKeeper::addPoint ( Point_t &&  point,
Vector_t &&  vect,
art::Ptr< recob::Hit hit,
PointFlags_t &&  flag,
double  chi2 
)
inline

Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument.

Definition at line 83 of file TrackCreationBookKeeper.h.

References trkmkr::TrackTrajectoryCreationBookKeeper::addPoint(), chi2v, totChi2_, and ttcbk_.

88  {
89  ttcbk_.addPoint(std::move(point), std::move(vect), hit, std::move(flag));
90  if (chi2 >= 0) {
91  chi2v.push_back(chi2);
92  totChi2_ += chi2;
93  }
94  }
trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
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 ...
void trkmkr::TrackCreationBookKeeper::addPoint ( Point_t &&  point,
Vector_t &&  vect,
art::Ptr< recob::Hit hit,
PointFlags_t &&  flag,
double  chi2,
OptionalPointElement ope 
)
inline

Add a single point; different version of the functions are provided using const references or rvalue references, with and without an OptionalPointElement argument.

Definition at line 95 of file TrackCreationBookKeeper.h.

References addPoint(), trkmkr::OptionalOutputs::addPoint(), and opts.

101  {
102  addPoint(std::move(point), std::move(vect), hit, std::move(flag), chi2);
103  opts->addPoint(ope);
104  }
void addPoint(const Point_t &point, const Vector_t &vect, art::Ptr< recob::Hit > hit, const PointFlags_t &flag, double chi2)
Add a single point; different version of the functions are provided using const references or rvalue ...
void addPoint(OptionalPointElement &ope)
add one OptionalPointElement
Definition: TrackMaker.h:113
recob::Track trkmkr::TrackCreationBookKeeper::finalizeTrack ( const recob::tracking::SMatrixSym55 covStart,
const recob::tracking::SMatrixSym55 covEnd 
)
inline

Get the finalized recob::Track; needs the start and end covariance matrices.

Definition at line 112 of file TrackCreationBookKeeper.h.

Referenced by trkf::TrackKalmanFitter::fillResult(), and setTotChi2().

114  {
116  pdgHyp_,
117  totChi2_,
118  int(chi2v.size()) - nfittedpars,
121  tkID_);
122  }
recob::TrackTrajectory finalizeTrackTrajectory()
Get the finalized recob::TrackTrajectory object; internal data vectors are moved so no more points sh...
trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 >> SMatrixSym55
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
recob::Track trkmkr::TrackCreationBookKeeper::finalizeTrack ( recob::tracking::SMatrixSym55 &&  covStart,
recob::tracking::SMatrixSym55 &&  covEnd 
)
inline

Get the finalized recob::Track; needs the start and end covariance matrices.

Definition at line 123 of file TrackCreationBookKeeper.h.

References chi2v, trkmkr::TrackTrajectoryCreationBookKeeper::finalizeTrackTrajectory(), nfittedpars, pdgHyp_, tkID_, totChi2_, and ttcbk_.

125  {
127  pdgHyp_,
128  totChi2_,
129  int(chi2v.size()) - nfittedpars,
130  std::move(covStart),
131  std::move(covEnd),
132  tkID_);
133  }
recob::TrackTrajectory finalizeTrackTrajectory()
Get the finalized recob::TrackTrajectory object; internal data vectors are moved so no more points sh...
trkmkr::TrackTrajectoryCreationBookKeeper ttcbk_
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
TrackCreationBookKeeper& trkmkr::TrackCreationBookKeeper::operator= ( const TrackCreationBookKeeper )
delete

Avoid copies of this object.

Referenced by TrackCreationBookKeeper().

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

Avoid copies of this object.

void trkmkr::TrackCreationBookKeeper::setTotChi2 ( double  totChi2)
inline

Member Data Documentation

std::vector<double> trkmkr::TrackCreationBookKeeper::chi2v
private
int trkmkr::TrackCreationBookKeeper::nfittedpars
private

Definition at line 143 of file TrackCreationBookKeeper.h.

Referenced by finalizeTrack(), and setTotChi2().

OptionalOutputs* trkmkr::TrackCreationBookKeeper::opts
private

Definition at line 140 of file TrackCreationBookKeeper.h.

Referenced by addPoint(), and TrackCreationBookKeeper().

int trkmkr::TrackCreationBookKeeper::pdgHyp_
private

Definition at line 138 of file TrackCreationBookKeeper.h.

Referenced by finalizeTrack(), and setTotChi2().

int trkmkr::TrackCreationBookKeeper::tkID_
private

Definition at line 137 of file TrackCreationBookKeeper.h.

Referenced by finalizeTrack(), and setTotChi2().

double trkmkr::TrackCreationBookKeeper::totChi2_
private
trkmkr::TrackTrajectoryCreationBookKeeper trkmkr::TrackCreationBookKeeper::ttcbk_
private

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