![]() |
LArSoft
v10_04_05
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., int angleMethod=1, int nsteps=6) | |
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, const double min_resolution=0, const double max_resolution=45) |
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 double min_resolution=0.001, const double max_resolution=800, const bool check_valid_scattered=false, const double angle_correction=0.757) |
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 Types | |
enum | ScatterAngleMethods { kAnglezx = 1, kAnglezy, kAngleCombined } |
Private Member Functions | |
bool | plotRecoTracks_ (std::vector< double > const &xxx, std::vector< double > const &yyy, std::vector< double > const &zzz) |
void | compute_max_fluctuation_vector (const std::vector< double > segx, const std::vector< double > segy, const std::vector< double > segz, std::vector< double > &segnx, std::vector< double > &segny, std::vector< double > &segnz, std::vector< bool > &segn_isvalid, std::vector< double > &vx, std::vector< double > &vy, std::vector< double > &vz, bool check_valid_scattered) |
Computes the vector with most scattering inside a segment with size steps_size. More... | |
std::optional< Segments > | getSegTracks_ (std::vector< double > const &xxx, std::vector< double > const &yyy, std::vector< double > const &zzz, double seg_size, bool check_valid_scattered=false) |
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< double > &ei, std::vector< double > &ej, std::vector< double > &th, std::vector< double > &ind, Segments const &segments, double thick, double const angle_correction) 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< double > const &dEi, std::vector< double > const &dEj, std::vector< double > const &dthij, std::vector< double > 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 | |
double | seg_stop {-1.} |
int | n_seg {} |
double | x_seg [50000] |
double | y_seg [50000] |
double | z_seg [50000] |
std::vector< double > | steps |
double | minLength |
double | maxLength |
double | steps_size |
double | rad_length {14.0} |
ScatterAngleMethods | fMCSAngleMethod |
int | n_steps |
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.
|
private |
Enumerator | |
---|---|
kAnglezx |
Use scattered angle z-x (z is along the particle's direction) |
kAnglezy |
Use scattered angle z-y. |
kAngleCombined |
Use space angle: sqrt( zx^2 + zy^2 )/sqrt(2) |
Definition at line 231 of file TrackMomentumCalculator.h.
trkf::TrackMomentumCalculator::TrackMomentumCalculator | ( | double | minLength = 100.0 , |
double | maxLength = 1350.0 , |
||
double | steps_size = 10. , |
||
int | angleMethod = 1 , |
||
int | nsteps = 6 |
||
) |
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 289 of file TrackMomentumCalculator.cxx.
References fMCSAngleMethod, 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 826 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 1338 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 |
angle_correction | Correction due to oversmoothing, applied for space angle only |
Definition at line 576 of file TrackMomentumCalculator.cxx.
References a1, a2, a3, util::abs(), find_angle(), fMCSAngleMethod, kAngleCombined, kAnglezx, kAnglezy, trkf::TrackMomentumCalculator::Segments::L, trkf::TrackMomentumCalculator::Segments::nx, trkf::TrackMomentumCalculator::Segments::ny, and trkf::TrackMomentumCalculator::Segments::nz.
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 1205 of file TrackMomentumCalculator.cxx.
References a1, a2, a3, find_angle(), fMCSAngleMethod, kAngleCombined, kAnglezx, kAnglezy, 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 , |
||
const double | min_resolution = 0 , |
||
const double | max_resolution = 45 |
||
) |
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 667 of file TrackMomentumCalculator.cxx.
References fMCSAngleMethod, getDeltaThetaRMS_(), getSegTracks_(), recob::Track::HasValidPoint(), kAngleCombined, recob::Track::Length(), 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 double | min_resolution = 0.001 , |
||
const double | max_resolution = 800 , |
||
const bool | check_valid_scattered = false , |
||
const double | angle_correction = 0.757 |
||
) |
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 |
check_valid_scattered | set to true will check if scatter angles are valid. Angles are invalid if there is only two points in one segment. |
angle_correction | Correction for space angle due to possible oversmoothing. The value (0.757) was set based on studies with MC. Change this value through the fhcl file |
TODO: Add better description of the steps done
Definition at line 415 of file TrackMomentumCalculator.cxx.
References fMCSAngleMethod, getDeltaThetaij_(), getSegTracks_(), GetTrackMomentum(), recob::Track::HasValidPoint(), kAngleCombined, recob::Track::Length(), recob::Track::LocationAtPoint(), maxLength, recob::Track::NumberTrajectoryPoints(), plotRecoTracks_(), and steps_size.
TVector3 trkf::TrackMomentumCalculator::GetMultiScatterStartingPoint | ( | art::Ptr< recob::Track > const & | trk | ) |
Definition at line 514 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 531 of file TrackMomentumCalculator.cxx.
References getDeltaThetaij_(), getSegTracks_(), recob::Track::Length(), 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 |
check_valid_scattered | set to true will check if scatter angles are valid. Angles are invalid if there is only two points in one segment. Set true only for LLHD! TODO: Add better description of steps |
Definition at line 954 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 305 of file TrackMomentumCalculator.cxx.
References util::abs(), and E.
Referenced by trkmkr::KalmanFilterFitTrackMaker::getMomentum(), GetMomentumMultiScatterLLHD(), 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 1384 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 1401 of file TrackMomentumCalculator.cxx.
References util::abs(), my_g(), rad_length, steps_size, and x1.
Referenced by GetMuMultiScatterLLHD3().
|
private |
Definition at line 793 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 237 of file TrackMomentumCalculator.h.
Referenced by getDeltaThetaij_(), getDeltaThetaRMS_(), GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), and TrackMomentumCalculator().
|
private |
Definition at line 251 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 250 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 253 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 252 of file TrackMomentumCalculator.h.
Referenced by plotRecoTracks_().
|
private |
Definition at line 256 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 255 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 258 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 257 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 227 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), GetMuMultiScatterLLHD3(), and TrackMomentumCalculator().
|
private |
Definition at line 226 of file TrackMomentumCalculator.h.
|
private |
Definition at line 208 of file TrackMomentumCalculator.h.
Referenced by compute_max_fluctuation_vector(), and getSegTracks_().
|
private |
Definition at line 238 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), and TrackMomentumCalculator().
|
private |
Definition at line 229 of file TrackMomentumCalculator.h.
Referenced by my_mcs_llhd().
|
private |
Definition at line 207 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 224 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), and TrackMomentumCalculator().
|
private |
Definition at line 228 of file TrackMomentumCalculator.h.
Referenced by GetMomentumMultiScatterChi2(), GetMomentumMultiScatterLLHD(), my_mcs_llhd(), and TrackMomentumCalculator().
|
private |
Definition at line 210 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 211 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().
|
private |
Definition at line 212 of file TrackMomentumCalculator.h.
Referenced by getSegTracks_().