1 #ifndef TRAJECTORYMCSFITTER_H 2 #define TRAJECTORYMCSFITTER_H 52 Name(
"pIdHypothesis"),
53 Comment(
"Default particle Id Hypothesis to be used in the fit when not specified."),
56 Name(
"minNumSegments"),
57 Comment(
"Minimum number of segments the track is split into."),
60 Name(
"segmentLength"),
61 Comment(
"Nominal length of track segments used in the fit."),
64 Name(
"minHitsPerSegment"),
65 Comment(
"Exclude segments with less hits than this value."),
69 Comment(
"Number of steps for computing energy loss uptream to current segment."),
73 Comment(
"Default is MPV Landau. Choose 1 for MIP (constant); 2 for Bethe-Bloch."),
76 Comment(
"Minimum momentum value in likelihood scan."),
79 Comment(
"Maximum momentum value in likelihood scan."),
83 Comment(
"Step in momentum value in initial coase likelihood scan."),
86 Comment(
"Step in momentum value in fine grained likelihood scan."),
89 Name(
"fineScanWindow"),
90 Comment(
"Window size for fine grained likelihood scan around result of coarse scan."),
95 "Angular resolution parameters used in Highland formula. Formula is angResol[0]/(p*p) + " 96 "angResol[1]/p + angResol[2] + angResol[3]*p + angResol[4]*p*p. Unit is mrad."),
101 "Parameters for tuning of Highland formula. Default is pdg value of 13.6. For values as " 102 "in https://arxiv.org/abs/1703.0618 set to [0.1049,0.,11.0038,0,0]. Formula is " 103 "hlParams[0]/(p*p) + hlParams[1]/p + hlParams[2] + hlParams[3]*p + hlParams[4]*p*p."),
104 {0., 0., 13.6, 0, 0}};
106 Name(
"segLenTolerance"),
107 Comment(
"Tolerance in actual segment length (lower bound)."),
110 Name(
"applySCEcorr"),
111 Comment(
"Flag to turn the Space Charge Effect correction on/off."),
127 const std::array<double, 5>&
angResol,
128 const std::array<double, 5>&
hlParams,
190 std::vector<float>& segradlengths,
191 std::vector<float>& cumseglens)
const;
193 const size_t firstPoint,
194 const size_t lastPoint,
198 std::vector<float>& dthetaij,
199 std::vector<float>& seg_nradl,
200 std::vector<float>& cumLen,
206 ScanResult(
double ap,
double apUnc,
double alogL) : p(ap), pUnc(apUnc), logL(alogL) {}
211 std::vector<float>& seg_nradlengths,
212 std::vector<float>& cumLen,
215 float detAngResol)
const;
217 std::vector<float>& seg_nradlengths,
218 std::vector<float>& cumLen,
224 float detAngResol)
const;
238 if (
abs(pid) == 13) {
return mumass; }
239 if (
abs(pid) == 211) {
return pimass; }
240 if (
abs(pid) == 321) {
return kmass; }
241 if (
abs(pid) == 2212) {
return pmass; }
245 double energyLossLandau(
const double mass2,
const double E2,
const double x)
const;
247 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
Data product for reconstructed trajectory in space.
fhicl::Atom< int > minHitsPerSegment
fhicl::Atom< int > pIdHypothesis
void breakTrajInSegments(const recob::TrackTrajectory &traj, std::vector< size_t > &breakpoints, std::vector< float > &segradlengths, std::vector< float > &cumseglens) const
fhicl::Atom< int > eLossMode
double DetectorAngularResolution(const double uz) const
fhicl::Atom< int > nElossSteps
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
fhicl::Atom< double > pMax
constexpr auto abs(T v)
Returns the absolute value of the argument.
fhicl::Atom< int > minNumSegments
fhicl::Atom< bool > applySCEcorr
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj) const
const ScanResult doLikelihoodScan(std::vector< float > &dtheta, std::vector< float > &seg_nradlengths, std::vector< float > &cumLen, bool fwdFit, int pid, float detAngResol) const
TrajectoryMCSFitter(const Parameters &p)
fhicl::Atom< double > segLenTolerance
recob::MCSFitResult fitMcs(const recob::Trajectory &traj) const
std::array< double, 5 > angResol_
double mass(int pid) const
size_t NPoints() const
Returns the number of stored trajectory points.
A trajectory in space reconstructed from hits.
double GetE(const double initial_E, const double length_travelled, const double mass) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space. See recob::tracking::Coord_t for more details on the ...
double segLenTolerance() const
void linearRegression(const recob::TrackTrajectory &traj, const size_t firstPoint, const size_t lastPoint, recob::tracking::Vector_t &pcdir) const
Provides recob::Track data product.
double energyLossLandau(const double mass2, const double E2, const double x) const
Data product for reconstructed trajectory in space.
std::array< double, 5 > hlParams_
std::vector< PointFlags_t > Flags_t
Type of point flag list.
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.
double HighlandFirstTerm(const double p) const
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)
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Trac...
fhicl::Atom< double > pStepCoarse
fhicl::Atom< double > segmentLength
double mcsLikelihood(double p, double theta0x, std::vector< float > &dthetaij, std::vector< float > &seg_nradl, std::vector< float > &cumLen, bool fwd, int pid) const
recob::MCSFitResult fitMcs(const recob::Track &track, int pid) const
constexpr double kBogusD
obviously bogus double value
fhicl::Sequence< double, 5 > hlParams
fhicl::Atom< double > pMin
recob::MCSFitResult fitMcs(const recob::Trajectory &traj, int pid) const
recob::MCSFitResult fitMcs(const recob::Track &track) const
fhicl::Atom< double > fineScanWindow
fhicl::Sequence< double, 5 > angResol
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track: