message: AliGenEMCocktailV2.cxx: Fixed particle weighting for secondary photons
diff: @@ -592,8 +592,9 @@ void AliGenEMCocktailV2::Generate()
  next.Reset();
  // Setting weights for proper absolute normalization
  - Int_t iPart, iMother;
  + Int_t iPart, iMother, iGrandMother;
  Int_t pdgMother = 0;
  + Int_t pdgGrandMother = 0;
  Double_t weight = 0.;
  Double_t dNdy = 0.;
  Int_t maxPart = partArray->GetEntriesFast();
  @@ -601,9 +602,15 @@ void AliGenEMCocktailV2::Generate()
  TParticle *part = gAlice->GetMCApp()->Particle(iPart);
  iMother = part->GetFirstMother();
  TParticle *mother = 0;
  + TParticle *grandmother = 0;
  if (iMother>=0){
  mother = gAlice->GetMCApp()->Particle(iMother);
  pdgMother = mother->GetPdgCode();
  + iGrandMother = mother->GetFirstMother();
  + if (iGrandMother>=0){
  + grandmother = gAlice->GetMCApp()->Particle(iGrandMother);
  + pdgGrandMother = grandmother->GetPdgCode();
  + }
  if(abs(part->GetPdgCode())==220011){
  // handle electrons from forced conversion
  part->SetPdgCode(TMath::Sign(abs(part->GetPdgCode())-220000,part->GetPdgCode()));
  @@ -612,6 +619,8 @@ void AliGenEMCocktailV2::Generate()
  TParticle *grandmother = gAlice->GetMCApp()->Particle(iGrandMother);
  pdgMother = grandmother->GetPdgCode();
  }
  + } else if (part->GetPdgCode()==22 && iMother>=0 && iGrandMother>=0){
  + pdgMother = grandmother->GetPdgCode();
  }
  } else pdgMother = part->GetPdgCode();
  