From ac2abbf0303306236f1d737e028ddd38293b774d Mon Sep 17 00:00:00 2001 From: Lennart Huth Date: Thu, 19 Nov 2020 11:11:39 +0100 Subject: [PATCH 1/4] corrected the ndofs for the straight line fit --- src/objects/Multiplet.cpp | 2 +- src/objects/StraightLineTrack.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/objects/Multiplet.cpp b/src/objects/Multiplet.cpp index 04681131..71593701 100644 --- a/src/objects/Multiplet.cpp +++ b/src/objects/Multiplet.cpp @@ -34,7 +34,7 @@ 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.; + ndof_ = m_upstream->getNdof() + m_downstream->getNdof(); chi2ndof_ = chi2_ / ndof_; } diff --git a/src/objects/StraightLineTrack.cpp b/src/objects/StraightLineTrack.cpp index f0a978b9..db49a7f0 100644 --- a/src/objects/StraightLineTrack.cpp +++ b/src/objects/StraightLineTrack.cpp @@ -36,8 +36,7 @@ ROOT::Math::XYPoint StraightLineTrack::getKinkAt(const std::string&) const { void StraightLineTrack::calculateChi2() { // Get the number of clusters - - ndof_ = static_cast(track_clusters_.size()) - 2.; + ndof_ = (static_cast(track_clusters_.size()) - 2.) * 2.; chi2_ = 0.; chi2ndof_ = 0.; -- GitLab From 5a22d6beab2bb837499370fb3c3ff853f3896351 Mon Sep 17 00:00:00 2001 From: Lennart Huth Date: Fri, 20 Nov 2020 10:20:35 +0100 Subject: [PATCH 2/4] changed chi2 definition of multiplet --- src/objects/Multiplet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objects/Multiplet.cpp b/src/objects/Multiplet.cpp index 71593701..2b8093b2 100644 --- a/src/objects/Multiplet.cpp +++ b/src/objects/Multiplet.cpp @@ -33,7 +33,7 @@ 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)); + chi2_ = m_upstream->getChi2() + m_downstream->getChi2(); ndof_ = m_upstream->getNdof() + m_downstream->getNdof(); chi2ndof_ = chi2_ / ndof_; } -- GitLab From a7f217e77bdf45362ede63fa3f8d218601f0b3b2 Mon Sep 17 00:00:00 2001 From: Lennart Huth Date: Fri, 20 Nov 2020 10:22:43 +0100 Subject: [PATCH 3/4] inline comment for degrees of freedom --- src/objects/StraightLineTrack.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/objects/StraightLineTrack.cpp b/src/objects/StraightLineTrack.cpp index db49a7f0..c8b7f792 100644 --- a/src/objects/StraightLineTrack.cpp +++ b/src/objects/StraightLineTrack.cpp @@ -36,6 +36,8 @@ ROOT::Math::XYPoint StraightLineTrack::getKinkAt(const std::string&) const { void StraightLineTrack::calculateChi2() { // Get the number of clusters + // 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.; -- GitLab From 087eb65d4d23a9324fb7f6c72a09348945dfba63 Mon Sep 17 00:00:00 2001 From: Lennart Huth Date: Mon, 23 Nov 2020 10:54:00 +0100 Subject: [PATCH 4/4] updated pass criteria for test to match corrected ndof definition --- testing/test_io_read_rootobj.conf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/test_io_read_rootobj.conf b/testing/test_io_read_rootobj.conf index db6acf7c..cc7cb79c 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 -- GitLab