LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "MCTrajectory.h"
Public Types | |
typedef std::vector< std::pair< TLorentzVector, TLorentzVector > > | list_type |
typedef list_type::value_type | value_type |
typedef list_type::iterator | iterator |
typedef list_type::const_iterator | const_iterator |
typedef list_type::reverse_iterator | reverse_iterator |
typedef list_type::const_reverse_iterator | const_reverse_iterator |
typedef list_type::size_type | size_type |
typedef list_type::difference_type | difference_type |
typedef std::vector< std::pair< size_t, unsigned char > > | ProcessMap |
Public Member Functions | |
MCTrajectory () | |
MCTrajectory (const TLorentzVector &vertex, const TLorentzVector &momentum) | |
const TLorentzVector & | Position (const size_type) const |
The accessor methods described above. More... | |
const TLorentzVector & | Momentum (const size_type) const |
double | X (const size_type i) const |
double | Y (const size_type i) const |
double | Z (const size_type i) const |
double | T (const size_type i) const |
double | Px (const size_type i) const |
double | Py (const size_type i) const |
double | Pz (const size_type i) const |
double | E (const size_type i) const |
double | TotalLength () const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
bool | empty () const |
void | swap (simb::MCTrajectory &other) |
void | clear () |
const value_type & | operator[] (const size_type i) const |
const value_type & | at (const size_type i) const |
void | push_back (value_type const &v) |
void | push_back (TLorentzVector const &p, TLorentzVector const &m) |
void | Add (TLorentzVector const &p, TLorentzVector const &m) |
void | Add (TLorentzVector const &p, TLorentzVector const &m, std::string const &process, bool keepTransportation=false) |
unsigned char | ProcessToKey (std::string const &process) const |
std::string | KeyToProcess (unsigned char const &key) const |
ProcessMap const & | TrajectoryProcesses () const |
void | Sparsify (double margin=.1, bool keep_second_to_last=false) |
Private Attributes | |
list_type | ftrajectory |
The list of trajectory points. More... | |
ProcessMap | fTrajectoryProcess |
Friends | |
std::ostream & | operator<< (std::ostream &output, const MCTrajectory &) |
Definition at line 58 of file MCTrajectory.h.
typedef list_type::const_iterator simb::MCTrajectory::const_iterator |
Definition at line 66 of file MCTrajectory.h.
typedef list_type::const_reverse_iterator simb::MCTrajectory::const_reverse_iterator |
Definition at line 68 of file MCTrajectory.h.
typedef list_type::difference_type simb::MCTrajectory::difference_type |
Definition at line 70 of file MCTrajectory.h.
typedef list_type::iterator simb::MCTrajectory::iterator |
Definition at line 65 of file MCTrajectory.h.
typedef std::vector< std::pair<TLorentzVector, TLorentzVector> > simb::MCTrajectory::list_type |
Some type definitions to make life easier, and to help "hide" the implementation details. (If you're not familiar with STL, you can ignore these definitions.)
Definition at line 63 of file MCTrajectory.h.
typedef std::vector< std::pair<size_t, unsigned char> > simb::MCTrajectory::ProcessMap |
Definition at line 71 of file MCTrajectory.h.
typedef list_type::reverse_iterator simb::MCTrajectory::reverse_iterator |
Definition at line 67 of file MCTrajectory.h.
typedef list_type::size_type simb::MCTrajectory::size_type |
Definition at line 69 of file MCTrajectory.h.
typedef list_type::value_type simb::MCTrajectory::value_type |
Definition at line 64 of file MCTrajectory.h.
simb::MCTrajectory::MCTrajectory | ( | ) |
Standard constructor: Start with initial position and momentum of the particle.
Definition at line 24 of file MCTrajectory.cxx.
simb::MCTrajectory::MCTrajectory | ( | const TLorentzVector & | vertex, |
const TLorentzVector & | momentum | ||
) |
Definition at line 29 of file MCTrajectory.cxx.
References ftrajectory.
void simb::MCTrajectory::Add | ( | TLorentzVector const & | p, |
TLorentzVector const & | m | ||
) |
Referenced by simb::MCParticle::AddTrajectoryPoint(), and at().
void simb::MCTrajectory::Add | ( | TLorentzVector const & | p, |
TLorentzVector const & | m, | ||
std::string const & | process, | ||
bool | keepTransportation = false |
||
) |
Definition at line 136 of file MCTrajectory.cxx.
References ftrajectory, fTrajectoryProcess, ProcessToKey(), and push_back().
|
inline |
Definition at line 175 of file MCTrajectory.h.
References Add(), ftrajectory, and push_back().
Referenced by nnet::TrainingDataAlg::collectVtxFlags(), and Sparsify().
|
inline |
Standard STL methods, to make this class look like an STL map. Again, if you don't know STL, you can just ignore these methods.
Definition at line 158 of file MCTrajectory.h.
References ftrajectory.
Referenced by simb::operator<<().
|
inline |
Definition at line 159 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 168 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 156 of file MCTrajectory.h.
References Momentum().
|
inline |
Definition at line 167 of file MCTrajectory.h.
References ftrajectory.
Referenced by evdb_tool::DrawLArVoxel3D::Draw(), larg4::ParticleListAction::isDropped(), larg4::ParticleListActionService::isDropped(), evd::SimulationDrawer::MCTruth3D(), and evd::SimulationDrawer::MCTruthOrtho().
|
inline |
Definition at line 160 of file MCTrajectory.h.
References ftrajectory.
Referenced by simb::operator<<().
|
inline |
Definition at line 161 of file MCTrajectory.h.
References ftrajectory.
std::string simb::MCTrajectory::KeyToProcess | ( | unsigned char const & | key | ) | const |
Definition at line 117 of file MCTrajectory.cxx.
Referenced by nnet::TrainingDataAlg::collectVtxFlags().
const TLorentzVector & simb::MCTrajectory::Momentum | ( | const size_type | index | ) | const |
Definition at line 44 of file MCTrajectory.cxx.
References ftrajectory.
Referenced by E(), simb::MCParticle::Momentum(), Px(), Py(), and Pz().
|
inline |
Definition at line 172 of file MCTrajectory.h.
References ftrajectory.
const TLorentzVector & simb::MCTrajectory::Position | ( | const size_type | index | ) | const |
The accessor methods described above.
Definition at line 36 of file MCTrajectory.cxx.
References ftrajectory.
Referenced by simb::MCParticle::Position(), T(), TotalLength(), X(), Y(), and Z().
unsigned char simb::MCTrajectory::ProcessToKey | ( | std::string const & | process | ) | const |
void simb::MCTrajectory::push_back | ( | value_type const & | v | ) |
void simb::MCTrajectory::push_back | ( | TLorentzVector const & | p, |
TLorentzVector const & | m | ||
) |
|
inline |
Definition at line 153 of file MCTrajectory.h.
References Momentum().
|
inline |
Definition at line 154 of file MCTrajectory.h.
References Momentum().
|
inline |
Definition at line 155 of file MCTrajectory.h.
References Momentum().
|
inline |
Definition at line 162 of file MCTrajectory.h.
References ftrajectory.
Referenced by Sparsify().
|
inline |
Definition at line 163 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 164 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 165 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 166 of file MCTrajectory.h.
References ftrajectory.
Referenced by evdb_tool::DrawLArVoxel3D::Draw(), simb::MCParticle::EndE(), simb::MCParticle::EndMomentum(), simb::MCParticle::EndPosition(), simb::MCParticle::EndPx(), simb::MCParticle::EndPy(), simb::MCParticle::EndPz(), simb::MCParticle::EndT(), simb::MCParticle::EndX(), simb::MCParticle::EndY(), simb::MCParticle::EndZ(), evd::SimulationDrawer::MCTruth3D(), evd::SimulationDrawer::MCTruthOrtho(), simb::MCParticle::NumberTrajectoryPoints(), simb::operator<<(), Sparsify(), and TotalLength().
void simb::MCTrajectory::Sparsify | ( | double | margin = .1 , |
bool | keep_second_to_last = false |
||
) |
Remove points from trajectory. Straight line interpolation between the remaining points will pass no further than margin from removed points.
Definition at line 160 of file MCTrajectory.cxx.
References at(), dir, ftrajectory, fTrajectoryProcess, rbegin(), and size().
Referenced by simb::MCParticle::SparsifyTrajectory().
|
inline |
Definition at line 169 of file MCTrajectory.h.
References ftrajectory.
|
inline |
Definition at line 152 of file MCTrajectory.h.
References Position().
double simb::MCTrajectory::TotalLength | ( | ) | const |
Definition at line 52 of file MCTrajectory.cxx.
References larg4::dist(), n, Position(), and size().
Referenced by sim::dump::DumpMCParticle(), and cosmic::BeamFlashTrackMatchTaggerAlg::RunHypothesisComparison().
|
inline |
Definition at line 188 of file MCTrajectory.h.
References fTrajectoryProcess.
Referenced by nnet::TrainingDataAlg::collectVtxFlags().
|
inline |
Definition at line 149 of file MCTrajectory.h.
References Position().
Referenced by evdb_tool::DrawLArVoxel3D::Draw(), evd::SimulationDrawer::MCTruth3D(), and evd::SimulationDrawer::MCTruthOrtho().
|
inline |
Definition at line 150 of file MCTrajectory.h.
References Position().
Referenced by evdb_tool::DrawLArVoxel3D::Draw(), evd::SimulationDrawer::MCTruth3D(), and evd::SimulationDrawer::MCTruthOrtho().
|
inline |
Definition at line 151 of file MCTrajectory.h.
References Position().
Referenced by evdb_tool::DrawLArVoxel3D::Draw(), evd::SimulationDrawer::MCTruth3D(), and evd::SimulationDrawer::MCTruthOrtho().
|
friend |
Definition at line 67 of file MCTrajectory.cxx.
|
private |
The list of trajectory points.
Definition at line 77 of file MCTrajectory.h.
Referenced by Add(), at(), begin(), clear(), empty(), end(), MCTrajectory(), Momentum(), operator[](), Position(), rbegin(), rend(), size(), Sparsify(), and swap().
|
private |
map of the scattering process to index in ftrajectory for a given point
Definition at line 78 of file MCTrajectory.h.
Referenced by Add(), Sparsify(), and TrajectoryProcesses().