All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
lar::example::TotallyCheatTrackingAlg Class Reference

Reconstructs tracks from simulated particles. More...

#include <TotallyCheatTrackingAlg.h>

Classes

struct  Config
 

Public Member Functions

 TotallyCheatTrackingAlg (Config const &)
 Constructor: accepts a configuration (currently unused). More...
 
void setup ()
 Set up the algorithm (currently no operation). More...
 
lar::example::CheatTrack makeTrack (simb::MCParticle const &mcParticle) const
 Returns a reconstructed track from the specified particle. More...
 

Detailed Description

Reconstructs tracks from simulated particles.

See Also
TotallyCheatTracks example overview

This totally cheating tracking algorithm will return one lar::example::CheatTrack object for each simb::MCParticle inserted. The information of the track will perfectly reflect the content of the simulated particle trajectory.

Note
The produced track is not a standard LArSoft recob::Track.

Example of usage: ----------------------------------------------------------------—{.cpp} lar::example::TotallyCheatTrackingAlg cheaterAlg({}); cheaterAlg.setup();

std::vector<lar::example::CheatTrack> tracks; for (auto const& mcParticle: mcParticles)

tracks.push_back(cheaterAlg.makeTrack(mcParticle));

(assuming mcParticles a collection of simb::MCParticle).

Configuration

Currently, none.

Dependencies and setup

Currently none.

Definition at line 59 of file TotallyCheatTrackingAlg.h.

Constructor & Destructor Documentation

lar::example::TotallyCheatTrackingAlg::TotallyCheatTrackingAlg ( Config const &  )
inline

Constructor: accepts a configuration (currently unused).

Definition at line 65 of file TotallyCheatTrackingAlg.h.

65 {}

Member Function Documentation

lar::example::CheatTrack lar::example::TotallyCheatTrackingAlg::makeTrack ( simb::MCParticle const &  mcParticle) const

Returns a reconstructed track from the specified particle.

Parameters
mcParticlethe simulated particle to be reconstructed
Returns
a reconstructed lar::example::CheatTrack track

The reconstucted track has one trajectory point per trajectory point of the input particle.

Definition at line 28 of file TotallyCheatTrackingAlg.cxx.

29 {
32 
33  for (auto const& pair: mcParticle.Trajectory()) {
34  pos.push_back
35  (geo::vect::rounded01(geo::vect::toPoint(pair.first.Vect()), 1e-8));
36  mom.push_back
37  (geo::vect::rounded01(geo::vect::toVector(pair.second.Vect()), 1e-8));
38  } // for
39 
40  return { { std::move(pos), std::move(mom), true }, mcParticle.PdgCode() };
41 } // lar::example::TotallyCheatTrackingAlg::makeTrack()
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
tracking::Positions_t Positions_t
Type of trajectory point list.
Definition: Trajectory.h:79
tracking::Momenta_t Momenta_t
Type of momentum list.
Definition: Trajectory.h:82
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
do i e
void lar::example::TotallyCheatTrackingAlg::setup ( )
inline

Set up the algorithm (currently no operation).

Definition at line 69 of file TotallyCheatTrackingAlg.h.

69 {}

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