From 5a8afae8b8583b10b6220bdb11492faa9b967008 Mon Sep 17 00:00:00 2001
From: scott snyder <snyder@bnl.gov>
Date: Mon, 5 Aug 2019 17:57:36 +0200
Subject: [PATCH] TrigCostRootAnalysis: Use [[maybe_unused]]

Use [[maybe_unused]] to mark unused variables rather than other hacky
methods that are not guaranteed to work.
---
 .../TrigCostRootAnalysis/Root/TrigXMLService.cxx     | 12 ++++++------
 .../TrigCostRootAnalysis/Utility.h                   |  8 +-------
 2 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
index 647e40267420..c2e30f40d128 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/Root/TrigXMLService.cxx
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // -------------------------------------------------------------
@@ -1626,13 +1626,16 @@ namespace TrigCostRootAnalysis {
     Float_t uniqueRate = counter->getDecoration(kDecUniqueRate);
     Float_t uniqueFraction = counter->getDecoration(kDecUniqueFraction); // Was in percent, change back to 0-1
 
+    [[maybe_unused]]
     Bool_t isL1 = kFALSE;
 
     if (counter->getStrDecoration(kDecType) == "L1") isL1 = kTRUE;
-    UNUSED(isL1);
 
     // TODO - THIS IS WRONG FOR WEIGHTED EVENTS
-    Float_t eff = 0., effErr = 0., psEff = 0., psEffErr = 0.;
+    Float_t eff = 0.;
+    Float_t psEff = 0.;
+    [[maybe_unused]] Float_t effErr = 0.;
+    [[maybe_unused]] Float_t psEffErr = 0.;
     if (evRun) {
       eff = evPassNoPS / evRun;
       effErr = (1. / evRun) * TMath::Sqrt(evPassNoPS * (1. - eff)); // Binomal
@@ -1640,9 +1643,6 @@ namespace TrigCostRootAnalysis {
       psEffErr = (1. / evRun) * TMath::Sqrt(evPassWeight * (1. - psEff)); // Binomal
     }
 
-    UNUSED(effErr);
-    UNUSED(psEffErr);
-
     xml.addNode(fout, "signature");
     xml.addNode(fout, "sig_name", counter->getName());
     xml.addNode(fout, "express_stream", intToString(0)); // TODO add me!
diff --git a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
index 17bf31f6e6c2..3a3e212b6a94 100644
--- a/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
+++ b/Trigger/TrigCost/TrigCostRootAnalysis/TrigCostRootAnalysis/Utility.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 */
 
 // -------------------------------------------------------------
@@ -40,12 +40,6 @@ class TFile;
   #define MUTEX_OFF //noop
 #endif
 
-/**
- * @def UNUSED(expr)
- * Preprocessed macro to mark deliberately unused variables and hide pedantic compiler warnings.
- */
-#define UNUSED(expr) do {(void) (expr);} while (0)
-
 /**
  * @file TrigCostRootAnalysis/Utility.h
  *
-- 
GitLab