From dee043abc8cd954deec5f1af3cb24e88f0ccee06 Mon Sep 17 00:00:00 2001
From: Dave Casper <dcasper@uci.edu>
Date: Fri, 13 Sep 2019 22:19:03 +0000
Subject: [PATCH] Revert "Check that the CI test fails when it should"

This reverts commit 2d94dbebb3d92c1f3c65855f9bab70744a706fad.
---
 .gitlab-ci.yml                                |   3 +-
 .../FaserAuthentication/data/dblookup.xml     |   1 +
 .../GeoModel/FaserGeoModel/CMakeLists.txt     |   3 +-
 .../GeoModel/FaserGeoModel/data/geomDB.sql    |   2 +-
 .../test/FaserGeometryConfig_EVNT_test.py     |   4 +-
 .../GeoModel/GeoModelTest/CMakeLists.txt      |   6 +-
 .../GeoModelTest/python/GeoModelTestConfig.py |  25 ++--
 .../GeoModelTest/src/GeoModelTestAlg.cxx      | 124 +++++++++++++++---
 .../GeoModelTest/src/GeoModelTestAlg.h        |   9 +-
 .../ScintDetectorManager.h                    |  10 --
 .../VetoDetectorManager.h                     |   9 +-
 .../src/VetoDetectorManager.cxx               |  43 ------
 .../VetoGeoModel/python/VetoGeoModelConfig.py |   6 +
 .../VetoGeoModel/src/VetoPlate.cxx            |   2 +-
 Simulation/G4Faser/G4FaserApp/CMakeLists.txt  |   3 +-
 Simulation/G4Faser/G4FaserApp/test/runG4.py   |   3 +-
 .../python/FaserSCT_GeoModelConfig.py         |   8 ++
 17 files changed, 159 insertions(+), 102 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 654fe4da..2d012143 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -42,6 +42,7 @@ test_unittest:
     - cd build
     - set +e && source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh; set -e
     - set +e && asetup master,latest,Athena; set -e
-    - ctest -j12
+    - set +e && source `find . -name 'setup.sh'`; set -e
+    - ctest -j12 
   dependencies:
     - build_image
\ No newline at end of file
diff --git a/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml b/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml
index 5c2e59b4..6254c549 100644
--- a/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml
+++ b/Database/ConnectionManagement/FaserAuthentication/data/dblookup.xml
@@ -3,6 +3,7 @@
 
 <logicalservice name="FASERDD">
  <service name="sqlite_file:data/geomDB_sqlite" accessMode="read" />
+ <service name="sqlite_file:DetectorDescription/GeoModel/FaserGeoModel/geomDB_sqlite" accessMode="read" />
 </logicalservice>
 
 </servicelist>
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt b/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt
index c3facd1d..2e739f4f 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt
+++ b/DetectorDescription/GeoModel/FaserGeoModel/CMakeLists.txt
@@ -27,4 +27,5 @@ atlas_install_scripts( test/*.py )
 
 atlas_add_test( EVNT_InputGeo_test
                 SCRIPT test/FaserGeometryConfig_EVNT_test.py
-                PROPERTIES TIMEOUT 300 )
+                PROPERTIES TIMEOUT 300 
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
index 7aeeeedc..738ea5cb 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
+++ b/DetectorDescription/GeoModel/FaserGeoModel/data/geomDB.sql
@@ -989,7 +989,7 @@ INSERT INTO "VETOTOPLEVEL_DATA2TAG" VALUES (100009, 2);
 INSERT INTO "VETOSTATIONGENERAL_DATA" VALUES (0, 2, 100.0);
 INSERT INTO "VETOSTATIONGENERAL_DATA2TAG" VALUES (100010, 0);
 --
-INSERT INTO "VETOPLATEGENERAL_DATA" VALUES (0, 2, 300.0, 300.0, 20.0, "scint::Scintillator");
+INSERT INTO "VETOPLATEGENERAL_DATA" VALUES (0, 1, 300.0, 300.0, 20.0, "scint::Scintillator");
 INSERT INTO "VETOPLATEGENERAL_DATA2TAG" VALUES (100025, 0);
 --
 INSERT INTO "SCINTMATERIALS_DATA" VALUES (0, "Scintillator", 1.032);
diff --git a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
index 15e91a51..cc1d174d 100644
--- a/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
+++ b/DetectorDescription/GeoModel/FaserGeoModel/test/FaserGeometryConfig_EVNT_test.py
@@ -5,13 +5,13 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
 """
 if __name__ == "__main__":
     import os
+    import sys
     from AthenaCommon.Logging import log
     from AthenaCommon.Constants import VERBOSE, INFO
     from AthenaCommon.Configurable import Configurable
     from CalypsoConfiguration.AllConfigFlags import ConfigFlags
     from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
     from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
-    # from AtlasGeoModel.AtlasGeoModelConfig import AtlasGeometryCfg
     # Set up logging and new style config
     from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
     log.setLevel(VERBOSE)
@@ -50,4 +50,4 @@ if __name__ == "__main__":
     f.close()
     ConfigFlags.dump()
     # Execute and finish
-    acc.run(maxEvents=3)
+    sys.exit(int(acc.run(maxEvents=3).isFailure()))
diff --git a/DetectorDescription/GeoModel/GeoModelTest/CMakeLists.txt b/DetectorDescription/GeoModel/GeoModelTest/CMakeLists.txt
index 6072a5a2..59715098 100644
--- a/DetectorDescription/GeoModel/GeoModelTest/CMakeLists.txt
+++ b/DetectorDescription/GeoModel/GeoModelTest/CMakeLists.txt
@@ -23,8 +23,12 @@ atlas_add_component( GeoModelTest
                      INCLUDE_DIRS ${GEOMODEL_INCLUDE_DIRS}
                      LINK_LIBRARIES ${GEOMODEL_LIBRARIES} AthenaBaseComps GeoModelUtilities ScintReadoutGeometry )
 
+atlas_add_test( GeoModelCheck
+                SCRIPT python/GeoModelTestConfig.py
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+                PROPERTIES TIMEOUT 300 )
+
 # Install files from the package:
 #atlas_install_headers( GeoModelTest )
 atlas_install_joboptions( share/*.py )
 atlas_install_python_modules( python/*.py )
-
diff --git a/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py b/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py
index 0e516aaf..8b0d37d4 100644
--- a/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py
+++ b/DetectorDescription/GeoModel/GeoModelTest/python/GeoModelTestConfig.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+import sys
 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
 
 def GeoModelTestCfg(flags):
@@ -12,23 +14,20 @@ def GeoModelTestCfg(flags):
 
 
 if __name__ == "__main__":
-    from AthenaCommon.Logging import log, logging
+    # from AthenaCommon.Logging import log, logging
     from AthenaCommon.Constants import VERBOSE, INFO
-    log.setLevel(VERBOSE)
+    # log.setLevel(VERBOSE)
 
     from AthenaCommon.Configurable import Configurable
     Configurable.configurableRun3Behavior = True
 # Flag definition
-    from AthenaConfiguration.AllConfigFlags import ConfigFlags
-    ConfigFlags.addFlag("GeoModel.FaserVersion", "Faser-00")
-    ConfigFlags.addFlag("GeoModel.GeoExportFile", "")
-    ConfigFlags.addFlag("Detector.SimulateVeto", True)
+    from CalypsoConfiguration.AllConfigFlags import ConfigFlags
 # Flag specification
     ConfigFlags.GeoModel.FaserVersion     = "FASER-00"
     ConfigFlags.GeoModel.GeoExportFile    = "faserGeo.db"
     ConfigFlags.GeoModel.Align.Dynamic    = False
     ConfigFlags.lock()
-    ConfigFlags.dump()
+    # ConfigFlags.dump()
 
 # Configuration
     from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
@@ -37,11 +36,9 @@ if __name__ == "__main__":
     acc = MainServicesSerialCfg()
     # acc.merge(PoolReadCfg(ConfigFlags))
     acc.merge(GeoModelTestCfg(ConfigFlags))
-
-    logging.getLogger('forcomps').setLevel(VERBOSE)
-    acc.foreach_component("*").OutputLevel = VERBOSE
-    acc.foreach_component("*ClassID*").OutputLevel = INFO
+    # logging.getLogger('forcomps').setLevel(VERBOSE)
+    # acc.foreach_component("*").OutputLevel = VERBOSE
+    # acc.foreach_component("*ClassID*").OutputLevel = INFO
     
-    acc.printConfig(withDetails=True)
-    # Execute and finish
-    acc.run(maxEvents=1)
+# Execute and finish
+    sys.exit(int(acc.run(maxEvents=1).isFailure()))
diff --git a/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.cxx b/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.cxx
index 1c2beaf6..219082c5 100644
--- a/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.cxx
+++ b/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.cxx
@@ -4,6 +4,7 @@
 #include "GeoModelUtilities/GeoModelExperiment.h"
 
 #include "ScintReadoutGeometry/VetoDetectorManager.h"
+#include "ScintReadoutGeometry/ScintDetectorElement.h"
 #include "ScintIdentifier/VetoID.h"
 
 
@@ -37,35 +38,30 @@ StatusCode GeoModelTestAlg::execute()
             }
             else
             {
-                ATH_MSG_ALWAYS("Failed to retrieve manager " << mgr);
+                ATH_MSG_FATAL("Failed to retrieve manager " << mgr);
                 return StatusCode::FAILURE;
             }
         }
     }
     else
     {
-        ATH_MSG_ALWAYS("Failed to retrieve top-level FASER experiment geometry from DetStore.");
+        ATH_MSG_FATAL("Failed to retrieve top-level FASER experiment geometry from DetStore.");
         return StatusCode::FAILURE;
     }
 
-    // Test direct retrieval of typed managers from DetStore
-    const ScintDD::VetoDetectorManager* vetoMgr = nullptr;
-    ATH_CHECK(detStore()->retrieve(vetoMgr, "Veto"));
-    if (vetoMgr != nullptr)
-    {
-        ATH_MSG_ALWAYS("Retrieved (typed) Veto detector manager with " << vetoMgr->getNumTreeTops() << " treetops directly from DetStore.");
-    }
-    else
-    {
-        ATH_MSG_ALWAYS("Failed to retrieve (typed) Veto detector manager directly from DetStore.");
-        return StatusCode::FAILURE;
-    }
+    ATH_CHECK(testVeto());
+
+    return StatusCode::SUCCESS;
+}
 
-    // Test neighbors
+StatusCode GeoModelTestAlg::testVeto()
+{
+    // Test retrieval of helper object directly from store
     const VetoID* helper = nullptr;
     ATH_CHECK(detStore()->retrieve(helper, "VetoID"));
     if (helper != nullptr)
     {
+        // Test neighbors with helper function
         const IdContext& context = helper->plate_context();
         ATH_MSG_ALWAYS("Retrieved VetoID helper from DetStore.");
         for (int iStation = 0; iStation < 2; iStation++)
@@ -85,6 +81,13 @@ StatusCode GeoModelTestAlg::execute()
                 int prevStat = helper->get_prev_in_z(thisHash, prevHash);
                 if (prevStat == 0) 
                 {
+                    IdentifierHash testHash;
+                    int nextStat = helper->get_next_in_z(prevHash, testHash);
+                    if (nextStat != 0 || testHash != thisHash)
+                    {
+                        ATH_MSG_FATAL("Next (" << testHash << ") of previous (" << prevHash << ") is not the original (" << thisHash <<")" );
+                        return StatusCode::FAILURE;
+                    }
                     prevStat = helper->get_id(prevHash, prevId, &context);
                     if (prevStat == 0)
                     {
@@ -95,6 +98,13 @@ StatusCode GeoModelTestAlg::execute()
                 int nextStat = helper->get_next_in_z(thisHash, nextHash);
                 if (nextStat == 0) 
                 {
+                    IdentifierHash testHash;
+                    prevStat = helper->get_prev_in_z(nextHash, testHash);
+                    if (prevStat != 0 || testHash != thisHash)
+                    {
+                        ATH_MSG_FATAL("Previous (" << testHash << ") of next (" << nextHash << ") is not the original (" << thisHash <<")" );
+                        return StatusCode::FAILURE;
+                    }
                     nextStat = helper->get_id(nextHash, nextId, &context);
                     if (nextStat == 0)
                     {
@@ -111,14 +121,94 @@ StatusCode GeoModelTestAlg::execute()
     }
     else
     {
-        ATH_MSG_ALWAYS("Failed to retrieve VetoID helper from DetStore.");
+        ATH_MSG_FATAL("Failed to retrieve VetoID helper from DetStore.");
         return StatusCode::FAILURE;
     }
 
-
+    // Test direct retrieval of typed managers from DetStore
+    const ScintDD::VetoDetectorManager* vetoMgr = nullptr;
+    ATH_CHECK(detStore()->retrieve(vetoMgr, "Veto"));
+    if (vetoMgr != nullptr)
+    {
+        ATH_MSG_ALWAYS("Retrieved (typed) Veto detector manager with " << vetoMgr->getNumTreeTops() << " treetops directly from DetStore.");
+        // Compare numerology with the "right" answers from our properties
+        if (vetoMgr->numerology().numStations() != m_numVetoStations || vetoMgr->getNumTreeTops() != m_numVetoStations)
+        {
+            ATH_MSG_FATAL("Disagreement in number of veto stations.");
+            return StatusCode::FAILURE;
+        }
+        if (vetoMgr->numerology().numPlatesPerStation() != m_numVetoPlatesPerStation)
+        {
+            ATH_MSG_FATAL("Disagreement in number of plates per veto station.");
+            return StatusCode::FAILURE;
+        }
+        if (vetoMgr->numerology().numPmtsPerPlate() != m_numVetoPmtsPerPlate)
+        {
+            ATH_MSG_FATAL("Disagreement in number of pmts per veto plate.");
+            return StatusCode::FAILURE;
+        }
+        // Test detector elements
+        const ScintDD::ScintDetectorElementCollection* elements = vetoMgr->getDetectorElementCollection();
+        for (int station = 0; station < m_numVetoStations; station++)
+        {
+            for (int plate = 0; plate < m_numVetoPlatesPerStation; plate++)
+            {
+                Identifier id = helper->plate_id(station, plate, true);
+                if (!vetoMgr->identifierBelongs(id))
+                {
+                    ATH_MSG_FATAL("Valid Veto identifier does not pass identifierBelongs.");
+                    return StatusCode::FAILURE;
+                }
+                IdentifierHash hash = helper->plate_hash(id);
+                ScintDD::ScintDetectorElement* elementByLevels = vetoMgr->getDetectorElement(station, plate);
+                ScintDD::ScintDetectorElement* elementById = vetoMgr->getDetectorElement(id);
+                ScintDD::ScintDetectorElement* elementByHash = vetoMgr->getDetectorElement(hash);
+                ScintDD::ScintDetectorElement* element = (*elements)[hash];
+                if (elementByLevels != element || elementById != element || elementByHash != element)
+                {
+                    ATH_MSG_FATAL("Inconsistent retrieval of Veto detector elements");
+                    return StatusCode::FAILURE;
+                }
+                ATH_MSG_ALWAYS("Found Veto plate (" << station << ", " << plate << ") with global center at (" << 
+                    element->center().x() << ", " <<
+                    element->center().y() << ", " <<
+                    element->center().z() << ")."
+                    );
+                const ScintDD::ScintDetectorElement* next = element->nextInZ();
+                if (next != nullptr)
+                {
+                    if (next->prevInZ() != element)
+                    {
+                        ATH_MSG_FATAL("Previous neighbor of next Veto element is not this element.");
+                        return StatusCode::FAILURE;
+                    }
+                }
+                const ScintDD::ScintDetectorElement* prev = element->prevInZ();
+                if (prev != nullptr)
+                {
+                    if (prev->nextInZ() != element)
+                    {
+                        ATH_MSG_FATAL("Next neighbor of previous Veto element is not this element.");
+                        return StatusCode::FAILURE;
+                    }
+                }
+                if (next == nullptr && prev == nullptr)
+                {
+                    ATH_MSG_FATAL("Veto element " << hash << " has no previous OR next neighbor.");
+                    return StatusCode::FAILURE;
+                }
+            }
+        }
+    }
+    else
+    {
+        ATH_MSG_FATAL("Failed to retrieve (typed) Veto detector manager directly from DetStore.");
+        return StatusCode::FAILURE;
+    }
     return StatusCode::SUCCESS;
 }
 
+
 StatusCode GeoModelTestAlg::finalize()
 {
 
diff --git a/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.h b/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.h
index 866968b1..f70dd6fb 100644
--- a/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.h
+++ b/DetectorDescription/GeoModel/GeoModelTest/src/GeoModelTestAlg.h
@@ -12,5 +12,12 @@ class GeoModelTestAlg : public AthAlgorithm
     StatusCode initialize();
     StatusCode execute();
     StatusCode finalize();
-    
+
+    private:  
+    StatusCode testVeto();
+
+    // Independently specify the "right" number of elements, for comparison with what we get from detector store
+    Gaudi::Property<int>            m_numVetoStations           {this, "NumVetoStations", 2, "Number of stations in the Veto detector"};
+    Gaudi::Property<int>            m_numVetoPlatesPerStation   {this, "NumVetoPlatesPerStation", 2, "Number of plates per station in the Veto detector"};
+    Gaudi::Property<int>            m_numVetoPmtsPerPlate       {this, "NumVetoPmtsPerPlate", 1, "Number of pmts per plate in the Veto detector"};
 };
\ No newline at end of file
diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManager.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManager.h
index b53ca47e..d357c752 100644
--- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManager.h
+++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/ScintDetectorManager.h
@@ -88,13 +88,6 @@ class ScintNumerology;
       /** Get tag used in dictionary */
       const std::string & tag() const; 
     
-    //   /** Methods to query which manager we have */
-    //   virtual bool isPixel() const = 0;
-    //   bool isSCT() const {return !isPixel();}
-     
-      /** Add alignable transforms. No access to these, they will be changed by manager: */
-      // virtual void addAlignableTransform (int level, const Identifier &id, GeoAlignableTransform *xf) = 0;
-    
       /** Invalidate cache for all detector elements */
       virtual void invalidateAll() const;
     
@@ -114,9 +107,6 @@ class ScintNumerology;
                                            GeoVAlignmentStore* alignStore=nullptr) const;
     
       /** Access to module design */
-      // void addDesign(const ScintDetectorDesign *);
-      // int numDesigns() const;
-      // const ScintDetectorDesign * getDesign(int i) const;
     
       void setDesign(const ScintDetectorDesign*);
       const ScintDetectorDesign* getDesign() const;
diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoDetectorManager.h b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoDetectorManager.h
index 9c64091a..1f8e8769 100644
--- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoDetectorManager.h
+++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/ScintReadoutGeometry/VetoDetectorManager.h
@@ -43,6 +43,7 @@ namespace ScintDD {
       
       @author: Grant Gorfine
       - modified and maintained by Nick Styles & Andreas Salzburger
+      - modified for FASER by D. Casper
       */
       
   class VetoDetectorManager : public ScintDetectorManager  {
@@ -95,16 +96,9 @@ namespace ScintDD {
     				                      GeoAlignableTransform *xf,
     				                      const GeoVPhysVol * child); 
     
-      // DEPRECATED
-      // virtual void addAlignableTransform (int, const Identifier &, GeoAlignableTransform *) override {}; // For backward compatibility
-    
       /** Initialize the neighbours. This can only be done when all elements are built. */
       virtual void initNeighbours() override;
 
-    //   /** Methods to query which manager we have */
-    //   virtual bool isPixel() const = 0;
-    //   bool isSCT() const {return !isPixel();}
-
       /** Check identifier is for this detector */
       virtual bool identifierBelongs(const Identifier & id) const override;
     
@@ -148,7 +142,6 @@ namespace ScintDD {
       typedef std::map<Identifier, ExtendedAlignableTransform *>    AlignableTransformMap;
       std::vector< AlignableTransformMap >                          m_higherAlignableTransforms;
       std::vector< ExtendedAlignableTransform *>                    m_alignableTransforms; 
-      // std::vector< ExtendedAlignableTransform *>                    m_moduleAlignableTransforms; 
       const VetoID*                                                 m_idHelper;
       
       /** This variable switches the how the local alignment corrections are applied
diff --git a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoDetectorManager.cxx b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoDetectorManager.cxx
index 61d6030d..e59ea9c1 100644
--- a/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoDetectorManager.cxx
+++ b/Scintillator/ScintDetDescr/ScintReadoutGeometry/src/VetoDetectorManager.cxx
@@ -201,42 +201,6 @@ namespace ScintDD {
         ATH_MSG_WARNING("Frames other than global or local are not supported.");
         return false;
       }
-    // } else if (level == 1) { // module level
-
-    //   // We retrieve it via a hashId.
-    //   IdentifierHash idHash = m_idHelper->plate_hash(id);
-    //   if (!idHash.is_valid()) return false;
-
-    // int idModuleHash = idHash;
-    // //   int idModuleHash = idHash / 2;
-
-    // //   if (idHash%2) {
-    // //     ATH_MSG_WARNING("Side 1 wafer id used for module id");
-    // //     return false;
-    // //   }
-
-    //   if (frame == ScintDD::global) { // global shift
-    //     // Its a global transform
-    //     return setAlignableTransformGlobalDelta(m_moduleAlignableTransforms[idModuleHash], delta, alignStore);
-    //   } else if (frame == ScintDD::local) { // local shift
-    //     ScintDetectorElement * element =  m_elementCollection[idHash];
-    //     if (!element) return false;
-       
-    //     // Its a local transform
-    //     //See header file for definition of m_isLogical          
-    //     if( m_isLogical ){
-    //       //Ensure cache is up to date and use the alignment corrected local to global transform
-    //       element->setCache();
-    //       return setAlignableTransformLocalDelta(m_moduleAlignableTransforms[idModuleHash], element->plateTransform(), delta, alignStore);
-    //     } else 
-    //       //Use default local to global transform
-    //       return setAlignableTransformLocalDelta(m_moduleAlignableTransforms[idModuleHash],element->defPlateTransform(), delta, alignStore);
-
-    //   } else {
-    //     // other not supported
-    //     ATH_MSG_WARNING("Frames other than global or local are not supported.");
-    //     return false;
-    //   }
     } else { // higher level
       if (frame != ScintDD::global) {
         ATH_MSG_WARNING("Non global shift at higher levels is not supported.");
@@ -284,13 +248,6 @@ namespace ScintDD {
         if (idHash.is_valid()) {
           m_alignableTransforms[idHash]= new ExtendedAlignableTransform(transform, child);
         } 
-      // } else if (level == 1) {
-      //   // Module
-      //   IdentifierHash idHash = m_idHelper->plate_hash(id);
-      //   if (idHash.is_valid()) {
-      //   //   m_moduleAlignableTransforms[idHash/2]=new ExtendedAlignableTransform(transform, child);
-      //     m_moduleAlignableTransforms[idHash]=new ExtendedAlignableTransform(transform, child);
-      //   } 
       } else {
         // Higher levels are saved in a map. NB level=0 is treated above.   
         int index = level - FIRST_HIGHER_LEVEL; // level 0 is treated separately.
diff --git a/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py b/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py
index 6e942ae3..fe6dca0b 100644
--- a/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py
+++ b/Scintillator/ScintDetDescr/VetoGeoModel/python/VetoGeoModelConfig.py
@@ -20,6 +20,12 @@ def VetoGeometryCfg( flags ):
     from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
     acc.addService(GeometryDBSvc("ScintGeometryDBSvc"))
 
+    from RDBAccessSvc.RDBAccessSvcConf import RDBAccessSvc
+    acc.addService(RDBAccessSvc("RDBAccessSvc"))
+
+    from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc
+    acc.addService(DBReplicaSvc("DBReplicaSvc"))
+
     from VetoGeoModel.VetoGeoModelConf import VetoDetectorTool
     vetoDetectorTool = VetoDetectorTool()
 
diff --git a/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoPlate.cxx b/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoPlate.cxx
index 457336c3..9b32c4a1 100644
--- a/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoPlate.cxx
+++ b/Scintillator/ScintDetDescr/VetoGeoModel/src/VetoPlate.cxx
@@ -45,7 +45,7 @@ VetoPlate::getParameters()
   m_thickness = parameters->plateThickness();
   m_length = parameters->plateLength();
   m_width     = parameters->plateWidth();
-
+  m_detectorManager->numerology().setNumPmtsPerPlate(parameters->platePmts());
 }
 
 const GeoLogVol * 
diff --git a/Simulation/G4Faser/G4FaserApp/CMakeLists.txt b/Simulation/G4Faser/G4FaserApp/CMakeLists.txt
index 02b9a8f5..8382ef9a 100644
--- a/Simulation/G4Faser/G4FaserApp/CMakeLists.txt
+++ b/Simulation/G4Faser/G4FaserApp/CMakeLists.txt
@@ -47,7 +47,8 @@ find_package( Eigen )
 
 atlas_add_test( G4FaserAlgConfig_Test
                 SCRIPT test/runG4.py
-                PROPERTIES TIMEOUT 300 )
+                PROPERTIES TIMEOUT 300 
+                PROPERTIES WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
 
 # Install files from the package:
 atlas_install_python_modules( python/*.py )
diff --git a/Simulation/G4Faser/G4FaserApp/test/runG4.py b/Simulation/G4Faser/G4FaserApp/test/runG4.py
index 5a27b8c6..311e0e09 100644
--- a/Simulation/G4Faser/G4FaserApp/test/runG4.py
+++ b/Simulation/G4Faser/G4FaserApp/test/runG4.py
@@ -1,6 +1,7 @@
 #!/usr/bin/env python
 if __name__ == "__main__":
     import os
+    import sys
     import GaudiPython
     import ParticleGun as PG
     from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
@@ -134,4 +135,4 @@ if __name__ == "__main__":
 #
 # Execute and finish
 #
-    acc.run(maxEvents=1000)
+    sys.exit(int(acc.run(maxEvents=1000).isFailure()))
diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py
index ad3cc847..647e449c 100644
--- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py
+++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/python/FaserSCT_GeoModelConfig.py
@@ -17,8 +17,16 @@ def FaserSCT_GeometryCfg( flags ):
     from FaserGeoModel.GeoModelConfig import GeoModelCfg
     acc = GeoModelCfg( flags )
     geoModelSvc=acc.getPrimary()
+    
     from GeometryDBSvc.GeometryDBSvcConf import GeometryDBSvc
     acc.addService(GeometryDBSvc("TrackerGeometryDBSvc"))
+    
+    from RDBAccessSvc.RDBAccessSvcConf import RDBAccessSvc
+    acc.addService(RDBAccessSvc("RDBAccessSvc"))
+
+    from DBReplicaSvc.DBReplicaSvcConf import DBReplicaSvc
+    acc.addService(DBReplicaSvc("DBReplicaSvc"))
+
     from FaserSCT_GeoModel.FaserSCT_GeoModelConf import FaserSCT_DetectorTool
     sctDetectorTool = FaserSCT_DetectorTool()
 
-- 
GitLab