1 #ifndef TRAJECTORYMCSFITTER_H
2 #define TRAJECTORYMCSFITTER_H
5 #include "fhiclcpp/types/Atom.h"
6 #include "fhiclcpp/types/Comment.h"
7 #include "fhiclcpp/types/Name.h"
8 #include "fhiclcpp/types/Sequence.h"
9 #include "fhiclcpp/types/Table.h"
52 Name(
"pIdHypothesis"),
53 Comment(
"Default particle Id Hypothesis to be used in the fit when not specified."),
57 Name(
"minNumSegments"),
58 Comment(
"Minimum number of segments the track is split into."),
62 Name(
"segmentLength"),
63 Comment(
"Nominal length of track segments used in the fit."),
67 Name(
"minHitsPerSegment"),
68 Comment(
"Exclude segments with less hits than this value."),
73 Comment(
"Number of steps for computing energy loss uptream to current segment."),
78 Comment(
"Default is MPV Landau. Choose 1 for MIP (constant); 2 for Bethe-Bloch."),
83 Comment(
"Minimum momentum value in likelihood scan."),
88 Comment(
"Maximum momentum value in likelihood scan."),
93 Comment(
"Step in momentum value in initial coase likelihood scan."),
98 Comment(
"Step in momentum value in fine grained likelihood scan."),
102 Name(
"fineScanWindow"),
103 Comment(
"Window size for fine grained likelihood scan around result of coarse scan."),
108 Comment(
"Angular resolution parameters used in Highland formula. Formula is angResol[0]/(p*p) + angResol[1]/p + angResol[2] + angResol[3]*p + angResol[4]*p*p. Unit is mrad."),
113 Comment(
"Parameters for tuning of Highland formula. Default is pdg value of 13.6. For values as in https://arxiv.org/abs/1703.0618 set to [0.1049,0.,11.0038,0,0]. Formula is hlParams[0]/(p*p) + hlParams[1]/p + hlParams[2] + hlParams[3]*p + hlParams[4]*p*p."),
117 Name(
"segLenTolerance"),
118 Comment(
"Tolerance in actual segment length (lower bound)."),
122 Name(
"applySCEcorr"),
123 Comment(
"Flag to turn the Space Charge Effect correction on/off."),
129 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){
147 :
TrajectoryMCSFitter(p().pIdHypothesis(),p().minNumSegments(),p().segmentLength(),p().minHitsPerSegment(),p().nElossSteps(),p().eLossMode(),p().pMin(),p().pMax(),p().pStepCoarse(),p().pStep(),p().fineScanWindow(),p().angResol(),p().
hlParams(),p().
segLenTolerance(),p().applySCEcorr()) {}
161 void breakTrajInSegments(
const recob::TrackTrajectory& traj, std::vector<size_t>& breakpoints, std::vector<float>& segradlengths, std::vector<float>& cumseglens)
const;
163 double mcsLikelihood(
double p,
double theta0x, std::vector<float>& dthetaij, std::vector<float>& seg_nradl, std::vector<float>& cumLen,
bool fwd,
int pid)
const;
171 const ScanResult doLikelihoodScan(std::vector<float>& dtheta, std::vector<float>& seg_nradlengths, std::vector<float>& cumLen,
bool fwdFit,
int pid,
float detAngResol)
const;
172 const ScanResult doLikelihoodScan(std::vector<float>& dtheta, std::vector<float>& seg_nradlengths, std::vector<float>& cumLen,
bool fwdFit,
int pid,
173 float pmin,
float pmax,
float pstep,
float detAngResol)
const;
182 if (
abs(pid)==13) {
return mumass; }
183 if (
abs(pid)==211) {
return pimass; }
184 if (
abs(pid)==321) {
return kmass; }
185 if (
abs(pid)==2212) {
return pmass; }
188 double energyLossBetheBloch(
const double mass,
const double e2)
const;
189 double energyLossLandau(
const double mass2,
const double E2,
const double x)
const;
191 double GetE(
const double initial_E,
const double length_travelled,
const double mass)
const;
ScanResult(double ap, double apUnc, double alogL)
Data product for reconstructed trajectory in space.
double DetectorAngularResolution(const double uz) const
fhicl::Table< Config > Parameters
fhicl::Atom< double > pMin
process_name opflash particleana ie x
fhicl::Atom< int > minNumSegments
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
fhicl::Atom< int > pIdHypothesis
fhicl::Atom< bool > applySCEcorr
process_name use argoneut_mc_hitfinder track
fhicl::Atom< int > eLossMode
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj) const
fhicl::Atom< int > minHitsPerSegment
TrajectoryMCSFitter(const Parameters &p)
fhicl::Atom< int > nElossSteps
fhicl::Atom< double > segLenTolerance
recob::MCSFitResult fitMcs(const recob::Trajectory &traj) 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 ...
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 segLenTolerance() const
BEGIN_PROLOG vertical distance to the surface Name
Data product for reconstructed trajectory in space.
std::array< double, 5 > hlParams_
std::vector< PointFlags_t > Flags_t
Type of point flag list.
Provides recob::Track data product.
Class storing the result of the Maximum Likelihood fit of Multiple Coulomb Scattering angles between ...
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 > segmentLength
fhicl::Atom< double > pStepCoarse
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 > pMax
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:
fhicl::Atom< double > pStep