]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 27635d3550009fc2688dabf3bf73344332d13ecb..d5ac28599ec6d11c9b8fad6bd10fd8011d91bc6c 100644 (file)
@@ -104,6 +104,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)
 {
index 983237a6396ab3f29c0d183f0e2903de1fc17ca3..ea72e6d4edf3ceb46aba2972975427b4f5a314de 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);