Do not init GRP in case AliEVE runs under aliroot and the mag field has been already...
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jul 2009 16:24:54 +0000 (16:24 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 9 Jul 2009 16:24:54 +0000 (16:24 +0000)
EVE/EveBase/AliEveEventManager.cxx

index cba8c52..c65bddd 100644 (file)
@@ -1006,6 +1006,14 @@ AliMagF* AliEveEventManager::AssertMagField()
   if (fgMagField)
     return fgMagField;
 
+  if (TGeoGlobalMagField::Instance()->GetField())
+  {
+    fgMagField = dynamic_cast<AliMagF*>(TGeoGlobalMagField::Instance()->GetField());
+    if (fgMagField == 0)
+      throw kEH + "Global field set, but it is not AliMagF.";
+    return fgMagField;
+  }
+
   if (!fgGRPLoaded)
   {
     InitGRP();