]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Set magnetic field for each event if not set. Fixes bug due to changes requiring...
authorslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Nov 2013 00:27:21 +0000 (00:27 +0000)
committerslindal <slindal@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Nov 2013 00:27:21 +0000 (00:27 +0000)
modified:   AliV0ReaderV1.cxx

PWGGA/GammaConv/AliV0ReaderV1.cxx

index 3f9b4584ee29a156f359763a225d4b98fd4e3b34..7be1ceefe9998ab65d69f3a9ecebb524a84cfff7 100644 (file)
@@ -36,6 +36,7 @@
 // If you want to find the AODTrack corresponding to the daugher track of a AliAODConversionPhoton you have to find the AODTrack with
 // AODTrack->GetID() == GetTrackLabelPositive() (GetTrackLabelNagative()).
 
+#include <TGeoGlobalMagField.h>
 
 #include "AliV0ReaderV1.h"
 #include "AliKFParticle.h"
@@ -226,6 +227,13 @@ Bool_t AliV0ReaderV1::Notify()
 //________________________________________________________________________
 void AliV0ReaderV1::UserExec(Option_t *option){
 
+  AliESDEvent * esdEvent = dynamic_cast<AliESDEvent*>(fInputEvent);
+  if(esdEvent) {
+    if (!TGeoGlobalMagField::Instance()->GetField()) esdEvent->InitMagneticField(); 
+  }
+
+
+
    // Check if correctly initialized
    if(!fConversionGammas)Init();