From cd829cd18dc128abc19f785ba959cc588f14f7d4 Mon Sep 17 00:00:00 2001
From: Christian Gutschow <chris.g@cern.ch>
Date: Thu, 6 Aug 2020 11:15:17 +0100
Subject: [PATCH] allow for negative cross-sections

---
 Generators/Rivet_i/src/Rivet_i.cxx | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/Generators/Rivet_i/src/Rivet_i.cxx b/Generators/Rivet_i/src/Rivet_i.cxx
index 0dc0f53dab5..81ba33fcf5a 100644
--- a/Generators/Rivet_i/src/Rivet_i.cxx
+++ b/Generators/Rivet_i/src/Rivet_i.cxx
@@ -50,8 +50,8 @@ Rivet_i::Rivet_i(const std::string& name, ISvcLocator* pSvcLocator) :
   // Options
   declareProperty("McEventKey", m_genEventKey="GEN_EVENT");
   declareProperty("Analyses", m_analysisNames);
-  declareProperty("CrossSection", m_crossSection=-1.0);
-  declareProperty("CrossSectionUncertainty", m_crossSection_uncert=-1.0);
+  declareProperty("CrossSection", m_crossSection=0.0);
+  declareProperty("CrossSectionUncertainty", m_crossSection_uncert=0.0);
   declareProperty("Stream", m_stream="/Rivet");
   declareProperty("RunName", m_runname="");
   declareProperty("HistoFile", m_file="Rivet.yoda");
@@ -225,10 +225,11 @@ StatusCode Rivet_i::execute() {
 StatusCode Rivet_i::finalize() {
   ATH_MSG_INFO("Rivet_i finalizing");
 
-  // Set xsec in Rivet
-  double custom_xs = m_crossSection > 0 ? m_crossSection : 1.0;
-  double custom_xserr = m_crossSection_uncert > 0 ? m_crossSection_uncert : 0.0; 
-  m_analysisHandler->setCrossSection({custom_xs, custom_xserr});
+  // Setting cross-section in Rivet
+  // If no user-specified cross-section available,
+  // set AMI cross-section at plotting time 
+  double custom_xs = m_crossSection != 0 ? m_crossSection : 1.0;
+  m_analysisHandler->setCrossSection({custom_xs, m_crossSection_uncert});
   
   m_analysisHandler->finalize();
 
-- 
GitLab