Correction in the photon generation (Gustavo)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Jan 2007 14:42:32 +0000 (14:42 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 31 Jan 2007 14:42:32 +0000 (14:42 +0000)
PYTHIA6/AliGenPythia.cxx

index 1844a3d..9ad2f82 100644 (file)
@@ -840,8 +840,10 @@ Int_t  AliGenPythia::GenerateMB()
        TParticle* iparticle = (TParticle *) fParticles->At(i);
        if(iparticle->GetStatusCode()==1 && iparticle->GetPdgCode()==pdg && 
           iparticle->Pt() > fFragPhotonOrPi0MinPt){
+         Int_t imother = iparticle->GetFirstMother();
+         TParticle* pmother = (TParticle *) fParticles->At(imother);
          if(pdg == 111 || 
-            (pdg == 22 && iparticle->GetFirstMother() != 11))//No photon from hadron decay
+            (pdg == 22 && pmother->GetStatusCode() != 11))//No photon from hadron decay
            {
              Float_t phi = iparticle->Phi()*180./TMath::Pi(); //Convert to degrees
              Float_t eta =TMath::Abs(iparticle->Eta());//in calos etamin=-etamax