From deb594952823eaa491d5ef22d509e4dffb8e6cc7 Mon Sep 17 00:00:00 2001
From: Felix Rauscher <Felix.Rauscher@cern.ch>
Date: Fri, 11 Feb 2011 14:48:29 +0100
Subject: [PATCH] * add config for efficiancy monitoring * tagging
 MuonCombinedDQA-01-00-02 (MuonCombinedDQA-01-00-02)

---
 .../MuonCombinedDQA/cmt/requirements          | 10 +++
 .../python/MuonCombinedDQAFlags.py            | 89 +++++++++++++++++++
 .../MuonCombinedDQA/python/__init__.py        |  2 +
 .../MuonCombinedMonitoring_jobOptions.py      | 13 +++
 4 files changed, 114 insertions(+)
 create mode 100644 Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/cmt/requirements
 create mode 100644 Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/MuonCombinedDQAFlags.py
 create mode 100644 Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/__init__.py
 create mode 100644 Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/share/MuonCombinedMonitoring_jobOptions.py

diff --git a/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/cmt/requirements b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/cmt/requirements
new file mode 100644
index 00000000000..352b1331b0b
--- /dev/null
+++ b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/cmt/requirements
@@ -0,0 +1,10 @@
+package MuonCombinedDQA
+
+branches python run
+
+use AtlasPolicy AtlasPolicy-*
+use     TestPolicy                  TestPolicy-*
+use     AtlasReconstructionRunTime  AtlasReconstructionRunTime-*
+
+apply_pattern declare_joboptions files="*.py"
+apply_pattern declare_python_modules files="*.py"
diff --git a/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/MuonCombinedDQAFlags.py b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/MuonCombinedDQAFlags.py
new file mode 100644
index 00000000000..257db306541
--- /dev/null
+++ b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/MuonCombinedDQAFlags.py
@@ -0,0 +1,89 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
+__doc__ = """Flags to steer the DQA for Muon Combined Reconstruction."""
+
+from AthenaCommon.JobProperties import JobProperty,JobPropertyContainer,jobproperties
+from MuonRecExample.MuonRecUtils import logMuon,RecConfigInfo,AutoLoadContainerJobProperty,\
+     AutoLoadContainer,fillJobPropertyContainer,override_lock_and_set_Value
+from AthenaCommon import BeamFlags
+beamFlags = jobproperties.Beam
+
+class Enabled(JobProperty):
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+    def _do_action(self):
+        """Set all flags Off"""
+        global _propertiesList
+        for p in _propertiesList:
+            if p is not self: p.set_On()
+
+    def _undo_action(self):
+        """Set all flags Off"""
+        global _propertiesList
+        for p in _propertiesList:
+            if p is not self: p.set_Off()
+
+
+class doMuonStandaloneMon(JobProperty):
+    """Run DQA on the standalone muons MuidSA/Muonboy"""
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+class doMuonCombinedMon(JobProperty):
+    """Run DQA on the combined track muons MuidCB/Staco"""
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+class doMuonMSTagMon(JobProperty):
+    """Run DQA on the tagged muons MuTag/MuGirl/MuTagIMO"""
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+class doMuonCaloTagMon(JobProperty):
+    """Run DQA on the calo tagged muons MuonCaloLR/MuonCaloTag"""
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+class doMuonEfficiency(JobProperty):
+    """Run DQA on the muon efficiency"""
+    statusOn=True
+    allowedTypes=['bool']
+    StoredValue=True
+
+
+
+class MuonCombinedDQA(JobPropertyContainer):
+    """The flags to steer muon combined reconstruction"""
+
+    def setDefaults(self):
+        global beamFlags
+        if beamFlags.beamType()=='cosmics' or beamFlags.beamType()=='singlebeam':
+            self.doMuonStandaloneMon = True
+            self.doMuonCombinedMon   = True
+            self.doMuonMSTagMon      = True
+            self.doMuonCaloTagMon    = True
+            self.doMuonEfficiency    = True
+        else: # collisions
+            self.doMuonStandaloneMon = True
+            self.doMuonCombinedMon   = True
+            self.doMuonMSTagMon      = True
+            self.doMuonCaloTagMon    = True
+            self.doMuonEfficiency    = True
+
+    def sync_Flags(self):
+        """Synchronise all flags to make them consistent"""
+            
+
+jobproperties.add_Container(MuonCombinedDQA)
+muonCombinedDQAFlags = jobproperties.MuonCombinedDQA
+
+# fill properties in container and store for later use (due to lack of iterator)
+_propertiesList = fillJobPropertyContainer(muonCombinedDQAFlags,__name__)
+
+muonCombinedDQAFlags.setDefaults()
diff --git a/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/__init__.py b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/__init__.py
new file mode 100644
index 00000000000..74583d364ec
--- /dev/null
+++ b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/python/__init__.py
@@ -0,0 +1,2 @@
+# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+
diff --git a/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/share/MuonCombinedMonitoring_jobOptions.py b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/share/MuonCombinedMonitoring_jobOptions.py
new file mode 100644
index 00000000000..e55b9ebd574
--- /dev/null
+++ b/Reconstruction/MuonIdentification/MuonCombinedValidation/MuonCombinedDQA/share/MuonCombinedMonitoring_jobOptions.py
@@ -0,0 +1,13 @@
+#
+# JobOptions to configure MuonCombined DQA monitoring
+# MuonCombinedMonManager must be set up before calling these jobOptions
+#
+
+from AthenaCommon.AlgSequence import AlgSequence
+from AthenaCommon.AppMgr import ToolSvc,ServiceMgr
+from AthenaCommon import CfgMgr
+from AthenaCommon.BeamFlags import jobproperties
+beamFlags = jobproperties.Beam
+from MuonCombinedDQA.MuonCombinedDQAFlags import muonCombinedDQAFlags
+
+include("MuonCombinedTrackMon/MuonCombinedTrackValidation_jobOptions.py")
-- 
GitLab