Avoid direct instantiation of AliMagF.
[u/mrichter/AliRoot.git] / EVE / alice-macros / MUON_displayData.C
index 185338fdf64ad31cfd86e2180b7ff480bd96ff0b..744cc2ea40a0094700b8a059ad190c021a39efa4 100644 (file)
@@ -25,12 +25,8 @@ void MUON_displayData(Bool_t fromRaw = kFALSE, Bool_t showTracks = kTRUE, Bool_t
   if (!AliMpSegmentation::Instance()) AliMpCDB::LoadMpSegmentation();
   if (!AliMpDDLStore::Instance())     AliMpCDB::LoadDDLStore();
 
-  if (!TGeoGlobalMagField::Instance()->GetField()) {
-    printf("Loading field map...\n");
-    AliMagF* field = new AliMagF("Maps","Maps",2,1.,1., 10.,AliMagF::k5kG);
-    TGeoGlobalMagField::Instance()->SetField(field);
-  }
   // set the magnetic field for track extrapolations
+  AliEveEventManager::AssertMagField();
   AliMUONTrackExtrap::SetField();
 
   TTree* dt = 0;