Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larexamples
larexamples
Algorithms
TotallyCheatTracks
TotallyCheatTrackingAlg.cxx
Go to the documentation of this file.
1
/**
2
* @file larexamples/Algorithms/TotallyCheatTracks/TotallyCheatTrackingAlg.cxx
3
* @brief Algorithm to "reconstruct" trajectories from simulated particles.
4
* @author Gianluca Petrillo (petrillo@fnal.gov)
5
* @date December 26, 2017
6
* @see larexamples/Algorithms/TotallyCheatTracks/TotallyCheatTrackingAlg.h
7
* @ingroup TotallyCheatTracks
8
*
9
*/
10
11
// algorithm header
12
#include "
larexamples/Algorithms/TotallyCheatTracks/TotallyCheatTrackingAlg.h
"
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
//------------------------------------------------------------------------------
24
lar::example::CheatTrack
lar::example::TotallyCheatTrackingAlg::makeTrack
25
(
simb::MCParticle
const
& mcParticle)
const
26
{
27
recob::Trajectory::Positions_t
pos
;
28
recob::Trajectory::Momenta_t
mom;
29
30
for
(
auto
const
& pair: mcParticle.
Trajectory
()) {
31
pos.push_back
32
(
geo::vect::rounded01
(
geo::vect::toPoint
(pair.first.Vect()), 1
e
-8));
33
mom.push_back
34
(
geo::vect::rounded01
(
geo::vect::toVector
(pair.second.Vect()), 1
e
-8));
35
}
// for
36
37
return
{ {
std::move
(pos),
std::move
(mom),
true
}, mcParticle.
PdgCode
() };
38
}
// lar::example::TotallyCheatTrackingAlg::makeTrack()
39
40
41
//------------------------------------------------------------------------------
geo_vectors_utils.h
Utilities to extend the interface of geometry vectors.
simb::MCParticle::PdgCode
int PdgCode() const
Definition:
MCParticle.h:212
simb::MCParticle::Trajectory
const simb::MCTrajectory & Trajectory() const
Definition:
MCParticle.h:253
geo::vect::toPoint
::geo::Point_t toPoint(Point const &p)
Convert the specified point into a geo::Point_t.
Definition:
geo_vectors_utils.h:1280
TotallyCheatTrackingAlg.h
Algorithm to "reconstruct" trajectories from simulated particles.
geo::vect::toVector
::geo::Vector_t toVector(Vector const &v)
Convert the specified vector into a geo::Vector_t.
Definition:
geo_vectors_utils.h:1285
simb::MCParticle
Definition:
MCParticle.h:24
lar::example::CheatTrack
Pseudo-track object for TotallyCheatTracks example.
Definition:
CheatTrack.h:52
e
const double e
Definition:
gUpMuFluxGen.cxx:165
wirecell.gen.depos.move
def move(depos, offset)
Definition:
depos.py:107
lar::example::TotallyCheatTrackingAlg::makeTrack
lar::example::CheatTrack makeTrack(simb::MCParticle const &mcParticle) const
Returns a reconstructed track from the specified particle.
Definition:
TotallyCheatTrackingAlg.cxx:25
recob::Trajectory::Positions_t
tracking::Positions_t Positions_t
Type of trajectory point list.
Definition:
Trajectory.h:79
recob::Trajectory::Momenta_t
tracking::Momenta_t Momenta_t
Type of momentum list.
Definition:
Trajectory.h:82
geo::vect::rounded01
Vector rounded01(Vector const &v, Scalar tol)
Returns a vector with all components rounded if close to 0, -1 or +1.
Definition:
geo_vectors_utils.h:964
MakeVectorFile.pos
tuple pos
Definition:
MakeVectorFile.py:68
Generated by
1.8.11