From ecb36af7de07d9d7c0ef6fc96121d45155dd6573 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 2 Feb 2005 04:33:22 +0000 Subject: [PATCH] If the TRD geometry is not stored in the file, get it from gAlice --- TRD/AliTRDgeometry.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/TRD/AliTRDgeometry.cxx b/TRD/AliTRDgeometry.cxx index 4641b32591c..9dda6b0c02c 100644 --- a/TRD/AliTRDgeometry.cxx +++ b/TRD/AliTRDgeometry.cxx @@ -28,6 +28,9 @@ #include "AliTRDgeometry.h" #include "AliTRDparameter.h" +#include "AliRun.h" +#include "AliTRD.h" + ClassImp(AliTRDgeometry) //_____________________________________________________________________________ @@ -507,7 +510,15 @@ AliTRDgeometry* AliTRDgeometry::GetGeometry(AliRunLoader* runLoader) TDirectory* saveDir = gDirectory; runLoader->CdGAFile(); + // Try from the galice.root file AliTRDgeometry* geom = (AliTRDgeometry*) gDirectory->Get("TRDgeometry"); + + if (!geom) { + // It is not in the file, try to get it from gAlice, + // which corresponds to the run loader + AliTRD * trd = (AliTRD*)runLoader->GetAliRun()->GetDetector("TRD"); + geom = trd->GetGeometry(); + } if (!geom) ::Error("AliTRDgeometry::GetGeometry", "Geometry not found"); saveDir->cd(); -- 2.43.0