From d2fe239786684986b4fa721382ba7eb8db74db72 Mon Sep 17 00:00:00 2001
From: Peter Onyisi <ponyisi@utexas.edu>
Date: Wed, 17 Sep 2014 14:51:12 +0200
Subject: [PATCH] Add enableLumiAccess flag to suppress all lumi access if
 desired (AthenaMonitoring-02-01-11)

	* Merge change from AthenaMonitoring-02-01-09-branch
	* Add enableLumiAccess flag to suppress all lumi access if desired
	* tag AthenaMonitoring-02-01-11

2014-08-18  scott snyder  <snyder@bnl.gov>

	* Tagging AthenaMonitoring-02-01-10.
	* AlgTool -> AthAlgTool; Algorithm -> AthAlgorithm.
---
 Control/AthenaMonitoring/AthenaMonitoring/AthenaMon.h     | 4 ++--
 .../AthenaMonitoring/AthenaMonitoring/MonitorToolBase.h   | 4 ++--
 Control/AthenaMonitoring/python/DQMonFlags.py             | 7 +++++++
 .../share/DataQualitySteering_jobOptions.py               | 8 ++++----
 Control/AthenaMonitoring/src/AthenaMon.cxx                | 2 +-
 Control/AthenaMonitoring/src/MonitorToolBase.cxx          | 2 +-
 6 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/Control/AthenaMonitoring/AthenaMonitoring/AthenaMon.h b/Control/AthenaMonitoring/AthenaMonitoring/AthenaMon.h
index aa2f999680a..a7765d4dcda 100755
--- a/Control/AthenaMonitoring/AthenaMonitoring/AthenaMon.h
+++ b/Control/AthenaMonitoring/AthenaMonitoring/AthenaMon.h
@@ -5,11 +5,11 @@
 #ifndef ATHENAMON_H
 #define ATHENAMON_H
 
-#include "GaudiKernel/Algorithm.h"
+#include "AthenaBaseComps/AthAlgorithm.h"
 
 #include "AthenaMonitoring/IMonitorToolBase.h"
 
-class AthenaMon:public Algorithm {
+class AthenaMon:public AthAlgorithm {
  public:
 
   AthenaMon (const std::string& name, ISvcLocator* pSvcLocator);
diff --git a/Control/AthenaMonitoring/AthenaMonitoring/MonitorToolBase.h b/Control/AthenaMonitoring/AthenaMonitoring/MonitorToolBase.h
index c489cb48ed3..76668d2cf46 100755
--- a/Control/AthenaMonitoring/AthenaMonitoring/MonitorToolBase.h
+++ b/Control/AthenaMonitoring/AthenaMonitoring/MonitorToolBase.h
@@ -5,7 +5,7 @@
 #ifndef MONITORTOOLBASE_H
 #define MONITORTOOLBASE_H
 
-#include "GaudiKernel/AlgTool.h"
+#include "AthenaBaseComps/AthAlgTool.h"
 #include "GaudiKernel/IHistogramSvc.h"
 #include "GaudiKernel/ITHistSvc.h"
 
@@ -15,7 +15,7 @@
 #include <vector>
 #include <map>
 
-class MonitorToolBase : public AlgTool,
+class MonitorToolBase : public AthAlgTool,
 			virtual public IMonitorToolBase
                          
 {
diff --git a/Control/AthenaMonitoring/python/DQMonFlags.py b/Control/AthenaMonitoring/python/DQMonFlags.py
index 618f5dda9a2..98d339b7828 100644
--- a/Control/AthenaMonitoring/python/DQMonFlags.py
+++ b/Control/AthenaMonitoring/python/DQMonFlags.py
@@ -370,6 +370,13 @@ class disableFilledBunchFilter(JobProperty):
     StoredValue=False
 list+=[disableFilledBunchFilter]
 
+class enableLumiAccess(JobProperty):
+    """ If set to false, will force lumi tool access off """
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+list+=[enableLumiAccess]
+
 ##-----------------------------------------------------------------------------
 ## 2nd step
 ## Definition of the DQMon flag container
diff --git a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
index 7c6279b57f7..97be8d67b25 100644
--- a/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
+++ b/Control/AthenaMonitoring/share/DataQualitySteering_jobOptions.py
@@ -18,8 +18,8 @@ if DQMonFlags.doMonitoring():
          include("AthenaMonitoring/TrigDecTool_jobOptions.py")
 
 
-   # don't set up lumi access if in MC
-   if globalflags.DataSource.get_Value() != 'geant4':
+   # don't set up lumi access if in MC or enableLumiAccess == False
+   if globalflags.DataSource.get_Value() != 'geant4' and DQMonFlags.enableLumiAccess():
       if not hasattr(ToolSvc,"LuminosityTool"):
          if athenaCommonFlags.isOnline:
             local_logger.debug("luminosity tool not found, importing online version")
@@ -253,8 +253,8 @@ if DQMonFlags.doMonitoring():
    for tool in monToolSet_after-monToolSet_before:
       # if we have the FilterTools attribute, assume this is in fact a
       # monitoring tool
-      # stop lumi access if we're in MC
-      if globalflags.DataSource.get_Value() == 'geant4':
+      # stop lumi access if we're in MC or enableLumiAccess == False
+      if globalflags.DataSource.get_Value() == 'geant4' or not DQMonFlags.enableLumiAccess():
          if 'EnableLumi' in dir(tool):
             tool.EnableLumi = False
       if DQMonFlags.monToolPostExec():
diff --git a/Control/AthenaMonitoring/src/AthenaMon.cxx b/Control/AthenaMonitoring/src/AthenaMon.cxx
index 430162991cd..1950ddbd555 100755
--- a/Control/AthenaMonitoring/src/AthenaMon.cxx
+++ b/Control/AthenaMonitoring/src/AthenaMon.cxx
@@ -24,7 +24,7 @@ class ISvcLocator;
 
 /*---------------------------------------------------------------*/
 AthenaMon::AthenaMon(const std::string& name, ISvcLocator* pSvcLocator) :
-  Algorithm(name, pSvcLocator)
+  AthAlgorithm(name, pSvcLocator)
 {   
   MsgStream log(msgSvc(), "AthenaMon");
   
diff --git a/Control/AthenaMonitoring/src/MonitorToolBase.cxx b/Control/AthenaMonitoring/src/MonitorToolBase.cxx
index 5d0b666aa21..952f1ada4f3 100755
--- a/Control/AthenaMonitoring/src/MonitorToolBase.cxx
+++ b/Control/AthenaMonitoring/src/MonitorToolBase.cxx
@@ -27,7 +27,7 @@
 MonitorToolBase::MonitorToolBase(const std::string & type, 
 				 const std::string & name,
 				 const IInterface* parent)
-  : AlgTool(type, name, parent)
+  : AthAlgTool(type, name, parent)
     , m_histsvc(0)
     , m_rootsvc(0)
     , m_isBooked(false)
-- 
GitLab