]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
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 796c91ee136a262d3159b83d845fea3caa62e407..17e09a737d065511382c807bfc2a584a3a7cd28f 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