Avoid direct instantiation of AliMagF.
[u/mrichter/AliRoot.git] / EVE / alice-macros / MUON_displaySimu.C
index 3c8e74ff8b5fb92f02971eecf800dfa674056da1..a6b0268e1ee6672c009ca057637732904ea6e86c 100644 (file)
@@ -26,12 +26,8 @@ void MUON_displaySimu(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;