From 3749ceb80da5cae5ed08a189b1c23ff705b3c620 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Wed, 24 Jan 2024 12:16:39 +0100
Subject: [PATCH] CbmMatchRecoToMC: removed assertion to the MVD MC point in
 the StsTrack matching procedure

---
 core/base/CbmMatchRecoToMC.cxx | 7 +++++--
 macro/qa/CMakeLists.txt        | 6 +++---
 macro/qa/configs/objects.yaml  | 2 +-
 macro/run/CMakeLists.txt       | 4 ++--
 macro/run/run_qa.C             | 4 ++--
 5 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/core/base/CbmMatchRecoToMC.cxx b/core/base/CbmMatchRecoToMC.cxx
index 528651ebe9..3a5b0c8177 100644
--- a/core/base/CbmMatchRecoToMC.cxx
+++ b/core/base/CbmMatchRecoToMC.cxx
@@ -773,8 +773,11 @@ void CbmMatchRecoToMC::MatchStsTracks(const TClonesArray* mvdHitMatches, const T
       for (Int_t iLink = 0; iLink < nofLinks; iLink++) {
         const CbmLink& link      = hitMatch->GetLink(iLink);
         const FairMCPoint* point = static_cast<const FairMCPoint*>(mvdPoints->Get(link));
-        assert(point);
-        trackMatch->AddLink(CbmLink(1., point->GetTrackID(), link.GetEntry(), link.GetFile()));
+        if (point) {
+          // NOTE: 24.01.2024 SZh: the assertion was replaced with nullptr check, because there are links,
+          //                       which are not assigned to any MC point. Can it be a bug?
+          trackMatch->AddLink(CbmLink(1., point->GetTrackID(), link.GetEntry(), link.GetFile()));
+        }
       }
     }
 
diff --git a/macro/qa/CMakeLists.txt b/macro/qa/CMakeLists.txt
index fa0a9616df..e8eaf2aa22 100644
--- a/macro/qa/CMakeLists.txt
+++ b/macro/qa/CMakeLists.txt
@@ -80,14 +80,14 @@ foreach(setup IN LISTS cbm_setup)
   # --- Test run_qa
   # --- Run QA tasks with Event-by-event reconstruction from time-based simulation
   # --- Real raw event builder
-  set(testname qa_${sname}_compare)
+  set(testname qa_${sname}_ts_eb_ideal_compare)
   add_test(${testname} ${MACRODIR}/qa_compare.sh \"configs/objects.yaml\" \"${sname}\" \"../run/data\" \"../run/data/\" \"data/QACheckerOutput.${sname}.root\" )
   set_tests_properties(${testname} PROPERTIES
   	TIMEOUT ${timeOutTime}
 	FAIL_REGULAR_EXPRESSION "segmentation violation"
   PASS_REGULAR_EXPRESSION "Macro finished successfully"
-	FIXTURES_REQUIRED "fixt_qa_${setup}"
-	FIXTURES_SETUP fixt_qa_compare_${setup}
+	FIXTURES_REQUIRED "fixt_qa_ts_eb_ideal_${setup}"
+	FIXTURES_SETUP fixt_qa_ts_eb_ideal_compare_${setup}
   )
 
 endforeach(setup IN LISTS cbm_setup)
diff --git a/macro/qa/configs/objects.yaml b/macro/qa/configs/objects.yaml
index fe4d1e6aa7..4ce5df7300 100644
--- a/macro/qa/configs/objects.yaml
+++ b/macro/qa/configs/objects.yaml
@@ -7,7 +7,7 @@
 
 checker:
   files:
-    - name: "%v/%d_qa.qa.root"
+    - name: "%v/%d_ts_eb_ideal_qa.qa.root"
       label: qa
       objects:
         - CbmCaInputQaSts/efficiencies/casts_reco_eff_vs_r_st0
diff --git a/macro/run/CMakeLists.txt b/macro/run/CMakeLists.txt
index c832cea41f..5c4adc0985 100644
--- a/macro/run/CMakeLists.txt
+++ b/macro/run/CMakeLists.txt
@@ -309,7 +309,7 @@ foreach(setup IN LISTS cbm_setup)
     FAIL_REGULAR_EXPRESSION "segmentation violation"
     PASS_REGULAR_EXPRESSION "QA checks passed;Macro finished successfully"
     FIXTURES_REQUIRED "fixt_tra_coll_${setup};fixt_digi_ts_${setup};fixt_reco_ts_eb_ideal_${setup}"
-    FIXTURES_SETUP fixt_qa_${setup}
+    FIXTURES_SETUP fixt_qa_ts_eb_ideal_${setup}
     RESOURCE_LOCK collParDb_${setup}
   )
 
@@ -327,7 +327,7 @@ foreach(setup IN LISTS cbm_setup)
     FAIL_REGULAR_EXPRESSION "segmentation violation"
     PASS_REGULAR_EXPRESSION "QA checks passed;Macro finished successfully"
     FIXTURES_REQUIRED "fixt_tra_coll_${setup};fixt_digi_ts_${setup};fixt_reco_ts_eb_real_${setup}"
-    FIXTURES_SETUP fixt_qa_${setup}
+    FIXTURES_SETUP fixt_qa_ts_eb_real_${setup}
     RESOURCE_LOCK collParDb_${setup}
   )
 
diff --git a/macro/run/run_qa.C b/macro/run/run_qa.C
index a34d152690..47bfa43c0d 100644
--- a/macro/run/run_qa.C
+++ b/macro/run/run_qa.C
@@ -307,8 +307,8 @@ void run_qa(TString dataTraColl,
   pCaOutputQa->SetProcessFullTs(!bEventBasedReco);
   pCaOutputQa->SetStsTrackingMode();
   pCaOutputQa->ReadParameters(caParFile.Data());
-  if (configName.Length() != 0) {
-    pCaOutputQa->SetConfigName(configName);
+  if (config.Length() != 0) {
+    pCaOutputQa->SetConfigName(config);
   }
   // TODO: Provide detector selection interface from the L1Parameters
   pCaOutputQa->SetUseMvd(!(sEvBuildRaw.EqualTo("Real", TString::ECaseCompare::kIgnoreCase)) ? bUseMvd : false);
-- 
GitLab