Skip to content

Commit 9fa3747

Browse files
committed
select the parton checking the acceptance so that at least one of the parton/jets is within the acceptance, not the two
1 parent 5ea9b1d commit 9fa3747

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

MC/config/PWGGAJE/hooks/jets_hook.C

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ R__ADD_INCLUDE_PATH($O2DPG_ROOT)
77

88
/// \brief Select jet events within acceptance or associated parton flavor using Pythia Hooks.
99
///
10-
/// Select outoging jets on the 2->2 process, at least one in a selected acceptance and
11-
/// with a given PDG value.
10+
/// Select outoging parton/jets on the 2->2 process, at least one in a selected acceptance and
11+
/// optionally select the parton with a given PDG value.
1212
/// Only valid for PYTHIA8 and using Hooks
1313
///
1414
/// \author Gustavo Conesa Balbastre (LPSC-IN2P3-CNRS)
@@ -22,6 +22,14 @@ class UserHooks_jets : public Pythia8::UserHooks
2222
~UserHooks_jets() = default;
2323
bool canVetoPartonLevel() override { return true; };
2424
bool doVetoPartonLevel(const Pythia8::Event& event) override {
25+
26+
// for (Int_t id = 0; id < 10; id++)
27+
// {
28+
// printf("parton %d PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
29+
// id, event[id].id() , event[id].status(), event[id].mother1(),
30+
// event[id].e() , event[id].pT(),
31+
// event[id].eta(), event[id].phi()*TMath::RadToDeg());
32+
// }
2533

2634
// Get the outgoing 2->2 partons.
2735
// The jets are in position 5 or 6.
@@ -37,39 +45,37 @@ class UserHooks_jets : public Pythia8::UserHooks
3745
if ( mOutPartonPDG > 0 && TMath::Abs(event[id1].id()) != mOutPartonPDG )
3846
okpdg1 = false;
3947

40-
if ( acc1 && okpdg1 )
41-
{
42-
printf("--- Accepted event, jet 1 ---\n");
43-
printf("PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
44-
event[id1].id() , event[id1].status(), event[id1].mother1(),
45-
event[id1].e() , event[id1].pT(),
46-
event[id1].eta(), event[id1].phi()*TMath::RadToDeg());
47-
48-
return false;
49-
}
50-
5148
// Check the second jet
5249
//
5350
bool acc2 = detector_acceptance(mAcceptance, event[id2].phi(), event[id2].eta()) ;
5451
bool okpdg2 = true;
5552

5653
if ( mOutPartonPDG > 0 && TMath::Abs(event[id2].id()) != mOutPartonPDG )
5754
okpdg2 = false;
58-
59-
if ( acc2 && okpdg2 )
55+
56+
//printf("acc1 %d, acc2 %d, okpdg1 %d, okpdf2 %d\n",acc1,acc2,okpdg1,okpdg2);
57+
58+
if ( (acc1 || acc2) && (okpdg1 || okpdg2) )
6059
{
61-
printf("--- Accepted event, jet 2 ---\n");
62-
printf("PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
60+
printf("--- Accepted event ---\n");
61+
printf("\t --- jet 1 ---\n");
62+
printf("\t PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
63+
event[id1].id() , event[id1].status(), event[id1].mother1(),
64+
event[id1].e() , event[id1].pT(),
65+
event[id1].eta(), event[id1].phi()*TMath::RadToDeg());
66+
67+
printf("\t --- jet 2 ---\n");
68+
printf("\t PDG %d, status %d, mother %d, E %2.2f, pT %2.2f, eta %2.2f, phi %2.2f\n",
6369
event[id2].id() , event[id2].status(), event[id2].mother1(),
6470
event[id2].e() , event[id2].pT(),
6571
event[id2].eta(), event[id2].phi()*TMath::RadToDeg());
66-
72+
6773
return false;
6874
}
6975

70-
// Jets not found
76+
// Jets rejected
7177
//
72-
printf("--- Rejected event ---\n");
78+
printf("\t --- Rejected event ---\n");
7379

7480
return true;
7581

0 commit comments

Comments
 (0)