#include <TrackStoppingChi2Alg.h>
Definition at line 22 of file TrackStoppingChi2Alg.h.
sbn::TrackStoppingChi2Alg::TrackStoppingChi2Alg |
( |
fhicl::ParameterSet const & |
p | ) |
|
sbn::StoppingChi2Fit sbn::TrackStoppingChi2Alg::RunFit |
( |
const std::vector< float > & |
dEdxVec, |
|
|
const std::vector< float > & |
resRangeVec |
|
) |
| const |
Definition at line 14 of file TrackStoppingChi2Alg.cc.
16 if (dEdxVec.size() != resRangeVec.size())
17 throw cet::exception(
"TrackStoppingChi2Alg") <<
"dEdx and Res Range do not have same length: " << dEdxVec.size() <<
" and " << resRangeVec.size() << std::endl;
20 return StoppingChi2Fit();
22 const auto graph(std::make_unique<TGraph>(dEdxVec.size(), &resRangeVec[0], &dEdxVec[0]));
25 graph->Fit(
"pol0",
"Q");
26 const TF1* polFit = graph->GetFunction(
"pol0");
27 const float pol0Chi2(polFit ? polFit->GetChisquare() : -5.f);
28 const float pol0Fit(polFit ? polFit->GetParameter(0) : -5.f);
31 graph->Fit(
"expo",
"Q");
32 const TF1* expFit = graph->GetFunction(
"expo");
33 const float expChi2(expFit ? expFit->GetChisquare() : -5.f);
35 return StoppingChi2Fit(pol0Chi2, expChi2, pol0Fit);
const unsigned int fMinHits
Definition at line 38 of file TrackStoppingChi2Alg.cc.
41 std::vector<float> dEdxVec, resRangeVec;
43 for (
size_t i = 1; i < calo.
dEdx().size() - 1; i++) {
44 const float thisdEdx(calo.
dEdx()[i]);
49 dEdxVec.push_back(thisdEdx);
50 resRangeVec.push_back(thisResRange);
53 return this->
RunFit(dEdxVec, resRangeVec);
const std::vector< float > & ResidualRange() const
const std::vector< float > & dEdx() const
StoppingChi2Fit RunFit(const std::vector< float > &dEdxVec, const std::vector< float > &resRangeVec) const
Definition at line 56 of file TrackStoppingChi2Alg.cc.
58 if(calo.
XYZ().size() == 0)
59 return StoppingChi2Fit();
64 std::vector<float> dEdxVec, resRangeVec;
66 for (
size_t i = 1; i < calo.
dEdx().size() - 1; i++) {
67 const float thisdEdx(calo.
dEdx()[i]);
72 dEdxVec.push_back(thisdEdx);
73 resRangeVec.push_back(thisResRange);
78 std::reverse(dEdxVec.begin(), dEdxVec.end());
79 std::reverse(resRangeVec.begin(), resRangeVec.end());
82 return this->
RunFit(dEdxVec, resRangeVec);
const std::vector< Point_t > & XYZ() const
const std::vector< float > & ResidualRange() const
double MinDistToWall(geo::Point_t point) const
auto end(FixedBins< T, C > const &) noexcept
const std::vector< float > & dEdx() const
StoppingChi2Fit RunFit(const std::vector< float > &dEdxVec, const std::vector< float > &resRangeVec) const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
const float sbn::TrackStoppingChi2Alg::fFitRange |
|
private |
const float sbn::TrackStoppingChi2Alg::fMaxdEdx |
|
private |
const unsigned int sbn::TrackStoppingChi2Alg::fMinHits |
|
private |
The documentation for this class was generated from the following files: