diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
index f9b1e323f6967700f530930fd3c48d00cc3a6e04..b0032c8eda77fd050eb7434f8cdaafffda920093 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/MuonAGDDTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MuonAGDDTool_H
@@ -20,8 +20,7 @@ class IToolSvc;
 class MuonAGDDTool: public AGDDToolBase
 {
 public:
-	MuonAGDDTool(const std::string& type, const std::string& name, 
-				 const IInterface* parent);
+	MuonAGDDTool(const std::string& type, const std::string& name, const IInterface* parent);
 	virtual StatusCode construct();
 	
 	virtual StatusCode initialize();
@@ -32,6 +31,8 @@ private:
 	std::vector<std::string> m_structuresFromFlags;
 	std::string m_outFileType;
 	std::string m_outPREsqlName;
+	std::string m_DBFileName;
+	std::string m_agdd2GeoSvcName;
 
 	bool m_readAGDD;
 	bool m_dumpAGDD;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/NSWAGDDTool.h b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/NSWAGDDTool.h
index f91c9ed8f8c3a66b18c63a47e8688b6c0baf307e..afd6fa7e2896231508258ace41b15525b80f1e26 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/NSWAGDDTool.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/MuonAGDD/NSWAGDDTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef NSWAGDDTool_H
@@ -17,8 +17,7 @@ namespace MuonGM
 class NSWAGDDTool: public AGDDToolBase
 {
 public:
-	NSWAGDDTool(const std::string& type, const std::string& name, 
-				 const IInterface* parent);
+	NSWAGDDTool(const std::string& type, const std::string& name, const IInterface* parent);
 	virtual StatusCode construct();
 	
 	virtual StatusCode initialize();
@@ -36,6 +35,8 @@ private:
 
 	std::string m_outFileType;
 	std::string m_outPREsqlName;
+	std::string m_DBFileName;
+	std::string m_agdd2GeoSvcName;
 
 	bool m_readAGDD;
 	bool m_dumpAGDD;
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
index 8cc4c830566ab8a9c11daefcde9705659c58f050..66f9790e635d17919ff51bd1673003d0b80bf939 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonAGDD/MuonAGDDTool.h"
@@ -16,19 +16,23 @@
 
 using namespace MuonGM;
 
-MuonAGDDTool::MuonAGDDTool(const std::string& type, const std::string& name, 
-				 const IInterface* parent):AGDDToolBase(type,name,parent),
-					m_overrideConfiguration(false),m_buildNSW(true)
+MuonAGDDTool::MuonAGDDTool(const std::string& type, const std::string& name, const IInterface* parent) :
+    AGDDToolBase(type,name,parent),
+    m_outPREsqlName(""),
+    m_overrideConfiguration(false),
+    m_buildNSW(true)
 #ifndef SIMULATIONBASE
 					, p_AmdcsimrecAthenaSvc ( "AmdcsimrecAthenaSvc",name )
 #endif
 {
   	declareProperty( "Structures" ,     m_structuresToBuild);
 	declareProperty( "ReadAGDD",   		m_readAGDD = true);
-	declareProperty( "DumpAGDD",		m_dumpAGDD = false);
+	declareProperty( "DumpAGDD",		m_dumpAGDD = false, "write blob from DB into text file");
 	declareProperty( "OverrideConfiguration",m_overrideConfiguration = false);
 	declareProperty( "BuildNSW",		m_buildNSW = true);
 	declareProperty( "OutputFileType",	m_outFileType = "AGDD", "Name for database table");
+	declareProperty( "OutputFileName",	m_DBFileName = "", "specify name for DB text file");
+	declareProperty( "AGDDtoGeoSvcName", m_agdd2GeoSvcName = "AGDDtoGeoSvc", "specify name of AGDDtoGeoSvc");
 }
 
 StatusCode MuonAGDDTool::initialize()
@@ -39,6 +43,10 @@ StatusCode MuonAGDDTool::initialize()
 
 	ATH_CHECK(AGDDToolBase::initialize());
 
+	if (m_DBFileName.empty()) {
+		m_DBFileName = "Generated_" + m_outFileType + "_pool.txt";
+	}
+
 	// please see more details on regarding the dependency on AMDB on ATLASSIM-3636
 	// and the CMakeLists.txt . the NSWAGDDTool avoids the dependency already
 #ifndef SIMULATIONBASE
@@ -48,6 +56,7 @@ StatusCode MuonAGDDTool::initialize()
 	if (m_buildNSW) 
 	{
 		MuonAGDDToolHelper theHelper;
+		theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
 		theHelper.SetNSWComponents();
 	}
 	
@@ -58,7 +67,8 @@ StatusCode MuonAGDDTool::initialize()
 StatusCode MuonAGDDTool::construct() 
 {
 	MuonAGDDToolHelper theHelper;
-		
+	theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
+
 	m_controller->UseGeoModelDetector("Muon");
 	
 	if (!m_locked)
@@ -81,8 +91,8 @@ StatusCode MuonAGDDTool::construct()
 	}
 	
 	ATH_MSG_INFO(" now reading AGDD blob ");
-	
-	std::string AGDDfile=theHelper.GetAGDD(m_dumpAGDD, m_outFileType);
+
+	std::string AGDDfile=theHelper.GetAGDD(m_dumpAGDD, m_outFileType, m_DBFileName);
 #ifndef SIMULATIONBASE
 	if(m_writeDBfile) AGDDfile = p_AmdcsimrecAthenaSvc->GetAgddString();
 #endif
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
index abdf632b9556e5b0709caf5ee051cc3d62980940..e582c335e369e680674e81b1f019f85bdcd5aac4 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.cxx
@@ -38,12 +38,15 @@
 #include "MuonAGDDBase/mmSpacer_TechHandler.h"
 #include "MuonAGDDBase/mm_readoutHandler.h"
 
+#include <TString.h> // for Form
 #include <fstream>
 
 using namespace MuonGM;
 
-MuonAGDDToolHelper::MuonAGDDToolHelper()
-{
+MuonAGDDToolHelper::MuonAGDDToolHelper() :
+    p_RDBAccessSvc(nullptr),
+    p_GeoModelSvc(nullptr),
+    m_svcName("AGDDtoGeoSvc") {
 	StatusCode result;
 	
 	result=Gaudi::svcLocator()->service("GeoModelSvc",p_GeoModelSvc);
@@ -64,10 +67,8 @@ std::vector<std::string>& MuonAGDDToolHelper::ReadAGDDFlags()
 	structuresFromFlags.clear();
    std::string agdd2geoVersion = p_RDBAccessSvc->getChildTag("AGDD2GeoSwitches",p_GeoModelSvc->muonVersion(),"MuonSpectrometer");
 
-//   m_AGDD2GeoSwitches.clear();
    if(!agdd2geoVersion.empty()) 
    {
-//     m_AGDD2GeoSwitchesStamp = m_AGDD2GeoSwitchesStamp + 1;
      std::string TheKEYNAME;
      int TheKEYVALUE;
      IRDBRecordset_ptr pIRDBRecordset = p_RDBAccessSvc->getRecordsetPtr("AGDD2GeoSwitches",p_GeoModelSvc->muonVersion(),"MuonSpectrometer");
@@ -78,8 +79,6 @@ std::vector<std::string>& MuonAGDDToolHelper::ReadAGDDFlags()
        TheKEYVALUE = record->getInt("KEYVALUE");
        if ( TheKEYVALUE == 1 )
        {
-//        std::cout<<"  Add to m_AGDD2GeoSwitches " << TheKEYNAME <<std::endl;
-//		 if (aliases->IsAliased(TheKEYNAME))
          structuresFromFlags.push_back(TheKEYNAME);
        }
      }
@@ -92,7 +91,7 @@ std::vector<std::string>& MuonAGDDToolHelper::ReadAGDDFlags()
 }
 
 
-std::string MuonAGDDToolHelper::GetAGDD(bool dumpIt, std::string tableName)
+std::string MuonAGDDToolHelper::GetAGDD(const bool dumpIt, const std::string& tableName, const std::string& outFileName)
 {
 
    const IGeoModelSvc * geoModel=p_GeoModelSvc;
@@ -125,11 +124,7 @@ std::string MuonAGDDToolHelper::GetAGDD(bool dumpIt, std::string tableName)
    if (dumpIt) 
    {
 	 	std::ofstream  GeneratedFile;
-		std::string fileName;
-		fileName.append("Generated_");
-		fileName.append(tableName);
-		fileName.append("_pool.txt");
-	 	GeneratedFile.open(fileName);
+	 	GeneratedFile.open(outFileName);
 		GeneratedFile<<AgddString<<std::endl;
 		GeneratedFile.close();
    }
@@ -140,45 +135,20 @@ std::string MuonAGDDToolHelper::GetAGDD(bool dumpIt, std::string tableName)
 
 bool MuonAGDDToolHelper::BuildMScomponents() const
 {
-
-//  ATH_MSG_INFO("BuildMScomponents - start");
-
-  StoreGateSvc* pDetStore=0;
+  StoreGateSvc* pDetStore=nullptr;
   ISvcLocator* svcLocator = Gaudi::svcLocator();
-  StatusCode sc=svcLocator->service("DetectorStore",pDetStore);
-  if (sc.isFailure()) 
-    {
-//      ATH_MSG_ERROR("AGDDController could not get at the detector store!");
-    }
-  MuonGM::MuonDetectorManager*	muonMgr;
-  sc = pDetStore->retrieve( muonMgr );
-  if ( sc.isFailure() ) {
-//   ATH_MSG_ERROR(" Cannot retrieve MuonDetectorManager " );
-   return false;
-  }
-
+  if (svcLocator->service("DetectorStore",pDetStore).isFailure()) return false;
+  MuonGM::MuonDetectorManager* muonMgr=nullptr;
+  if (pDetStore->retrieve(muonMgr).isFailure()) return false;
   bool readoutGeoDone =  BuildReadoutGeometry(muonMgr/*, GetMSdetectors*/);
-  if (!readoutGeoDone) {
-//   ATH_MSG_INFO(" Problems met while building the ReadoutGeometry " );
-   return false;
-  }
-//  else ATH_MSG_INFO( "ReadoutGeometry created" );
-//  ATH_MSG_INFO("In BuildMScomponents - done");
-
+  if (!readoutGeoDone) return false;
   return true;
 }
 
 bool MuonAGDDToolHelper::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*, std::map<GeoFullPhysVol*, std::string>* vec*/) const
 {
   bool geoBuilt = true;  
-//  ATH_MSG_INFO("In BuildReadoutGeometry - start");
 
-  //std::map<std::string, GeoFullPhysVol*>* myMap =  NULL;
-  //myMap = GetMSdetectors();
-  //log<<MSG::INFO<<"In AGDD2GeoSvc::BuildReadoutGeometry - size of the detector map = "<<myMap->size()<<endmsg;
-
-  //std::map<std::string, GeoFullPhysVol*>::const_iterator it;
-  
   detectorList& dList=AGDDDetectorStore::GetDetectorStore()->GetDetectorList();
   detectorList::const_iterator it;
   for (it=dList.begin(); it!=dList.end(); ++it)
@@ -188,7 +158,6 @@ bool MuonAGDDToolHelper::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*
       {
       std::string chTag = dPos[i]->ID.detectorAddress;
       GeoFullPhysVol* vol = dPos[i]->theVolume;
-//      ATH_MSG_INFO("Building RE for component named <"<<chTag<<">");
       
       std::string stName = chTag.substr(0,4);
       
@@ -205,20 +174,10 @@ bool MuonAGDDToolHelper::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*
       phiIndex = atoi((chTag.substr(12,1)).c_str());
       mLayer = atoi((chTag.substr(7,1)).c_str());
       
-      //MuonReadoutElement* re = NULL;
       if (chTag.substr(0,3)=="sMD")
 	  {
 	  MMReadoutElement* re = new MMReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);
 	  std::string myVolName = (chTag.substr(0,8)).c_str();
-	  /* AGDDParameterBagMM* MMparaBag = dynamic_cast<AGDDParameterBagMM*> (AGDDParameterStore::GetParameterStore()->GetParameterBag(myVolName));
-	  if(!MMparaBag) {
-	    std::cout << " not possible to retrieve parameters for <" << myVolName << ": quitting! >" << std::endl;
-		return false;
-	  }
-	  double pitch;
-	  if(iLS==1) pitch = MMparaBag->TechParameters->pitchSS; //small
-	  else pitch = MMparaBag->TechParameters->pitchLS; //large
-	  re->initDesign(MMparaBag->largeX, MMparaBag->smallX, MMparaBag->lengthY, pitch, MMparaBag->TechParameters->thickness); */
 	  re->initDesign(-999., -999., -999., -999., -999.);
 	  re->fillCache();
 	  mgr->addMMReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
@@ -228,43 +187,23 @@ bool MuonAGDDToolHelper::BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr/*
 	  {
 	  sTgcReadoutElement* re = new sTgcReadoutElement((GeoVFullPhysVol*)vol, stName, etaIndex, phiIndex, mLayer, false, mgr);	  
 	  std::string myVolName = (chTag.substr(0,8)).c_str();
-	  /*
-	  AGDDParameterBagsTGC* sTGCparaBag = dynamic_cast<AGDDParameterBagsTGC*> (AGDDParameterStore::GetParameterStore()->GetParameterBag(myVolName));
-	  if(!sTGCparaBag) {
-	    std::cout << " not possible to retrieve parameters for <" << myVolName << ": quitting! >" << std::endl;
-		return false;
-	  }
-	  re->initDesign(sTGCparaBag->largeX, sTGCparaBag->smallX, sTGCparaBag->lengthY, sTGCparaBag->TechParameters->stripPitch,
-			 sTGCparaBag->TechParameters->wirePitch, sTGCparaBag->TechParameters->stripWidth, sTGCparaBag->TechParameters->wireWidth,
-			 sTGCparaBag->TechParameters->thickness);
-	  
-	  since the concept of Parameter Bag is dismissed things get hardcoded
-	  initDesign for sTGCReadoutElement only uses stripPitch, strip Width and thickness - all other dimensions (here -999.) are (hard)coded there again
-	  */
 	  re->initDesign(-999., -999., -999., 3.2, -999., 2.7, -999., 2.6);
 	  re->fillCache();
 	  mgr->addsTgcReadoutElement_withIdFields(re, iLS, etaIndex, phiIndex, mLayer);
     re->setDelta(mgr);
 	  }
 	  }
-
-      //aggdContainer->push_back(*it);
   }
-  //std::cout<<"Size of the NSWdetectors = <"<<vec->size()<<"> "<<aggdContainer->size()<<std::cout;
-  //sc=pDetStore->record( aggdContainer ,"NSWdetectors");
   return geoBuilt;
 
 }
 
 void MuonAGDDToolHelper::SetNSWComponents()
 {
-	IAGDDtoGeoSvc* agddsvc;
-	StatusCode result;
-	result=Gaudi::svcLocator()->service("AGDDtoGeoSvc",agddsvc);
-	if (result.isFailure())
-    {
-    	std::cout<<"could not initialize AGDDtoGeoSvc!!! "<<std::endl;
-    }
+	IAGDDtoGeoSvc* agddsvc = nullptr;
+	if (Gaudi::svcLocator()->service(m_svcName,agddsvc).isFailure()) {
+    throw std::runtime_error(Form("File: %s, Line: %d\nMuonAGDDToolHelper::SetNSWComponents() - Could not retrieve %s from ServiceLocator", __FILE__, __LINE__, m_svcName.c_str()));
+  }
 	
 	agddsvc->addHandler(new micromegasHandler("micromegas"));
 	agddsvc->addHandler(new mm_TechHandler("mm_Tech"));
@@ -275,3 +214,7 @@ void MuonAGDDToolHelper::SetNSWComponents()
 	agddsvc->addHandler(new mmSpacer_TechHandler("mmSpacer_Tech"));
 	agddsvc->addHandler(new mm_readoutHandler("mm_readout"));
 }	
+
+void MuonAGDDToolHelper::setAGDDtoGeoSvcName(const std::string& name) {
+  m_svcName = name;
+}
\ No newline at end of file
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
index 4a88db9124efc92b2885138ae437ca149334f43a..7b65dbaea9728ae2936d9608893f72b76f49a4ce 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/MuonAGDDToolHelper.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef MUONAGDD_MUONAGDDTOOLHELPER_H
@@ -25,15 +25,18 @@ public:
 	
 	void SetNSWComponents();
 	
-	std::string GetAGDD(bool dumpIt, std::string tableName);
+	std::string GetAGDD(const bool dumpIt, const std::string& tableName, const std::string& outFileName);
 	
 	bool BuildMScomponents() const;
 	bool BuildReadoutGeometry(MuonGM::MuonDetectorManager* mgr) const;
 
+	void setAGDDtoGeoSvcName(const std::string& name);
+
 private:
 
 	IRDBAccessSvc* p_RDBAccessSvc;
 	IGeoModelSvc* p_GeoModelSvc;
+	std::string m_svcName;
 	
 };
 
diff --git a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx
index 3eef8bc23151d8f7f7d641e199bf8195a5fc20fb..4ae838e48938fb840830a22eeff38f6764fedb45 100644
--- a/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx
+++ b/MuonSpectrometer/MuonDetDescr/MuonAGDD/src/NSWAGDDTool.cxx
@@ -1,22 +1,24 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "MuonAGDD/NSWAGDDTool.h"
+
 #include "MuonAGDDToolHelper.h"
 #include "AGDDControl/AGDDController.h"
 #include "AGDDControl/AGDD2GeoModelBuilder.h"
 #include "AGDD2GeoSvc/IAGDD2GeoSvc.h"
-
 #include "AGDDModel/AGDDParameterStore.h"
 #include "AGDDKernel/AGDDDetector.h"
 #include "AGDDKernel/AGDDDetectorStore.h"
+
 #include <fstream>
 
 using namespace MuonGM;
 
-NSWAGDDTool::NSWAGDDTool(const std::string& type, const std::string& name, 
-				 const IInterface* parent):AGDDToolBase(type,name,parent)
+NSWAGDDTool::NSWAGDDTool(const std::string& type, const std::string& name, const IInterface* parent) :
+    AGDDToolBase(type,name,parent),
+    m_outPREsqlName("")
 {
 	declareProperty( "ReadAGDD",   		m_readAGDD    = true,           "read description from DB");
 	declareProperty( "DumpAGDD",		m_dumpAGDD    = false,          "write out parsed XML");
@@ -28,6 +30,8 @@ NSWAGDDTool::NSWAGDDTool(const std::string& type, const std::string& name,
 	declareProperty( "OutputFilePASVNAME",	m_outFilePasN = "",		"passive structure version string");
 	declareProperty( "OutputFileFORMAT",	m_outFileForm = "AGDDXML",	"format of output file");
 	declareProperty( "OutputFileType",	m_outFileType = "NSWD", 	"name for database table");
+	declareProperty( "OutputFileName",	m_DBFileName = "", "specify name for DB text file");
+	declareProperty( "AGDDtoGeoSvcName", m_agdd2GeoSvcName = "AGDDtoGeoSvc", "specify name of AGDDtoGeoSvc");
 }
 
 StatusCode NSWAGDDTool::initialize()
@@ -44,7 +48,11 @@ StatusCode NSWAGDDTool::initialize()
 	m_outFileName = "Out.AmdcOracle.AM." + m_outFileType + "temp.data";
 	m_outPREsqlName = "Out.AmdcOracle.AM." + m_outFileType + ".PREsql";
 
-        ATH_CHECK(AGDDToolBase::initialize());
+    ATH_CHECK(AGDDToolBase::initialize());
+
+	if (m_DBFileName.empty()) {
+		m_DBFileName = "Generated_" + m_outFileType + "_pool.txt";
+	}
 	
 	static int iEntries=0;
 	
@@ -52,6 +60,7 @@ StatusCode NSWAGDDTool::initialize()
 	{
 		iEntries=1;
 		MuonAGDDToolHelper theHelper;
+		theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
 		theHelper.SetNSWComponents();
 	}
 
@@ -65,6 +74,7 @@ StatusCode NSWAGDDTool::construct()
 	ATH_MSG_INFO(" Name = "<<name());
 	
 	MuonAGDDToolHelper theHelper;
+	theHelper.setAGDDtoGeoSvcName(m_agdd2GeoSvcName);
 	if (!m_readAGDD)
 	{
 		ATH_MSG_INFO(" trying to parse files ");
@@ -73,7 +83,7 @@ StatusCode NSWAGDDTool::construct()
 	else
 	{
 		ATH_MSG_INFO(" trying to parse data base content ");
-		std::string AGDDfile = theHelper.GetAGDD(m_dumpAGDD, m_outFileType);
+		std::string AGDDfile = theHelper.GetAGDD(m_dumpAGDD, m_outFileType, m_DBFileName);
 		m_controller->ParseString(AGDDfile);
 	}
 	
@@ -100,7 +110,6 @@ StatusCode NSWAGDDTool::construct()
 	if(m_writeDBfile)
 	{
 		// build model before writing blob - if Athena crashes the XML is not good and should not become a blob
-		//((AGDD2GeoModelBuilder*)m_controller->GetBuilder())->BuildAllVolumes();
 		ATH_MSG_INFO("\t-- attempting to write output to "<< m_outFileName );
 		if( !m_outFileName.empty() )
 		{