From 13c93c857d731c2482d0138aa6f0b3d13eb8e74c Mon Sep 17 00:00:00 2001
From: Chengdong Fu <fucd@ihep.ac.cn>
Date: Mon, 1 Apr 2024 20:48:11 +0800
Subject: [PATCH] add switch for debug

---
 Service/TrackSystemSvc/src/MarlinTrkUtils.cc | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Service/TrackSystemSvc/src/MarlinTrkUtils.cc b/Service/TrackSystemSvc/src/MarlinTrkUtils.cc
index fcacb19c..bf2ab05d 100644
--- a/Service/TrackSystemSvc/src/MarlinTrkUtils.cc
+++ b/Service/TrackSystemSvc/src/MarlinTrkUtils.cc
@@ -608,7 +608,16 @@ namespace MarlinTrk {
         trkStateCalo.location = MarlinTrk::Location::AtCalorimeter;
         track->addToTrackStates(trkStateCalo);
       } else {
+#ifdef DEBUG
 	std::cout << "  >>>>>>>>>>> MarlinTrk::finaliseLCIOTrack:  could not get TrackState at Calo Face "  << std::endl ;
+	if (last_constrained_hit.isAvailable()) {
+	  auto pos = last_constrained_hit.getPosition();
+	  std::cout << " last_constrained_hit = " << pos.x << "," << pos.y << "," << pos.z << std::endl;
+	}
+	else {
+	  std::cout << " last_constrained_hit not Available" << std::endl;
+	}
+#endif
         //delete trkStateCalo;
       }
     } else {
-- 
GitLab