LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Track or Trajectory. More...
#include "TrajectoryMCSFitter.h"
Classes | |
struct | Config |
struct | ScanResult |
Public Types | |
using | Parameters = fhicl::Table< Config > |
Public Member Functions | |
TrajectoryMCSFitter (int pIdHyp, int minNSegs, double segLen, int minHitsPerSegment, int nElossSteps, int eLossMode, double pMin, double pMax, double pStepCoarse, double pStep, double fineScanWindow, const std::array< double, 5 > &angResol, const std::array< double, 5 > &hlParams, double segLenTolerance, bool applySCEcorr) | |
TrajectoryMCSFitter (const Parameters &p) | |
recob::MCSFitResult | fitMcs (const recob::TrackTrajectory &traj) const |
recob::MCSFitResult | fitMcs (const recob::Track &track) const |
recob::MCSFitResult | fitMcs (const recob::Trajectory &traj) const |
recob::MCSFitResult | fitMcs (const recob::TrackTrajectory &traj, int pid) const |
recob::MCSFitResult | fitMcs (const recob::Track &track, int pid) const |
recob::MCSFitResult | fitMcs (const recob::Trajectory &traj, int pid) const |
void | breakTrajInSegments (const recob::TrackTrajectory &traj, std::vector< size_t > &breakpoints, std::vector< float > &segradlengths, std::vector< float > &cumseglens) const |
void | linearRegression (const recob::TrackTrajectory &traj, const size_t firstPoint, const size_t lastPoint, recob::tracking::Vector_t &pcdir) const |
double | mcsLikelihood (double p, double theta0x, std::vector< float > &dthetaij, std::vector< float > &seg_nradl, std::vector< float > &cumLen, bool fwd, int pid) const |
const ScanResult | doLikelihoodScan (std::vector< float > &dtheta, std::vector< float > &seg_nradlengths, std::vector< float > &cumLen, bool fwdFit, int pid, float detAngResol) const |
const ScanResult | doLikelihoodScan (std::vector< float > &dtheta, std::vector< float > &seg_nradlengths, std::vector< float > &cumLen, bool fwdFit, int pid, float pmin, float pmax, float pstep, float detAngResol) const |
double | HighlandFirstTerm (const double p) const |
double | DetectorAngularResolution (const double uz) const |
double | mass (int pid) const |
double | energyLossBetheBloch (const double mass, const double e2) const |
double | energyLossLandau (const double mass2, const double E2, const double x) const |
double | GetE (const double initial_E, const double length_travelled, const double mass) const |
int | minNSegs () const |
double | segLen () const |
double | segLenTolerance () const |
Private Attributes | |
int | pIdHyp_ |
int | minNSegs_ |
double | segLen_ |
int | minHitsPerSegment_ |
int | nElossSteps_ |
int | eLossMode_ |
double | pMin_ |
double | pMax_ |
double | pStepCoarse_ |
double | pStep_ |
double | fineScanWindow_ |
std::array< double, 5 > | angResol_ |
std::array< double, 5 > | hlParams_ |
double | segLenTolerance_ |
bool | applySCEcorr_ |
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Track or Trajectory.
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Track or Trajectory.
Inputs are: a Track or Trajectory, and various fit parameters (pIdHypothesis, minNumSegments, segmentLength, pMin, pMax, pStep, angResol)
Outputs are: a recob::MCSFitResult, containing: resulting momentum, momentum uncertainty, and best likelihood value (both for fwd and bwd fit); vector of comulative segment (radiation) lengths, vector of scattering angles, and PID hypothesis used in the fit. Note that the comulative segment length is what is used to compute the energy loss, but the segment length is actually slightly different, so the output can be used to reproduce the original results but they will not be identical (but very close).
For configuration options see TrajectoryMCSFitter::Config
Definition at line 44 of file TrajectoryMCSFitter.h.
Definition at line 114 of file TrajectoryMCSFitter.h.
|
inline |
Definition at line 116 of file TrajectoryMCSFitter.h.
References trkf::TrajectoryMCSFitter::Config::angResol, angResol_, trkf::TrajectoryMCSFitter::Config::applySCEcorr, applySCEcorr_, trkf::TrajectoryMCSFitter::Config::eLossMode, eLossMode_, trkf::TrajectoryMCSFitter::Config::fineScanWindow, fineScanWindow_, trkf::TrajectoryMCSFitter::Config::hlParams, hlParams_, trkf::TrajectoryMCSFitter::Config::minHitsPerSegment, minHitsPerSegment_, minNSegs(), minNSegs_, trkf::TrajectoryMCSFitter::Config::nElossSteps, nElossSteps_, pIdHyp_, trkf::TrajectoryMCSFitter::Config::pMax, pMax_, trkf::TrajectoryMCSFitter::Config::pMin, pMin_, trkf::TrajectoryMCSFitter::Config::pStep, pStep_, trkf::TrajectoryMCSFitter::Config::pStepCoarse, pStepCoarse_, segLen(), segLen_, trkf::TrajectoryMCSFitter::Config::segLenTolerance, and segLenTolerance_.
|
inlineexplicit |
Definition at line 148 of file TrajectoryMCSFitter.h.
void TrajectoryMCSFitter::breakTrajInSegments | ( | const recob::TrackTrajectory & | traj, |
std::vector< size_t > & | breakpoints, | ||
std::vector< float > & | segradlengths, | ||
std::vector< float > & | cumseglens | ||
) | const |
Definition at line 73 of file TrajectoryMCSFitter.cxx.
References recob::TrackTrajectory::DirectionAtPoint(), geo::GeometryCore::FindTPCAtPosition(), recob::TrackTrajectory::FirstValidPoint(), recob::TrackTrajectory::InvalidIndex, geo::CryostatID::isValid, recob::TrackTrajectory::LastValidPoint(), recob::TrackTrajectory::Length(), recob::TrackTrajectory::LocationAtPoint(), recob::TrackTrajectory::NextValidPoint(), and geo::TPCID::TPC.
Referenced by fitMcs().
|
inline |
Definition at line 231 of file TrajectoryMCSFitter.h.
References angResol_.
const TrajectoryMCSFitter::ScanResult TrajectoryMCSFitter::doLikelihoodScan | ( | std::vector< float > & | dtheta, |
std::vector< float > & | seg_nradlengths, | ||
std::vector< float > & | cumLen, | ||
bool | fwdFit, | ||
int | pid, | ||
float | detAngResol | ||
) | const |
Definition at line 203 of file TrajectoryMCSFitter.cxx.
References trkf::TrajectoryMCSFitter::ScanResult::p, and trkf::TrajectoryMCSFitter::ScanResult::pUnc.
const TrajectoryMCSFitter::ScanResult TrajectoryMCSFitter::doLikelihoodScan | ( | std::vector< float > & | dtheta, |
std::vector< float > & | seg_nradlengths, | ||
std::vector< float > & | cumLen, | ||
bool | fwdFit, | ||
int | pid, | ||
float | pmin, | ||
float | pmax, | ||
float | pstep, | ||
float | detAngResol | ||
) | const |
Definition at line 153 of file TrajectoryMCSFitter.cxx.
double TrajectoryMCSFitter::energyLossBetheBloch | ( | const double | mass, |
const double | e2 | ||
) | const |
double TrajectoryMCSFitter::energyLossLandau | ( | const double | mass2, |
const double | E2, | ||
const double | x | ||
) | const |
Definition at line 360 of file TrajectoryMCSFitter.cxx.
Referenced by mass().
|
inline |
Definition at line 166 of file TrajectoryMCSFitter.h.
References pIdHyp_.
Referenced by fitMcs(), trkmkr::KalmanFilterFitTrackMaker::getMomentum(), and trkf::MCSFitProducer::produce().
|
inline |
Definition at line 170 of file TrajectoryMCSFitter.h.
References fitMcs(), and pIdHyp_.
Referenced by fitMcs().
|
inline |
Definition at line 171 of file TrajectoryMCSFitter.h.
References fitMcs(), and pIdHyp_.
recob::MCSFitResult TrajectoryMCSFitter::fitMcs | ( | const recob::TrackTrajectory & | traj, |
int | pid | ||
) | const |
Definition at line 16 of file TrajectoryMCSFitter.cxx.
References util::abs(), trkf::TrajectoryMCSFitter::ScanResult::logL, trkf::TrajectoryMCSFitter::ScanResult::p, trkf::TrajectoryMCSFitter::ScanResult::pUnc, and recob::TrackTrajectory::StartDirection().
|
inline |
Definition at line 177 of file TrajectoryMCSFitter.h.
References fitMcs(), and recob::Track::Trajectory().
|
inline |
Definition at line 181 of file TrajectoryMCSFitter.h.
References breakTrajInSegments(), fitMcs(), linearRegression(), mcsLikelihood(), and recob::Trajectory::NPoints().
double TrajectoryMCSFitter::GetE | ( | const double | initial_E, |
const double | length_travelled, | ||
const double | mass | ||
) | const |
Definition at line 406 of file TrajectoryMCSFitter.cxx.
Referenced by mass().
|
inline |
Definition at line 226 of file TrajectoryMCSFitter.h.
References hlParams_.
void TrajectoryMCSFitter::linearRegression | ( | const recob::TrackTrajectory & | traj, |
const size_t | firstPoint, | ||
const size_t | lastPoint, | ||
recob::tracking::Vector_t & | pcdir | ||
) | const |
Definition at line 230 of file TrajectoryMCSFitter.cxx.
References geo::vect::MiddlePointAccumulatorDim< N >::add(), recob::TrackTrajectory::DirectionAtPoint(), geo::GeometryCore::FindTPCAtPosition(), geo::CryostatID::isValid, recob::TrackTrajectory::LocationAtPoint(), geo::vect::MiddlePointAccumulatorDim< N >::middlePoint(), recob::TrackTrajectory::NextValidPoint(), norm, and geo::TPCID::TPC.
Referenced by fitMcs().
|
inline |
Definition at line 236 of file TrajectoryMCSFitter.h.
References util::abs(), energyLossBetheBloch(), energyLossLandau(), GetE(), util::kBogusD, and x.
double TrajectoryMCSFitter::mcsLikelihood | ( | double | p, |
double | theta0x, | ||
std::vector< float > & | dthetaij, | ||
std::vector< float > & | seg_nradl, | ||
std::vector< float > & | cumLen, | ||
bool | fwd, | ||
int | pid | ||
) | const |
Definition at line 309 of file TrajectoryMCSFitter.cxx.
References util::end().
Referenced by fitMcs().
|
inline |
Definition at line 249 of file TrajectoryMCSFitter.h.
References minNSegs_.
Referenced by TrajectoryMCSFitter().
|
inline |
Definition at line 250 of file TrajectoryMCSFitter.h.
References segLen_.
Referenced by TrajectoryMCSFitter().
|
inline |
Definition at line 251 of file TrajectoryMCSFitter.h.
References segLenTolerance_.
|
private |
Definition at line 265 of file TrajectoryMCSFitter.h.
Referenced by DetectorAngularResolution(), and TrajectoryMCSFitter().
|
private |
Definition at line 268 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 259 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 264 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 266 of file TrajectoryMCSFitter.h.
Referenced by HighlandFirstTerm(), and TrajectoryMCSFitter().
|
private |
Definition at line 257 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 255 of file TrajectoryMCSFitter.h.
Referenced by minNSegs(), and TrajectoryMCSFitter().
|
private |
Definition at line 258 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 254 of file TrajectoryMCSFitter.h.
Referenced by fitMcs(), and TrajectoryMCSFitter().
|
private |
Definition at line 261 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 260 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 263 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 262 of file TrajectoryMCSFitter.h.
Referenced by TrajectoryMCSFitter().
|
private |
Definition at line 256 of file TrajectoryMCSFitter.h.
Referenced by segLen(), and TrajectoryMCSFitter().
|
private |
Definition at line 267 of file TrajectoryMCSFitter.h.
Referenced by segLenTolerance(), and TrajectoryMCSFitter().