Skip to content

Commit 310f1a6

Browse files
authored
Update and rename MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_nonhfe.C to MC/config/PWGHF/trigger/selectNonHfe.C
remove gaptrigger and add trigger selection
1 parent 20a6450 commit 310f1a6

File tree

2 files changed

+39
-218
lines changed

2 files changed

+39
-218
lines changed

MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_nonhfe.C

Lines changed: 0 additions & 218 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#include <TParticle.h>
2+
#include "Generators/Trigger.h"
3+
#include <vector>
4+
#include <TMath.h>
5+
6+
///============================================================================
7+
8+
/// Select π⁰ and η within a given rapidity window for enhancement
9+
/// pdgPartForAccCut: PDG of the particle to select (111=π⁰, 221=η)
10+
/// minNb: minimum number of such particles per event for enhancement
11+
12+
//// authors: Rashi Gupta (rashi.gupta@cern.ch)
13+
/// authors: Ravindra Singh (ravindra.singh@cern.ch)
14+
/// ============================================================================
15+
16+
17+
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+
}
31+
}
32+
33+
// Only accept events with at least minNb π⁰/η
34+
if (count >= minNb)
35+
return kTRUE;
36+
else
37+
return kFALSE;
38+
};
39+
}

0 commit comments

Comments
 (0)