message: Adding conditions on mother and process in Pythia6 MC truth method
diff: @@ -4930,7 +4930,7 @@ void AliAnalysisTaskEMCALPhotonIsolation::AnalyzeMC(){
  }
  AliAODMCParticle *mcpart, *mom, *mcpp;
  - Int_t pdg, mompdg, photonlabel;
  + Int_t pdg = 0, photonlabel = 0, momidx = 0, mcppmomidx = 0, mompdg = 0;
  for(int iTr = 0; iTr < nTracks; iTr ++){
  eT=0.; phi=0.; eta=0.;
  @@ -4950,6 +4950,18 @@ void AliAnalysisTaskEMCALPhotonIsolation::AnalyzeMC(){
  if(pdg != 22 /*|| mcpart->GetLabel()!=8*/)
  continue;
  + momidx = mcpart->GetMother();
  + if(momidx > 0 && momidx < nTracks){
  + mom = static_cast<AliAODMCParticle*>(fAODMCParticles->At(momidx));
  + mompdg = TMath::Abs(mom->GetPdgCode());
  + }
  + else
  + mompdg = pdg;
  +
  + if(mompdg != 22) continue; // Discard particles whose mother is not a photon
  +
  + if(fPythiaHeader->ProcessType() != 201 && fPythiaHeader->ProcessType() != 202) continue; // Discard particles which do not come from prompt photon processes
  +
  eta = mcpart->Eta();
  phi = mcpart->Phi();
  @@ -4991,15 +5003,6 @@ void AliAnalysisTaskEMCALPhotonIsolation::AnalyzeMC(){
  }
  photonlabel = iTr;
  -
  - int momidx = mcpart->GetMother();
  - if(momidx>0){
  - mom = static_cast<AliAODMCParticle*>(fAODMCParticles->At(momidx));
  - mompdg = TMath::Abs(mom->GetPdgCode());
  - }
  - else
  - mompdg = mcpart->GetPdgCode();
  -
  eT = mcpart->E()*(TMath::Sin(mcpart->Theta())); // Transform to transverse Energy
  if(fWho == 1)
  @@ -5061,11 +5064,11 @@ void AliAnalysisTaskEMCALPhotonIsolation::AnalyzeMC(){
  if(mcpp->GetStatus()>10 || (!mcpp->IsPhysicalPrimary() || !mcpp->IsPrimary()))
  continue;
  - int mumidx = mcpp->GetMother();
  - if(mumidx < 0 || mumidx > nTracks)
  + mcppmomidx = mcpp->GetMother();
  + if(mcppmomidx < 0 || mcppmomidx > nTracks)
  continue;
  - if(mumidx == photonlabel)
  + if(mcppmomidx == photonlabel)
  continue;
  if(mcpp->E() < 0.3) // Minimal energy for clusters allowed at reconstructed level
  