]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDgeometry.cxx
Splitting of TRD library (T.Kuhr)
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometry.cxx
index 8be270a573f8fdc735c30e9713167630dd4c4bce..4641b32591cb23a060f16064ff650402cec7df14 100644 (file)
@@ -22,6 +22,9 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 
+#include <TError.h>
+
+#include "AliRunLoader.h"
 #include "AliTRDgeometry.h"
 #include "AliTRDparameter.h"
 
@@ -487,3 +490,26 @@ void AliTRDgeometry::SetOldGeometry()
   }
 
 }
+
+//_____________________________________________________________________________
+AliTRDgeometry* AliTRDgeometry::GetGeometry(AliRunLoader* runLoader)
+{
+  //
+  // load the geometry from the galice file
+  //
+
+  if (!runLoader) runLoader = AliRunLoader::GetRunLoader();
+  if (!runLoader) {
+    ::Error("AliTRDgeometry::GetGeometry", "No run loader");
+    return NULL;
+  }
+
+  TDirectory* saveDir = gDirectory;
+  runLoader->CdGAFile();
+
+  AliTRDgeometry* geom = (AliTRDgeometry*) gDirectory->Get("TRDgeometry");
+  if (!geom) ::Error("AliTRDgeometry::GetGeometry", "Geometry not found");
+
+  saveDir->cd();
+  return geom;
+}