LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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 66 of file TotallyCheatTrackingAlg.h.

Constructor & Destructor Documentation

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

Constructor: accepts a configuration (currently unused).

Definition at line 72 of file TotallyCheatTrackingAlg.h.

72 {}

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 25 of file TotallyCheatTrackingAlg.cxx.

References e, simb::MCParticle::PdgCode(), geo::vect::rounded01(), geo::vect::toPoint(), geo::vect::toVector(), and simb::MCParticle::Trajectory().

Referenced by lar::example::TotallyCheatTracker::produce(), and setup().

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()
::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: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
void lar::example::TotallyCheatTrackingAlg::setup ( )
inline

Set up the algorithm (currently no operation).

Definition at line 76 of file TotallyCheatTrackingAlg.h.

References makeTrack().

Referenced by lar::example::TotallyCheatTracker::produce().

76 {}

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