From 8fc41eb7dc59b9ee6a50ed757a0097be39d6fa56 Mon Sep 17 00:00:00 2001
From: Tobias Boeckh <tobias.boeckh@cern.ch>
Date: Wed, 21 Jun 2023 17:51:27 +0200
Subject: [PATCH] Add flag to turn vertexing off.

---
 PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx | 2 +-
 PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h   | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx
index 15680972..1fc059dc 100644
--- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx
+++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.cxx
@@ -1186,7 +1186,7 @@ StatusCode NtupleDumperAlg::execute(const EventContext &ctx) const
     m_longTracks++;
   }
 
-  if (goodTracks.size() >= 2) {
+  if (m_runVertexing && goodTracks.size() >= 2) {
     // sort tracks my momentum and reconstruct vertex
     std::sort(goodTracks.begin(), goodTracks.end(), [](const Trk::Track *lhs, const Trk::Track *rhs){
       return lhs->trackParameters()->front()->momentum().z() < rhs->trackParameters()->front()->momentum().z();
diff --git a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h
index d94379ca..475378c1 100644
--- a/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h
+++ b/PhysicsAnalysis/NtupleDumper/src/NtupleDumperAlg.h
@@ -130,6 +130,7 @@ private:
   UnsignedIntegerProperty m_minLayers{this, "minLayers", 7, "Miminimum number of layers of a track."};
   UnsignedIntegerProperty m_minHits{this, "minHits", 12, "Miminimum number of hits of a track."};
   DoubleProperty m_maxChi2NDOF{this, "maxChi2NDOF", 25, "Maximum chi2 per degree of freedom."};
+  BooleanProperty m_runVertexing{ this, "RunVertexing", true, "Run the vertexing, defaults to true." };
 
   // json object to hold data read from GRL file (or empty if not)
   nlohmann::json m_grl;
-- 
GitLab