From bb1914720ac83ed4fe37d1cbf83ec0e72485bff1 Mon Sep 17 00:00:00 2001
From: Tadej Novak <tadej.novak@cern.ch>
Date: Mon, 6 Feb 2023 15:20:03 +0100
Subject: [PATCH] CP algs: seed MET systematics tool for reproducibility

---
 .../Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx      | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx
index 8c5f0c9b9aa0..b4b39f81ac24 100644
--- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx
+++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/Root/MetMakerAlg.cxx
@@ -155,6 +155,9 @@ namespace CP
           return StatusCode::FAILURE;
         }
 
+        // Set the seed for reproducibility
+        m_systematicsTool->setRandomSeed(static_cast<int>(1e6 * softTerm->phi()));
+
         // This returns a `CorrectionCode`, so in principle this could
         // return an `OutOfValidity` result, but I have no idea what
         // that would mean or how to handle it, so I'm implicitly
-- 
GitLab