Skip to content

Commit

Permalink
Merge pull request alisw#291 from gconesab/master
Browse files Browse the repository at this point in the history
For direct photon generation in Pythia8, apply cuts on physical photons, see Jira ALIROOT-7308
  • Loading branch information
alibuild authored Jun 29, 2017
2 parents 71c43de + a96c6d7 commit 88ae668
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions PYTHIA6/AliPythia6/AliGenPythiaPlus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1205,6 +1205,41 @@ Bool_t AliGenPythiaPlus::CheckTrigger(const TParticle* jet1, const TParticle* je
ij = 1;
ig = 0;
}

// Search the physical direct photon
// and recover its eta and phi
if ( fProcess == kPyDirectGamma )
{
const TParticle * jets[] = {jet1,jet2};
Int_t status = jets[ig]->GetStatusCode();
Int_t index = jets[ig]->GetDaughter(0);
Int_t pdg = jets[ig]->GetPdgCode();
Int_t np = fParticles.GetEntriesFast();

//printf("Search physical photon...\n");
TParticle * photon = 0;
while ( status!=1 )
{
if ( pdg!=kGamma || index < 0 || index >= np)
{
AliWarning(Form("Photon with daughter PDG <%d> or negative/large index <%d>/<%d>, skip event",pdg,index,np));
return kFALSE;
}

//printf("\t daught %d, status %d, pdg %d, eta %2.2f, phi %2.2f\n",index,status,pdg,eta[ig],phi[ig]);
photon = (TParticle*) fParticles.At(index);
if(!photon) return kFALSE;

status = photon->GetStatusCode();
index = photon->GetDaughter(0);
pdg = photon->GetPdgCode();
eta[ig]= photon->Eta();
phi[ig]= photon->Phi();
}
//printf("final: daught %d, status %d, pdg %d, eta %2.2f, phi %2.2f\n",index,status,pdg,eta[ig],phi[ig]);
//printf("...found\n");
}

//Check eta range first...
if ((eta[ij] < fEtaMaxJet && eta[ij] > fEtaMinJet) &&
(eta[ig] < fEtaMaxGamma && eta[ig] > fEtaMinGamma))
Expand Down

0 comments on commit 88ae668

Please sign in to comment.