Additional safety check introduced
authorskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2004 20:39:48 +0000 (20:39 +0000)
committerskowron <skowron@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Jul 2004 20:39:48 +0000 (20:39 +0000)
ANALYSIS/AliReaderESD.cxx

index 796c91e..17e09a7 100644 (file)
@@ -253,7 +253,7 @@ Int_t AliReaderESD::ReadESD(AliESD* esd)
      Error("ReadESD","ESD is NULL");
      return 1;
    }
-
+  
   TDatabasePDG* pdgdb = TDatabasePDG::Instance();
   if (pdgdb == 0x0)
    {
@@ -543,17 +543,20 @@ Int_t AliReaderESD::ReadESD(AliESD* esd)
       }
      else
       {
-        if (particle->P() < 0.00001)
+        if ( fReadSim && stack  )
          {
-           Info("ReadNext","###################################");
-           Info("ReadNext","###################################");
-           Info("ReadNext","Track Label %d",esdtrack->GetLabel());
-           TParticle *p = stack->Particle(esdtrack->GetLabel());
-           Info("ReadNext","");
-           p->Print();
-           Info("ReadNext","");
-           particle->Print();
-         }
+           if (particle->P() < 0.00001)
+            {
+              Info("ReadNext","###################################");
+              Info("ReadNext","###################################");
+              Info("ReadNext","Track Label %d",esdtrack->GetLabel());
+              TParticle *p = stack->Particle(esdtrack->GetLabel());
+              Info("ReadNext","");
+              p->Print();
+              Info("ReadNext","");
+              particle->Print();
+            }
+         }   
       } 
 
    }//for (Int_t i = 0;i<ntr; i++)  -- loop over tracks