LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "TrackMomentumCalculator.h"
Classes | |
struct | Segments |
Struct to store segments. x, y and z are the 3D points of the segment nx, ny, nz forms the vector that point to the direction of most scattering L is the length of the segment, using steps_size. More... | |
Public Member Functions | |
TrackMomentumCalculator (double minLength=100.0, double maxLength=1350.0, double steps_size=10.) | |
Constructor. More... | |
double | GetTrackMomentum (double trkrange, int pdg) const |
double | GetMomentumMultiScatterChi2 (art::Ptr< recob::Track > const &trk, const bool checkValidPoints=false, const int maxMomentum_MeV=7500) |
Calculate muon momentum (GeV) using multiple coulomb scattering. Chi2 minimization of the Highland formula. More... | |
double | GetMomentumMultiScatterLLHD (art::Ptr< recob::Track > const &trk, const bool checkValidPoints=false, const int maxMomentum_MeV=7500, const int MomentumStep_MeV=10, const int max_resolution=0) |
Calculate muon momentum (GeV) using multiple coulomb scattering by log likelihood. More... | |
double | GetMuMultiScatterLLHD3 (art::Ptr< recob::Track > const &trk, bool dir) |
TVector3 | GetMultiScatterStartingPoint (art::Ptr< recob::Track > const &trk) |
Private Member Functions | |
bool | plotRecoTracks_ (std::vector< float > const &xxx, std::vector< float > const &yyy, std::vector< float > const &zzz) |
void | compute_max_fluctuation_vector (const std::vector< float > segx, const std::vector< float > segy, const std::vector< float > segz, std::vector< float > &segnx, std::vector< float > &segny, std::vector< float > &segnz, std::vector< float > &vx, std::vector< float > &vy, std::vector< float > &vz) |
Computes the vector with most scattering inside a segment with size steps_size. More... | |
std::optional< Segments > | getSegTracks_ (std::vector< float > const &xxx, std::vector< float > const &yyy, std::vector< float > const &zzz, double seg_size) |
Split tracks into segments to calculate the scattered angle later. Check DOI 10.1088/1748-0221/12/10/P10010. More... | |
std::tuple< double, double, double > | getDeltaThetaRMS_ (Segments const &segments, double thick) const |
Gets the scattered angle RMS for a all segments. More... | |
int | getDeltaThetaij_ (std::vector< float > &ei, std::vector< float > &ej, std::vector< float > &th, std::vector< float > &ind, Segments const &segments, double thick) const |
Gets the scatterd angle for all the segments. More... | |
double | my_g (double xx, double Q, double s) const |
chi square minizer using Minuit2, it will minize (xx-Q)/s More... | |
double | my_mcs_llhd (std::vector< float > const &dEi, std::vector< float > const &dEj, std::vector< float > const &dthij, std::vector< float > const &ind, double x0, double x1) const |
Minimizer of log likelihood for scattered angle. More... | |
double | find_angle (double vz, double vy) const |
Gets angle between two vy and vz. More... | |
Private Attributes | |
float | seg_stop {-1.} |
int | n_seg {} |
float | x_seg [50000] |
float | y_seg [50000] |
float | z_seg [50000] |
int | n_steps {6} |
std::vector< float > | steps |
double | minLength |
double | maxLength |
double | steps_size |
double | rad_length {14.0} |
TPolyLine3D * | gr_reco_xyz {nullptr} |
TGraph | gr_reco_xy {} |
TGraph | gr_reco_yz {} |
TGraph | gr_reco_xz {} |
TPolyLine3D * | gr_seg_xyz {nullptr} |
TGraph | gr_seg_xy {} |
TGraph | gr_seg_yz {} |
TGraph | gr_seg_xz {} |
Definition at line 21 of file TrackMomentumCalculator.h.
trkf::TrackMomentumCalculator::TrackMomentumCalculator | ( | double | minLength = 100.0 , |
double | maxLength = 1350.0 , |
||
double | steps_size = 10. |
||
) |
Constructor.
Parameters are relevant for Multiple Coulomb Scattering
minLength | minimum length in cm of tracks (length here is based on the amout of segments) |
maxLength | maximum length in cm of tracks (length here is based on the amout of segments) |
steps_size | size in cm of each segment to compute scattering |
Definition at line 129 of file TrackMomentumCalculator.cxx.
References maxLength, n_steps, steps, and steps_size.
|
private |
Computes the vector with most scattering inside a segment with size steps_size.
segx,segy,segz | segments points |
segnx,segny,segnz | vector components to be filled |
vector | used to control points to be used at segments |
Definition at line 616 of file TrackMomentumCalculator.cxx.
References util::abs(), and n_seg.
Referenced by getSegTracks_().
|
private |
Gets angle between two vy and vz.
vz | |
vy |
Definition at line 1057 of file TrackMomentumCalculator.cxx.
References util::abs().
Referenced by getDeltaThetaij_(), and getDeltaThetaRMS_().
|
private |
Gets the scatterd angle for all the segments.
ei,ej | will be filled with energy lost at point i and j |
th | delta theta to be filled |
ind | selection of scattering plane |
segments | |
thick | is the steps_size |
Definition at line 371 of file TrackMomentumCalculator.cxx.
References a1, a2, a3, util::abs(), find_angle(), trkf::TrackMomentumCalculator::Segments::L, trkf::TrackMomentumCalculator::Segments::nx, trkf::TrackMomentumCalculator::Segments::ny, trkf::TrackMomentumCalculator::Segments::nz, trkf::TrackMomentumCalculator::Segments::x, trkf::TrackMomentumCalculator::Segments::y, and trkf::TrackMomentumCalculator::Segments::z.
Referenced by GetMomentumMultiScatterLLHD(), and GetMuMultiScatterLLHD3().
|
private |
Gets the scattered angle RMS for a all segments.
segments | segments computed |
thick | is the steps_size |
TODO: Add better description of steps
Definition at line 935 of file TrackMomentumCalculator.cxx.
References a1, a2, a3, find_angle(), trkf::TrackMomentumCalculator::Segments::L, pmtana::mean(), trkf::TrackMomentumCalculator::Segments::nx, trkf::TrackMomentumCalculator::Segments::ny, and trkf::TrackMomentumCalculator::Segments::nz.
Referenced by GetMomentumMultiScatterChi2().
double trkf::TrackMomentumCalculator::GetMomentumMultiScatterChi2 | ( | art::Ptr< recob::Track > const & | trk, |
const bool | checkValidPoints = false , |
||
const int | maxMomentum_MeV = 7500 |
||
) |
Calculate muon momentum (GeV) using multiple coulomb scattering. Chi2 minimization of the Highland formula.
trk | the muon track |
checkValidPoints | rather take into account only valid points or not |
maxMomentum_MeV | maximum momentum in MeV for the minimization |
TODO: Add better description of the steps done.
Definition at line 474 of file TrackMomentumCalculator.cxx.
References getDeltaThetaRMS_(), getSegTracks_(), recob::Track::HasValidPoint(), recob::Track::LocationAtPoint(), maxLength, pmtana::mean(), n_steps, recob::Track::NumberTrajectoryPoints(), plotRecoTracks_(), steps, and steps_size.
Referenced by trkf::KalmanFilterFinalTrackFitter::setMomValue().
double trkf::TrackMomentumCalculator::GetMomentumMultiScatterLLHD | ( | art::Ptr< recob::Track > const & | trk, |
const bool | checkValidPoints = false , |
||
const int | maxMomentum_MeV = 7500 , |
||
const int | MomentumStep_MeV = 10 , |
||
const int | max_resolution = 0 |
||
) |
Calculate muon momentum (GeV) using multiple coulomb scattering by log likelihood.
trk | the muon track |
checkValidPoints | rather take into account only valid points or not |
maxMomentum_MeV | maximum momentum in MeV for the minimization |
MomentumStep_MeV | energy steps for minimization |
max_resolution | maximum angular resolution for fit. Setting to zero will cause the fit only over momentum and fixed resolution of 2 mrad |
TODO: Add better description of the steps done
Definition at line 246 of file TrackMomentumCalculator.cxx.
References e, getDeltaThetaij_(), getSegTracks_(), recob::Track::HasValidPoint(), recob::Track::LocationAtPoint(), maxLength, my_mcs_llhd(), recob::Track::NumberTrajectoryPoints(), plotRecoTracks_(), and steps_size.
TVector3 trkf::TrackMomentumCalculator::GetMultiScatterStartingPoint | ( | art::Ptr< recob::Track > const & | trk | ) |
Definition at line 312 of file TrackMomentumCalculator.cxx.
References GetMuMultiScatterLLHD3(), recob::Track::LocationAtPoint(), and recob::Track::NumberTrajectoryPoints().
double trkf::TrackMomentumCalculator::GetMuMultiScatterLLHD3 | ( | art::Ptr< recob::Track > const & | trk, |
bool | dir | ||
) |
Definition at line 329 of file TrackMomentumCalculator.cxx.
References getDeltaThetaij_(), getSegTracks_(), recob::Track::LocationAtPoint(), maxLength, my_mcs_llhd(), recob::Track::NumberTrajectoryPoints(), and plotRecoTracks_().
Referenced by GetMultiScatterStartingPoint().
|
private |
Split tracks into segments to calculate the scattered angle later. Check DOI 10.1088/1748-0221/12/10/P10010.
xxx | 3D reconstructed points x-axis |
yyy | 3D reconstructed points y-axiy |
zzz | 3D reconstructed points z-axiz |
seg_size | Segments size defined in class constructor |
TODO: Add better description of steps
Definition at line 721 of file TrackMomentumCalculator.cxx.
References a1, a2, a3, compute_max_fluctuation_vector(), gr_seg_xy, gr_seg_xyz, gr_seg_xz, gr_seg_yz, n_seg, seg_stop, x1, x2, x_seg, y1, y2, y_seg, and z_seg.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), and GetMuMultiScatterLLHD3().
double trkf::TrackMomentumCalculator::GetTrackMomentum | ( | double | trkrange, |
int | pdg | ||
) | const |
Definition at line 139 of file TrackMomentumCalculator.cxx.
References util::abs(), and E.
Referenced by trkmkr::KalmanFilterFitTrackMaker::getMomentum(), trkf::KalmanFilterTrajectoryFitter::setMomValue(), and trkf::KalmanFilterFinalTrackFitter::setMomValue().
|
private |
chi square minizer using Minuit2, it will minize (xx-Q)/s
xx | |
Q | |
s |
Definition at line 1097 of file TrackMomentumCalculator.cxx.
Referenced by my_mcs_llhd().
|
private |
Minimizer of log likelihood for scattered angle.
dEi | energy at step i |
dEj | energy at step j |
dthij | scattered angle between points i and j |
ind | selection of scattering plane |
x0 | momentum to be fitted |
x1 | resolution to be fitted |
TODO: Add better description of steps
Definition at line 1114 of file TrackMomentumCalculator.cxx.
References util::abs(), my_g(), rad_length, steps_size, and x1.
Referenced by GetMomentumMultiScatterLLHD(), and GetMuMultiScatterLLHD3().
|
private |
Definition at line 586 of file TrackMomentumCalculator.cxx.
References gr_reco_xy, gr_reco_xyz, gr_reco_xz, gr_reco_yz, and n.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), and GetMuMultiScatterLLHD3().
|
private |
Definition at line 224 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 223 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 226 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 225 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 229 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 228 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 231 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 230 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 209 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), GetMuMultiScatterLLHD3(), and TrackMomentumCalculator().
|
private |
Definition at line 208 of file TrackMomentumCalculator.h.
|
private |
Definition at line 189 of file TrackMomentumCalculator.h.
Referenced by compute_max_fluctuation_vector(), and getSegTracks_().
|
private |
Definition at line 205 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), and TrackMomentumCalculator().
|
private |
Definition at line 211 of file TrackMomentumCalculator.h.
Referenced by my_mcs_llhd().
|
private |
Definition at line 188 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 206 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), and TrackMomentumCalculator().
|
private |
Definition at line 210 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), my_mcs_llhd(), and TrackMomentumCalculator().
|
private |
Definition at line 191 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 192 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 193 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().