3 #include <utl/PhysicalConstants.h>
11 namespace RdSphericalFit {
14 SphericalFitFunction::operator()(
const std::vector<double>& pars)
18 UpdateParameters(pars);
23 std::vector<double> expectedTimes;
24 for (
const auto&
s : fStationData) {
25 double expectedTime = (
s.antennaPos - source).GetMag() / (fGamma *
kSpeedOfLight);
26 expectedTimes.push_back(expectedTime);
28 const double t0 =
TMath::Mean(expectedTimes.begin(), expectedTimes.end());
31 for (
unsigned int i=0; i<fStationData.size(); i++) {
32 chi2 +=
pow(((fStationData[i].signalTime - ftmean) - (expectedTimes[i] - t0)) / fStationData[i].signalTimeErr, 2);
39 SphericalFitFunction::GetNDF()
42 return fStationData.size() - GetNFreeParameters() - 1;
47 SphericalFitFunction::GetChi2(
const std::vector<double>& pars)
49 return this->operator()(pars);
double pow(const double x, const unsigned int i)
static const CSpherical kSpherical
constexpr double kSpeedOfLight
double Mean(const std::vector< double > &v)