LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
TotallyCheatTrackingAlg.cxx
Go to the documentation of this file.
1 
11 // algorithm header
13 
14 // LArSoft libraries
15 #include "larcorealg/Geometry/geo_vectors_utils.h" // geo::vect namespace
16 
17 // C/C++ standard libraries
18 #include <utility> // std::move()
19 
20 
21 //------------------------------------------------------------------------------
22 //--- lar::example::TotallyCheatTrackingAlg implementation
23 //------------------------------------------------------------------------------
25  (simb::MCParticle const& mcParticle) const
26 {
29 
30  for (auto const& pair: mcParticle.Trajectory()) {
31  pos.push_back
32  (geo::vect::rounded01(geo::vect::toPoint(pair.first.Vect()), 1e-8));
33  mom.push_back
34  (geo::vect::rounded01(geo::vect::toVector(pair.second.Vect()), 1e-8));
35  } // for
36 
37  return { { std::move(pos), std::move(mom), true }, mcParticle.PdgCode() };
38 } // lar::example::TotallyCheatTrackingAlg::makeTrack()
39 
40 
41 //------------------------------------------------------------------------------
int PdgCode() const
Definition: MCParticle.h:216
const simb::MCTrajectory & Trajectory() const
Definition: MCParticle.h:257
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
Algorithm to "reconstruct" trajectories from simulated particles.
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
Pseudo-track object for TotallyCheatTracks example.
Definition: CheatTrack.h:52
Utilities to extend the interface of geometry vectors.
lar::example::CheatTrack makeTrack(simb::MCParticle const &mcParticle) const
Returns a reconstructed track from the specified particle.
tracking::Positions_t Positions_t
Type of trajectory point list.
Definition: Trajectory.h:85
tracking::Momenta_t Momenta_t
Type of momentum list.
Definition: Trajectory.h:88
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
Float_t e
Definition: plot.C:34