Skip to content

Commit f69e077

Browse files
committed
pass acceptance and min photon pT as parameters optionally
1 parent a1b053b commit f69e077

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

MC/config/PWGGAJE/trigger/decay_gamma_jets.C

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ R__ADD_INCLUDE_PATH($O2DPG_ROOT)
1414
/// \author Gustavo Conesa Balbastre (LPSC-IN2P3-CNRS)
1515
/// =================================================
1616

17-
o2::eventgen::Trigger decay_gamma_jets( )
17+
o2::eventgen::Trigger decay_gamma_jets(int acceptanceIn = 0, float ptminIn = 0)
1818
{
19-
return [](const std::vector<TParticle>& particles) -> bool {
19+
return [acceptanceIn,ptminIn](const std::vector<TParticle>& particles) -> bool {
2020

2121
// Select decay photon with min pT
22-
Float_t ptmin = 0;
23-
if ( !ptmin && gSystem->Getenv("CONFIG_DECAYGAMMA_PTMIN") )
24-
ptmin = atof(gSystem->Getenv("CONFIG_DECAYGAMMA_PTMIN"));
22+
Float_t ptmin = ptminIn;
23+
if ( ptmin <= 0 && gSystem->Getenv("PTTRIGMIN") )
24+
ptmin = atof(gSystem->Getenv("PTTRIGMIN"));
2525
//printf("Requested minimum pT %2.2f\n",ptmin);
2626

2727
// Select photons within acceptance
2828
//
29-
Int_t acceptance = 0;
30-
if ( gSystem->Getenv("PARTICLE_ACCEPTANCE") )
29+
Int_t acceptance = acceptanceIn;
30+
if ( acceptance <= 0 && gSystem->Getenv("PARTICLE_ACCEPTANCE") )
3131
acceptance = atoi(gSystem->Getenv("PARTICLE_ACCEPTANCE"));
3232
//printf("Requested acceptance %d\n",acceptance);
3333

@@ -60,21 +60,21 @@ o2::eventgen::Trigger decay_gamma_jets( )
6060
if ( !detector_acceptance(acceptance, part.Phi(), part.Eta()) )
6161
continue;
6262

63-
printf("index %d, PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
63+
printf("Selected photon index %d, PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
6464
ipart-1, part.GetPdgCode(),
6565
part.GetStatusCode(),
6666
part.GetFirstMother(),
6767
part.Energy(), part.Pt(),
6868
part.Eta(), part.Phi()*TMath::RadToDeg());
6969

70-
printf("mother %d, PDG %d, status %d, 1st daugh %d, last daugh %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
71-
part.GetFirstMother(), mother.GetPdgCode(),
72-
mother.GetStatusCode(),
73-
mother.GetFirstDaughter(), mother.GetLastDaughter(),
74-
mother.Energy(), mother.Pt(),
75-
mother.Eta(), mother.Phi()*TMath::RadToDeg());
76-
77-
printf("+++ Accepted event +++ \n");
70+
// printf("mother %d, PDG %d, status %d, 1st daugh %d, last daugh %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
71+
// part.GetFirstMother(), mother.GetPdgCode(),
72+
// mother.GetStatusCode(),
73+
// mother.GetFirstDaughter(), mother.GetLastDaughter(),
74+
// mother.Energy(), mother.Pt(),
75+
// mother.Eta(), mother.Phi()*TMath::RadToDeg());
76+
//
77+
// printf("+++ Accepted event +++ \n");
7878

7979
return true;
8080

0 commit comments

Comments
 (0)