Skip to content

Commit 8aff829

Browse files
authored
Add correctly pDg cut
1 parent 76c6771 commit 8aff829

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

MC/config/PWGHF/trigger/selectNonHfe.C

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,26 @@
1212
//// authors: Rashi Gupta (rashi.gupta@cern.ch)
1313
/// authors: Ravindra Singh (ravindra.singh@cern.ch)
1414
/// ============================================================================
15+
o2::eventgen::Trigger selectPionEtaWithinAcc(TString pdgPartForAccCut = "111;221", double rapidityMin = -1.5, double rapidityMax = 1.5, int minNb = 1)
16+
{
17+
return [pdgPartForAccCut, rapidityMin, rapidityMax, minNb](const std::vector<TParticle>& particles) -> bool {
18+
TObjArray* obj = pdgPartForAccCut.Tokenize(";");
19+
int count = 0;
20+
for (const auto& particle : particles) {
21+
int pdg = TMath::Abs(particle.GetPdgCode());
22+
double y = particle.Y();
1523

24+
if (y < rapidityMin || y > rapidityMax) continue;
1625

26+
for (int i = 0; i < obj->GetEntriesFast(); ++i) {
27+
int pdgCode = std::stoi(obj->At(i)->GetName());
1728

18-
19-
o2::eventgen::Trigger selectPionEtaWithinAcc(Int_t pdgPartForAccCut = 111; 221, double rapidityMin = -1.5, double rapidityMax = 1.5, int minNb = 1)
20-
{
21-
return [pdgPartForAccCut, rapidityMin, rapidityMax, minNb](const std::vector<TParticle>& particles) -> bool {
22-
int count = 0;
23-
for (const auto& particle : particles) {
24-
Int_t pdg = TMath::Abs(particle.GetPdgCode());
25-
if (pdg == pdgPartForAccCut) { // select π⁰ (111) or η (221)
26-
double y = particle.Y();
27-
if (y >= rapidityMin && y <= rapidityMax) {
28-
count++;
29-
}
30-
}
29+
if (pdg == pdgCode) {
30+
count++;
31+
break;
3132
}
32-
33+
}
34+
}
3335
// Only accept events with at least minNb π⁰/η
3436
if (count >= minNb)
3537
return kTRUE;

0 commit comments

Comments
 (0)