1 #ifndef TRAJECTORYMCSFITTER_H 2 #define TRAJECTORYMCSFITTER_H 41 Name(
"pIdHypothesis"),
42 Comment(
"Default particle Id Hypothesis to be used in the fit when not specified."),
46 Name(
"minNumSegments"),
47 Comment(
"Minimum number of segments the track is split into."),
51 Name(
"segmentLength"),
52 Comment(
"Nominal length of track segments used in the fit."),
56 Name(
"minHitsPerSegment"),
57 Comment(
"Exclude segments with less hits than this value."),
62 Comment(
"Number of steps for computing energy loss uptream to current segment."),
67 Comment(
"Default is MPV Landau. Choose 1 for MIP (constant); 2 for Bethe-Bloch."),
72 Comment(
"Minimum momentum value in likelihood scan."),
77 Comment(
"Maximum momentum value in likelihood scan."),
82 Comment(
"Step in momentum value in likelihood scan."),
87 Comment(
"Angular resolution parameter used in modified Highland formula. Unit is mrad."),
117 return fitMcs(tt,pid,momDepConst);
122 double mcsLikelihood(
double p,
double theta0x, std::vector<double>& dthetaij, std::vector<double>& seg_nradl, std::vector<double>& cumLen,
bool fwd,
bool momDepConst,
int pid)
const;
126 ScanResult(
double ap,
double apUnc,
double alogL) : p(ap), pUnc(apUnc), logL(alogL) {}
130 const ScanResult doLikelihoodScan(std::vector<double>& dtheta, std::vector<double>& seg_nradlengths, std::vector<double>& cumLen,
bool fwdFit,
bool momDepConst,
int pid)
const;
134 constexpr
double a = 0.1049;
135 constexpr
double c = 11.0038;
136 return (a/(p*p)) + c;
139 if (abs(pid)==13) {
return mumass; }
140 if (abs(pid)==211) {
return pimass; }
141 if (abs(pid)==321) {
return kmass; }
142 if (abs(pid)==2212) {
return pmass; }
146 double energyLossLandau(
const double mass2,
const double E2,
const double x)
const;
148 double GetE(
const double initial_E,
const double length_travelled,
const double mass)
const;
ScanResult(double ap, double apUnc, double alogL)
double energyLossBetheBloch(const double mass, const double e2) const
fhicl::Atom< int > minHitsPerSegment
fhicl::Atom< int > pIdHypothesis
const ScanResult doLikelihoodScan(std::vector< double > &dtheta, std::vector< double > &seg_nradlengths, std::vector< double > &cumLen, bool fwdFit, bool momDepConst, int pid) const
fhicl::Atom< int > eLossMode
fhicl::Atom< int > nElossSteps
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
recob::MCSFitResult fitMcs(const recob::Trajectory &traj, int pid, bool momDepConst=true) const
double mcsLikelihood(double p, double theta0x, std::vector< double > &dthetaij, std::vector< double > &seg_nradl, std::vector< double > &cumLen, bool fwd, bool momDepConst, int pid) const
fhicl::Atom< double > pMax
fhicl::Atom< int > minNumSegments
void breakTrajInSegments(const recob::TrackTrajectory &traj, std::vector< size_t > &breakpoints, std::vector< double > &segradlengths, std::vector< double > &cumseglens) const
TrajectoryMCSFitter(const Parameters &p)
double mass(int pid) const
recob::MCSFitResult fitMcs(const recob::Trajectory &traj, bool momDepConst=true) const
size_t NPoints() const
Returns the number of stored trajectory points.
A trajectory in space reconstructed from hits.
fhicl::Atom< double > angResol
double GetE(const double initial_E, const double length_travelled, const double mass) const
geo::Vector_t Vector_t
Type for representation of momenta in 3D space.
void linearRegression(const recob::TrackTrajectory &traj, const size_t firstPoint, const size_t lastPoint, recob::tracking::Vector_t &pcdir) const
double energyLossLandau(const double mass2, const double E2, const double x) const
std::vector< PointFlags_t > Flags_t
Type of point flag list.
Provides recob::Track data product.
double MomentumDependentConstant(const double p) const
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj, bool momDepConst=true) const
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
fhicl::Atom< double > pStep
A trajectory in space reconstructed from hits.
TrajectoryMCSFitter(int pIdHyp, int minNSegs, double segLen, int minHitsPerSegment, int nElossSteps, int eLossMode, double pMin, double pMax, double pStep, double angResol)
recob::MCSFitResult fitMcs(const recob::Track &track, bool momDepConst=true) const
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Trac...
recob::MCSFitResult fitMcs(const recob::Track &track, int pid, bool momDepConst=true) const
fhicl::Atom< double > segmentLength
constexpr double kBogusD
obviously bogus double value
fhicl::Atom< double > pMin
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: