diff --git a/MC/config/PWGGAJE/hooks/jets_hook.C b/MC/config/PWGGAJE/hooks/jets_hook.C index 02ccb4dd9..b7e8cb4b3 100644 --- a/MC/config/PWGGAJE/hooks/jets_hook.C +++ b/MC/config/PWGGAJE/hooks/jets_hook.C @@ -40,7 +40,10 @@ class UserHooks_jets : public Pythia8::UserHooks // Check the first jet // - bool acc1 = detector_acceptance(mAcceptance, event[id1].phi(), event[id1].eta()); + Float_t phi_j1 = event[id1].phi(); + if (phi_j1 < 0) phi_j1 += 2 * TMath::Pi(); + + bool acc1 = detector_acceptance(mAcceptance, phi_j1, event[id1].eta()); bool okpdg1 = true; if (mOutPartonPDG > 0 && TMath::Abs(event[id1].id()) != mOutPartonPDG) @@ -48,7 +51,9 @@ class UserHooks_jets : public Pythia8::UserHooks // Check the second jet // - bool acc2 = detector_acceptance(mAcceptance, event[id2].phi(), event[id2].eta()); + Float_t phi_j2 = event[id2].phi(); + if (phi_j2 < 0) phi_j2 += 2 * TMath::Pi(); + bool acc2 = detector_acceptance(mAcceptance, phi_j2, event[id2].eta()); bool okpdg2 = true; if (mOutPartonPDG > 0 && TMath::Abs(event[id2].id()) != mOutPartonPDG) diff --git a/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C b/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C index 678b67c18..9ab6836dc 100644 --- a/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C +++ b/MC/config/PWGGAJE/hooks/prompt_gamma_hook.C @@ -62,16 +62,17 @@ class UserHooks_promptgamma : public Pythia8::UserHooks return true; } } - // Select photons within acceptance // - if (detector_acceptance(mAcceptance, event[idGam].phi(), event[idGam].eta())) { + Float_t phiGam = event[idGam].phi(); + if (phiGam < 0) phiGam += 2 * TMath::Pi(); + + if (detector_acceptance(mAcceptance, phiGam, event[idGam].eta())) { // printf("+++ Accepted event +++ \n"); printf("Selected gamma, id %d, PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n", idGam, event[idGam].id(), event[idGam].status(), event[idGam].mother1(), event[idGam].e(), event[idGam].pT(), - event[idGam].eta(), event[idGam].phi() * TMath::RadToDeg()); - + event[idGam].eta(), phiGam * TMath::RadToDeg()); // printf("Back-to-back parton, id %d, PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n", idPar, // event[idPar].id() , event[idPar].status(), event[idPar].mother1(), // event[idPar].e() , event[idPar].pT(), @@ -83,7 +84,6 @@ class UserHooks_promptgamma : public Pythia8::UserHooks // event[idPar].pT() - event[idGam].pT(), // event[idPar].eta()- event[idGam].eta(), // event[idPar].phi()*TMath::RadToDeg()-event[idGam].phi()*TMath::RadToDeg()); - return false; } else { // printf("--- Rejected event ---\n");