From ada1b542ebff46a3baefd2c205ab89de29d95712 Mon Sep 17 00:00:00 2001
From: Chris Hays <Chris.Hays@cern.ch>
Date: Fri, 24 Jun 2011 12:16:05 +0200
Subject: [PATCH] New tag to remove warnings from ATN.
 (InDetGeometryValidation-00-00-01)

---
 .../InDetGeometryValidation/cmt/requirements  |  22 +++
 .../ReadSiDetectorElements_jobOptions.py      | 148 ++++++++++++++++++
 .../ReadTRT_DetectorElements_jobOptions.py    |  56 +++++++
 .../InDetGeometryValidation_load.cxx          |   4 +
 .../test/InDetGeometryValidation_Test.sh      |   4 +
 ...etGeometryValidation_TestConfiguration.xml |  37 +++++
 6 files changed, 271 insertions(+)
 create mode 100755 InnerDetector/InDetValidation/InDetGeometryValidation/cmt/requirements
 create mode 100755 InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
 create mode 100755 InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadTRT_DetectorElements_jobOptions.py
 create mode 100644 InnerDetector/InDetValidation/InDetGeometryValidation/src/components/InDetGeometryValidation_load.cxx
 create mode 100755 InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_Test.sh
 create mode 100644 InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_TestConfiguration.xml

diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/cmt/requirements b/InnerDetector/InDetValidation/InDetGeometryValidation/cmt/requirements
new file mode 100755
index 000000000000..3b1d27276c5e
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/cmt/requirements
@@ -0,0 +1,22 @@
+package InDetGeometryValidation
+
+author Chris Hays <hays@physics.ox.ac.uk>
+
+private
+
+use AtlasPolicy    AtlasPolicy-* 
+use TestPolicy                 TestPolicy-*
+
+use GaudiInterface GaudiInterface-*  External 
+
+use InDetReadoutGeometry InDetReadoutGeometry-*    InnerDetector/InDetDetDescr
+
+library InDetGeometryValidation *.cxx components/*.cxx
+
+branches run share
+apply_pattern declare_joboptions files="*.py"
+
+apply_pattern declare_runtime files="*.py"
+apply_pattern install_xmls
+
+apply_pattern athenarun_test name="InDetGeometryValidation" options="../share/*.py"
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
new file mode 100755
index 000000000000..71a7aeb092a5
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py
@@ -0,0 +1,148 @@
+###############################################################
+#
+# Loads Detector Description for Pixel and SCT
+# and prints out various quanities for each detector element.
+#
+###############################################################
+
+
+# Use Global flags and DetFlags.
+from AthenaCommon.DetFlags import DetFlags
+from AthenaCommon.GlobalFlags import globalflags
+
+# Just the pixel and SCT
+DetFlags.detdescr.pixel_setOn()
+DetFlags.detdescr.SCT_setOn()
+
+# MC or data - affects which conditions database instance is used
+globalflags.DataSource='geant4'
+#globalflags.DataSource='data'
+
+# Select the geometry version. 
+globalflags.DetDescrVersion='ATLAS-GEO-08-00-00'
+
+# For misalignments
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag('OFLCOND-CSC-00-01-00')
+
+# Initialize geometry
+from AtlasGeoModel import GeoModelInit
+from AtlasGeoModel import SetGeometryVersion
+
+# Use MagneticFieldSvc
+include( "BFieldAth/BFieldAth_jobOptions.py" )
+
+# Set up the job.
+from AthenaCommon.AlgSequence import AlgSequence
+job = AlgSequence()
+
+# Load algorithms
+
+from InDetDetDescrExample.InDetDetDescrExampleConf import ReadSiDetectorElements
+
+ReadPixelElements = ReadSiDetectorElements("ReadPixelElements")
+ReadPixelElements.ManagerName = "Pixel"
+job += ReadPixelElements;
+
+ReadSCTElements = ReadSiDetectorElements("ReadSCTElements")
+ReadSCTElements.ManagerName = "SCT"
+job += ReadSCTElements;
+
+
+#
+# Configure services
+#
+from AthenaCommon.AppMgr import ServiceMgr
+
+#
+# Both pixel and SCT
+#
+from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc
+from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc;
+
+#
+# Pixel
+#
+# Load DCS service
+include( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" )
+
+## Silicon conditions service (set up by LorentzAngleSvcSetup)
+pixelSiliconConditionsSvc = lorentzAngleSvc.PixelSiliconConditionsSvc
+## Or directly from ServiceMgr (its the same instance)
+#pixelSiliconConditionsSvc=ServiceMgr.PixelSiliconConditionsSvc
+## Or if you want a different instance than used by LorentzAngleSvcSetup
+#from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc
+#pixelSiliconConditionsSvc = PixelSiliconConditionsSvc("OtherPixel_SiliconConditionsSvc")
+#ServiceMgr += pixelSiliconConditionsSvc
+
+# Silicon properties service
+pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",
+                                     DetectorName="Pixel",
+                                     SiConditionsServices = pixelSiliconConditionsSvc)
+ServiceMgr += pixelSiPropertiesSvc
+
+ReadPixelElements.SiLorentzAngleSvc = lorentzAngleSvc.pixel
+ReadPixelElements.SiPropertiesSvc   = pixelSiPropertiesSvc
+ReadPixelElements.SiConditionsSvc   = pixelSiliconConditionsSvc
+
+
+#
+# SCT
+#
+# Load DCS service
+conddb.addFolder("DCS_OFL","/SCT/DCS/CHANSTAT")
+conddb.addFolder("DCS_OFL","/SCT/DCS/MODTEMP")
+conddb.addFolder("DCS_OFL","/SCT/DCS/HV")
+from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc
+InDetSCT_DCSConditionsSvc = SCT_DCSConditionsSvc(name = "InDetSCT_DCSConditionsSvc")
+ServiceMgr += InDetSCT_DCSConditionsSvc
+
+## Silicon conditions service (set up by LorentzAngleSvcSetup)
+sctSiliconConditionsSvc = lorentzAngleSvc.SCT_SiliconConditionsSvc
+## Or directly from ServiceMgr (its the same instance)
+# sctSiliconConditionsSvc = ServiceMgr.SCT_SiliconConditionsSvc
+## Or if you want a different instance than used by LorentzAngleSvcSetup
+#from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_SiliconConditionsSvc
+#sctSiliconConditionsSvc=SCT_SiliconConditionsSvc("OtherSCT_SiliconConditionsSvc")
+#ServiceMgr += sctSiliconConditionsSvc
+
+# Silicon properties service
+sctSiPropertiesSvc = SiPropertiesSvc(name = "SCT_SiPropertiesSvc",
+                                   DetectorName="SCT",
+                                   SiConditionsServices = sctSiliconConditionsSvc)
+ServiceMgr += sctSiPropertiesSvc
+
+ReadSCTElements.SiLorentzAngleSvc = lorentzAngleSvc.sct
+ReadSCTElements.SiPropertiesSvc   = sctSiPropertiesSvc
+ReadSCTElements.SiConditionsSvc   = sctSiliconConditionsSvc
+
+
+print ReadPixelElements
+print lorentzAngleSvc.pixel
+print pixelSiliconConditionsSvc
+print pixelSiPropertiesSvc
+
+print ReadSCTElements
+print lorentzAngleSvc.sct
+print sctSiliconConditionsSvc
+print sctSiPropertiesSvc
+
+
+#--------------------------------------------------------------
+# Set output level threshold (DEBUG, INFO, WARNING, ERROR, FATAL)
+#--------------------------------------------------------------
+job.ReadPixelElements.OutputLevel = INFO
+job.ReadSCTElements.OutputLevel = INFO
+
+# To set global output level use 
+# athena -l DEBUG
+
+# Number of events to be processed (default is 10)
+theApp.EvtMax = 1
+
+# ReadSiDetectorElement properties
+#
+# ManagerName:      Manager name.
+# LoopOverElements: Set false to avoid loop over all elements
+#
+###############################################################
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadTRT_DetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadTRT_DetectorElements_jobOptions.py
new file mode 100755
index 000000000000..3dea53c20ced
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadTRT_DetectorElements_jobOptions.py
@@ -0,0 +1,56 @@
+###############################################################
+#
+# Loads Detector Description for the TRT
+# and prints out various quanities for each detector element.
+#
+###############################################################
+
+
+# Use Global flags and DetFlags.
+from AthenaCommon.DetFlags import DetFlags
+from AthenaCommon.GlobalFlags import globalflags
+
+# Just the TRT
+DetFlags.detdescr.TRT_setOn()
+
+# MC or data - affects which conditions database instance is used
+globalflags.DataSource='geant4'
+#globalflags.DataSource='data'
+
+# Select the geometry version. 
+globalflags.DetDescrVersion='ATLAS-GEO-08-00-00'
+
+# For misalignments
+from IOVDbSvc.CondDB import conddb
+conddb.setGlobalTag('OFLCOND-CSC-00-01-00')
+
+# Initialize geometry
+from AtlasGeoModel import GeoModelInit
+from AtlasGeoModel import SetGeometryVersion
+
+# Use MagneticFieldSvc
+include( "BFieldAth/BFieldAth_jobOptions.py" )
+
+# Set up the job.
+from AthenaCommon.AlgSequence import AlgSequence
+job = AlgSequence()
+
+# Load algorithms
+
+from InDetDetDescrExample.InDetDetDescrExampleConf import ReadTRT_DetectorElements
+
+job += ReadTRT_DetectorElements()
+print job.ReadTRT_DetectorElements
+
+#--------------------------------------------------------------
+# Set output level threshold (DEBUG, INFO, WARNING, ERROR, FATAL)
+#--------------------------------------------------------------
+job.ReadTRT_DetectorElements = INFO
+
+# To set global output level use 
+# athena -l DEBUG
+
+# Number of events to be processed (default is 10)
+theApp.EvtMax = 1
+
+###############################################################
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/src/components/InDetGeometryValidation_load.cxx b/InnerDetector/InDetValidation/InDetGeometryValidation/src/components/InDetGeometryValidation_load.cxx
new file mode 100644
index 000000000000..d76fd7ddb3aa
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/src/components/InDetGeometryValidation_load.cxx
@@ -0,0 +1,4 @@
+#include "GaudiKernel/LoadFactoryEntries.h"
+
+LOAD_FACTORY_ENTRIES(InDetGeometryValidation)
+
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_Test.sh b/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_Test.sh
new file mode 100755
index 000000000000..0cb28d712efb
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_Test.sh
@@ -0,0 +1,4 @@
+echo "## Running in $PWD"
+cd ../../../InnerDetector/InDetValidation/InDetGeometryValidation/cmt/
+gmake
+exit
diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_TestConfiguration.xml b/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_TestConfiguration.xml
new file mode 100644
index 000000000000..067c7553b351
--- /dev/null
+++ b/InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_TestConfiguration.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0"?>
+<!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd">   
+<unifiedTestConfiguration> 
+<atn>
+   <TEST name="InDetGeometryValidation" type="script" suite="Examples">
+     <options_atn>InnerDetector/InDetValidation/InDetGeometryValidation/test/InDetGeometryValidation_Test.sh</options_atn>
+     <author>Atlas Developer</author>
+     <mailto>hays@physics.ox.ac.uk</mailto>
+      <expectations>
+         <returnValue>0</returnValue>
+      </expectations>
+   </TEST>
+
+   <TEST name="InDetGeometryValidation" type="athena" suite="Examples">
+     <options_atn>InDetGeometryValidation/ReadSiDetectorElements_jobOptions.py</options_atn>
+     <timelimit>3</timelimit>
+     <author>Atlas Developer</author>
+     <mailto>hays@physics.ox.ac.uk</mailto>
+      <expectations>
+         <errorMessage>ERROR</errorMessage>
+         <returnValue>0</returnValue>
+      </expectations>
+   </TEST>
+
+   <TEST name="InDetGeometryValidation" type="athena" suite="Examples">
+     <options_atn>InDetGeometryValidation/ReadTRT_DetectorElements_jobOptions.py</options_atn>
+     <timelimit>3</timelimit>
+     <author>Atlas Developer</author>
+     <mailto>hays@physics.ox.ac.uk</mailto>
+      <expectations>
+         <errorMessage>ERROR</errorMessage>
+         <returnValue>0</returnValue>
+      </expectations>
+   </TEST>
+
+</atn>
+</unifiedTestConfiguration>
-- 
GitLab