diff --git a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt
index 1c5a6a250d17d322d65921bc2b0e57a691830961..11d692e0978ce22a18c076d918404cb77d0da99d 100644
--- a/Control/CalypsoExample/GeoModelTest/CMakeLists.txt
+++ b/Control/CalypsoExample/GeoModelTest/CMakeLists.txt
@@ -13,6 +13,7 @@ atlas_depends_on_subdirs( PRIVATE
                           Scintillator/ScintDetDescr/ScintReadoutGeometry
                           Tracker/TrackerDetDescr/TrackerReadoutGeometry
                           MagneticField/MagFieldInterfaces
+                          Tracker/TrackerAlignTools/TrackerAlignGenTools
                         )
 
 # External dependencies:
diff --git a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
index cf1c0cb22074e149daf4588ce88b5eca433da14d..e1e8363a42c4c065da3f594da17b7ef5dcc3ca77 100644
--- a/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
+++ b/Control/CalypsoExample/GeoModelTest/python/GeoModelTestConfig.py
@@ -1,7 +1,9 @@
 #!/usr/bin/env python
 import sys
 
-def GeoModelTestCfg(flags):
+def GeoModelTestCfg(flags, name="GeoModelTestAlg", **kwargs):
+
+    kwargs.setdefault("AlignDbTool", "TrackerAlignDBTool/DefaultAlignDBTool")
 
     from FaserGeoModel.FaserGeoModelConfig import FaserGeometryCfg
     a = FaserGeometryCfg(flags)
@@ -11,18 +13,20 @@ def GeoModelTestCfg(flags):
     fieldSvc = a.getService("FaserFieldSvc")
 
     from GeoModelTest.GeoModelTestConf import GeoModelTestAlg
-    a.addEventAlgo(GeoModelTestAlg())
-    a.getEventAlgo("GeoModelTestAlg").FieldService = fieldSvc
+    a.addEventAlgo(GeoModelTestAlg(name, **kwargs))
+    a.getEventAlgo(name).FieldService = fieldSvc
 
     return a
 
 
 if __name__ == "__main__":
     # from AthenaCommon.Logging import log, logging
-    #from AthenaCommon.Constants import VERBOSE, INFO
+    # from AthenaCommon.Constants import VERBOSE, INFO
     # log.setLevel(VERBOSE)
 
     from AthenaCommon.Configurable import Configurable
+    from AthenaConfiguration.ComponentFactory import CompFactory
+
     Configurable.configurableRun3Behavior = True
 # Flag definition
     from CalypsoConfiguration.AllConfigFlags import ConfigFlags
@@ -43,14 +47,20 @@ if __name__ == "__main__":
 # Configuration
     from AthenaConfiguration.MainServicesConfig import MainServicesSerialCfg
     # from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
+    from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
 
     acc = MainServicesSerialCfg()
     # acc.merge(PoolReadCfg(ConfigFlags))
-    acc.merge(GeoModelTestCfg(ConfigFlags))
+    acc.merge(PoolWriteCfg(ConfigFlags))
+    acc.merge(GeoModelTestCfg(ConfigFlags, 
+                              AlignDbTool=CompFactory.TrackerAlignDBTool("AlignDbTool", 
+                                        OutputTool = CompFactory.AthenaOutputStreamTool("DbStreamTool", 
+                                                         OutputFile = "myAlignDb.pool.root"))))
+    acc.getService("IOVDbSvc").dbConnection = "sqlite://;schema=ALLP200.db;dbname=OFLP200"                                                      
     acc.getService("PoolSvc").SortReplicas = False  # protects against random failures to find sqlite file
     # logging.getLogger('forcomps').setLevel(VERBOSE)
     # acc.foreach_component("*").OutputLevel = VERBOSE
     # acc.foreach_component("*ClassID*").OutputLevel = INFO
     
 # Execute and finish
-    sys.exit(int(acc.run(maxEvents=1).isFailure()))
+    sys.exit(int(acc.run(maxEvents=1).isFailure()))
\ No newline at end of file
diff --git a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx
index e93deaa7676f54a950bcaad40ba8b02192ce9b61..908a297185a7e81f586037592e0e68a00d35eb63 100644
--- a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx
+++ b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.cxx
@@ -22,6 +22,7 @@ GeoModelTestAlg::~GeoModelTestAlg() { }
 StatusCode GeoModelTestAlg::initialize()
 {
     ATH_CHECK(m_field.retrieve());
+    ATH_CHECK(m_alignTool.retrieve());
     return StatusCode::SUCCESS;
 }
 
@@ -62,6 +63,11 @@ StatusCode GeoModelTestAlg::execute()
 
     ATH_CHECK(testField());
 
+    ATH_CHECK(m_alignTool->createDB());
+    ATH_CHECK(m_alignTool->sortTrans());
+    ATH_CHECK(m_alignTool->outputObjs());
+    ATH_CHECK(m_alignTool->fillDB("",1,0,9999999,9999999));
+
     return StatusCode::SUCCESS;
 }
 
diff --git a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h
index 2f19d3fd76b6704102d6fa94ab378a9996e2ce4c..a7ad58486c8e2e2e17ef2dc0018026cda2bcfc08 100644
--- a/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h
+++ b/Control/CalypsoExample/GeoModelTest/src/GeoModelTestAlg.h
@@ -1,6 +1,7 @@
 #include "AthenaBaseComps/AthAlgorithm.h"
 
 #include "MagFieldInterfaces/IMagFieldSvc.h"
+#include "TrackerAlignGenTools/ITrackerAlignDBTool.h"
 
 // Minimalist algorithm to test retrieval of constructed geometry from DetStore
 
@@ -32,4 +33,6 @@ class GeoModelTestAlg : public AthAlgorithm
     Gaudi::Property<int>            m_numSctStripsPerSensor     {this, "NumSCTStripsPerSensor", 768,"Number of readout strips per sensor in the SCT detector"};
 
     ServiceHandle<MagField::IMagFieldSvc> m_field { this, "FieldService", "FaserFieldSvc" };
+
+    ToolHandle<ITrackerAlignDBTool> m_alignTool { this, "AlignDbTool", "TrackerAlignDBTool" };
 };
\ No newline at end of file
diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/CMakeLists.txt b/Tracker/TrackerAlignTools/TrackerAlignGenTools/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..a3a2597dc74438050f24130ca5116fa152f5e4f2
--- /dev/null
+++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/CMakeLists.txt
@@ -0,0 +1,60 @@
+################################################################################
+# Package: TrackerAlignGenTools
+################################################################################
+
+# Declare the package name:
+atlas_subdir( TrackerAlignGenTools )
+
+# Declare the package's dependencies:
+atlas_depends_on_subdirs( PUBLIC
+                          Control/AthenaBaseComps
+                          Control/AthenaKernel
+                          Database/AthenaPOOL/AthenaPoolUtilities
+                          DetectorDescription/GeoPrimitives
+                          DetectorDescription/Identifier
+#                          Event/EventPrimitives
+#                          InnerDetector/InDetAlignEvent/InDetAlignTrkInfo
+#                          InnerDetector/InDetAlignTools/InDetAlignToolInterfaces
+#                          InnerDetector/InDetRecEvent/InDetPrepRawData
+#                          Tracking/TrkEvent/TrkEventPrimitives
+#                          Tracking/TrkEvent/TrkEventUtils
+#                          Tracking/TrkEvent/TrkTrack
+#                          Tracking/TrkExtrapolation/TrkExInterfaces
+#                          Tracking/TrkTools/TrkToolInterfaces
+                          Event/EventContainers
+                          PRIVATE
+                          Control/AthContainers
+                          Database/RegistrationServices
+                          DetectorDescription/FaserDetDescr
+                          DetectorDescription/DetDescrCond/DetDescrConditions
+                          GaudiKernel
+                          Tracker/TrackerDetDescr/TrackerIdentifier
+                          Tracker/TrackerDetDescr/TrackerReadoutGeometry
+#                          Simulation/G4Sim/TrackRecord
+#                          Tracking/TrkEvent/TrkMeasurementBase
+#                          Tracking/TrkEvent/TrkParameters
+#                          Tracking/TrkEvent/TrkPrepRawData
+#                          Tracking/TrkEvent/TrkRIO_OnTrack
+#                          Tracking/TrkEvent/TrkTrackSummary
+#                          Tracking/TrkEvent/TrkTruthData
+#                          Tracking/TrkFitter/TrkFitterInterfaces 
+                        )
+
+# External dependencies:
+find_package( CLHEP )
+find_package( CORAL COMPONENTS CoralBase CoralKernel RelationalAccess )
+find_package( Eigen )
+find_package( HepMC )
+find_package( HepPDT )
+
+# Component(s) in the package:
+atlas_add_component( TrackerAlignGenTools
+                     src/*.cxx
+                     src/components/*.cxx
+                     INCLUDE_DIRS ${CORAL_INCLUDE_DIRS} ${HEPPDT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
+                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives Identifier EventPrimitives AthenaKernel AthContainers FaserDetDescr DetDescrConditions GaudiKernel TrackerIdentifier TrackerReadoutGeometry )
+#                     LINK_LIBRARIES ${CORAL_LIBRARIES} ${HEPPDT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives Identifier EventPrimitives InDetAlignTrkInfo InDetPrepRawData TrkEventPrimitives TrkEventUtils TrkTrack TrkExInterfaces TrkToolInterfaces AthenaKernel AthContainers AtlasDetDescr DetDescrConditions GaudiKernel InDetIdentifier InDetReadoutGeometry TrkMeasurementBase TrkParameters TrkPrepRawData TrkRIO_OnTrack TrkTrackSummary TrkTruthData TrkFitterInterfaces EventContainers )
+
+# Install files from the package:
+atlas_install_headers( TrackerAlignGenTools )
+
diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/TrackerAlignGenTools/ITrackerAlignDBTool.h b/Tracker/TrackerAlignTools/TrackerAlignGenTools/TrackerAlignGenTools/ITrackerAlignDBTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..e5fa21744510f5ff33811b10a71359fbfb2f1e01
--- /dev/null
+++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/TrackerAlignGenTools/ITrackerAlignDBTool.h
@@ -0,0 +1,70 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRACKERALIGNTOOLS_ALIGNDBTOOL_IH
+#define TRACKERALIGNTOOLS_ALIGNDBTOOL_IH
+// ITrackerAlignDBTool.h
+// an AlgTool to manage the tracker alignment database classes
+// abstract interface class, actual implementation and doc 
+// is in TrackerAlignDBTool.h
+// Richard Hawkings, started 11/4/05
+
+#include "GaudiKernel/IAlgTool.h"
+#include "EventPrimitives/EventPrimitives.h"
+#include "GeoPrimitives/GeoPrimitives.h"
+
+
+class Identifier;
+
+static const InterfaceID 
+IID_TRACKERALIGN_ITrackerAlignDBTool("ITrackerAlignDBTool",1,0);
+
+class ITrackerAlignDBTool: virtual public IAlgTool {
+ public:
+  static const InterfaceID& interfaceID();
+
+  virtual StatusCode createDB() const =0;
+//   virtual void dispGroup(const int, const int, const int, const int, const int,
+//                       const float, const float, const float, 
+//                       const int, const int, const int) const =0;
+
+//   virtual void writeFile(const bool, const std::string) const =0;
+//   virtual void writeGlobalFolderFile( const std::string file) const =0;
+//   virtual void readTextFile(const std::string) const =0;
+//   virtual void readNtuple(const std::string) const =0;
+
+//   virtual bool idToDetSet(const Identifier,
+//                           int&,int&,int&,int&,int&) const =0;
+//   virtual std::string dirkey(const Identifier&, const int) const =0;
+//   virtual std::string dirkey(const int,const int, const int, const int) const =0;  // new function
+
+//   virtual bool setTrans(const Identifier&, const int, const Amg::Transform3D& )
+//     const =0;
+//   virtual bool setTrans(const Identifier& ident, const int level,
+//                         const Amg::Vector3D & translate, double alpha, double beta, double gamma) const = 0;
+//   virtual bool tweakTrans(const Identifier&, const int, const Amg::Transform3D&)
+//     const =0;
+//   virtual bool tweakTrans(const Identifier& ident, const int level,
+// 			                    const Amg::Vector3D& translate, double alpha, 
+// 			                    double beta, double gamma) const = 0;
+
+//   virtual Identifier getL1L2fromL3Identifier( const Identifier& ident
+//                                             , const int& level
+//                                             ) const=0 ;
+//   virtual Amg::Transform3D getTransL123( const Identifier& ident ) const=0 ;
+//   virtual Amg::Transform3D getTrans(const Identifier&, const int) const=0;
+  virtual StatusCode outputObjs() const=0;
+  virtual StatusCode fillDB(const std::string, const unsigned int,const unsigned int,
+                      const unsigned  int, const unsigned int) const=0;
+  virtual StatusCode printDB(const int) const=0;
+  virtual StatusCode sortTrans() const=0; 
+//   virtual void extractAlphaBetaGamma(const Amg::Transform3D & trans, 
+//                                      double& alpha, double& beta, double &gamma) const=0;
+};
+
+inline const InterfaceID& ITrackerAlignDBTool::interfaceID()
+{ return   IID_TRACKERALIGN_ITrackerAlignDBTool; }
+
+
+#endif // TRACKERALIGNTOOLS_ALIGNDBTOOL_IH
diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..f1f2fcde0c2badfc971577d178768a7bf70f96a4
--- /dev/null
+++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.cxx
@@ -0,0 +1,916 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+// TrackerAlignDBTool.cxx
+// AlgTool to manage the SCT AlignableTransforms in the conditions store
+// Richard Hawkings, started 8/4/05
+
+#include "CoralBase/AttributeListSpecification.h"
+#include "CoralBase/Attribute.h"
+
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaPoolUtilities/AthenaAttributeList.h"
+
+#include <fstream>
+#include <iostream>
+
+#include "GeoPrimitives/CLHEPtoEigenConverter.h"
+
+#include "AthenaKernel/IAthenaOutputStreamTool.h"
+#include "TrackerReadoutGeometry/SCT_DetectorManager.h"
+#include "TrackerReadoutGeometry/SiDetectorElementCollection.h"
+#include "TrackerReadoutGeometry/SiDetectorElement.h"
+#include "TrackerReadoutGeometry/TrackerDD_Defs.h"
+
+#include "TrackerIdentifier/FaserSCT_ID.h"
+
+#include "DetDescrConditions/AlignableTransformContainer.h"
+#include "RegistrationServices/IIOVRegistrationSvc.h"
+
+#include "TrackerAlignDBTool.h"
+
+
+// name of the folder for ID alignment information
+#define TRACKER_ALIGN "/Tracker/Align"
+
+TrackerAlignDBTool::TrackerAlignDBTool(const std::string& type,
+           const std::string& name, const IInterface* parent)
+  : AthAlgTool(type,name,parent),
+    p_toolsvc("ToolSvc",name),
+    m_sctid(nullptr),
+    m_sctman(nullptr),
+    m_par_scttwoside(false),
+    m_par_dbroot( TRACKER_ALIGN ),
+    m_par_dbkey( TRACKER_ALIGN ),
+    m_dynamicDB(false),
+    m_forceUserDBConfig(false)
+{
+  declareInterface<ITrackerAlignDBTool>(this);
+  declareProperty("IToolSvc",    p_toolsvc);
+  declareProperty("SCTTwoSide",  m_par_scttwoside);
+  declareProperty("DBRoot",      m_par_dbroot,"name of the root folder for constants");
+  declareProperty("DBKey",       m_par_dbkey,"base part of the key for loading AlignableTransforms");
+  declareProperty("forceUserDBConfig",m_forceUserDBConfig, "Set to true to override any DB auto-configuration");
+}
+
+TrackerAlignDBTool::~TrackerAlignDBTool()
+{}
+
+StatusCode TrackerAlignDBTool::initialize() 
+{
+  
+    ATH_MSG_DEBUG("initializing");
+  
+    m_alignobjs.clear();
+    m_alignchans.clear();
+    int ndet {0};
+
+    // get storegate access to conditions store
+    ATH_CHECK(detStore().retrieve());
+
+    ATH_CHECK( p_toolsvc.retrieve() );
+
+    // attempt to get ID helpers from detector store 
+    // (relying on GeoModel to put them)
+
+    ATH_CHECK(detStore()->retrieve(m_sctman,"SCT"));
+
+    if (m_sctman->m_alignfoldertype == TrackerDD::static_run1 && 
+        !m_forceUserDBConfig)
+    {
+        m_par_dbroot = "/Tracker/Align";
+        m_dynamicDB = false;
+    } 
+    else if (m_sctman->m_alignfoldertype == TrackerDD::timedependent_run2 && 
+            !m_forceUserDBConfig)
+    {
+        m_par_dbroot = "/Tracker/AlignL3";
+        m_dynamicDB = true;
+    }  
+    m_par_dbkey = m_par_dbroot;
+
+    ATH_CHECK(detStore()->retrieve(m_sctid));
+
+    // setup list of alignable transforms from geometry
+    int chan[3];
+    int TransfLevel_low = 0; // depending on alignfolder sheme; 0 for old, 2 for new
+    if (m_dynamicDB) TransfLevel_low = 2;
+
+    for (int i=0;i<3;++i) chan[i]=100*i;
+
+    std::string man_name;
+    for (const TrackerDD::SiDetectorElement* element : *(m_sctman->getDetectorElementCollection())) 
+    {
+        if (element!=0) 
+        {
+          const Identifier ident=element->identify();
+          int station, layer, eta, phi, side;
+          if (idToDetSet(ident, station, layer, eta, phi, side)) 
+          {
+              std::string level[3];
+              for (int i=TransfLevel_low; i<3; ++i) 
+              {  
+                level[i]=dirkey(station, layer, 1+i, phi);
+                // add this to list if not seen already
+                std::vector<std::string>::const_iterator ix =
+                    find(m_alignobjs.begin(), m_alignobjs.end(), level[i]);
+                if (ix==m_alignobjs.end()) 
+                {
+                  m_alignobjs.push_back(level[i]);
+                  m_alignchans.push_back(chan[i]++);
+                }
+              }
+              ++ndet;
+          } 
+          else 
+          {
+              ATH_MSG_ERROR("Error translating element identifier." );
+          }
+        }
+      }
+
+    ATH_CHECK(m_outputTool.retrieve());
+
+  if (msgLvl(MSG::DEBUG)) 
+  {
+    ATH_MSG_DEBUG( "Database root folder " << m_par_dbroot );
+    ATH_MSG_DEBUG( "Geometry initialisation sees " << ndet << 
+        " SCT modules giving " << m_alignobjs.size() << " alignment keys" );
+    ATH_MSG_DEBUG("Keys/channels are:");
+    
+    for (unsigned int i=0; i < m_alignobjs.size(); ++i)
+      ATH_MSG_DEBUG( " " << m_alignobjs[i] << " [" << m_alignchans[i] << "]" );
+    
+  }
+
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrackerAlignDBTool::finalize()
+{
+  ATH_MSG_DEBUG( "finalizing" );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrackerAlignDBTool::createDB() const
+{
+  
+  ATH_MSG_DEBUG("createDB method called");
+  AlignableTransform* pat = nullptr;
+
+  // loop over all SiDetectorElements and fill corresponding
+  // AlignableTransform objects with default values
+
+  // first create the empty AlignableTransform objects in TDS
+  // check object does not already exist
+
+  if (detStore()->contains<AlignableTransformContainer>(m_par_dbroot)) 
+  {
+      ATH_MSG_WARNING("createDB: AlignableTransformContainer already exists" );
+      return StatusCode::FAILURE;
+  }
+
+  // put them in a collection /Indet/Align
+  ATH_MSG_DEBUG( "Setup database structures in AlignableTransformContainer" );
+  AlignableTransformContainer* patc = new AlignableTransformContainer;
+
+  if (m_par_scttwoside) ATH_MSG_DEBUG( "Produce separate transforms for each side of SCT modules" );
+  else ATH_MSG_DEBUG( "Treat both sides of SCT module as single entity" );
+
+  for (unsigned int i = 0; i < m_alignobjs.size(); ++i) 
+  {
+    pat = new AlignableTransform(m_alignobjs[i]);
+    // add to collection and set corresponding channel number
+    patc->push_back(pat);
+    patc->add( m_alignchans[i] );
+  }
+
+  // record collection in SG
+ 
+  ATH_CHECK( detStore()->record(patc, m_par_dbroot) );
+  ATH_MSG_DEBUG( "Collection has size " <<  patc->size() );
+
+  // now loop over all detector modules and add null level 3 transforms
+  std::vector<std::string> level2;
+  for (const TrackerDD::SiDetectorElement* element : *(m_sctman->getDetectorElementCollection()) )
+  {
+      if (element != 0) 
+      {
+        const Identifier ident = element->identify();
+        std::string key = dirkey(ident,3);
+        // do not produce AlignableTrasnforms for SCT side 1 if option set
+        if (!(m_sctid->side(ident)==1) || m_par_scttwoside) 
+        {
+            if ((pat=getTransPtr(key))) 
+            {
+                pat->add(ident,Amg::EigenTransformToCLHEP( Amg::Transform3D::Identity() ) );
+            } 
+            else 
+            {
+                ATH_MSG_ERROR( "Cannot retrieve AlignableTransform for key " << key );
+            }
+            // add level 2 transform if needed - do this the first time a module
+            // for this level 3 key is seen
+            std::vector<std::string>::const_iterator ix=
+                find(level2.begin(),level2.end(),key);
+            if (ix==level2.end()) 
+            {
+                level2.push_back(key);
+                // construct identifier of level 2 transform
+                Identifier ident2;
+                ident2=m_sctid->wafer_id(m_sctid->station(ident),
+                                        m_sctid->layer(ident),
+                                        0, 0, 0);
+                std::string key2 = dirkey(ident, 2);
+                if ((pat = getTransPtr(key2))) 
+                {
+                    pat->add(ident2, 
+                             Amg::EigenTransformToCLHEP( Amg::Transform3D::Identity() ) );
+                } 
+                else 
+                {
+                    ATH_MSG_ERROR( "Cannot retrieve AlignableTransform for key " << key2 );
+                }
+            }
+        }
+      }
+    }
+
+    // create the global object with positions for the stations
+    Identifier ident1;
+    std::string key1 = dirkey(ident1, 1);
+    if ((pat = getTransPtr(key1))) 
+    {
+        Amg::Transform3D globshift;
+        globshift.setIdentity();
+        // Tracker upstream
+        ident1 = m_sctid->wafer_id(-1, 0, 0, 0, 0);
+        pat->add(ident1, Amg::EigenTransformToCLHEP(globshift));
+        // Tracker central
+        ident1 = m_sctid->wafer_id(0, 0, 0, 0, 0);
+        pat->add(ident1, Amg::EigenTransformToCLHEP(globshift));
+        // Tracker downstream
+        ident1 = m_sctid->wafer_id(1, 0, 0, 0, 0);
+        pat->add(ident1, Amg::EigenTransformToCLHEP(globshift));
+    } 
+    else
+    {
+        ATH_MSG_ERROR( "Cannot retrieve AlignableTransform for key " << key1 );
+    } 
+
+    // sort the created objects (in case, usually come out sorted from GeoModel)
+    sortTrans();
+    // list out size of all created objects
+    ATH_MSG_DEBUG( "Dumping size of created AlignableTransform objects");
+    for (unsigned int i = 0; i < m_alignobjs.size(); ++i)
+        if ((pat = getTransPtr(m_alignobjs[i]))) pat->print();
+
+    return StatusCode::SUCCESS;
+}
+
+bool TrackerAlignDBTool::idToDetSet(const Identifier ident, int& station,
+          int& layer, int& eta, int& phi, int& side) const 
+{
+  // transform Identifier to list of integers specifiying station,layer
+  // eta, phi, side
+
+  station = m_sctid->station(ident);
+  layer = m_sctid->layer(ident);
+  eta = m_sctid->eta_module(ident);
+  phi = m_sctid->phi_module(ident);
+  side = m_sctid->side(ident);
+  return true;
+}
+
+std::string TrackerAlignDBTool::dirkey(const Identifier& ident,
+             const int level) const 
+{
+  // given SCT identifier, and level (1, 2 or 3) return
+  // directory key name for associated alignment data
+  int station, layer, eta, phi, side;
+  idToDetSet(ident, station, layer, eta, phi, side);
+  return dirkey(station, layer, level, phi);
+}
+
+std::string TrackerAlignDBTool::dirkey(const int station, 
+                                     const int layer, 
+                                     const int level, 
+                                     const int ) const 
+{
+  // channel info and level (1,2 or 3) return
+  // directory key name for associated alignment data
+  std::ostringstream result;
+  if (m_dynamicDB)
+  {
+    result << "/Tracker/AlignL";
+    result << level;
+    result << "/" ;          // new folders have L1, L2, L3 structure
+  }
+  else
+  {
+    result << m_par_dbkey << "/" ;
+  }
+  
+  if (level==1) {
+    result << "Stations";
+  } else {
+    if (level==2) result << "Planes";
+    if (level==3) {
+        if (station == 1 ) result << "Downstream";
+        if (station == 0 ) result << "Central";
+        if (station ==-1 ) result << "Upstream";
+        result << 1+layer;
+    }
+  }
+  return result.str();
+}
+
+// void InDetAlignDBTool::dispGroup(const int dettype, const int bec, 
+//                                  const int layer,const int ring, const int sector,
+//                                  const float rphidisp, const float rdisp, const float zdisp, 
+//                                  const int syst, const int level, const int skip) const {
+ 
+//   ATH_MSG_DEBUG( "dispGroup called: level " << level << " syst " << syst);
+//   int nmod=0;
+//   // random number service
+//   IRndmGenSvc* randsvc;
+//   if (StatusCode::SUCCESS!=service("RndmGenSvc",randsvc,true))
+//     ATH_MSG_ERROR("Cannot find RndmGenSvc" );
+//   Rndm::Numbers gauss(randsvc,Rndm::Gauss(0.,1.));
+//   if (skip>0) {
+//     ATH_MSG_DEBUG("Skip random numbers " << skip ); 
+//     for (int i=0;i<skip;++i) gauss();
+//   }
+//   // for syst 5, choose random shifts based on the input numbers
+//   float rpd=0,rd=0,zd=0;
+//   if (syst==5) {
+//     rpd=rphidisp*gauss();
+//     rd=rdisp*gauss();
+//     zd=zdisp*gauss();
+//   } 
+//   // keep a list of level1/2 transform IDs to make sure they are only set once
+//   std::vector<Identifier> lvl12id;
+//   // loop over all pixel and SCT modules
+//   AlignableTransform* pat;
+//   for (int idet=1;idet<3;++idet) {
+//     for (const InDetDD::SiDetectorElement* element: *(idet==1 ? m_pixman->getDetectorElementCollection() : m_sctman->getDetectorElementCollection())) {
+//       if (element!=0) {
+//         const Identifier ident=element->identify();
+//         int mdet,mbec,mlayer,mring,msector,mside;
+//         idToDetSet(ident,mdet,mbec,mlayer,mring,msector,mside);
+//         // find matching modules - note side=1 modules never touched
+//         if ((dettype==-1 || mdet==dettype) && (bec==-1 || std::abs(2*mbec)==bec) &&
+//             (layer==-1 || mlayer==layer) && (ring==-1 || mring==ring) && 
+//             (sector== -1 || msector==sector) && mside==0) {
+//           // displace this module - first choose displacement type
+//           // dont choose new displacements if seeing second side of SCT module
+//           // ensures they both move together
+//           // depends on the side1 module immediatly following side 0 in list
+//           // which is currently the case - fragile
+//           // also for syst 6 choose number only for new ring (eta) slice
+//           if (dettype!=2 || mside!=1) {
+//             if (syst==2 || syst==4 || (syst==6 && mring==-6)) {
+//               rpd=rphidisp*gauss();
+//               rd=rdisp*gauss();
+//               zd=zdisp*gauss();
+//               if (syst==6) ATH_MSG_DEBUG("New rndm at layer/ring " << 
+//                                          mlayer << " " << mring << " z " << zd );
+//             } else if (syst<5) {
+//               rpd=rphidisp;
+//               rd=rdisp;
+//               zd=zdisp;
+//             }
+//           }
+//           // interpretation as rphi/r or x/y
+//           float xd,yd;
+//           if (syst<=2 || syst==6) {
+//             // rphi displacement - calculate from module position in x/y
+//             const Amg::Vector3D modcent=element->center();
+//             float dx=modcent.x();
+//             float dy=modcent.y();
+//             float dr=sqrt(dx*dx+dy*dy);
+//                   xd=(rd*dx-rpd*dy)/dr;
+//             yd=(rd*dy+rpd*dx)/dr;
+//           } else {
+//             xd=rpd;
+//             yd=rd;
+//           }
+//           // find the corresponding AlignableTransform object
+//           std::string key=dirkey(mdet,mbec,mlayer,level);
+//           // first get as const as transforms might have been read in
+//           const AlignableTransform* cpat=cgetTransPtr(key);
+//                 pat=const_cast<AlignableTransform*>(cpat);
+//           if (pat) {
+//             Identifier ident2;
+//             bool update=true;
+//             if (level==3) {
+//               ident2=ident;
+//             } else if (level==2) {
+//               // identifier for layer in level 2 transform
+//               if (mdet==1) {
+//                 ident2=m_pixid->wafer_id(m_pixid->barrel_ec(ident),
+//                        m_pixid->layer_disk(ident),0,0);
+//               } else {
+//                 ident2=m_sctid->wafer_id(m_sctid->barrel_ec(ident),
+//                  m_sctid->layer_disk(ident),0,0,0);
+//               }
+//               // check this identifier has not been updated before
+//               std::vector<Identifier>::const_iterator ix=
+//                 find(lvl12id.begin(),lvl12id.end(),ident2);
+//               if (ix==lvl12id.end()) {
+//                 lvl12id.push_back(ident2);
+//               } else {
+//                 update=false;
+//               }
+//             } else {
+//               // identifier for ID 
+//               if (mdet==1) {
+//                 ident2=m_pixid->wafer_id(0,0,0,0);
+//               } else {
+//                 ident2=m_sctid->wafer_id(0,0,0,0,0);
+//               }
+//               // check this identifier has not been updated before
+//               std::vector<Identifier>::const_iterator ix=
+//                 find(lvl12id.begin(),lvl12id.end(),ident2);
+//               if (ix==lvl12id.end()) {
+//                 lvl12id.push_back(ident2);
+//               } else {
+//                 update=false;
+//               }
+//             }
+//             // update, adding to any existing shift
+//             if (update) {
+            
+//               Amg::Transform3D shift =   Amg::Translation3D(xd,yd,zd) * Amg::RotationMatrix3D::Identity(); 
+//               pat->tweak(ident2,Amg::EigenTransformToCLHEP(shift));
+//               ATH_MSG_VERBOSE( "Updated module " << mdet << "," << mbec 
+//                                << "," << mlayer << "," << mring << "," << msector << " to xyz" <<
+//                                xd << "," << yd << "," << zd );
+//                                 ++nmod;
+//             }
+//           } else {
+//             ATH_MSG_ERROR("Cannot find AlignableTransform for key" << key );
+//           }
+//         }
+//       }
+//     }
+//   }
+//  ATH_MSG_DEBUG( "Added displacement to " << nmod << " modules " << dettype << "," 
+//              << bec << "," << layer << " [" << rphidisp << "," << rdisp 
+//              << "," << zdisp << "]"
+//              << " type " << syst );
+// }
+
+
+// bool InDetAlignDBTool::setTrans(const Identifier& ident, const int level,
+//         const Amg::Transform3D& trans) const {
+
+//   bool result=false;
+
+//   // New additions for new global folder structure -- setTrans for this might need to be revisited
+//   // No ATs exist for levels 1 & 2 --> need alternative
+//   if (m_dynamicDB && level!=3){
+//     result=tweakGlobalFolder(ident, level, trans);
+//     if (!result ) ATH_MSG_ERROR( "Attempt tweak GlobalDB folder failed" );
+//   }
+//   else {
+//     // find transform key, then set appropriate transform
+//     // do storegate const retrieve, then cast to allow update of locked data
+//     std::string key=dirkey(ident,level);
+//     const AlignableTransform* pat;
+//     AlignableTransform* pat2;
+//     bool result=false;
+//     if ((pat=cgetTransPtr(key))) {
+//       pat2=const_cast<AlignableTransform*>(pat);
+//       if (pat2!=0) {
+// 	result=pat2->update(ident, Amg::EigenTransformToCLHEP(trans) );
+// 	if (!result) ATH_MSG_ERROR( "Attempt to set non-existant transform" );
+//       } 
+//     } else {
+//       ATH_MSG_ERROR( "setTrans: cannot retrieve AlignableTransform for key" << key );
+//     }
+//   }
+
+//   return result;
+// }
+
+// bool InDetAlignDBTool::setTrans(const Identifier& ident, const int level,
+//         const Amg::Vector3D& translate, double alpha, double beta, double gamma) const
+// {
+  
+//   Amg::Translation3D  newtranslation(translate);    
+//   Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
+//   newtrans *= Amg::AngleAxis3D(gamma, Amg::Vector3D(0.,0.,1.));
+//   newtrans *= Amg::AngleAxis3D(beta, Amg::Vector3D(0.,1.,0.));
+//   newtrans *= Amg::AngleAxis3D(alpha, Amg::Vector3D(1.,0.,0.));
+  
+//   return setTrans(ident, level,  newtrans);
+// }
+
+
+// bool InDetAlignDBTool::tweakTrans(const Identifier& ident, const int level,
+//           const Amg::Transform3D& trans) const {
+
+//   bool result=false;
+
+//   // New additions for new global folder structure 
+//   // No ATs exist for levels 1 & 2 --> need alternative
+//   if (m_dynamicDB && level!=3){
+//     result=tweakGlobalFolder(ident, level, trans);
+//     if (!result ) ATH_MSG_ERROR( "Attempt tweak GlobalDB folder failed" );
+//   }
+//   else {
+//     // find transform key, then set appropriate transform
+//     std::string key=dirkey(ident,level);
+//     const AlignableTransform* pat;
+//     AlignableTransform* pat2;
+//     if ((pat=cgetTransPtr(key))) {
+//       pat2=const_cast<AlignableTransform*>(pat);
+//       if (pat2!=0) {
+// 	result=pat2->tweak(ident,Amg::EigenTransformToCLHEP(trans));
+//       if (!result) ATH_MSG_ERROR(
+// 				 "Attempt to tweak non-existant transform" );
+//       } else {
+// 	ATH_MSG_ERROR("tweakTrans: cast fails for key " << key );
+//       }
+//     } else {
+//       ATH_MSG_ERROR(
+// 		    "tweakTrans: cannot retrieve AlignableTransform for key" << key );
+//     }
+//   }
+
+//   return result;
+// }
+
+// bool InDetAlignDBTool::tweakTrans(const Identifier& ident, const int level,
+//           const Amg::Vector3D& translate, double alpha, double beta, double gamma) const
+// {
+  
+//   Amg::Translation3D  newtranslation(translate);    
+//   Amg::Transform3D newtrans = newtranslation * Amg::RotationMatrix3D::Identity();
+//   newtrans *= Amg::AngleAxis3D(gamma, Amg::Vector3D(0.,0.,1.));
+//   newtrans *= Amg::AngleAxis3D(beta, Amg::Vector3D(0.,1.,0.));
+//   newtrans *= Amg::AngleAxis3D(alpha, Amg::Vector3D(1.,0.,0.));
+  
+//   return tweakTrans(ident, level, newtrans);
+// }
+
+// /** convert L3 module identifier to L1 or L2 */
+// Identifier InDetAlignDBTool::getL1L2fromL3Identifier( const Identifier& ident
+//                   , const int& level
+//                   ) const {
+//   if( level == 3 ) return ident ; //!< no translation needed
+//   /** check whether PIX */
+//   if( m_pixid->is_pixel(ident) ) {
+//     if( level == 1 ) {
+//       return m_pixid->wafer_id( 0, 0, 0, 0 ) ; //!< Whole pixel det. at L1
+//     }
+//     if( level == 2 ) {
+//       int barrel_ec  = m_pixid->barrel_ec(  ident ) ;
+//       int layer_disk = m_pixid->layer_disk( ident ) ;
+//       return m_pixid->wafer_id( barrel_ec, layer_disk, 0, 0 ) ;
+//     }
+//   }
+//   /** check whether SCT */
+//   if( m_sctid->is_sct(ident) ) {
+//     if( level == 1 ) {
+//       int barrel_ec  = m_sctid->barrel_ec(  ident ) ;
+//       return m_sctid->wafer_id( barrel_ec, 0, 0, 0, 0 ) ; //!< barrel + 2 x EC at L1
+//     }
+//     if( level == 2 ) {
+//       int barrel_ec  = m_sctid->barrel_ec(  ident ) ;
+//       int layer_disk = m_sctid->layer_disk( ident ) ;
+//       return m_sctid->wafer_id( barrel_ec, layer_disk, 0, 0, 0 ) ;
+//     }
+//   }
+//   return ident ; //!< take care of the case where level != 1,2,3 or ident neither pix nor sct
+// }
+
+// /** get cumulative L1, L2, L3 trafo for (L3-) module */
+// Amg::Transform3D InDetAlignDBTool::getTransL123( const Identifier& ident ) const {
+ 
+//   Amg::Transform3D result ;
+//   InDetDD::SiDetectorElement* element = m_pixman->getDetectorElement( ident ) ;
+//   if( !element ) {
+//     element = m_sctman->getDetectorElement( ident ) ;
+//   }
+//   if( !element ) {
+//     ATH_MSG_ERROR("getTransL123(): Module not found in PIX or SCT!" );
+//     return result ;
+//   }
+//   Amg::Transform3D trfL1 = getTrans( ident, 1 ) ;
+//   Amg::Transform3D trfL2 = getTrans( ident, 2 ) ;
+//   Amg::Transform3D trfL3 = getTrans( ident, 3 ) ;
+//   ATH_MSG_FATAL("Code needs to corrected otherwise you will get nonsensical results-- IndetAlignDBTool:2060");
+//   //const Amg::Transform3D trfNominal   ; //= element->defModuleTransform() ;
+//   //result = trfNominal.inverse() * trfL1 * trfL2 * trfNominal * trfL3 ;
+//   result = trfL1 * trfL2 * trfL3 ;
+//   return result ;
+// }
+
+// /** return value of particular transform specified by identifier and level
+//     calculates L1 and L2 identifiers automatically by getL1L2fromL3Identifier 
+//     if L3 identifier passed */
+// Amg::Transform3D InDetAlignDBTool::getTrans(const Identifier& ident, 
+//             const int level) const {
+//   const Identifier identifier = getL1L2fromL3Identifier( ident, level ) ;
+//   Amg::Transform3D result;
+//   const std::string key=dirkey(identifier,level);
+//   const AlignableTransform* pat;
+//   if ((pat=cgetTransPtr(key))) {
+//     AlignableTransform::AlignTransMem_citr itr=pat->findIdent(identifier);
+//     if (itr!=pat->end()) result= Amg::CLHEPTransformToEigen(itr->transform());
+//   }
+//   return result;
+// }
+
+StatusCode TrackerAlignDBTool::outputObjs() const {
+  
+  ATH_MSG_DEBUG( "Output AlignableTranform objects to stream" << m_outputTool );
+  // get the AthenaOutputStream tool
+//   IAthenaOutputStreamTool* optool {nullptr};
+
+//   ATH_CHECK(p_toolsvc->retrieveTool("AthenaOutputStreamTool", m_par_condstream, optool));
+  
+//   ATH_CHECK(optool->connectOutput("myAlignFile.pool.root"));
+  ATH_CHECK(m_outputTool->connectOutput());
+
+  // construct list of objects to be written out, either 
+  // AlignableTransformContainer or several of AlignableTransforms
+  int npairs=1;
+  IAthenaOutputStreamTool::TypeKeyPairs typekeys(npairs);
+  typekeys[0]=
+      IAthenaOutputStreamTool::TypeKeyPair("AlignableTransformContainer",
+             m_par_dbroot);
+  if (!(detStore()->contains<AlignableTransformContainer>(m_par_dbroot)))
+    ATH_MSG_ERROR(
+        "Expected " << m_par_dbroot << " object not found" );
+  // write objects to stream
+//   ATH_CHECK(optool->streamObjects(typekeys, "myAlignFile.pool.root"));
+  ATH_CHECK(m_outputTool->streamObjects(typekeys));
+
+  // commit output
+  ATH_CHECK(m_outputTool->commitOutput());
+  ATH_MSG_DEBUG( "Written " << typekeys.size() << " objects to stream " << m_outputTool);
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrackerAlignDBTool::fillDB(const std::string tag, 
+            const unsigned int run1, const unsigned int event1,
+            const unsigned int run2, const unsigned int event2) const 
+{
+  
+  ATH_MSG_DEBUG( "fillDB: Data tag " << tag );
+  ATH_MSG_DEBUG( "Run/evt1 [" << run1 << "," << event1 << "]" );
+  ATH_MSG_DEBUG( "Run/evt2 [" << run2 << "," << event2 << "]" );
+
+  // get pointer to registration svc
+  IIOVRegistrationSvc* regsvc {nullptr};
+  ATH_CHECK(service("IOVRegistrationSvc", regsvc));
+
+  // loop over all AlignableTransform objects created earlier and save them
+
+  ATH_CHECK(regsvc->registerIOV(
+             "AlignableTransformContainer",m_par_dbroot, tag, run1, run2, event1, event2));
+
+  ATH_MSG_DEBUG( "Stored AlignableTransform object " << m_par_dbroot );
+  ATH_MSG_DEBUG( " Wrote one AlignableTransformContainer objects to conditions database" );
+  return StatusCode::SUCCESS;
+}
+
+StatusCode TrackerAlignDBTool::printDB(const int level) const 
+{
+  
+  ATH_MSG_DEBUG("Printout TrackerAlign database contents, detail level" << level );
+
+  for (std::vector<std::string>::const_iterator iobj = m_alignobjs.begin();
+       iobj != m_alignobjs.end();
+       ++iobj) 
+  {
+    const AlignableTransform* pat;
+    if ((pat = cgetTransPtr(*iobj))) 
+    {
+      ATH_MSG_DEBUG( "AlignableTransform object " << *iobj );
+      int nobj = 0;
+      for (AlignableTransform::AlignTransMem_citr cit = pat->begin();
+        cit!=pat->end();
+        ++cit) 
+      {
+        const Identifier& ident = cit->identify();
+        const Amg::Transform3D& trans = Amg::CLHEPTransformToEigen( cit->transform() );
+        Amg::Vector3D shift = trans.translation();
+        //Amg::RotationMatrix3D rot=trans.rotation();
+        int station, layer, eta, phi, side;
+        if (idToDetSet(ident, station, layer, eta, phi, side)) 
+        {
+          if (level > 1) 
+          {
+            double alpha, beta, gamma;
+            extractAlphaBetaGamma(trans, alpha, beta, gamma);
+            ATH_MSG_DEBUG( "Tracker [" << station << "," << layer << 
+                              "," << eta << "," << phi << "," << side << "] Trans:(" <<
+                                shift.x() << "," << shift.y() << "," << shift.z() << ") Rot:{"
+                                << alpha << "," << beta << "," << gamma << "}");
+          }
+          ++nobj;
+        } 
+        else 
+        {
+          ATH_MSG_ERROR("Unknown identifier in AlignableTransform" );
+        }
+      }
+      ATH_MSG_DEBUG( "Object contains " << nobj << " transforms" );
+    } 
+    else
+    {
+      ATH_MSG_ERROR( "AlignableTransform " << *iobj << " not found" );
+    }
+  }
+  return StatusCode::SUCCESS;
+}
+
+// ==========================================
+
+AlignableTransform* TrackerAlignDBTool::getTransPtr(const std::string key) 
+  const {
+  // look in collection to retrieve pointer to AlignableTransform object of 
+  // given key and return it, return 0 if not collection or key value not found
+  AlignableTransformContainer* patc;
+  AlignableTransform* pat {nullptr};
+
+  if(detStore()->retrieve(patc,m_par_dbroot ).isFailure())
+  {
+      ATH_MSG_ERROR("Unable to retrieve alignment container from DetStore.");
+      return nullptr;
+  }
+
+  for (DataVector<AlignableTransform>::iterator dva=patc->begin();
+            dva!=patc->end();++dva) 
+  {
+    if ((*dva)->tag()==key) 
+    {
+        pat=*dva;
+        break;
+    }
+  }
+  return pat;
+}
+
+const AlignableTransform* TrackerAlignDBTool::cgetTransPtr(const std::string key) const 
+{
+  // look in collection to retrieve pointer to AlignableTransform object of 
+  // given key and return it, return 0 if not collection or key value not found
+  // const version
+  const AlignableTransformContainer* patc;
+  const AlignableTransform* pat {nullptr};
+
+  if(detStore()->retrieve(patc, m_par_dbroot ).isFailure())
+  {
+      ATH_MSG_ERROR("Unable to retrieve alignment container from DetStore.");
+      return nullptr;
+  }
+
+  for (DataVector<AlignableTransform>::const_iterator dva=patc->begin();
+            dva!=patc->end(); 
+            ++dva) 
+  {
+    if ((*dva)->tag() == key) 
+    {
+          pat=*dva;
+          break;
+    }
+  }
+  return pat;
+}
+
+StatusCode TrackerAlignDBTool::sortTrans() const 
+{
+  // loop through all the AlignableTransform objects and sort them
+  
+  ATH_MSG_DEBUG( "Sorting all AlignableTransforms in TDS" );
+  AlignableTransform* pat;
+  // use cget and a const cast to allow containers that have been read in
+  // (and hence are locked by StoreGate) to be sorted
+  for (unsigned int i=0; i<m_alignobjs.size(); ++i)
+    if ((pat = const_cast<AlignableTransform*>(cgetTransPtr(m_alignobjs[i])))) pat->sortv();
+
+  return StatusCode::SUCCESS;
+}
+
+void TrackerAlignDBTool::extractAlphaBetaGamma(const Amg::Transform3D & trans, 
+               double& alpha, double& beta, double &gamma) const 
+{
+  double siny = trans(0,2);
+  beta = asin(siny);
+  // Check if cosy = 0. This requires special treatment.
+  // can check either element (1,2),(2,2) both equal zero
+  // or (0,1) and (0,0)
+  // Probably not likely it will be exactly 0 and may still 
+  // have some problems when very close to zero. We mostly
+  // deal with small rotations so its not too important.
+  if ((trans(1,2) == 0) && (trans(2,2) == 0)) {
+    // alpha and gamma are degenerate. We arbitrarily choose
+    // gamma = 0.
+    gamma = 0;
+    alpha = atan2(trans(1,1),trans(2,1));
+  } else {
+    alpha = atan2(-trans(1,2),trans(2,2));
+    gamma = atan2(-trans(0,1),trans(0,0));
+    if (alpha == 0) alpha = 0; // convert -0 to 0
+    if (gamma == 0) gamma = 0; // convert -0 to 0
+  }
+}
+
+
+// bool InDetAlignDBTool::tweakGlobalFolder(const Identifier& ident, const int level,
+// 					 const Amg::Transform3D& trans ) const {
+
+//   // find transform key, then set appropriate transform           
+//   const CondAttrListCollection* atrlistcol1=0;
+//   CondAttrListCollection* atrlistcol2=0;
+//   bool result=false;
+//   std::string key=dirkey(ident,level);
+//   int det,bec,layer,ring,sector,side;
+//   idToDetSet(ident,det,bec,layer,ring,sector,side);
+//   const unsigned int DBident=det*10000+2*bec*1000+layer*100+ring*10+sector;  
+//   // so far not a very fancy DB identifier, but seems elaborate enough for this simple structure
+  
+//   if (StatusCode::SUCCESS==detStore()->retrieve(atrlistcol1,key)) {
+//     // loop over objects in collection                                    
+//     //atrlistcol1->dump();
+//     atrlistcol2 = const_cast<CondAttrListCollection*>(atrlistcol1);
+//     if (atrlistcol2!=0){
+//       for (CondAttrListCollection::const_iterator citr=atrlistcol2->begin(); citr!=atrlistcol2->end();++citr) {
+	
+// 	const coral::AttributeList& atrlist=citr->second;
+// 	coral::AttributeList& atrlist2  = const_cast<coral::AttributeList&>(atrlist);
+
+// 	if(citr->first!=DBident) continue;
+// 	else {
+// 	  msg(MSG::DEBUG) << "Tweak Old global DB -- channel: " << citr->first
+//                           << " ,det: "    << atrlist2["det"].data<int>()
+//                           << " ,bec: "    << atrlist2["bec"].data<int>()
+//                           << " ,layer: "  << atrlist2["layer"].data<int>()
+//                           << " ,ring: "   << atrlist2["ring"].data<int>()
+//                           << " ,sector: " << atrlist2["sector"].data<int>()
+//                           << " ,Tx: "     << atrlist2["Tx"].data<float>()
+//                           << " ,Ty: "     << atrlist2["Ty"].data<float>()
+//                           << " ,Tz: "     << atrlist2["Tz"].data<float>()
+//                           << " ,Rx: "     << atrlist2["Rx"].data<float>()
+//                           << " ,Ry: "     << atrlist2["Ry"].data<float>()
+//                           << " ,Rz: "     << atrlist2["Rz"].data<float>() << endmsg;
+
+
+// 	  // Order of rotations is defined as around z, then y, then x.  
+// 	  Amg::Translation3D  oldtranslation(atrlist2["Tx"].data<float>(),atrlist2["Ty"].data<float>(),atrlist2["Tz"].data<float>());
+// 	  Amg::Transform3D oldtrans = oldtranslation * Amg::RotationMatrix3D::Identity();
+// 	  oldtrans *= Amg::AngleAxis3D(atrlist2["Rz"].data<float>()*CLHEP::mrad, Amg::Vector3D(0.,0.,1.));
+// 	  oldtrans *= Amg::AngleAxis3D(atrlist2["Ry"].data<float>()*CLHEP::mrad, Amg::Vector3D(0.,1.,0.));
+// 	  oldtrans *= Amg::AngleAxis3D(atrlist2["Rx"].data<float>()*CLHEP::mrad, Amg::Vector3D(1.,0.,0.));
+	  
+// 	  // get the new transform
+// 	  Amg::Transform3D newtrans = trans*oldtrans;
+
+// 	  // Extract the values we need to write to DB     
+// 	  Amg::Vector3D shift=newtrans.translation();
+// 	  double alpha, beta, gamma;
+// 	  extractAlphaBetaGamma(newtrans, alpha, beta, gamma);
+
+// 	  atrlist2["Tx"].data<float>() = shift.x();
+// 	  atrlist2["Ty"].data<float>() = shift.y();
+// 	  atrlist2["Tz"].data<float>() = shift.z();
+// 	  atrlist2["Rx"].data<float>() = alpha/CLHEP::mrad ;
+// 	  atrlist2["Ry"].data<float>() = beta/CLHEP::mrad ;
+// 	  atrlist2["Rz"].data<float>() = gamma/CLHEP::mrad ;
+	  
+// 	  result = true;
+// 	  msg(MSG::DEBUG) << "Tweak New global DB -- channel: " << citr->first
+//                           << " ,det: "    << atrlist2["det"].data<int>()
+//                           << " ,bec: "    << atrlist2["bec"].data<int>()
+//                           << " ,layer: "  << atrlist2["layer"].data<int>()
+//                           << " ,ring: "   << atrlist2["ring"].data<int>()
+//                           << " ,sector: " << atrlist2["sector"].data<int>()
+//                           << " ,Tx: "     << atrlist2["Tx"].data<float>()
+//                           << " ,Ty: "     << atrlist2["Ty"].data<float>()
+//                           << " ,Tz: "     << atrlist2["Tz"].data<float>()
+//                           << " ,Rx: "     << atrlist2["Rx"].data<float>()
+//                           << " ,Ry: "     << atrlist2["Ry"].data<float>()
+//                           << " ,Rz: "     << atrlist2["Rz"].data<float>() << endmsg;
+	  
+// 	}	
+//       }
+//     }
+//     else {
+//       ATH_MSG_ERROR("tweakGlobalFolder: cast fails for DBident " << DBident );
+//       return false;
+//    }
+//   }
+//   else {
+//     ATH_MSG_ERROR("tweakGlobalFolder: cannot retrieve CondAttrListCollection for key " << key );
+//     return false;
+//   }
+
+//   return result;  
+// }
+
diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h
new file mode 100644
index 0000000000000000000000000000000000000000..47d7e8ee96ce38bae26ea21daa6209449dd5a000
--- /dev/null
+++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/TrackerAlignDBTool.h
@@ -0,0 +1,193 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef TRACKERALIGNGENTOOLS_ALIGNDBTOOL_H
+#define TRACKERALIGNGENTOOLS_ALIGNDBTOOL_H
+// TrackerAlignDBTool.h
+// an AlgTool to manage the tracker alignment database classes
+// Richard Hawkings, started 8/4/05
+//
+// This AlgTool provides utilities to manage the Tracker alignment conditions
+// data in the transient store, and to read and write it in a variety of
+// formats
+// Tool methods provided:
+//   createDB - create a 'null' set of AlignableTransforms, with no shifts
+//   dispGroup - apply a pattern to displace a group of modules randomly
+//               or systematically
+//   printDB - printout details of all the module transforms
+//   writeFile - export database contents on a text file or ntuple
+//   readTextFile - import database from text file
+//   readNtuple - import database from ntuple
+//
+// The following utility methods are also exposed
+//   idToDetSet - convert an SCT/pixel Identifier to set of integers
+//         specifying detector,barrel/ec,layer,ring, sector (and side for SCT)
+//   dirkey - return the AlignableTransform TDS key for a given module
+//            (by Identifier or set of integers)
+//   setTrans - set the transformation for a particular module, identified by 
+//              a given Identifier
+//   tweakTrans - tweak (add to existing transform) the transformation for
+//              a particular module, identified by a given Identifier
+
+#include <vector>
+#include <string>
+#include "AthenaBaseComps/AthAlgTool.h"
+#include "GaudiKernel/ServiceHandle.h" 
+#include "TrackerAlignGenTools/ITrackerAlignDBTool.h"
+#include "AthenaPoolUtilities/CondAttrListCollection.h"
+#include "AthenaKernel/IAthenaOutputStreamTool.h"
+
+
+class FaserSCT_ID;
+class AlignableTransform;
+
+namespace TrackerDD {
+  class SCT_DetectorManager;
+}
+
+class TrackerAlignDBTool: virtual public ITrackerAlignDBTool, public AthAlgTool {
+ public:
+  TrackerAlignDBTool(const std::string& type, const std::string& name,
+	    const IInterface* parent);
+  virtual ~TrackerAlignDBTool();
+
+  virtual StatusCode initialize();
+  virtual StatusCode finalize();
+
+  // tool methods
+  // create null database in TDS for subsequent manipulation
+
+  virtual StatusCode createDB() const;
+
+  // displace a group of modules
+  // modules to effect are specified by dettype (1=pixel, 2=SCT, -1 both),
+  // bec (barrel=0, 2 for both endcaps, -1 for all), layer (0 to n-1, -1=all)
+  // ring (-1=all) and sector (-1=all)
+  // rphidisp,rdisp and zdisp specify the offsets to be used
+  // syst specifies what will be done, 1=systematic displacement of affected
+  // modules, 2=random (rphidisp etc are RMS), 3,4=systematic and random
+  // displacements but interpreting r/phi/zdisp as x/y/z, 5 chooses the
+  // same randomised numbers for all modules;
+  // level specifies the level oill look for the right balance of CERN staff supervisors and ATLAS
+  //USERS supervisors; f transformations affected
+  // skip=n optionally skips n random numbers to enable different patterns
+
+//   virtual void dispGroup(const int dettype, const int bec, const int layer,
+//                           const int ring, const int sector,
+//                           const float rphidisp, const float rdisp, const float zdisp, 
+//                           const int syst, const int level, const int skip) const;
+
+  // write database contents to flat text file or ntuple
+  // for flat file, file gives filename, for ntuple, file is e.g. 
+  //  /NTUPLES/FILE1
+//   virtual void writeFile(const bool ntuple, const std::string file) const;
+
+  // write GlobalFolder txt files
+//   virtual void writeGlobalFolderFile( const std::string file) const;
+
+  // read back database from text file
+//   virtual void readTextFile(const std::string file) const;
+
+  // read back database from text file
+  //  void readOldTextFile(const std::string file) const;
+
+  // read back database from ntuple
+//   virtual void readNtuple(const std::string file) const;
+
+  // set a particular transform specified by Identifier
+//   virtual bool setTrans(const Identifier& ident, const int level,
+//     const Amg::Transform3D& trans) const;
+
+  // As above but takes translation and rotations alpha, beta, gamma (rotations around x,y,z axes) as input.
+  // Calculates transform as HepGeom::Translate3D(translate) * HepGeom::RotateX3D(alpha) * HepGeom::RotateY3D(beta) * HepGeom::RotateZ3D(gamma)
+//   virtual bool setTrans(const Identifier& ident, const int level,
+// 			const Amg::Vector3D& translate, double alpha, double beta, double gamma) const;
+
+
+  // tweak a particular transform specified by Identifier (i.e. add to 
+  //   already existing transformation)
+//   virtual bool tweakTrans(const Identifier& ident, const int level,
+//     const Amg::Transform3D& trans) const;
+
+  // As above but takes translation and rotations alpha, beta, gamma (rotations around x,y,z axes) as input.
+  // Calculates transform as HepGeom::Translate3D(translate) * HepGeom::RotateX3D(alpha) * HepGeom::RotateY3D(beta) * HepGeom::RotateZ3D(gamma)
+//   virtual bool tweakTrans(const Identifier& ident, const int level,
+//                         const Amg::Vector3D& translate, double alpha, double beta, double gamma) const;
+
+  /** This is the tweak function for the GlobalFolder DB **/
+//   virtual bool tweakGlobalFolder(const Identifier& ident, const int level,
+// 				 const Amg::Transform3D& trans) const ;
+
+  /** convert L3 module identifier to L1 or L2 */
+//   virtual Identifier getL1L2fromL3Identifier( const Identifier& ident
+//                                             , const int& level
+//                                             ) const ;
+
+  /** get cumulative L1, L2, L3 trafo for (L3-) module. Result is in local frame. */
+//   virtual Amg::Transform3D getTransL123( const Identifier& ident ) const ;
+
+  /** return value of particular transform specified by identifier and level
+  calculates L1 and L2 identifiers automatically by getL1L2fromL3Identifier 
+  if L3 identifier passed. L1, L2 are in global, L3 in local frame. */
+//   virtual Amg::Transform3D getTrans( const Identifier& ident
+//                                  , const int level
+//                                  ) const ;
+
+  // write the transforms to outputstream
+  virtual StatusCode outputObjs() const;
+
+  // write the transform IOVs to IOVDB
+  virtual StatusCode fillDB(const std::string tag, 
+     const unsigned int run1, const unsigned int event1,
+     const unsigned int run2, const unsigned int event2) const;
+
+  // print the transforms, level=1 lists sizes, level=2 lists all transforms
+  virtual StatusCode printDB(const int level) const;
+
+  // sort all the AlignableTransform objects so searches/inserts work properly
+  virtual StatusCode sortTrans() const;
+  
+  
+ private:
+
+  // convert an Identifier to a set of integers specifying station
+  // layer, ring (eta), sector (phi), and side (0/1)
+  virtual bool idToDetSet(const Identifier ident,
+          int& bec,int& layer,int& ring,int& sector,int& side) const;
+
+  // return the AlignableTransform name where the transform for the given
+  // module can be found, 3 levels corresponding to alignment hierarchy
+  virtual std::string dirkey(const Identifier&, const int) const;
+  virtual std::string dirkey(const int,const int, const int, const int) const;
+
+   //calculate three rotations around locX,locY,locY = alpha,beta,gamma out of an HepGeom::Transform3D
+  void extractAlphaBetaGamma(const Amg::Transform3D & trans, 
+                             double& alpha, double& beta, double &gamma) const; 
+
+  ServiceHandle < IToolSvc > p_toolsvc;
+
+  const FaserSCT_ID* m_sctid;
+  const TrackerDD::SCT_DetectorManager* m_sctman;
+
+  std::vector<std::string> m_alignobjs;
+  std::vector<int> m_alignchans;
+
+  bool m_par_scttwoside; // create structures with separated SCT module sides
+  /** name of the root folder for constants, which can be set via 
+      the <key> syntax. Default: /Tracker/Align. */
+  std::string m_par_dbroot;
+  /** the base part of the key for loading AlignableTransform objects
+      from the Transient Data Store. Default: /Tracker/Align */
+  std::string m_par_dbkey;
+
+  AlignableTransform* getTransPtr(const std::string key) const;
+  const AlignableTransform* cgetTransPtr(const std::string key) const;
+  bool m_dynamicDB;
+  bool m_forceUserDBConfig;
+
+  mutable  ToolHandle<IAthenaOutputStreamTool> m_outputTool { this, "OutputTool", "AthenaOutputStreamTool/CondStream1"} ;
+
+};
+
+#endif // TRACKERALIGNGENTOOLS_ALIGNDBTOOL_H
diff --git a/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/components/TrackerAlignGenTools_entries.cxx b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/components/TrackerAlignGenTools_entries.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..6b54f172aa90dd9265f0d5f5699d3d04c940bac4
--- /dev/null
+++ b/Tracker/TrackerAlignTools/TrackerAlignGenTools/src/components/TrackerAlignGenTools_entries.cxx
@@ -0,0 +1,19 @@
+#include "../TrackerAlignDBTool.h"
+// #include "InDetAlignGenTools/InDetAlignTrackSelTool.h"
+// #include "InDetAlignGenTools/InDetAlignFillTrack.h"
+
+// #include "InDetAlignGenTools/InDetAlignOverlapTool.h"
+// #include "InDetAlignGenTools/InDetAlignFillSiCluster.h"
+// #include "InDetAlignGenTools/RefitSiOnlyTool.h"
+// #include "InDetAlignGenTools/InDetAlignHitQualSelTool.h"
+
+
+DECLARE_COMPONENT( TrackerAlignDBTool )
+// DECLARE_COMPONENT( InDetAlignTrackSelTool )
+// DECLARE_COMPONENT( InDetAlignFillTrack )
+
+// DECLARE_COMPONENT( InDetAlignOverlapTool )
+// DECLARE_COMPONENT( InDetAlignFillSiCluster )
+// DECLARE_COMPONENT( InDetAlignHitQualSelTool )
+// DECLARE_COMPONENT( InDetAlignment::RefitSiOnlyTool )
+
diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx
index c13d6942ed5a0ea351b5250033b3d7cc0133aad0..b43e4b321c7e3286a79bc1dd6858526e3c58ae62 100644
--- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx
+++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_DetectorFactory.cxx
@@ -179,7 +179,17 @@ void SCT_DetectorFactory::create(GeoPhysVol *world)
 
     m_detectorManager->addAlignFolderType(TrackerDD::static_run1);
     m_detectorManager->addFolder("/Tracker/Align");
-    m_detectorManager->addChannel("/Tracker/Align/Tracker", 3, TrackerDD::global);
+    m_detectorManager->addChannel("/Tracker/Align/Stations",    3, TrackerDD::global);  // Stations in world
+    m_detectorManager->addChannel("/Tracker/Align/Planes",      2, TrackerDD::global);  // Planes in world
+    m_detectorManager->addChannel("/Tracker/Align/Upstream1",   1, TrackerDD::local);  // Modules in planes and wafers in modules
+    m_detectorManager->addChannel("/Tracker/Align/Upstream2",   1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Upstream3",   1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Central1" ,   1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Central2" ,   1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Central3" ,   1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Downstream1", 1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Downstream2", 1, TrackerDD::local);
+    m_detectorManager->addChannel("/Tracker/Align/Downstream3", 1, TrackerDD::local);
     // m_detectorManager->addFolder("/Indet/Align");
     // m_detectorManager->addChannel("/Indet/Align/ID",3,InDetDD::global);
     // m_detectorManager->addChannel("/Indet/Align/SCT",2,InDetDD::global);
diff --git a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_Plane.cxx b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_Plane.cxx
index 164c40df58e84638d4bd1f1f56a7f80925d4a201..70e433725204a90c67b78db8a6b90a8829992dba 100644
--- a/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_Plane.cxx
+++ b/Tracker/TrackerDetDescr/FaserSCT_GeoModel/src/SCT_Plane.cxx
@@ -107,13 +107,11 @@ SCT_Plane::build(SCT_Identifier id)
     plane->add(new GeoNameTag("Side#" + intToString(side)));
     plane->add(new GeoIdentifierTag(side));
     int iz = -1 + 2 * side;
-    GeoAlignableTransform* transform = new GeoAlignableTransform(GeoTrf::Translate3D(0.0, 0.0, iz * m_sideHalfPitch) * 
-                                                                 GeoTrf::RotateY3D(-iz * 90 * Gaudi::Units::deg));
+    GeoTransform* transform = new GeoTransform(GeoTrf::Translate3D(0.0, 0.0, iz * m_sideHalfPitch) * 
+                                               GeoTrf::RotateY3D(-iz * 90 * Gaudi::Units::deg));
     plane->add(transform);
     GeoVPhysVol* halfPlanePV = m_halfPlane->build(id, -iz);
     plane->add(halfPlanePV);
-    // Store alignable transform; unclear if we can do this...
-    m_detectorManager->addAlignableTransform(2, id.getWaferId(), transform, halfPlanePV);    
   }
 
   // Extra Material
diff --git a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/SCT_DetectorManager.cxx b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/SCT_DetectorManager.cxx
index 47ed2b7742cd7673dfdf7ac934c65322ee7dfe83..948f9c16b9c876f5e806d1032384f3ca70977152 100755
--- a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/SCT_DetectorManager.cxx
+++ b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/SCT_DetectorManager.cxx
@@ -179,7 +179,7 @@ namespace TrackerDD {
                                                        FrameType frame,
                                                        GeoVAlignmentStore* alignStore) const
   {
-
+    ATH_MSG_FATAL("Called un-updated SCT_DetectorManager::setAlignableTransformDelta with level " << level );
     if (level == 0) { // 0 - At the element level
 
       // We retrieve it via a hashId.
@@ -329,8 +329,9 @@ namespace TrackerDD {
   // New global alignment folders
   bool SCT_DetectorManager::processGlobalAlignment(const std::string & key, int level, FrameType frame,
                                                    const CondAttrListCollection* obj, GeoVAlignmentStore* alignStore) const
-  {
-    ATH_MSG_INFO("Processing new global alignment containers with key " << key << " in the " << frame << " frame at level ");
+  { 
+    ATH_MSG_FATAL("Calling un-updated SCT_DetectorManager::processGlobalAlignment method with key " << key << " and level " << level);
+    ATH_MSG_INFO("Processing new global alignment containers with key " << key << " in the " << frame << " frame at level " << level);
 
     const CondAttrListCollection* atrlistcol=obj;
     if(atrlistcol==nullptr and m_detStore->retrieve(atrlistcol,key)!=StatusCode::SUCCESS) {
@@ -394,13 +395,15 @@ namespace TrackerDD {
   }
 
 bool SCT_DetectorManager::processSpecialAlignment(
-    const std::string &, TrackerDD::AlignFolderType) const {
+    const std::string &, 
+    TrackerDD::AlignFolderType) const {
   return false;
 }
 
-bool SCT_DetectorManager::processSpecialAlignment(const std::string& /*key*/,
-                                                  const CondAttrListCollection* /*obj*/,
-                                                  GeoVAlignmentStore* /*alignStore*/) const {
+bool SCT_DetectorManager::processSpecialAlignment(
+    const std::string& /*key*/,
+    const CondAttrListCollection* /*obj*/,
+    GeoVAlignmentStore* /*alignStore*/) const {
   return false;
 
 }
diff --git a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx
index 9395182dc6859c1e30968d8253730bde51a30af0..41c0ab6061de1a7862abc476b86378bb19196039 100755
--- a/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx
+++ b/Tracker/TrackerDetDescr/TrackerReadoutGeometry/src/TrackerDetectorManager.cxx
@@ -205,7 +205,7 @@ namespace TrackerDD
     StatusCode TrackerDetectorManager::align(const RawAlignmentObjects& alignObjects, GeoVAlignmentStore* alignStore) const
     {
 
-        ATH_MSG_DEBUG("align() called from an alignment CondAlg");
+        ATH_MSG_DEBUG("align() called from an alignment CondAlg with " << alignObjects.size() << " folders in RawAlignmentObjects");
         if (!getIdHelper()) return StatusCode::SUCCESS; // To Do: is it really a success?
 
         bool alignmentChange = false;
@@ -273,7 +273,7 @@ namespace TrackerDD
     {
         bool alignmentChange = false;
 
-        ATH_MSG_DEBUG("Dealing with key as container");
+        ATH_MSG_DEBUG("Dealing with AlignmentContainer " << key );
         const AlignableTransformContainer* container;
         if (StatusCode::SUCCESS!=m_detStore->retrieve(container, key)) {        
             ATH_MSG_ERROR("Cannot find AlignableTransformContainer for key " 
@@ -309,11 +309,16 @@ namespace TrackerDD
             // This should not occur in normal situations so we force job to abort.
             throw std::runtime_error("Unable to apply Tracker alignments.");
         }
+        else
+        {
+            ATH_MSG_DEBUG("Processing container with " << container->size() << " AlignableTransforms");
+        }
         // loop over all the AlignableTransform objects in the collection
         // use only the last ones.
         std::map<const std::string, const AlignableTransform*> stringToTransform;
         for (DataVector<AlignableTransform>::const_iterator pat=container->begin();
              pat!=container->end();++pat) {
+            ATH_MSG_DEBUG("Found AlignableTransform with tag " << (*pat)->tag());
             stringToTransform[(*pat)->tag()] = *pat;
         }
         for (std::pair<const std::string, const AlignableTransform*> value: stringToTransform) {
@@ -333,9 +338,9 @@ namespace TrackerDD
         // returns -1 if unrecognized.  
         const LevelInfo & levelInfo = getLevel(key);
         if (levelInfo.isValid()) {
-            ATH_MSG_VERBOSE("Processing channel: " << key);
+            ATH_MSG_VERBOSE("Processing channel: " << key << " with " << transformCollection->size() << " elements");
         } else {
-            ATH_MSG_DEBUG("Channel " << key << " not registered in this manager");
+            ATH_MSG_DEBUG("Channel " << key << " with " << transformCollection->size() << " elements not registered in this manager");
         }
         // return silently if unrecognised - this can happen in container mode
         // when a single container holds transforms for both pixel and SCT