1 #ifndef TrajectoryMCSFitterICARUS_H
2 #define TrajectoryMCSFitterICARUS_H
4 #include "fhiclcpp/ParameterSet.h"
5 #include "fhiclcpp/types/Atom.h"
6 #include "fhiclcpp/types/Table.h"
7 #include "canvas/Persistency/Common/Ptr.h"
43 Name(
"pIdHypothesis"),
44 Comment(
"Default particle Id Hypothesis to be used in the fit when not specified."),
48 Name(
"minNumSegments"),
49 Comment(
"Minimum number of segments the track is split into."),
53 Name(
"segmentLength"),
54 Comment(
"Nominal length of track segments used in the fit."),
58 Name(
"minHitsPerSegment"),
59 Comment(
"Exclude segments with less hits than this value."),
64 Comment(
"Number of steps for computing energy loss uptream to current segment."),
69 Comment(
"Default is MPV Landau. Choose 1 for MIP (constant); 2 for Bethe-Bloch."),
74 Comment(
"Minimum momentum value in likelihood scan."),
79 Comment(
"Maximum momentum value in likelihood scan."),
84 Comment(
"Step in momentum value in likelihood scan."),
89 Comment(
"Angular resolution parameter used in modified Highland formula. Unit is mrad."),
95 TrajectoryMCSFitterICARUS(
int pIdHyp,
int minNSegs,
double segLen,
int minHitsPerSegment,
int nElossSteps,
int eLossMode,
double pMin,
double pMax,
double pStep,
double angResol){
108 :
TrajectoryMCSFitterICARUS(p().pIdHypothesis(),p().minNumSegments(),p().segmentLength(),p().minHitsPerSegment(),p().nElossSteps(),p().eLossMode(),p().pMin(),p().pMax(),p().pStep(),p().angResol()) {}
119 return fitMcs(tt,pid,momDepConst);
125 double mcsLikelihood(
double p,
double theta0x, std::vector<float>& dthetaij, std::vector<float>& seg_nradl, std::vector<float>& cumLen,
bool fwd,
bool momDepConst,
int pid)
const;
126 double GetOptimalSegLen(
const double guess_p,
const int n_points,
const int plane,
const double length_travelled)
const;
138 const ScanResult doLikelihoodScan(std::vector<float>& dtheta, std::vector<float>& seg_nradlengths, std::vector<float>& cumLen,
bool fwdFit,
bool momDepConst,
int pid)
const;
142 constexpr
double a = 0.1049;
143 constexpr
double c = 11.0038;
144 return (a/(p*p)) + c;
147 if (
abs(pid)==13) {
return mumass; }
148 if (
abs(pid)==211) {
return pimass; }
149 if (
abs(pid)==321) {
return kmass; }
150 if (
abs(pid)==2212) {
return pmass; }
154 double energyLossLandau(
const double mass2,
const double E2,
const double x)
const;
156 double GetE(
const double initial_E,
const double length_travelled,
const double mass)
const;
double energyLossBetheBloch(const double mass, const double e2) const
void linearRegression(const recob::TrackTrajectory &traj, const size_t firstPoint, const size_t lastPoint, recob::tracking::Vector_t &pcdir) const
process_name opflash particleana ie x
fhicl::Atom< double > segmentLength
fhicl::Atom< double > pMin
recob::MCSFitResult fitMcs(const recob::Track &track, int pid, bool momDepConst=true) const
recob::MCSFitResult fitMcs(const recob::Trajectory &traj, int pid, bool momDepConst=true) const
void breakTrajInSegments(const recob::TrackTrajectory &traj, std::vector< size_t > &breakpoints, std::vector< float > &segradlengths, std::vector< float > &cumseglens) const
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
fhicl::Table< Config > Parameters
Declaration of signal hit object.
fhicl::Atom< int > eLossMode
process_name use argoneut_mc_hitfinder track
fhicl::Atom< double > pStep
void set2DHits(std::vector< recob::Hit > h)
void findSegmentBarycenter(const recob::TrackTrajectory &traj, const size_t firstPoint, const size_t lastPoint, recob::tracking::Vector_t &pcdir) const
double GetE(const double initial_E, const double length_travelled, const double mass) const
double energyLossLandau(const double mass2, const double E2, const double x) 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 ...
recob::MCSFitResult fitMcs(const recob::Track &track, bool momDepConst=true) const
TrajectoryMCSFitterICARUS(int pIdHyp, int minNSegs, double segLen, int minHitsPerSegment, int nElossSteps, int eLossMode, double pMin, double pMax, double pStep, double angResol)
size_t NPoints() const
Returns the number of stored trajectory points.
std::vector< recob::Hit > hits2d
A trajectory in space reconstructed from hits.
const ScanResult doLikelihoodScan(std::vector< float > &dtheta, std::vector< float > &seg_nradlengths, std::vector< float > &cumLen, bool fwdFit, bool momDepConst, int pid) const
double GetOptimalSegLen(const double guess_p, const int n_points, const int plane, const double length_travelled) const
TrajectoryMCSFitterICARUS(const Parameters &p)
double mcsLikelihood(double p, double theta0x, std::vector< float > &dthetaij, std::vector< float > &seg_nradl, std::vector< float > &cumLen, bool fwd, bool momDepConst, int pid) const
BEGIN_PROLOG vertical distance to the surface Name
std::vector< PointFlags_t > Flags_t
Type of point flag list.
recob::MCSFitResult fitMcs(const recob::Trajectory &traj, bool momDepConst=true) const
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.
fhicl::Atom< int > minNumSegments
fhicl::Atom< double > pMax
Class for Maximum Likelihood fit of Multiple Coulomb Scattering angles between segments within a Trac...
fhicl::Atom< double > angResol
recob::MCSFitResult fitMcs(const recob::TrackTrajectory &traj, bool momDepConst=true) const
double MomentumDependentConstant(const double p) const
constexpr double kBogusD
obviously bogus double value
double computeResidual(int i, double &alfa) const
fhicl::Atom< int > minHitsPerSegment
ScanResult(double ap, double apUnc, double alogL)
double mass(int pid) const
fhicl::Atom< int > pIdHypothesis
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
fhicl::Atom< int > nElossSteps