LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
TrackCreationBookKeeper.h
Go to the documentation of this file.
1 #ifndef TRACKCREATIONBOOKKEEPER_H
2 #define TRACKCREATIONBOOKKEEPER_H
3 
10 
11 namespace trkmkr {
12 
31 
33  public:
36  OptionalOutputs& optionals,
37  int tkID,
38  int pdgHyp,
39  bool hasMomenta,
40  int nfitpars = 4)
41  : ttcbk_(outhits, hasMomenta)
42  , tkID_(tkID)
43  , pdgHyp_(pdgHyp)
44  , totChi2_(0)
45  , opts(&optionals)
46  , nfittedpars(nfitpars)
47  {
48  opts->reset();
49  }
50  //
58  //
60  void addPoint(const Point_t& point,
62  const Vector_t& vect,
64  const PointFlags_t& flag,
65  double chi2)
66  {
67  ttcbk_.addPoint(point, vect, hit, flag);
68  if (chi2 >= 0) {
69  chi2v.push_back(chi2);
70  totChi2_ += chi2;
71  }
72  }
73  void addPoint(const Point_t& point,
74  const Vector_t& vect,
76  const PointFlags_t& flag,
77  double chi2,
79  {
80  addPoint(point, vect, hit, flag, chi2);
81  opts->addPoint(ope);
82  }
83  void addPoint(Point_t&& point,
84  Vector_t&& vect,
86  PointFlags_t&& flag,
87  double chi2)
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  }
95  void addPoint(Point_t&& point,
96  Vector_t&& vect,
98  PointFlags_t&& flag,
99  double chi2,
101  {
102  addPoint(std::move(point), std::move(vect), hit, std::move(flag), chi2);
103  opts->addPoint(ope);
104  }
106  //
108  void setTotChi2(double totChi2) { totChi2_ = totChi2; }
109  //
113  const recob::tracking::SMatrixSym55& covEnd)
114  {
116  pdgHyp_,
117  totChi2_,
118  int(chi2v.size()) - nfittedpars,
121  tkID_);
122  }
125  {
127  pdgHyp_,
128  totChi2_,
129  int(chi2v.size()) - nfittedpars,
130  std::move(covStart),
131  std::move(covEnd),
132  tkID_);
133  }
135  private:
137  int tkID_;
138  int pdgHyp_;
139  double totChi2_;
141  std::vector<double> chi2v;
142  int
143  nfittedpars; // hits are 1D measurement, i.e. each hit is one d.o.f.; no B field: 4 fitted parameters by default
144  //
145  };
146 
147 }
148 #endif
recob::TrajectoryPointFlags PointFlags_t
Type for flags of a point/hit.
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 setTotChi2(double totChi2)
Set the total chi2 value.
TrackCreationBookKeeper & operator=(const TrackCreationBookKeeper &)=delete
Avoid copies of this object.
Declaration of signal hit object.
recob::TrackTrajectory finalizeTrackTrajectory()
Get the finalized recob::TrackTrajectory object; internal data vectors are moved so no more points sh...
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 ...
ROOT::Math::SMatrix< Double32_t, 5, 5, ROOT::Math::MatRepSym< Double32_t, 5 >> SMatrixSym55
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:289
Helper class to aid the creation of a recob::TrackTrajectory, keeping data vectors in sync...
Struct holding point-by-point elements used in OptionalOutputs.
Definition: TrackMaker.h:44
recob::tracking::Vector_t Vector_t
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
Definition: TrackingTypes.h:31
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 need...
Provides recob::Track data product.
recob::Track finalizeTrack(recob::tracking::SMatrixSym55 &&covStart, recob::tracking::SMatrixSym55 &&covEnd)
Get the finalized recob::Track; needs the start and end covariance matrices.
Detector simulation of raw signals on wires.
void reset()
reset the stored vectors
Definition: TrackMaker.h:128
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 ...
void addPoint(OptionalPointElement &ope)
add one OptionalPointElement
Definition: TrackMaker.h:113
Helper class to aid the creation of a recob::Track, keeping data vectors in sync. ...
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 ...
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.
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Definition: TrackingTypes.h:27
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 ...
Struct holding optional TrackMaker outputs.
Definition: TrackMaker.h:108
Set of flags pertaining a point of the track.
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
recob::tracking::Point_t Point_t