LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "Propagator.h"
Public Types | |
enum | PropDirection { FORWARD, BACKWARD, UNKNOWN } |
Propagation direction enum. More... | |
Public Member Functions | |
Propagator (detinfo::DetectorPropertiesData const &detProp, double tcut, bool doDedx, const std::shared_ptr< const Interactor > &interactor) | |
Constructor. More... | |
virtual | ~Propagator () |
Destructor. More... | |
double | getTcut () const |
bool | getDoDedx () const |
const std::shared_ptr< const Interactor > & | getInteractor () const |
virtual Propagator * | clone () const =0 |
Clone method. More... | |
virtual std::optional< double > | short_vec_prop (KTrack &trk, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, TrackMatrix *prop_matrix=0, TrackError *noise_matrix=0) const =0 |
Propagate without error (short distance). More... | |
virtual std::optional< double > | origin_vec_prop (KTrack &trk, const std::shared_ptr< const Surface > &porient, TrackMatrix *prop_matrix=0) const =0 |
Propagate without error to surface whose origin parameters coincide with track position. More... | |
std::optional< double > | vec_prop (KTrack &trk, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, TrackMatrix *prop_matrix=0, TrackError *noise_matrix=0) const |
Propagate without error (long distance). More... | |
std::optional< double > | lin_prop (KTrack &trk, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, KTrack *ref=0, TrackMatrix *prop_matrix=0, TrackError *noise_matrix=0) const |
Linearized propagate without error. More... | |
std::optional< double > | err_prop (KETrack &tre, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, KTrack *ref=0, TrackMatrix *prop_matrix=0) const |
Propagate with error, but without noise. More... | |
std::optional< double > | noise_prop (KETrack &tre, const std::shared_ptr< const Surface > &psurf, PropDirection dir, bool doDedx, KTrack *ref=0) const |
Propagate with error and noise. More... | |
std::optional< double > | dedx_prop (double pinv, double mass, double s, double *deriv=0) const |
Method to calculate updated momentum due to dE/dx. More... | |
Private Attributes | |
detinfo::DetectorPropertiesData const & | fDetProp |
double | fTcut |
Maximum delta ray energy for dE/dx. More... | |
bool | fDoDedx |
Energy loss enable flag. More... | |
std::shared_ptr< const Interactor > | fInteractor |
Interactor (for calculating noise). More... | |
Definition at line 91 of file Propagator.h.
Propagation direction enum.
Enumerator | |
---|---|
FORWARD | |
BACKWARD | |
UNKNOWN |
Definition at line 94 of file Propagator.h.
trkf::Propagator::Propagator | ( | detinfo::DetectorPropertiesData const & | detProp, |
double | tcut, | ||
bool | doDedx, | ||
const std::shared_ptr< const Interactor > & | interactor | ||
) |
Constructor.
Constructor.
Arguments:
tcut - Maximum delta ray energy. doDedx - dE/dx enable flag.
Definition at line 26 of file Propagator.cxx.
References fDoDedx, fInteractor, fTcut, and ~Propagator().
|
virtualdefault |
Destructor.
Referenced by Propagator().
|
pure virtual |
Clone method.
Implemented in trkf::PropAny, trkf::PropXYZPlane, trkf::PropYZPlane, and trkf::PropYZLine.
std::optional< double > trkf::Propagator::dedx_prop | ( | double | pinv, |
double | mass, | ||
double | s, | ||
double * | deriv = 0 |
||
) | const |
Method to calculate updated momentum due to dE/dx.
Method to calculate updated momentum due to dE/dx.
Arguments:
pinv - Initial inverse momentum (units c/GeV). mass - Particle mass (GeV/c^2). s - Path distance. deriv - Pointer to store derivative d(pinv2)/d(pinv1) if nonzero.
Returns: Final inverse momentum (pinv2) + success flag.
Failure is returned in case of range out.
Inverse momentum can be signed (q/p). Returned inverse momentum has the same sign as the input.
In this method, we are solving the differential equation in terms of energy.
dE/dx = -f(E)
where f(E) is the stopping power returned by method LArProperties::Eloss.
We expect that this method will be called exclusively for short distance propagation. The differential equation is solved using the midpoint method using a single step, which requires two evaluations of f(E).
dE = -s*f(E1) E2 = E1 - s*f(E1 + 0.5*dE)
The derivative is calculated assuming E2 = E1 + constant, giving
d(pinv2)/d(pinv1) = pinv2^3 E2 / (pinv1^3 E1).
Definition at line 447 of file Propagator.cxx.
References util::abs(), detinfo::DetectorPropertiesData::Eloss(), fDetProp, and fTcut.
Referenced by trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
std::optional< double > trkf::Propagator::err_prop | ( | KETrack & | tre, |
const std::shared_ptr< const Surface > & | psurf, | ||
PropDirection | dir, | ||
bool | doDedx, | ||
KTrack * | ref = 0 , |
||
TrackMatrix * | prop_matrix = 0 |
||
) | const |
Propagate with error, but without noise.
Propagate with error, but without noise (i.e. reversibly).
Arguments:
tre - Track to propagate. psurf - Destination surface. dir - Propagation direction (FORWARD, BACKWARD, or UNKNOWN). doDedx - dE/dx enable/disable flag. ref - Reference track (for linearized propagation). Can be null. prop_matrix - Return propagation matrix if not null.
Returned value: propagation distance + success flag.
Definition at line 343 of file Propagator.cxx.
References trkf::KETrack::getError(), lin_prop(), and trkf::KETrack::setError().
Referenced by trkf::KGTrack::fillTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), and trkf::KHit< N >::predict().
|
inline |
Definition at line 108 of file Propagator.h.
Referenced by trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), trkf::PropXYZPlane::short_vec_prop(), and vec_prop().
|
inline |
Definition at line 109 of file Propagator.h.
References dir.
Referenced by trkf::PropYZLine::short_vec_prop(), trkf::PropYZPlane::short_vec_prop(), and trkf::PropXYZPlane::short_vec_prop().
|
inline |
Definition at line 107 of file Propagator.h.
std::optional< double > trkf::Propagator::lin_prop | ( | KTrack & | trk, |
const std::shared_ptr< const Surface > & | psurf, | ||
PropDirection | dir, | ||
bool | doDedx, | ||
KTrack * | ref = 0 , |
||
TrackMatrix * | prop_matrix = 0 , |
||
TrackError * | noise_matrix = 0 |
||
) | const |
Linearized propagate without error.
Linearized propagate without error.
Arguments:
trk - Track to propagate. psurf - Destination surface. dir - Propagation direction (FORWARD, BACKWARD, or UNKNOWN). doDedx - dE/dx enable/disable flag. ref - Reference track (for linearized propagation). Can be null. prop_matrix - Return propagation matrix if not null. noise_matrix - Return noise matrix if not null.
Returned value: Propagation distance & success flag.
If the reference track is null, this method simply calls vec_prop.
Definition at line 249 of file Propagator.cxx.
References trkf::KTrack::getDirection(), trkf::KTrack::getSurface(), trkf::KTrack::getVector(), trkf::KTrack::isValid(), trkf::KTrack::setDirection(), trkf::KTrack::setSurface(), trkf::KTrack::setVector(), and vec_prop().
Referenced by err_prop(), and noise_prop().
std::optional< double > trkf::Propagator::noise_prop | ( | KETrack & | tre, |
const std::shared_ptr< const Surface > & | psurf, | ||
PropDirection | dir, | ||
bool | doDedx, | ||
KTrack * | ref = 0 |
||
) | const |
Propagate with error and noise.
Propagate with error and noise.
Arguments:
tre - Track to propagate. psurf - Destination surface. dir - Propagation direction (FORWARD, BACKWARD, or UNKNOWN). doDedx - dE/dx enable/disable flag. ref - Reference track (for linearized propagation). Can be null.
Returned value: propagation distance + success flag.
Definition at line 382 of file Propagator.cxx.
References trkf::KETrack::getError(), lin_prop(), and trkf::KETrack::setError().
Referenced by trkf::KalmanFilterAlg::buildTrack(), trkf::KalmanFilterAlg::extendTrack(), trkf::KalmanFilterAlg::fitMomentumMS(), trkf::KalmanFilterAlg::smoothTrack(), and trkf::KalmanFilterAlg::updateMomentum().
|
pure virtual |
Propagate without error to surface whose origin parameters coincide with track position.
Implemented in trkf::PropAny, trkf::PropXYZPlane, trkf::PropYZPlane, and trkf::PropYZLine.
|
pure virtual |
Propagate without error (short distance).
Implemented in trkf::PropAny, trkf::PropXYZPlane, trkf::PropYZPlane, and trkf::PropYZLine.
Referenced by vec_prop().
std::optional< double > trkf::Propagator::vec_prop | ( | KTrack & | trk, |
const std::shared_ptr< const Surface > & | psurf, | ||
PropDirection | dir, | ||
bool | doDedx, | ||
TrackMatrix * | prop_matrix = 0 , |
||
TrackError * | noise_matrix = 0 |
||
) | const |
Propagate without error (long distance).
Propagate without error (long distance).
Arguments:
trk - Track to propagate. psurf - Destination surface. dir - Propagation direction (FORWARD, BACKWARD, or UNKNOWN). doDedx - dE/dx enable/disable flag. prop_matrix - Return propagation matrix if not null. noise_matrix - Return noise matrix if not null.
Returned value: Propagation distance & success flag.
This method calls virtual method short_vec_prop in steps of some maximum size.
Definition at line 52 of file Propagator.cxx.
References util::abs(), larg4::dist(), e, detinfo::DetectorPropertiesData::Eloss(), fDetProp, fTcut, getDoDedx(), trkf::KTrack::getMomentum(), trkf::KTrack::getPosition(), trkf::KTrack::getVector(), trkf::KTrack::Mass(), and short_vec_prop().
Referenced by trkf::KalmanFilterAlg::fitMomentumMS(), lin_prop(), trkf::KHitContainer::sort(), and trkf::KalmanFilterAlg::updateMomentum().
|
private |
Definition at line 164 of file Propagator.h.
Referenced by dedx_prop(), and vec_prop().
|
private |
|
private |
Interactor (for calculating noise).
Definition at line 167 of file Propagator.h.
Referenced by Propagator().
|
private |
Maximum delta ray energy for dE/dx.
Definition at line 165 of file Propagator.h.
Referenced by dedx_prop(), Propagator(), and vec_prop().