diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
index 5ff2e87d8f6c2991f2a25fdb0e633cc12068de40..d6bbdb8fcc3543a8d87e620be3e7d183abe4b664 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/GeoRead/GReadIn.h
@@ -105,8 +105,7 @@ private:
 
 
 	// input arguments
-	std::string _dbName;
-	GeoPhysVol* _root;
+	GeoPhysVol* m_root;
 	GMDBManager* m_dbManager;
 	unsigned long* m_progress;
 	bool m_deepDebug;
@@ -121,25 +120,25 @@ private:
 
 	// data containers
 
-	QHash<QString, QMap<unsigned int, QStringList>> _allchildren; // key = "parentId:parentTable", item = list of children parameters, inserted by child position
+	QHash<QString, QMap<unsigned int, QStringList>> m_allchildren; // key = "parentId:parentTable", item = list of children parameters, inserted by child position
 
-	QHash<unsigned int, QStringList> _physVols;
-	QHash<unsigned int, QStringList> _fullPhysVols;
-	QHash<unsigned int, QStringList> _logVols;
-	QHash<unsigned int, QStringList> _shapes;
-	QHash<unsigned int, QStringList> _materials;
-	QHash<unsigned int, QStringList> _transforms;
-	QHash<unsigned int, QStringList> _alignableTransforms;
-	QHash<unsigned int, QStringList> _serialDenominators;
-	QHash<unsigned int, QStringList> _serialTransformers;
-	QHash<unsigned int, QStringList> _functions;
-	QHash<unsigned int, QStringList> _nameTags;
+	QHash<unsigned int, QStringList> m_physVols;
+	QHash<unsigned int, QStringList> m_fullPhysVols;
+	QHash<unsigned int, QStringList> m_logVols;
+	QHash<unsigned int, QStringList> m_shapes;
+	QHash<unsigned int, QStringList> m_materials;
+	QHash<unsigned int, QStringList> m_transforms;
+	QHash<unsigned int, QStringList> m_alignableTransforms;
+	QHash<unsigned int, QStringList> m_serialDenominators;
+	QHash<unsigned int, QStringList> m_serialTransformers;
+	QHash<unsigned int, QStringList> m_functions;
+	QHash<unsigned int, QStringList> m_nameTags;
 
-	QHash<unsigned int, QString> _tableid_tableName;
+	QHash<unsigned int, QString> m_tableid_tableName;
 
-	QStringList _root_vol_data;
+	QStringList m_root_vol_data;
 
-	QHash<QString, GeoGraphNode*> _memMap;
+	QHash<QString, GeoGraphNode*> m_memMap;
 
 	std::set<std::string> m_unknown_shapes;
 
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
index 69815340e41d68e39af8d5eff628c7353b2a6d15..7788ea3ecf7995989c5279ee8885b8575a9648ba 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoRead/src/GReadIn.cpp
@@ -172,13 +172,13 @@ GeoPhysVol* GReadIn::buildGeoModelByCalls()
 	QString nodeType = rootValues.takeFirst(); // it takes out the first element
 
 	// get GeoModel node. Depth == -1 means "get all children volumes / all levels"
-	// _root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, -1));
-	_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType));
+	// m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, -1));
+	m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType));
 
 	// TODO: check if shared nodes are restored only one and then used when needed,
 	// or they are restored with a new node in memory every time they are met
 
-	return _root;
+	return m_root;
 }
 */
 
@@ -187,42 +187,42 @@ GeoPhysVol* GReadIn::buildGeoModelOneGo()
 	qDebug() << "GReadIn::buildGeoModelOneGo()";
 
 	// get all objects from the DB
-	_physVols = m_dbManager->getTableFromNodeType("GeoPhysVol");
+	m_physVols = m_dbManager->getTableFromNodeType("GeoPhysVol");
 	std::cout << "GeoPhysVol, read in." << std::endl;
-	_fullPhysVols = m_dbManager->getTableFromNodeType("GeoFullPhysVol");
+	m_fullPhysVols = m_dbManager->getTableFromNodeType("GeoFullPhysVol");
 	std::cout << "GeoFullPhysVol, read in." << std::endl;
-	_logVols = m_dbManager->getTableFromNodeType("GeoLogVol");
+	m_logVols = m_dbManager->getTableFromNodeType("GeoLogVol");
 	std::cout << "GeoLogVol, read in." << std::endl;
-	_shapes = m_dbManager->getTableFromNodeType("GeoShape");
+	m_shapes = m_dbManager->getTableFromNodeType("GeoShape");
 	std::cout << "GeoShape, read in." << std::endl;
-	_materials = m_dbManager->getTableFromNodeType("GeoMaterial");
+	m_materials = m_dbManager->getTableFromNodeType("GeoMaterial");
 	std::cout << "GeoMaterial, read in." << std::endl;
-	_functions = m_dbManager->getTableFromNodeType("Function");
+	m_functions = m_dbManager->getTableFromNodeType("Function");
 	std::cout << "Function, read in." << std::endl;
-	_serialDenominators = m_dbManager->getTableFromNodeType("GeoSerialDenominator");
+	m_serialDenominators = m_dbManager->getTableFromNodeType("GeoSerialDenominator");
 	std::cout << "GeoSerialDenominator, read in." << std::endl;
-	_serialTransformers = m_dbManager->getTableFromNodeType("GeoSerialTransformer");
+	m_serialTransformers = m_dbManager->getTableFromNodeType("GeoSerialTransformer");
 	std::cout << "GeoSerialTransformer, read in." << std::endl;
-	_alignableTransforms = m_dbManager->getTableFromNodeType("GeoAlignableTransform");
+	m_alignableTransforms = m_dbManager->getTableFromNodeType("GeoAlignableTransform");
 	std::cout << "GeoAlignableTransform, read in." << std::endl;
-	_transforms = m_dbManager->getTableFromNodeType("GeoTransform");
+	m_transforms = m_dbManager->getTableFromNodeType("GeoTransform");
 	std::cout << "GeoTransform, read in." << std::endl;
-	_nameTags = m_dbManager->getTableFromNodeType("GeoNameTag");
+	m_nameTags = m_dbManager->getTableFromNodeType("GeoNameTag");
 	std::cout << "GeoNameTag, read in." << std::endl;
-	// qDebug() << "physVols: " << _physVols;
-	// qDebug() << "fullPhysVols: " << _fullPhysVols;
+	// qDebug() << "physVols: " << m_physVols;
+	// qDebug() << "fullPhysVols: " << m_fullPhysVols;
 
 	// get DB metadata
-	_tableid_tableName = m_dbManager->getAll_TableIDsNodeTypes();
+	m_tableid_tableName = m_dbManager->getAll_TableIDsNodeTypes();
 	std::cout << "DB metadata, read in." << std::endl;
 
 	// get the children table from DB
-	_allchildren = m_dbManager->getChildrenTable();
-	// qDebug() << "all children from DB:" << _allchildren;
+	m_allchildren = m_dbManager->getChildrenTable();
+	// qDebug() << "all children from DB:" << m_allchildren;
 	std::cout << "children positions, read in." << std::endl;
 
 	// get the root volume data
-	_root_vol_data = m_dbManager->getRootPhysVol();
+	m_root_vol_data = m_dbManager->getRootPhysVol();
 	std::cout << "root volume data, read in." << std::endl;
 
 	return loopOverAllChildren();
@@ -241,161 +241,161 @@ GeoPhysVol* GReadIn::buildGeoModelOneGo()
 GeoPhysVol* GReadIn::loopOverAllChildren()
 {
 
-	std::cout << "Looping over all children to build the GeoModel tree..." << std::endl;
-
-	int nChildrenRecords = _allchildren.size();
-
-	// This should go in VP1Light, not in this library. The library could be used by standalone apps without a GUI
-        /*
-	  QProgressDialog progress("Loading the geometry...", "Abort Loading", 0, nChildrenRecords, 0);
-  	  progress.setWindowModality(Qt::WindowModal);
-	  progress.show();
-	*/
-
-	// loop over parents' keys
-	int counter = 0;
-	foreach (const QString &parentKey, _allchildren.keys() ) {
-
-		 /* //This should go in VP1Light as well!
-		  if (progress.wasCanceled()) {
-			std::cout << "You aborted the loading of the geometry." << std::endl;
-
-			QMessageBox msgBox;
-			msgBox.setText("You aborted the loading of the geometry.");
-			msgBox.setInformativeText("Do you want to really abort it?");
-			msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
-			msgBox.setDefaultButton(QMessageBox::No);
-			int ret = msgBox.exec();
-
-			switch (ret) {
-			   case QMessageBox::Yes:
-			      // Abort the loading of the geometry
-			      break;
-			   case QMessageBox::No:
-			      // Continue with the loading of the geometry
-			      progress.reset();
-			  default:
-			      // should never be reached
-			      break;
-			}
-		  }
-		*/
-
-
-
-		++counter;
-		std::cout.precision(0);
-		if ( nChildrenRecords < 10000 && counter % 500 == 0 ) {
-			float done = ( (float)counter / nChildrenRecords) * 100;
-			std::cout << "\t" << std::fixed << counter << "children records processed [" << done << "%]" << std::endl;
-			if ( m_progress != nullptr  ) {
-			  //progress.setValue(counter); // This hould go in VP1Light
-			  *m_progress = counter;
-			}
-		}
-		else if ( nChildrenRecords > 10000 && counter % 2000 == 0 ) {
-			float done = ( (float)counter / nChildrenRecords) * 100;
-			std::cout << "\t" << std::fixed << counter << " children records processed [" << done << "%]" << std::endl;
-			if ( m_progress != nullptr ) {
-			  //progress.setValue(counter); // This should go in VP1Light
-			  *m_progress = counter;
-			}
-		}
-		if (m_deepDebug) qDebug() << "\nparent: " << parentKey << ':' << _allchildren.value(parentKey) << "[parentId, parentType, parentCopyNumber, childPos, childType, childId, childCopyN]";
-
-		// get the parent's details
-		QStringList parentKeyItems = parentKey.split(":");
-		QString parentId = parentKeyItems[0];
-		QString parentTableId = parentKeyItems[1];
-		QString parentCopyN = parentKeyItems[2];
-		if (m_deepDebug) qDebug() << "parent ID:" << parentId << ", parent table ID:" << parentTableId << ", parent copy number:" << parentCopyN;
-
-		bool isRootVolume = false;
-		if (parentId == "NULL") {
-		  isRootVolume = true;
-		}
-
-		GeoVPhysVol* parentVol = nullptr;
-
-		// build or get parent volume.
-		// Using the parentCopyNumber here, to get a given instance of the parent volume
-		if (!isRootVolume) {
-			if (m_deepDebug) qDebug() << "get the parent volume...";
-		 	parentVol = buildVPhysVol( parentId, parentTableId, parentCopyN);
-	 	}
-
-
-		// get the parent's children
-		QMap<unsigned int, QStringList> children = _allchildren.value(parentKey);
-
-
-
-		// loop over children, sorted by child position automatically
-		// "id", "parentId", "parentTable", "parentCopyNumber", "position", "childTable", "childId", "childCopyNumber"
-		if (m_deepDebug) qDebug() << "parent volume has " << children.size() << "children. Looping over them...";
-		foreach(QStringList child, children) {
-
-			if (m_deepDebug) qDebug() << "child:" << child;
-
-			// build or get child node
-			QString childTableId = child[5];
-			QString childId = child[6];
-			QString childCopyN = child[7];
-
-			QString childNodeType = _tableid_tableName[childTableId.toUInt()];
-
-			if (m_deepDebug) qDebug() << "childTableId:" << childTableId << ", type:" << childNodeType << ", childId:" << childId;
-
-			if (childNodeType.isEmpty()) {
-				qWarning("ERROR!!! childNodeType is empty!!! Aborting...");
-				exit(1);
-			}
-
-			if (childNodeType == "GeoPhysVol") {
-				if (m_deepDebug) qDebug() << "GeoPhysVol child...";
-				GeoVPhysVol* childNode = dynamic_cast<GeoPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoFullPhysVol") {
-				if (m_deepDebug) qDebug() << "GeoFullPhysVol child...";
-				GeoVPhysVol* childNode = dynamic_cast<GeoFullPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoSerialDenominator") {
-				if (m_deepDebug) qDebug() << "GeoSerialDenominator child...";
-				GeoSerialDenominator* childNode = buildSerialDenominator(childId);
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoAlignableTransform") {
-				if (m_deepDebug) qDebug() << "GeoAlignableTransform child...";
-				GeoAlignableTransform* childNode = buildAlignableTransform(childId);
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoTransform") {
-				if (m_deepDebug) qDebug() << "GeoTransform child...";
-				GeoTransform* childNode = buildTransform(childId);
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoSerialTransformer") {
-				if (m_deepDebug) qDebug() << "GeoSerialTransformer child...";
-				GeoSerialTransformer* childNode = buildSerialTransformer(childId);
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-			}
-			else if (childNodeType == "GeoNameTag") {
-				if (m_deepDebug) qDebug() << "GeoNameTag child...";
-				GeoNameTag* childNode = buildNameTag(childId);
-				if (!isRootVolume) volAddHelper(parentVol, childNode);
-	                }
-			else {
-				QString msg = "[" + childNodeType + "]" + QString(" ==> ERROR!!! - The conversion for this type of child node needs to be implemented, still!!!");
-				qFatal("%s", msg.toLatin1().constData());
-			}
-
-		} // loop over all children
-	} // loop over childrenPositions records
-
-	// return the root volume
-	return getRootVolume();
+  std::cout << "Looping over all children to build the GeoModel tree..." << std::endl;
+
+  int nChildrenRecords = m_allchildren.size();
+
+  // This should go in VP1Light, not in this library. The library could be used by standalone apps without a GUI
+  /*
+    QProgressDialog progress("Loading the geometry...", "Abort Loading", 0, nChildrenRecords, 0);
+    progress.setWindowModality(Qt::WindowModal);
+    progress.show();
+  */
+
+  // loop over parents' keys
+  int counter = 0;
+  foreach (const QString &parentKey, m_allchildren.keys() ) {
+
+    /* //This should go in VP1Light as well!
+       if (progress.wasCanceled()) {
+       std::cout << "You aborted the loading of the geometry." << std::endl;
+
+       QMessageBox msgBox;
+       msgBox.setText("You aborted the loading of the geometry.");
+       msgBox.setInformativeText("Do you want to really abort it?");
+       msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
+       msgBox.setDefaultButton(QMessageBox::No);
+       int ret = msgBox.exec();
+
+       switch (ret) {
+       case QMessageBox::Yes:
+       // Abort the loading of the geometry
+       break;
+       case QMessageBox::No:
+       // Continue with the loading of the geometry
+       progress.reset();
+       default:
+       // should never be reached
+       break;
+       }
+       }
+    */
+
+
+
+    ++counter;
+    std::cout.precision(0);
+    if ( nChildrenRecords < 10000 && counter % 500 == 0 ) {
+      float done = ( (float)counter / nChildrenRecords) * 100;
+      std::cout << "\t" << std::fixed << counter << "children records processed [" << done << "%]" << std::endl;
+      if ( m_progress != nullptr  ) {
+        //progress.setValue(counter); // This hould go in VP1Light
+        *m_progress = counter;
+      }
+    }
+    else if ( nChildrenRecords > 10000 && counter % 2000 == 0 ) {
+      float done = ( (float)counter / nChildrenRecords) * 100;
+      std::cout << "\t" << std::fixed << counter << " children records processed [" << done << "%]" << std::endl;
+      if ( m_progress != nullptr ) {
+        //progress.setValue(counter); // This should go in VP1Light
+        *m_progress = counter;
+      }
+    }
+    if (m_deepDebug) qDebug() << "\nparent: " << parentKey << ':' << m_allchildren.value(parentKey) << "[parentId, parentType, parentCopyNumber, childPos, childType, childId, childCopyN]";
+
+    // get the parent's details
+    QStringList parentKeyItems = parentKey.split(":");
+    QString parentId = parentKeyItems[0];
+    QString parentTableId = parentKeyItems[1];
+    QString parentCopyN = parentKeyItems[2];
+    if (m_deepDebug) qDebug() << "parent ID:" << parentId << ", parent table ID:" << parentTableId << ", parent copy number:" << parentCopyN;
+
+    bool isRootVolume = false;
+    if (parentId == "NULL") {
+      isRootVolume = true;
+    }
+
+    GeoVPhysVol* parentVol = nullptr;
+
+    // build or get parent volume.
+    // Using the parentCopyNumber here, to get a given instance of the parent volume
+    if (!isRootVolume) {
+      if (m_deepDebug) qDebug() << "get the parent volume...";
+      parentVol = buildVPhysVol( parentId, parentTableId, parentCopyN);
+    }
+
+
+    // get the parent's children
+    QMap<unsigned int, QStringList> children = m_allchildren.value(parentKey);
+
+
+
+    // loop over children, sorted by child position automatically
+    // "id", "parentId", "parentTable", "parentCopyNumber", "position", "childTable", "childId", "childCopyNumber"
+    if (m_deepDebug) qDebug() << "parent volume has " << children.size() << "children. Looping over them...";
+    foreach(QStringList child, children) {
+
+      if (m_deepDebug) qDebug() << "child:" << child;
+
+      // build or get child node
+      QString childTableId = child[5];
+      QString childId = child[6];
+      QString childCopyN = child[7];
+
+      QString childNodeType = m_tableid_tableName[childTableId.toUInt()];
+
+      if (m_deepDebug) qDebug() << "childTableId:" << childTableId << ", type:" << childNodeType << ", childId:" << childId;
+
+      if (childNodeType.isEmpty()) {
+        qWarning("ERROR!!! childNodeType is empty!!! Aborting...");
+        exit(1);
+      }
+
+      if (childNodeType == "GeoPhysVol") {
+        if (m_deepDebug) qDebug() << "GeoPhysVol child...";
+        GeoVPhysVol* childNode = dynamic_cast<GeoPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoFullPhysVol") {
+        if (m_deepDebug) qDebug() << "GeoFullPhysVol child...";
+        GeoVPhysVol* childNode = dynamic_cast<GeoFullPhysVol*>(buildVPhysVol(childId, childTableId, childCopyN));
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoSerialDenominator") {
+        if (m_deepDebug) qDebug() << "GeoSerialDenominator child...";
+        GeoSerialDenominator* childNode = buildSerialDenominator(childId);
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoAlignableTransform") {
+        if (m_deepDebug) qDebug() << "GeoAlignableTransform child...";
+        GeoAlignableTransform* childNode = buildAlignableTransform(childId);
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoTransform") {
+        if (m_deepDebug) qDebug() << "GeoTransform child...";
+        GeoTransform* childNode = buildTransform(childId);
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoSerialTransformer") {
+        if (m_deepDebug) qDebug() << "GeoSerialTransformer child...";
+        GeoSerialTransformer* childNode = buildSerialTransformer(childId);
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else if (childNodeType == "GeoNameTag") {
+        if (m_deepDebug) qDebug() << "GeoNameTag child...";
+        GeoNameTag* childNode = buildNameTag(childId);
+        if (!isRootVolume) volAddHelper(parentVol, childNode);
+      }
+      else {
+        QString msg = "[" + childNodeType + "]" + QString(" ==> ERROR!!! - The conversion for this type of child node needs to be implemented, still!!!");
+        qFatal("%s", msg.toLatin1().constData());
+      }
+
+    } // loop over all children
+  } // loop over childrenPositions records
+
+  // return the root volume
+  return getRootVolume();
 }
 
 
@@ -420,750 +420,750 @@ GeoPhysVol* GReadIn::loopOverAllChildren()
 // 	QString nodeType = rootValues.takeFirst(); // it takes out the first element
 //
 // 	// get GeoModel node. Depth == 1 means "get only first level children"
-// 	_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, 1));
+// 	m_root = dynamic_cast<GeoPhysVol*>(parseVPhysVol(rootValues, nodeType, 1));
 //
 // 	// TODO: check if shared nodes are restored only one and then used when needed,
 // 	// or they are restored with a new node in memory every time they are met
 //
-// 	return _root;
+// 	return m_root;
 // }
 
 /*
-GeoVPhysVol* GReadIn::parseChildren(GeoVPhysVol* vol, QMap<unsigned int, QStringList> children, int depth)
-{
-	qDebug() << "GReadIn::parseChildren()";
-
-	//qDebug() << "children:" << children;
-
-	// get parent volume type
-	QString volType;
-	if (dynamic_cast<GeoPhysVol*>(vol))
-		volType = "GeoPhysVol";
-	else if (dynamic_cast<GeoFullPhysVol*>(vol))
-		volType = "GeoFullPhysVol";
-	else
-		qWarning() << "ERROR!! Unknown vol type!!";
-
-	QMap<unsigned int, QStringList>::const_iterator it; // we don't modify the map, so we use a const_iterator, which is is slightly faster as well.
-
-	for ( it = children.begin(); it != children.end(); ++it) {
-		qDebug() << "\nchild item:" << it.key() << ":" << it.value();
-
-		// QString id = it.value()[0];
-		// QString parentId = it.value()[1];
-		// QString parentTableId = it.value()[2];
-		// QString childPosition = it.value()[3];
-		unsigned int childTableId = it.value()[4].toUInt();
-		unsigned int childId = it.value()[5].toUInt();
-
-		// QString parentTable = m_dbManager->getTableNameFromTableId(parentTableId.toUInt());
-
-		QStringList child = m_dbManager->getItemAndType(childTableId, childId );
-		qDebug() << "child:" << child;
-
-		QString nodeType = child.takeFirst(); // it pops out the first element, leaving the other items in the list
-
-		if (depth > 0) {
-			depth = depth - 1; // decrease the depth by one
-		}
-
-		if (nodeType == "GeoPhysVol") {
-			// if ( childId != parentId.toUInt() ) {
-				if (child.length() > 0) {
-					// build the node
-					GeoPhysVol* volChild = dynamic_cast<GeoPhysVol*>(parseVPhysVol(child, nodeType, depth));
-					// add the node to the parent
-					volAddHelper(vol, volChild);
-				} else {
-					qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
-				}
-			// } else {
-			// 	qWarning() << "WARNING!!" << "childId and parentId are the same! That means an infinite loop!! To be investigated! Skipping now...";
-			// }
-		}
-		else if (nodeType == "GeoFullPhysVol") {
-			if (child.length() > 0) {
-				GeoFullPhysVol* volChild = dynamic_cast<GeoFullPhysVol*>(parseVPhysVol(child, nodeType, depth));
-				volAddHelper(vol, volChild);
-			} else {
-				qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
-			}
-		}
-		else if (nodeType == "GeoSerialDenominator") {
-			GeoSerialDenominator* volChild = parseSerialDenominator(child);
-			volAddHelper(vol, volChild);
-			// vol->add(volChild);
-		}
-		else if (nodeType == "GeoAlignableTransform") {
-			GeoAlignableTransform* volChild = parseAlignableTransform(child);
-			volAddHelper(vol, volChild);
-			// vol->add(volChild);
-		}
-		else if (nodeType == "GeoTransform") {
-			GeoTransform* volChild = parseTransform(child);
-			volAddHelper(vol, volChild);
-			// vol->add(volChild);
-		}
-		else if (nodeType == "GeoSerialTransformer") {
-			GeoSerialTransformer* volChild = parseSerialTransformer(child);
-			volAddHelper(vol, volChild);
-			// vol->add(volChild);
-		}
-		else if (nodeType == "GeoNodeTag") { // TODO: implement it!!
-			QString msg = nodeType + QString(" GeoNodeTag needs to be implemented!!!");
-			qWarning() << msg;
-		}
-		else {
-			QString msg = nodeType + QString(" child-->GeoModel conversion for this type still needs to be implemented!!!");
-			qWarning() << msg;
-		}
-
-	}
-	// this below is to suppress the compiler warning,
-	// but it should not be reached, so we use a qFatal
-	qFatal("This code should not be reached!!! Aborting...");
-	GeoVPhysVol* volnull = nullptr;
-	return volnull;
-}
+  GeoVPhysVol* GReadIn::parseChildren(GeoVPhysVol* vol, QMap<unsigned int, QStringList> children, int depth)
+  {
+  qDebug() << "GReadIn::parseChildren()";
+
+  //qDebug() << "children:" << children;
+
+  // get parent volume type
+  QString volType;
+  if (dynamic_cast<GeoPhysVol*>(vol))
+  volType = "GeoPhysVol";
+  else if (dynamic_cast<GeoFullPhysVol*>(vol))
+  volType = "GeoFullPhysVol";
+  else
+  qWarning() << "ERROR!! Unknown vol type!!";
+
+  QMap<unsigned int, QStringList>::const_iterator it; // we don't modify the map, so we use a const_iterator, which is is slightly faster as well.
+
+  for ( it = children.begin(); it != children.end(); ++it) {
+  qDebug() << "\nchild item:" << it.key() << ":" << it.value();
+
+  // QString id = it.value()[0];
+  // QString parentId = it.value()[1];
+  // QString parentTableId = it.value()[2];
+  // QString childPosition = it.value()[3];
+  unsigned int childTableId = it.value()[4].toUInt();
+  unsigned int childId = it.value()[5].toUInt();
+
+  // QString parentTable = m_dbManager->getTableNameFromTableId(parentTableId.toUInt());
+
+  QStringList child = m_dbManager->getItemAndType(childTableId, childId );
+  qDebug() << "child:" << child;
+
+  QString nodeType = child.takeFirst(); // it pops out the first element, leaving the other items in the list
+
+  if (depth > 0) {
+  depth = depth - 1; // decrease the depth by one
+  }
+
+  if (nodeType == "GeoPhysVol") {
+  // if ( childId != parentId.toUInt() ) {
+  if (child.length() > 0) {
+  // build the node
+  GeoPhysVol* volChild = dynamic_cast<GeoPhysVol*>(parseVPhysVol(child, nodeType, depth));
+  // add the node to the parent
+  volAddHelper(vol, volChild);
+  } else {
+  qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
+  }
+  // } else {
+  // 	qWarning() << "WARNING!!" << "childId and parentId are the same! That means an infinite loop!! To be investigated! Skipping now...";
+  // }
+  }
+  else if (nodeType == "GeoFullPhysVol") {
+  if (child.length() > 0) {
+  GeoFullPhysVol* volChild = dynamic_cast<GeoFullPhysVol*>(parseVPhysVol(child, nodeType, depth));
+  volAddHelper(vol, volChild);
+  } else {
+  qWarning() << "WARNING!!!" << "The PhysVol" << childId << "is empty/not-existing!!! To be investigated why...! Skipping now...";
+  }
+  }
+  else if (nodeType == "GeoSerialDenominator") {
+  GeoSerialDenominator* volChild = parseSerialDenominator(child);
+  volAddHelper(vol, volChild);
+  // vol->add(volChild);
+  }
+  else if (nodeType == "GeoAlignableTransform") {
+  GeoAlignableTransform* volChild = parseAlignableTransform(child);
+  volAddHelper(vol, volChild);
+  // vol->add(volChild);
+  }
+  else if (nodeType == "GeoTransform") {
+  GeoTransform* volChild = parseTransform(child);
+  volAddHelper(vol, volChild);
+  // vol->add(volChild);
+  }
+  else if (nodeType == "GeoSerialTransformer") {
+  GeoSerialTransformer* volChild = parseSerialTransformer(child);
+  volAddHelper(vol, volChild);
+  // vol->add(volChild);
+  }
+  else if (nodeType == "GeoNodeTag") { // TODO: implement it!!
+  QString msg = nodeType + QString(" GeoNodeTag needs to be implemented!!!");
+  qWarning() << msg;
+  }
+  else {
+  QString msg = nodeType + QString(" child-->GeoModel conversion for this type still needs to be implemented!!!");
+  qWarning() << msg;
+  }
+
+  }
+  // this below is to suppress the compiler warning,
+  // but it should not be reached, so we use a qFatal
+  qFatal("This code should not be reached!!! Aborting...");
+  GeoVPhysVol* volnull = nullptr;
+  return volnull;
+  }
 */
 
 void GReadIn::volAddHelper(GeoVPhysVol* vol, GeoGraphNode* volChild)
 {
-	if (dynamic_cast<GeoPhysVol*>(vol)) {
-		GeoPhysVol* volume = dynamic_cast<GeoPhysVol*>(vol);
-		volume->add(volChild);
-	} else if (dynamic_cast<GeoFullPhysVol*>(vol)) {
-		GeoFullPhysVol* volume = dynamic_cast<GeoFullPhysVol*>(vol);
-		volume->add(volChild);
-	}
+  if (dynamic_cast<GeoPhysVol*>(vol)) {
+    GeoPhysVol* volume = dynamic_cast<GeoPhysVol*>(vol);
+    volume->add(volChild);
+  } else if (dynamic_cast<GeoFullPhysVol*>(vol)) {
+    GeoFullPhysVol* volume = dynamic_cast<GeoFullPhysVol*>(vol);
+    volume->add(volChild);
+  }
 }
 
 /*
 // Instantiate a PhysVol and get its children
 GeoVPhysVol* GReadIn::parseVPhysVol(QStringList values, QString nodeType, int depth)
 {
-	qDebug() << "GReadIn::parseVPhysVol()";
-
-	QString volId = values[0];
-	QString logVolId = values[1];
-	QString parentId = values[2];
-
-	qDebug() << "\tPhysVol-ID:" << volId;
-	qDebug() << "\tPhysVol-LogVol:" << logVolId;
-	qDebug() << "\tPhysVol-parentId:" << parentId;
-	qDebug() << "\tnodeType:" << nodeType;
-
-
-	// GET LOGVOL
-	// get logVol properties from the DB
-	QStringList paramsLog = m_dbManager->getItem("GeoLogVol", logVolId.toUInt());
-	qDebug() << "params:" << paramsLog;
-
-	// build the LogVol
-	GeoLogVol* logVol = parseLogVol(paramsLog);
-
-	// a pointer to the VPhysVol
-	GeoVPhysVol* vol = nullptr;
-
-	// BUILD THE PHYSVOL OR THE FULLPHYSVOL
-	if (nodeType == "GeoPhysVol")
-		vol = new GeoPhysVol(logVol);
-	else if (nodeType == "GeoFullPhysVol")
-		vol = new GeoFullPhysVol(logVol);
-	else
-		qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
-
-
-	// if we want to get the volume's children
-	if (depth != 0) {
-
-		// * check if the volume has children
-		// get the IDs of all children of this PhysVol volume
-		QMap<unsigned int, QStringList> children = m_dbManager->getVPhysVolChildren( volId.toUInt(), nodeType );
-		qDebug() << "children of the " << nodeType << "node with Id:" << volId << " --> " << children;
-		// if this PhysVol has children, build them and add them to it
-		if (children.size() > 0)
-			parseChildren(vol, children, depth);
-		else
-			qDebug() << "VPhysVol has no children";
-	}
+qDebug() << "GReadIn::parseVPhysVol()";
+
+QString volId = values[0];
+QString logVolId = values[1];
+QString parentId = values[2];
+
+qDebug() << "\tPhysVol-ID:" << volId;
+qDebug() << "\tPhysVol-LogVol:" << logVolId;
+qDebug() << "\tPhysVol-parentId:" << parentId;
+qDebug() << "\tnodeType:" << nodeType;
+
+
+// GET LOGVOL
+// get logVol properties from the DB
+QStringList paramsLog = m_dbManager->getItem("GeoLogVol", logVolId.toUInt());
+qDebug() << "params:" << paramsLog;
+
+// build the LogVol
+GeoLogVol* logVol = parseLogVol(paramsLog);
+
+// a pointer to the VPhysVol
+GeoVPhysVol* vol = nullptr;
+
+// BUILD THE PHYSVOL OR THE FULLPHYSVOL
+if (nodeType == "GeoPhysVol")
+vol = new GeoPhysVol(logVol);
+else if (nodeType == "GeoFullPhysVol")
+vol = new GeoFullPhysVol(logVol);
+else
+qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
+
+
+// if we want to get the volume's children
+if (depth != 0) {
+
+// * check if the volume has children
+// get the IDs of all children of this PhysVol volume
+QMap<unsigned int, QStringList> children = m_dbManager->getVPhysVolChildren( volId.toUInt(), nodeType );
+qDebug() << "children of the " << nodeType << "node with Id:" << volId << " --> " << children;
+// if this PhysVol has children, build them and add them to it
+if (children.size() > 0)
+parseChildren(vol, children, depth);
+else
+qDebug() << "VPhysVol has no children";
+}
 
-	return vol;
+return vol;
 }
 */
 
 
 void GReadIn::checkInputString(QString input)
 {
-	if (input.isEmpty() || input.isNull() || input == "NULL") {
-		qWarning() << "ERROR!!! Input QString is empty or equal to 'NULL'!!! Aborting...";
-		exit(1);
-	}
+  if (input.isEmpty() || input.isNull() || input == "NULL") {
+    qWarning() << "ERROR!!! Input QString is empty or equal to 'NULL'!!! Aborting...";
+    exit(1);
+  }
 }
 
 // Instantiate a PhysVol and get its children
 GeoVPhysVol* GReadIn::buildVPhysVol(QString id, QString tableId, QString copyN)
 {
-	if (m_deepDebug) qDebug() << "GReadIn::buildVPhysVol()" << id << tableId << copyN;
+  if (m_deepDebug) qDebug() << "GReadIn::buildVPhysVol()" << id << tableId << copyN;
 
-	checkInputString(id);
-	checkInputString(tableId);
+  checkInputString(id);
+  checkInputString(tableId);
 
-	// if previously built, return that
-	if (isNodeBuilt(id, tableId, copyN)) {
-		if (m_deepDebug) qDebug() << "getting the volume from memory...";
-		return dynamic_cast<GeoVPhysVol*>(getNode(id, tableId, copyN));
-	}
+  // if previously built, return that
+  if (isNodeBuilt(id, tableId, copyN)) {
+    if (m_deepDebug) qDebug() << "getting the volume from memory...";
+    return dynamic_cast<GeoVPhysVol*>(getNode(id, tableId, copyN));
+  }
 
-	if (m_deepDebug) qDebug() << "building a new volume...";
+  if (m_deepDebug) qDebug() << "building a new volume...";
 
-	// QString nodeType = m_dbManager->getNodeTypeFromTableId(tableId.toUInt());
-	QString nodeType = _tableid_tableName[tableId.toUInt()];
+  // QString nodeType = m_dbManager->getNodeTypeFromTableId(tableId.toUInt());
+  QString nodeType = m_tableid_tableName[tableId.toUInt()];
 
-	// get the parent volume parameters
-	// here we do not need to use copyN, since the actual volume is the same for all instances
-	QStringList values;
-	if (nodeType == "GeoPhysVol")
-		 values = _physVols[id.toUInt()];
-	else if (nodeType == "GeoFullPhysVol")
-		 values = _fullPhysVols[id.toUInt()];
+  // get the parent volume parameters
+  // here we do not need to use copyN, since the actual volume is the same for all instances
+  QStringList values;
+  if (nodeType == "GeoPhysVol")
+    values = m_physVols[id.toUInt()];
+  else if (nodeType == "GeoFullPhysVol")
+    values = m_fullPhysVols[id.toUInt()];
 
 
 
-	QString volId = values[0];
-	QString logVolId = values[1];
-	//QString parentId = values[2]; // FIXME: delete it, it is not used any more
+  QString volId = values[0];
+  QString logVolId = values[1];
+  //QString parentId = values[2]; // FIXME: delete it, it is not used any more
 
-	if (m_deepDebug) {
-	  qDebug() << "\tPhysVol-ID:" << volId;
-	  qDebug() << "\tPhysVol-LogVol:" << logVolId;
-	  //qDebug() << "\tPhysVol-parentId:" << parentId;
-	  qDebug() << "\tnodeType:" << nodeType;
-	}
+  if (m_deepDebug) {
+    qDebug() << "\tPhysVol-ID:" << volId;
+    qDebug() << "\tPhysVol-LogVol:" << logVolId;
+    //qDebug() << "\tPhysVol-parentId:" << parentId;
+    qDebug() << "\tnodeType:" << nodeType;
+  }
 
-	// GET LOGVOL
-	GeoLogVol* logVol = buildLogVol(logVolId);
+  // GET LOGVOL
+  GeoLogVol* logVol = buildLogVol(logVolId);
 
-	// a pointer to the VPhysVol
-	GeoVPhysVol* vol = nullptr;
+  // a pointer to the VPhysVol
+  GeoVPhysVol* vol = nullptr;
 
-	// BUILD THE PHYSVOL OR THE FULLPHYSVOL
-	if (nodeType == "GeoPhysVol")
-		vol = new GeoPhysVol(logVol);
-	else if (nodeType == "GeoFullPhysVol")
-		vol = new GeoFullPhysVol(logVol);
-	else
-		qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
+  // BUILD THE PHYSVOL OR THE FULLPHYSVOL
+  if (nodeType == "GeoPhysVol")
+    vol = new GeoPhysVol(logVol);
+  else if (nodeType == "GeoFullPhysVol")
+    vol = new GeoFullPhysVol(logVol);
+  else
+    qWarning() << "ERROR!!! Unkonwn node type!! : " << nodeType;
 
-	// storing the address of the newly built node
-	storeNode(id, tableId, copyN, vol);
+  // storing the address of the newly built node
+  storeNode(id, tableId, copyN, vol);
 
-	return vol;
+  return vol;
 }
 
 
 // Get the root volume
 GeoPhysVol* GReadIn::getRootVolume()
 {
-	if (m_deepDebug) qDebug() << "GReadIn::getRootVolume()";
-	QString id = _root_vol_data[1];
-	QString tableId = _root_vol_data[2];
-	QString copyNumber = "1"; // the Root volume has only one copy by definition
-	return dynamic_cast<GeoPhysVol*>(buildVPhysVol(id, tableId, copyNumber));
+  if (m_deepDebug) qDebug() << "GReadIn::getRootVolume()";
+  QString id = m_root_vol_data[1];
+  QString tableId = m_root_vol_data[2];
+  QString copyNumber = "1"; // the Root volume has only one copy by definition
+  return dynamic_cast<GeoPhysVol*>(buildVPhysVol(id, tableId, copyNumber));
 }
 
 
 
 /*
-GeoMaterial* GReadIn::parseMaterial(QStringList values)
-{
-	qDebug() << "GReadIn::parseMaterial()";
+  GeoMaterial* GReadIn::parseMaterial(QStringList values)
+  {
+  qDebug() << "GReadIn::parseMaterial()";
 
-	QString matId = values[0];
-	QString matName = values[1];
+  QString matId = values[0];
+  QString matName = values[1];
 
-	qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
+  qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
 
-	// TODO: Bogus densities.  Later: read from database.
-	double densityOfAir=0.1;
+  // TODO: Bogus densities.  Later: read from database.
+  double densityOfAir=0.1;
 
-	return new GeoMaterial(matName.toStdString(),densityOfAir);
+  return new GeoMaterial(matName.toStdString(),densityOfAir);
 
-}
+  }
 */
 
 
 GeoMaterial* GReadIn::buildMaterial(QString id)
 {
-	if (m_deepDebug) qDebug() << "GReadIn::buildMaterial()";
-	QStringList values = _materials[id.toUInt()];
+  if (m_deepDebug) qDebug() << "GReadIn::buildMaterial()";
+  QStringList values = m_materials[id.toUInt()];
 
-	QString matId = values[0];
-	QString matName = values[1];
+  QString matId = values[0];
+  QString matName = values[1];
 
-	if (m_deepDebug) qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
+  if (m_deepDebug) qDebug() << "\tMaterial-ID:" << matId << ", Material-name:" << matName;
 
-	// TODO: Bogus densities.  Later: read from database.
-	double densityOfAir=0.1;
+  // TODO: Bogus densities.  Later: read from database.
+  double densityOfAir=0.1;
 
-	return new GeoMaterial(matName.toStdString(),densityOfAir);
+  return new GeoMaterial(matName.toStdString(),densityOfAir);
 
 }
 
 
 /*
-GeoShape* GReadIn::parseShape(QStringList values)
-{
-	qDebug() << "GReadIn::parseShape()";
-
-	QString id = values[0];
-	QString type = values[1];
-	QString parameters = values[2];
-
-	qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
-
-	if (type == "Box") {
-
-			// needed parameters
-			double XHalfLength;
-			double YHalfLength;
-			double ZHalfLength;
-
-			// get parameters from DB string
-			QStringList shapePars = parameters.split(";");
-			foreach( QString par, shapePars) {
-					QStringList vars = par.split("=");
-					QString varName = vars[0];
-					QString varValue = vars[1];
-
-					if (varName == "XHalfLength") XHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-					if (varName == "YHalfLength") YHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-					if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-			}
-
-		// return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
-		return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
-	}
-	else if (type == "Tube") {
-
-		// needed parameters
-		double RMin;
-		double RMax;
-		double ZHalfLength;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-
-			if (varName == "RMin") RMin = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMax") RMax = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-			if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
-		}
-
-		// return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
-		return new GeoTube(RMin, RMax, ZHalfLength);
-
-	}
-	else if (type == "Shift") {
-
-		// needed parameters
-		unsigned int shapeId;
-		unsigned int transfId;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-
-			if (varName == "A") shapeId = varValue.toUInt();
-			if (varName == "X") transfId = varValue.toUInt();
-		}
-
-		// get the referenced shape
-		const GeoShape* shapeA = getShape( QString::number(shapeId) );
-
-		// get the referenced HepGeom::Transform3D
-		QStringList transPars = m_dbManager->getItemFromTableName("Transforms", transfId);
-		qDebug() << "child:" << transPars;
-		GeoTransform* transf = parseTransform(transPars);
-		const HepGeom::Transform3D transfX = transf->getTransform();
-
-		// build and return the GeoShapeShift instance
-		return new GeoShapeShift(shapeA, transfX);
-	}
-	else if (type == "Pcon") {
-
-		// needed parameters
-		unsigned int SPhi;
-		unsigned int DPhi;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-
-			if (varName == "SPhi") SPhi = varValue.toUInt();
-			if (varName == "DPhi") DPhi = varValue.toUInt();
-		}
-
-		// return new shape
-		return new GeoPcon(SPhi, DPhi);
-	}
-	else {
-		QString msg = "WARNING!! - Shape '" + type + "' not implemented yet!!! Returning a dummy cube.";
-		qWarning() << msg;
-		return new GeoBox(30.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm); // FIXME: bogus shape. Use actual shape!
-	}
-
-}
+  GeoShape* GReadIn::parseShape(QStringList values)
+  {
+  qDebug() << "GReadIn::parseShape()";
+
+  QString id = values[0];
+  QString type = values[1];
+  QString parameters = values[2];
+
+  qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
+
+  if (type == "Box") {
+
+  // needed parameters
+  double XHalfLength;
+  double YHalfLength;
+  double ZHalfLength;
+
+  // get parameters from DB string
+  QStringList shapePars = parameters.split(";");
+  foreach( QString par, shapePars) {
+  QStringList vars = par.split("=");
+  QString varName = vars[0];
+  QString varValue = vars[1];
+
+  if (varName == "XHalfLength") XHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  if (varName == "YHalfLength") YHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  }
+
+  // return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
+  return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
+  }
+  else if (type == "Tube") {
+
+  // needed parameters
+  double RMin;
+  double RMax;
+  double ZHalfLength;
+
+  // get parameters from DB string
+  QStringList shapePars = parameters.split(";");
+  foreach( QString par, shapePars) {
+  QStringList vars = par.split("=");
+  QString varName = vars[0];
+  QString varValue = vars[1];
+
+  if (varName == "RMin") RMin = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  if (varName == "RMax") RMax = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble() * SYSTEM_OF_UNITS::mm;
+  }
+
+  // return new GeoBox(5.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm);
+  return new GeoTube(RMin, RMax, ZHalfLength);
+
+  }
+  else if (type == "Shift") {
+
+  // needed parameters
+  unsigned int shapeId;
+  unsigned int transfId;
+
+  // get parameters from DB string
+  QStringList shapePars = parameters.split(";");
+  foreach( QString par, shapePars) {
+  QStringList vars = par.split("=");
+  QString varName = vars[0];
+  QString varValue = vars[1];
+
+  if (varName == "A") shapeId = varValue.toUInt();
+  if (varName == "X") transfId = varValue.toUInt();
+  }
+
+  // get the referenced shape
+  const GeoShape* shapeA = getShape( QString::number(shapeId) );
+
+  // get the referenced HepGeom::Transform3D
+  QStringList transPars = m_dbManager->getItemFromTableName("Transforms", transfId);
+  qDebug() << "child:" << transPars;
+  GeoTransform* transf = parseTransform(transPars);
+  const HepGeom::Transform3D transfX = transf->getTransform();
+
+  // build and return the GeoShapeShift instance
+  return new GeoShapeShift(shapeA, transfX);
+  }
+  else if (type == "Pcon") {
+
+  // needed parameters
+  unsigned int SPhi;
+  unsigned int DPhi;
+
+  // get parameters from DB string
+  QStringList shapePars = parameters.split(";");
+  foreach( QString par, shapePars) {
+  QStringList vars = par.split("=");
+  QString varName = vars[0];
+  QString varValue = vars[1];
+
+  if (varName == "SPhi") SPhi = varValue.toUInt();
+  if (varName == "DPhi") DPhi = varValue.toUInt();
+  }
+
+  // return new shape
+  return new GeoPcon(SPhi, DPhi);
+  }
+  else {
+  QString msg = "WARNING!! - Shape '" + type + "' not implemented yet!!! Returning a dummy cube.";
+  qWarning() << msg;
+  return new GeoBox(30.0*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm, 30*SYSTEM_OF_UNITS::cm); // FIXME: bogus shape. Use actual shape!
+  }
+
+  }
 */
 
 GeoShape* GReadIn::buildShape(QString shapeId)
 {
-	if (m_deepDebug) qDebug() << "GReadIn::buildShape()";
-	QStringList paramsShape = _shapes[ shapeId.toUInt() ];
-
-	QString id = paramsShape[0];
-	QString type = paramsShape[1];
-	QString parameters = paramsShape[2];
-
-	if (m_deepDebug) qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
-
-	if (type == "Box") {
-			// shape parameters
-			double XHalfLength = 0.;
-			double YHalfLength = 0.;
-			double ZHalfLength = 0.;
-			// get parameters from DB string
-			QStringList shapePars = parameters.split(";");
-			foreach( QString par, shapePars) {
-					QStringList vars = par.split("=");
-					QString varName = vars[0];
-					QString varValue = vars[1];
-					if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-					if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			}
-		return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
-	}
-	else if (type == "Cons") {
-		// shape parameters
-		double RMin1 = 0.;
-		double RMin2 = 0.;
-		double RMax1 = 0.;
-		double RMax2 = 0.;
-		double DZ = 0.;
-		double SPhi = 0.;
-		double DPhi = 0.;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "RMin1") RMin1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMin2") RMin2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMax1") RMax1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "RMax2") RMax2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "DZ") DZ = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "SPhi") SPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "SPDPhihi") DPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-		}
-		return new GeoCons (RMin1, RMin2, RMax1, RMax2, DZ, SPhi, DPhi);
-	}
-	else if (type == "Para") {
-		// shape parameters
-		double XHalfLength = 0.;
-		double YHalfLength = 0.;
-		double ZHalfLength = 0.;
-		double Alpha = 0.;
-		double Theta = 0.;
-		double Phi = 0.;
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		foreach( QString par, shapePars) {
-			QStringList vars = par.split("=");
-			QString varName = vars[0];
-			QString varValue = vars[1];
-			if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "Alpha") Alpha = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "Theta") Theta = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-			if (varName == "Phi") Phi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
-		}
-		return new GeoPara (XHalfLength, YHalfLength, ZHalfLength, Alpha, Theta, Phi);
-	}
-	else if (type == "Pcon") {
-		// shape parameters
-		double SPhi = 0.;
-		double DPhi = 0.;
-		unsigned int NZPlanes = 0;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-
-		bool error = 0;
-		QString par;
-		QStringList vars;
-		QString varName;
-		QString varValue;
-
-		GeoPcon* pcon = nullptr;
-
-		int sizePars = shapePars.size();
-		// check if we have more than 3 parameters
-		if (sizePars > 3) {
-
-			// get the three first GeoPcon parameters: the SPhi and DPhi angles, plus the number of Z planes
-			for( int it=0; it < 3; it++) {
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				if (varName == "SPhi") SPhi = varValue.toDouble();
-				if (varName == "DPhi") DPhi = varValue.toDouble();
-				if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
-			}
-			// build the basic GeoPcon shape
-			pcon = new GeoPcon(SPhi, DPhi);
-
-			// and now loop over the rest of the list, to get the parameters of all Z planes
-			for (int it=3; it < sizePars; it++)
-			{
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				// qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
-
-				if (varName == "ZPos") {
-
-					double zpos = varValue.toDouble();
-					double rmin=0., rmax=0.;
-
-					it++; // go to next variable
-
-					par = shapePars[it];
-					vars = par.split("=");
-					varName = vars[0];
-					varValue = vars[1];
-					if (varName == "ZRmin") rmin = varValue.toDouble();
-					else error = 1;
-					it++; // go to next variable
-
-					par = shapePars[it];
-					vars = par.split("=");
-					varName = vars[0];
-					varValue = vars[1];
-					if (varName == "ZRmax") rmax = varValue.toDouble();
-					else error = 1;
-
-					if(error) qWarning() << "ERROR! GeoPcon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
-
-					// add a Z plane to the GeoPcon
-					pcon->addPlane(zpos, rmin, rmax);
-				} else {
-					error = 1;
-					qWarning() << "ERROR! GeoPcon 'ZPos' value is not at the right place! --> " << shapePars;
-				}
-			}
-
-			// sanity check on the resulting Pcon shape
-			if( pcon->getNPlanes() != NZPlanes) {
-				error = 1;
-				qWarning() << "ERROR! GeoPcon number of planes: " << QString::number(pcon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
-			}
-			if(!pcon->isValid()) {
-				error = 1;
-				qWarning() << "ERROR! GeoPcon shape is not valid!! -- input: " << shapePars;
-			}
-	  } // end if (size>3)
-		else {
-			qWarning() << "ERROR!! GeoPcon has no Z planes!! --> shape input parameters: " << shapePars;
-			error = 1;
-		}
-
-		if(error) qFatal("GeoPcon shape error!!! Aborting...");
-
-		return pcon;
-	}
-	else if (type == "Pgon") {
-		// shape parameters
-		double SPhi = 0.;
-		double DPhi = 0.;
-		unsigned int NSides = 0;
-		unsigned int NZPlanes = 0;
-
-		bool error = false;
-		GeoPgon* pgon = nullptr;
-		QString par;
-		QStringList vars;
-		QString varName;
-		QString varValue;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		// qInfo() << "shapePars: " << shapePars; // debug
-
-		int sizePars = shapePars.size();
-		// check if we have more than 3 parameters
-		if (sizePars > 3) {
-
-			// get the first four GeoPgon parameters: the SPhi and DPhi angles, plus the number of Z planes
-			for( int it=0; it < 4; it++) {
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				// qInfo() << "vars: " << vars; // for debug only
-				if (varName == "SPhi") SPhi = varValue.toDouble();
-				if (varName == "DPhi") DPhi = varValue.toDouble();
-				if (varName == "NSides") NSides = varValue.toUInt();// * SYSTEM_OF_UNITS::mm;
-				if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
-
-			}
-			// build the basic GeoPgon shape
-			pgon = new GeoPgon(SPhi, DPhi, NSides);
-
-			// and now loop over the rest of the list, to get the parameters of all Z planes
-			for (int it=4; it < sizePars; it++)
-			{
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				// qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
-
-				if (varName == "ZPos") {
-
-					double zpos = varValue.toDouble();
-					double rmin=0., rmax=0.;
-
-					it++; // go to next variable
-
-					par = shapePars[it];
-					vars = par.split("=");
-					varName = vars[0];
-					varValue = vars[1];
-					if (varName == "ZRmin") rmin = varValue.toDouble();
-					else error = 1;
-					it++; // go to next variable
-
-					par = shapePars[it];
-					vars = par.split("=");
-					varName = vars[0];
-					varValue = vars[1];
-					if (varName == "ZRmax") rmax = varValue.toDouble();
-					else error = 1;
-
-					if(error) qWarning() << "ERROR! GeoPgon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
-
-					// add a Z plane to the GeoPgon
-					pgon->addPlane(zpos, rmin, rmax);
-				} else {
-					error = 1;
-					qWarning() << "ERROR! GeoPgon 'ZPos' value is not at the right place! --> " << shapePars;
-				}
-			}
-
-			// sanity check on the resulting Pgon shape
-			if( pgon->getNPlanes() != NZPlanes) {
-				error = 1;
-				qWarning() << "ERROR! GeoPgon number of planes: " << QString::number(pgon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
-			}
-			if(!pgon->isValid()) {
-				error = 1;
-				qWarning() << "ERROR! GeoPgon shape is not valid!! -- input: " << shapePars;
-			}
-		} // end if (size>3)
-		else {
-			qWarning() << "ERROR!! GeoPgon has no Z planes!! --> shape input parameters: " << shapePars;
-			error = 1;
-		}
-		if(error) qFatal("GeoPgon shape error!!! Aborting...");
-		return pgon;
-	}
-	else if (type == "SimplePolygonBrep")
-	{
-		//qInfo() << "Reading-in: SimplePolygonBrep: "; // debug
-		// shape parameters
-		double DZ = 0.;
-		unsigned int NVertices = 0;
-		double xV = 0.;
-		double yV = 0.;
-
-		bool error = 0;
-		GeoSimplePolygonBrep* sh = nullptr;
-		QString par;
-		QStringList vars;
-		QString varName;
-		QString varValue;
-
-		// get parameters from DB string
-		QStringList shapePars = parameters.split(";");
-		//qInfo() << "shapePars: " << shapePars; // debug
-
-		int sizePars = shapePars.size();
-		// check if we have more than 2 parameters
-		if (sizePars > 2) {
-
-			// get the first two GeoSimplePolygonBrep parameters: DZ and the number of vertices.
-			for( int it=0; it < 2; it++) {
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				// qInfo() << "vars: " << vars; // for debug only
-				if (varName == "DZ") DZ = varValue.toDouble();
-				if (varName == "NVertices") NVertices = varValue.toDouble();
-				//else if (varName == "NVertices") NVertices = varValue.toDouble();
-				//else error = 1;
-				//if(error) qWarning() << "ERROR! GeoSimplePolygonBrep parameters are not correctly stored! -->" << vars;
-
-			}
-			// build the basic GeoSimplePolygonBrep shape
-			sh = new GeoSimplePolygonBrep(DZ);
-
-			// and now loop over the rest of the list, to get the parameters of all vertices
-			for (int it=2; it < sizePars; it++)
-			{
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				if (varName == "xV") xV = varValue.toDouble();
-				else error = 1;
-
-				it++; // go to next variable (they come in pairs)
-
-				par = shapePars[it];
-				vars = par.split("=");
-				varName = vars[0];
-				varValue = vars[1];
-				if (varName == "yV") yV = varValue.toDouble();
-				else error = 1;
-
-				if(error) qWarning() << "ERROR! GeoSimplePolygonBrep 'xVertex' and 'yVertex' values are not at the right place! --> " << shapePars;
-
-				// add a Z plane to the GeoSimplePolygonBrep
-				sh->addVertex(xV, yV);
-			}
-			// sanity check on the resulting shape
-			if( sh->getNVertices() != NVertices) {
-				error = 1;
-				qWarning() << "ERROR! GeoSimplePolygonBrep number of planes: " << QString::number(sh->getNVertices()) << " is not equal to the original size! --> " << shapePars;
-			}
-			if(!sh->isValid()) {
-				error = 1;
-				qWarning() << "ERROR! GeoSimplePolygonBrep shape is not valid!! -- input: " << shapePars;
+  if (m_deepDebug) qDebug() << "GReadIn::buildShape()";
+  QStringList paramsShape = m_shapes[ shapeId.toUInt() ];
+
+  QString id = paramsShape[0];
+  QString type = paramsShape[1];
+  QString parameters = paramsShape[2];
+
+  if (m_deepDebug) qDebug() << "\tShape-ID:" << id << ", Shape-type:" << type;
+
+  if (type == "Box") {
+    // shape parameters
+    double XHalfLength = 0.;
+    double YHalfLength = 0.;
+    double ZHalfLength = 0.;
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+    foreach( QString par, shapePars) {
+      QStringList vars = par.split("=");
+      QString varName = vars[0];
+      QString varValue = vars[1];
+      if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+    }
+    return new GeoBox(XHalfLength, YHalfLength, ZHalfLength);
+  }
+  else if (type == "Cons") {
+    // shape parameters
+    double RMin1 = 0.;
+    double RMin2 = 0.;
+    double RMax1 = 0.;
+    double RMax2 = 0.;
+    double DZ = 0.;
+    double SPhi = 0.;
+    double DPhi = 0.;
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+    foreach( QString par, shapePars) {
+      QStringList vars = par.split("=");
+      QString varName = vars[0];
+      QString varValue = vars[1];
+      if (varName == "RMin1") RMin1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "RMin2") RMin2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "RMax1") RMax1 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "RMax2") RMax2 = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "DZ") DZ = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "SPhi") SPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "SPDPhihi") DPhi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+    }
+    return new GeoCons (RMin1, RMin2, RMax1, RMax2, DZ, SPhi, DPhi);
+  }
+  else if (type == "Para") {
+    // shape parameters
+    double XHalfLength = 0.;
+    double YHalfLength = 0.;
+    double ZHalfLength = 0.;
+    double Alpha = 0.;
+    double Theta = 0.;
+    double Phi = 0.;
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+    foreach( QString par, shapePars) {
+      QStringList vars = par.split("=");
+      QString varName = vars[0];
+      QString varValue = vars[1];
+      if (varName == "XHalfLength") XHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "YHalfLength") YHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "ZHalfLength") ZHalfLength = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "Alpha") Alpha = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "Theta") Theta = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+      if (varName == "Phi") Phi = varValue.toDouble();// * SYSTEM_OF_UNITS::mm;
+    }
+    return new GeoPara (XHalfLength, YHalfLength, ZHalfLength, Alpha, Theta, Phi);
+  }
+  else if (type == "Pcon") {
+    // shape parameters
+    double SPhi = 0.;
+    double DPhi = 0.;
+    unsigned int NZPlanes = 0;
+
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+
+    bool error = 0;
+    QString par;
+    QStringList vars;
+    QString varName;
+    QString varValue;
+
+    GeoPcon* pcon = nullptr;
+
+    int sizePars = shapePars.size();
+    // check if we have more than 3 parameters
+    if (sizePars > 3) {
+
+      // get the three first GeoPcon parameters: the SPhi and DPhi angles, plus the number of Z planes
+      for( int it=0; it < 3; it++) {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        if (varName == "SPhi") SPhi = varValue.toDouble();
+        if (varName == "DPhi") DPhi = varValue.toDouble();
+        if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
+      }
+      // build the basic GeoPcon shape
+      pcon = new GeoPcon(SPhi, DPhi);
+
+      // and now loop over the rest of the list, to get the parameters of all Z planes
+      for (int it=3; it < sizePars; it++)
+      {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        // qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
+
+        if (varName == "ZPos") {
+
+          double zpos = varValue.toDouble();
+          double rmin=0., rmax=0.;
+
+          it++; // go to next variable
+
+          par = shapePars[it];
+          vars = par.split("=");
+          varName = vars[0];
+          varValue = vars[1];
+          if (varName == "ZRmin") rmin = varValue.toDouble();
+          else error = 1;
+          it++; // go to next variable
+
+          par = shapePars[it];
+          vars = par.split("=");
+          varName = vars[0];
+          varValue = vars[1];
+          if (varName == "ZRmax") rmax = varValue.toDouble();
+          else error = 1;
+
+          if(error) qWarning() << "ERROR! GeoPcon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
+
+          // add a Z plane to the GeoPcon
+          pcon->addPlane(zpos, rmin, rmax);
+        } else {
+          error = 1;
+          qWarning() << "ERROR! GeoPcon 'ZPos' value is not at the right place! --> " << shapePars;
+        }
+      }
+
+      // sanity check on the resulting Pcon shape
+      if( pcon->getNPlanes() != NZPlanes) {
+        error = 1;
+        qWarning() << "ERROR! GeoPcon number of planes: " << QString::number(pcon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
+      }
+      if(!pcon->isValid()) {
+        error = 1;
+        qWarning() << "ERROR! GeoPcon shape is not valid!! -- input: " << shapePars;
+      }
+    } // end if (size>3)
+    else {
+      qWarning() << "ERROR!! GeoPcon has no Z planes!! --> shape input parameters: " << shapePars;
+      error = 1;
+    }
+
+    if(error) qFatal("GeoPcon shape error!!! Aborting...");
+
+    return pcon;
+  }
+  else if (type == "Pgon") {
+    // shape parameters
+    double SPhi = 0.;
+    double DPhi = 0.;
+    unsigned int NSides = 0;
+    unsigned int NZPlanes = 0;
+
+    bool error = false;
+    GeoPgon* pgon = nullptr;
+    QString par;
+    QStringList vars;
+    QString varName;
+    QString varValue;
+
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+    // qInfo() << "shapePars: " << shapePars; // debug
+
+    int sizePars = shapePars.size();
+    // check if we have more than 3 parameters
+    if (sizePars > 3) {
+
+      // get the first four GeoPgon parameters: the SPhi and DPhi angles, plus the number of Z planes
+      for( int it=0; it < 4; it++) {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        // qInfo() << "vars: " << vars; // for debug only
+        if (varName == "SPhi") SPhi = varValue.toDouble();
+        if (varName == "DPhi") DPhi = varValue.toDouble();
+        if (varName == "NSides") NSides = varValue.toUInt();// * SYSTEM_OF_UNITS::mm;
+        if (varName == "NZPlanes") NZPlanes = varValue.toDouble();
+
+      }
+      // build the basic GeoPgon shape
+      pgon = new GeoPgon(SPhi, DPhi, NSides);
+
+      // and now loop over the rest of the list, to get the parameters of all Z planes
+      for (int it=4; it < sizePars; it++)
+      {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        // qInfo() << "it:" << it << "par:" << par << "varName:" << varName << "varValue:" << varValue;
+
+        if (varName == "ZPos") {
+
+          double zpos = varValue.toDouble();
+          double rmin=0., rmax=0.;
+
+          it++; // go to next variable
+
+          par = shapePars[it];
+          vars = par.split("=");
+          varName = vars[0];
+          varValue = vars[1];
+          if (varName == "ZRmin") rmin = varValue.toDouble();
+          else error = 1;
+          it++; // go to next variable
+
+          par = shapePars[it];
+          vars = par.split("=");
+          varName = vars[0];
+          varValue = vars[1];
+          if (varName == "ZRmax") rmax = varValue.toDouble();
+          else error = 1;
+
+          if(error) qWarning() << "ERROR! GeoPgon 'ZRmin' and 'ZRmax' values are not at the right place! --> " << shapePars;
+
+          // add a Z plane to the GeoPgon
+          pgon->addPlane(zpos, rmin, rmax);
+        } else {
+          error = 1;
+          qWarning() << "ERROR! GeoPgon 'ZPos' value is not at the right place! --> " << shapePars;
+        }
+      }
+
+      // sanity check on the resulting Pgon shape
+      if( pgon->getNPlanes() != NZPlanes) {
+        error = 1;
+        qWarning() << "ERROR! GeoPgon number of planes: " << QString::number(pgon->getNPlanes()) << " is not equal to the original size! --> " << shapePars;
+      }
+      if(!pgon->isValid()) {
+        error = 1;
+        qWarning() << "ERROR! GeoPgon shape is not valid!! -- input: " << shapePars;
+      }
+    } // end if (size>3)
+    else {
+      qWarning() << "ERROR!! GeoPgon has no Z planes!! --> shape input parameters: " << shapePars;
+      error = 1;
+    }
+    if(error) qFatal("GeoPgon shape error!!! Aborting...");
+    return pgon;
+  }
+  else if (type == "SimplePolygonBrep")
+  {
+    //qInfo() << "Reading-in: SimplePolygonBrep: "; // debug
+    // shape parameters
+    double DZ = 0.;
+    unsigned int NVertices = 0;
+    double xV = 0.;
+    double yV = 0.;
+
+    bool error = 0;
+    GeoSimplePolygonBrep* sh = nullptr;
+    QString par;
+    QStringList vars;
+    QString varName;
+    QString varValue;
+
+    // get parameters from DB string
+    QStringList shapePars = parameters.split(";");
+    //qInfo() << "shapePars: " << shapePars; // debug
+
+    int sizePars = shapePars.size();
+    // check if we have more than 2 parameters
+    if (sizePars > 2) {
+
+      // get the first two GeoSimplePolygonBrep parameters: DZ and the number of vertices.
+      for( int it=0; it < 2; it++) {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        // qInfo() << "vars: " << vars; // for debug only
+        if (varName == "DZ") DZ = varValue.toDouble();
+        if (varName == "NVertices") NVertices = varValue.toDouble();
+        //else if (varName == "NVertices") NVertices = varValue.toDouble();
+        //else error = 1;
+        //if(error) qWarning() << "ERROR! GeoSimplePolygonBrep parameters are not correctly stored! -->" << vars;
+
+      }
+      // build the basic GeoSimplePolygonBrep shape
+      sh = new GeoSimplePolygonBrep(DZ);
+
+      // and now loop over the rest of the list, to get the parameters of all vertices
+      for (int it=2; it < sizePars; it++)
+      {
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        if (varName == "xV") xV = varValue.toDouble();
+        else error = 1;
+
+        it++; // go to next variable (they come in pairs)
+
+        par = shapePars[it];
+        vars = par.split("=");
+        varName = vars[0];
+        varValue = vars[1];
+        if (varName == "yV") yV = varValue.toDouble();
+        else error = 1;
+
+        if(error) qWarning() << "ERROR! GeoSimplePolygonBrep 'xVertex' and 'yVertex' values are not at the right place! --> " << shapePars;
+
+        // add a Z plane to the GeoSimplePolygonBrep
+        sh->addVertex(xV, yV);
+      }
+      // sanity check on the resulting shape
+      if( sh->getNVertices() != NVertices) {
+        error = 1;
+        qWarning() << "ERROR! GeoSimplePolygonBrep number of planes: " << QString::number(sh->getNVertices()) << " is not equal to the original size! --> " << shapePars;
+      }
+      if(!sh->isValid()) {
+        error = 1;
+qWarning() << "ERROR! GeoSimplePolygonBrep shape is not valid!! -- input: " << shapePars;
 			}
 		} // end if (size>3)
 		else {
@@ -1399,7 +1399,7 @@ GeoLogVol* GReadIn::parseLogVol(QStringList values)
 
 	// GET LOGVOL MATERIAL
 	QString matId = values[3];
-	QStringList paramsMat = _materials[ matId.toUInt() ];
+	QStringList paramsMat = m_materials[ matId.toUInt() ];
 	GeoMaterial* mat = parseMaterial(paramsMat);
 
 	// instantiate teh GeoLogVol
@@ -1414,7 +1414,7 @@ GeoLogVol* GReadIn::buildLogVol(QString logVolId)
 	if (m_deepDebug) qDebug() << "GReadIn::buildLogVol()";
 
 	// get logVol properties from the DB
-	QStringList values = _logVols[logVolId.toUInt()];
+	QStringList values = m_logVols[logVolId.toUInt()];
 	if (m_deepDebug) qDebug() << "params:" << values;
 
 	// build the LogVol
@@ -1447,7 +1447,7 @@ GeoShape* GReadIn::getShape(QString shapeId){
 GeoSerialDenominator* GReadIn::buildSerialDenominator(QString id)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildSerialDenominator()";
-	return parseSerialDenominator( _serialDenominators[id.toUInt()] );
+	return parseSerialDenominator( m_serialDenominators[id.toUInt()] );
 }
 
 GeoSerialDenominator* GReadIn::parseSerialDenominator(QStringList values)
@@ -1462,7 +1462,7 @@ GeoSerialDenominator* GReadIn::parseSerialDenominator(QStringList values)
 GeoAlignableTransform* GReadIn::buildAlignableTransform(QString id)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildAlignableTransform()";
-	return parseAlignableTransform( _alignableTransforms[id.toUInt()] );
+	return parseAlignableTransform( m_alignableTransforms[id.toUInt()] );
 }
 
 GeoAlignableTransform* GReadIn::parseAlignableTransform(QStringList values)
@@ -1505,7 +1505,7 @@ GeoAlignableTransform* GReadIn::parseAlignableTransform(QStringList values)
 GeoTransform* GReadIn::buildTransform(QString id)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildTransform()";
-	return parseTransform( _transforms[id.toUInt()] );
+	return parseTransform( m_transforms[id.toUInt()] );
 }
 
 GeoTransform* GReadIn::parseTransform(QStringList values)
@@ -1561,7 +1561,7 @@ GeoSerialTransformer* GReadIn::parseSerialTransformer(QStringList values)
 	unsigned int physVolTableId = physVolTableIdStr.toUInt();
 
 	// QString physVolType = m_dbManager->getNodeTypeFromTableId(physVolTableId);
-	QString physVolType = _tableid_tableName[physVolTableId];
+	QString physVolType = m_tableid_tableName[physVolTableId];
 
 	qDebug() << "\tID:" << id << ", functionId:" << functionId << ", physVolId:" << physVolId << ", physVolTableId:" << physVolTableId << ", copies:" << copies;
 
@@ -1592,7 +1592,7 @@ GeoSerialTransformer* GReadIn::buildSerialTransformer(QString nodeId)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildSerialTransformer()";
 
-	QStringList values = _serialTransformers[nodeId.toUInt()];
+	QStringList values = m_serialTransformers[nodeId.toUInt()];
 	if (m_deepDebug) qDebug() << "values:" << values;
 
 	// std::cout <<"ST * " << values[0].toStdString() << " " << values[1].toStdString() << " " << values[2].toStdString() << std::endl;
@@ -1606,7 +1606,7 @@ GeoSerialTransformer* GReadIn::buildSerialTransformer(QString nodeId)
 
 	unsigned int physVolTableId = physVolTableIdStr.toUInt();
 
-	QString physVolType = _tableid_tableName[physVolTableId];
+	QString physVolType = m_tableid_tableName[physVolTableId];
 
 	if (m_deepDebug) qDebug() << "\tID:" << id << ", functionId:" << functionId << ", physVolId:" << physVolId << ", physVolTableId:" << physVolTableId << ", copies:" << copies;
 
@@ -1633,11 +1633,11 @@ TRANSFUNCTION GReadIn::buildFunction(QString id)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildFunction()";
 
-	// return parseFunction( _functions[id.toUInt()] );
+	// return parseFunction( m_functions[id.toUInt()] );
 
-	// return parseFunction( _functions[id.toUInt()] );
+	// return parseFunction( m_functions[id.toUInt()] );
 
-	QStringList values = _functions[id.toUInt()];
+	QStringList values = m_functions[id.toUInt()];
 	// return parseFunction( values[0].toUInt(), values[1].toStdString() );
 	return parseFunction( values[1].toStdString() );
 
@@ -1702,7 +1702,7 @@ TRANSFUNCTION GReadIn::parseFunction(const std::string& expr)
 GeoNameTag* GReadIn::buildNameTag(QString id)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::buildNameTag()";
-	return parseNameTag( _nameTags[id.toUInt()] );
+	return parseNameTag( m_nameTags[id.toUInt()] );
 }
 
 GeoNameTag* GReadIn::parseNameTag(QStringList values)
@@ -1719,7 +1719,7 @@ bool GReadIn::isNodeBuilt(const QString id, const QString tableId, const QString
 {
 	// qDebug() << "GReadIn::isNodeBuilt(): " << id << tableId << copyNumber;
 	QString key = id + ":" + tableId + ":" + copyNumber;
-	return _memMap.contains(key);
+	return m_memMap.contains(key);
 }
 
 
@@ -1727,14 +1727,14 @@ GeoGraphNode* GReadIn::getNode(const QString id, const QString tableId, const QS
 {
 	if (m_deepDebug) qDebug() << "GReadIn::getNode(): " << id << tableId << copyN;
 	QString key = id + ":" + tableId + ":" + copyN;
-	return _memMap[key];
+	return m_memMap[key];
 }
 
 void GReadIn::storeNode(const QString id, const QString tableId, const QString copyN, GeoGraphNode* node)
 {
 	if (m_deepDebug) qDebug() << "GReadIn::storeNode(): " << id << tableId << copyN << node;
 	QString key = id + ":" + tableId + ":" + copyN;
-	_memMap[key] = node;
+	m_memMap[key] = node;
 }
 
 
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
index e44b3aab716570bcf3b454ee441a744ed018ff0b..416e787c2ab194e5fadd854e6afc9e37acf49d58 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/GeoWrite/DumpGeoModelActionLocal.h
@@ -167,20 +167,20 @@ private:
 	bool m_rootVolumeFound;
 	bool m_unconnectedTree;
 
-	std::vector<QStringList> _logVols;
-	std::vector<QStringList> _physVols;
-	std::vector<QStringList> _fullPhysVols;
-	std::vector<QStringList> _shapes;
-	std::vector<QStringList> _materials;
-	std::vector<QStringList> _transforms;
-	std::vector<QStringList> _alignableTransforms;
-	std::vector<QStringList> _serialDenominators;
-	std::vector<QStringList> _serialTransformers;
-	std::vector<QStringList> _functions;
-	std::vector<QStringList> _nameTags;
-
-	std::vector<QStringList> _childrenPositions;
-	QStringList _rootVolume;
+	std::vector<QStringList> m_logVols;
+	std::vector<QStringList> m_physVols;
+	std::vector<QStringList> m_fullPhysVols;
+	std::vector<QStringList> m_shapes;
+	std::vector<QStringList> m_materials;
+	std::vector<QStringList> m_transforms;
+	std::vector<QStringList> m_alignableTransforms;
+	std::vector<QStringList> m_serialDenominators;
+	std::vector<QStringList> m_serialTransformers;
+	std::vector<QStringList> m_functions;
+	std::vector<QStringList> m_nameTags;
+
+	std::vector<QStringList> m_childrenPositions;
+	QStringList m_rootVolume;
 
 };
 
diff --git a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
index 2215475578ff645329dc41cd940cd85179b4cc02..ac1af6c13cf522563b1037f1451d91c9d4daddee 100644
--- a/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
+++ b/DetectorDescription/GeoModel/GeoModelStandalone/GeoWrite/src/DumpGeoModelActionLocal.cpp
@@ -1368,7 +1368,7 @@ unsigned int DumpGeoModelActionLocal::addRecord(std::vector<QStringList>* contai
 QVariant DumpGeoModelActionLocal::addMaterial(const QString name)
 {
 	qDebug() << "DumpGeoModelActionLocal::addMaterial(QString*) - name:" << name;
-	std::vector<QStringList>* container = &_materials;
+	std::vector<QStringList>* container = &m_materials;
 	QStringList values;
 	values << name;
 	return QVariant( addRecord(container, values) );
@@ -1377,7 +1377,7 @@ QVariant DumpGeoModelActionLocal::addMaterial(const QString name)
 QVariant DumpGeoModelActionLocal::addNameTag(const QString name)
 {
 	qDebug() << "DumpGeoModelActionLocal::addNameTag(QString*) - name:" << name;
-	std::vector<QStringList>* container = &_nameTags;
+	std::vector<QStringList>* container = &m_nameTags;
 	QStringList values;
 	values << name;
 	return QVariant( addRecord(container, values) );
@@ -1386,7 +1386,7 @@ QVariant DumpGeoModelActionLocal::addNameTag(const QString name)
 QVariant DumpGeoModelActionLocal::addSerialDenominator(const QString &baseName)
 {
 	qDebug() << "DumpGeoModelActionLocal::addSerialDenominator(QString*) - basename:" << baseName;
-	std::vector<QStringList>* container = &_serialDenominators;
+	std::vector<QStringList>* container = &m_serialDenominators;
 	QStringList values;
 	values << baseName;
 	return QVariant( addRecord(container, values) );
@@ -1396,7 +1396,7 @@ QVariant DumpGeoModelActionLocal::addSerialDenominator(const QString &baseName)
 QVariant DumpGeoModelActionLocal::addFunction(const QString expression)
 {
 	qDebug() << "DumpGeoModelActionLocal::addFunction(QString*) - expression:" << expression;
-	std::vector<QStringList>* container = &_functions;
+	std::vector<QStringList>* container = &m_functions;
 	QStringList values;
 	values << expression;
 	return QVariant( addRecord(container, values) );
@@ -1406,7 +1406,7 @@ QVariant DumpGeoModelActionLocal::addFunction(const QString expression)
 QVariant DumpGeoModelActionLocal::addAlignableTransform(const std::vector<double> params)
 {
 	qDebug() << "DumpGeoModelActionLocal::addAlignableTransform(QString*)";
-	std::vector<QStringList>* container = &_alignableTransforms;
+	std::vector<QStringList>* container = &m_alignableTransforms;
 	QStringList values;
 	foreach(double par, params) {
 		values << QString::number(par);
@@ -1419,7 +1419,7 @@ QVariant DumpGeoModelActionLocal::addAlignableTransform(const std::vector<double
 QVariant DumpGeoModelActionLocal::addTransform(const std::vector<double> params)
 {
 	qDebug() << "DumpGeoModelActionLocal::addTransform(QString*)";
-	std::vector<QStringList>* container = &_transforms;
+	std::vector<QStringList>* container = &m_transforms;
 	QStringList values;
 	foreach(double par, params) {
 		values << QString::number(par);
@@ -1439,7 +1439,7 @@ QString DumpGeoModelActionLocal::getIdFromNodeType( QString nodeType )
 QVariant DumpGeoModelActionLocal::addSerialTransformer(const QVariant &funcId, const QVariant &physvolId, const QString volType, const unsigned int &copies)
 {
 	qDebug() << "DumpGeoModelActionLocal::addSerialTransformer()";
-	std::vector<QStringList>* container = &_serialTransformers;
+	std::vector<QStringList>* container = &m_serialTransformers;
 	QString volTypeID = getIdFromNodeType(volType);
 
 	QStringList values;
@@ -1450,7 +1450,7 @@ QVariant DumpGeoModelActionLocal::addSerialTransformer(const QVariant &funcId, c
 
 QVariant DumpGeoModelActionLocal::addShape(const QString &type, const QString &parameters)
 {
-	std::vector<QStringList>* container = &_shapes;
+	std::vector<QStringList>* container = &m_shapes;
 	QStringList values;
 	values << type << parameters;
 	return QVariant( addRecord(container, values) );
@@ -1459,7 +1459,7 @@ QVariant DumpGeoModelActionLocal::addShape(const QString &type, const QString &p
 
 QVariant DumpGeoModelActionLocal::addPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
 {
-	std::vector<QStringList>* container = &_physVols;
+	std::vector<QStringList>* container = &m_physVols;
 
 	QStringList values;
 	values << logVolId.toString() << parentPhysVolId.toString(); // TODO: we should remove the parent info: it's not complete because the type is missing (PhysVol or FullPhysVol) and it's redundant, because we store the childrenPositions. It's only useful for quick visual debug, by dumping the PhysVol DB table
@@ -1469,7 +1469,7 @@ QVariant DumpGeoModelActionLocal::addPhysVol(const QVariant &logVolId, const QVa
 	if (isRootVolume) {
 		QStringList rootValues;
 		rootValues << QString::number(idx) << "GeoPhysVol";
-		_rootVolume = rootValues;
+		m_rootVolume = rootValues;
 	}
 	return QVariant(idx);
 }
@@ -1477,7 +1477,7 @@ QVariant DumpGeoModelActionLocal::addPhysVol(const QVariant &logVolId, const QVa
 
 QVariant DumpGeoModelActionLocal::addFullPhysVol(const QVariant &logVolId, const QVariant &parentPhysVolId, bool isRootVolume)
 {
-	std::vector<QStringList>* container = &_fullPhysVols;
+	std::vector<QStringList>* container = &m_fullPhysVols;
 
 	QStringList values;
 	values << logVolId.toString() << parentPhysVolId.toString(); // TODO: we should remove the parent info: it's not complete because the type is missing (PhysVol or FullPhysVol) and it's redundant, because we store the childrenPositions. It's only useful for quick visual debug, by dumping the PhysVol DB table
@@ -1487,14 +1487,14 @@ QVariant DumpGeoModelActionLocal::addFullPhysVol(const QVariant &logVolId, const
 	if (isRootVolume) {
 		QStringList rootValues;
 		rootValues << QString::number(idx) << "GeoFullPhysVol";
-		_rootVolume = rootValues;
+		m_rootVolume = rootValues;
 	}
 	return QVariant(idx);
 }
 
 QVariant DumpGeoModelActionLocal::addLogVol(const QString &name, const QVariant &shapeId, const QVariant &materialId)
 {
-	std::vector<QStringList>* container = &_logVols;
+	std::vector<QStringList>* container = &m_logVols;
 	QStringList values;
 	values << name << shapeId.toString() << materialId.toString();
 	return QVariant( addRecord(container, values) );
@@ -1504,7 +1504,7 @@ QVariant DumpGeoModelActionLocal::addLogVol(const QString &name, const QVariant
 // OLD // FIXME: to be removed when all objects will be migrated to the new version
 void DumpGeoModelActionLocal::addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int childPos, const QString childType)
 {
-	std::vector<QStringList>* container = &_childrenPositions;
+	std::vector<QStringList>* container = &m_childrenPositions;
 
 	QString parentTableID = getIdFromNodeType(parentType);
 	QString childTableID = getIdFromNodeType(childType);
@@ -1519,7 +1519,7 @@ void DumpGeoModelActionLocal::addChildPosition(const QVariant parentId, const QS
 // NEW
 void DumpGeoModelActionLocal::addChildPosition(const QVariant parentId, const QString parentType, const QVariant childId, const unsigned int parentCopyN, const unsigned int childPos, const QString childType, const unsigned int childCopyN)
 {
-	std::vector<QStringList>* container = &_childrenPositions;
+	std::vector<QStringList>* container = &m_childrenPositions;
 
 	QString parentTableID = getIdFromNodeType(parentType);
 	QString childTableID = getIdFromNodeType(childType);
@@ -1536,20 +1536,20 @@ void DumpGeoModelActionLocal::saveToDB()
 	qDebug() << "DumpGeoModelActionLocal::savetoDB()";
     std::cout << "saving to file: " << m_dbpath.toStdString() << std::endl;
 
-	m_dbManager->addListOfRecords("GeoMaterial", _materials);
-	m_dbManager->addListOfRecords("GeoNameTag", _nameTags);
-	m_dbManager->addListOfRecords("GeoAlignableTransform", _alignableTransforms);
-	m_dbManager->addListOfRecords("GeoTransform", _transforms);
-	m_dbManager->addListOfRecords("Function", _functions);
-	m_dbManager->addListOfRecords("GeoSerialTransformer", _serialTransformers);
-	m_dbManager->addListOfRecords("GeoShape", _shapes);
-	m_dbManager->addListOfRecords("GeoSerialDenominator", _serialDenominators);
-	m_dbManager->addListOfRecords("GeoPhysVol", _physVols);
-	m_dbManager->addListOfRecords("GeoFullPhysVol", _fullPhysVols);
-	m_dbManager->addListOfRecords("GeoLogVol", _logVols);
-
-	m_dbManager->addListOfChildrenPositions(_childrenPositions);
-	m_dbManager->addRootVolume(_rootVolume);
+	m_dbManager->addListOfRecords("GeoMaterial", m_materials);
+	m_dbManager->addListOfRecords("GeoNameTag", m_nameTags);
+	m_dbManager->addListOfRecords("GeoAlignableTransform", m_alignableTransforms);
+	m_dbManager->addListOfRecords("GeoTransform", m_transforms);
+	m_dbManager->addListOfRecords("Function", m_functions);
+	m_dbManager->addListOfRecords("GeoSerialTransformer", m_serialTransformers);
+	m_dbManager->addListOfRecords("GeoShape", m_shapes);
+	m_dbManager->addListOfRecords("GeoSerialDenominator", m_serialDenominators);
+	m_dbManager->addListOfRecords("GeoPhysVol", m_physVols);
+	m_dbManager->addListOfRecords("GeoFullPhysVol", m_fullPhysVols);
+	m_dbManager->addListOfRecords("GeoLogVol", m_logVols);
+
+	m_dbManager->addListOfChildrenPositions(m_childrenPositions);
+	m_dbManager->addRootVolume(m_rootVolume);
 
 	return;
 }