diff --git a/src/objects/Multiplet.cpp b/src/objects/Multiplet.cpp index 04681131558b8000dacdcdb6964036c7b93b9ba0..2b8093b2bafa43602a78b250e829e1493ee20cc6 100644 --- a/src/objects/Multiplet.cpp +++ b/src/objects/Multiplet.cpp @@ -33,8 +33,8 @@ ROOT::Math::XYPoint Multiplet::getKinkAt(const std::string&) const { void Multiplet::calculateChi2() { - chi2_ = m_upstream->getChi2() + m_downstream->getChi2() + sqrt(m_offsetAtScatterer.Dot(m_offsetAtScatterer)); - ndof_ = static_cast(track_clusters_.size()) - 4.; + chi2_ = m_upstream->getChi2() + m_downstream->getChi2(); + ndof_ = m_upstream->getNdof() + m_downstream->getNdof(); chi2ndof_ = chi2_ / ndof_; } diff --git a/src/objects/StraightLineTrack.cpp b/src/objects/StraightLineTrack.cpp index f0a978b99d491da437f18b395886d4f0da4b0d91..c8b7f7923e47adcf0b761871e56aa2fabb3b3614 100644 --- a/src/objects/StraightLineTrack.cpp +++ b/src/objects/StraightLineTrack.cpp @@ -36,8 +36,9 @@ ROOT::Math::XYPoint StraightLineTrack::getKinkAt(const std::string&) const { void StraightLineTrack::calculateChi2() { // Get the number of clusters - - ndof_ = static_cast(track_clusters_.size()) - 2.; + // We do have a 2-dimensional offset(x_0,y_0) and slope (dx,dy). Each hit provides two measurements. + // ndof_ = 2*num_planes - 4 = 2 * (num_planes -2) + ndof_ = (static_cast(track_clusters_.size()) - 2.) * 2.; chi2_ = 0.; chi2ndof_ = 0.; diff --git a/testing/test_io_read_rootobj.conf b/testing/test_io_read_rootobj.conf index db6acf7ce3d40b2f66301d9df7dc91a22bcb5afb..cc7cb79ce6047d1f18a5becc3e76a339f5a3f6de 100644 --- a/testing/test_io_read_rootobj.conf +++ b/testing/test_io_read_rootobj.conf @@ -19,8 +19,7 @@ time_cut_frameedge = 10ns #DEPENDS test_io_write_rootobj.conf -#PASS Total efficiency of detector W0013_G02: 100%, measured with 32108/32108 matched/total tracks - +#PASS Total efficiency of detector W0013_G02: 100%, measured with 34446/34446 matched/total tracks # Please note: # Pixels are masked in the [EventLoaderTimepix3] when reading in the online configuration files. # Therefore, no pixels are masked here and the number of associated tracks is slightly higher than