method Destroy added to AliGeomManager for clean removal of geometry
authorshahoian <ruben.shahoyan@cern.ch>
Thu, 25 Sep 2014 12:01:51 +0000 (14:01 +0200)
committershahoian <ruben.shahoyan@cern.ch>
Thu, 25 Sep 2014 12:03:22 +0000 (14:03 +0200)
STEER/STEER/AliGeomManager.cxx
STEER/STEER/AliGeomManager.h

index 27635d3..d5ac285 100644 (file)
@@ -105,6 +105,15 @@ Int_t AliGeomManager::fgNalignable[fgkNDetectors] = {0,0, 0, 0, 0, 0, 0, 0, 0, 0
 TGeoManager* AliGeomManager::fgGeometry = 0x0;
 
 //_____________________________________________________________________________
+void AliGeomManager::Destroy()
+{
+  // destroy the manager as well as gGeoManager (if it was not attached to fgGeometry)
+  delete gGeoManager;
+  fgGeometry = gGeoManager = 0;
+  ResetPNEntriesLUT();
+}
+
+//_____________________________________________________________________________
 void AliGeomManager::LoadGeometry(const char *geomFileName)
 {
   // initialization
index 983237a..ea72e6d 100644 (file)
@@ -43,6 +43,7 @@ public:
                kLastLayer=21};
 
   static TGeoManager* GetGeometry() { return fgGeometry; }
+  static void         Destroy();
 
   static Int_t       LayerSize(Int_t layerId);
   static const char* LayerName(Int_t layerId);