Skip to content

Commit 2e7f88a

Browse files
authored
[PWGEM] add additional max. mass pair cut to reduce number of events (#17571)
1 parent 4c80c05 commit 2e7f88a

1 file changed

Lines changed: 26 additions & 3 deletions

File tree

PWGEM/Dilepton/TableProducer/filterEoI.cxx

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "Common/Core/TableHelper.h"
2121

22+
#include <Framework/ASoAHelpers.h>
2223
#include <Framework/AnalysisDataModel.h>
2324
#include <Framework/AnalysisHelpers.h>
2425
#include <Framework/AnalysisTask.h>
@@ -28,6 +29,7 @@
2829
#include <Framework/InitContext.h>
2930
#include <Framework/runDataProcessing.h>
3031

32+
#include <Math/Vector4D.h>
3133
#include <TH1.h>
3234

3335
#include <cstdint>
@@ -53,6 +55,7 @@ struct filterEoI {
5355
Configurable<int> minNphotons{"minNphotons", 1, "min number of photon candidates per collision"};
5456
Configurable<std::string> taskNameForNelectron{"taskNameForNelectron", "skimmer-primary-electron", "task name where minNelectron is defined."};
5557
Configurable<std::string> varNameForNelectron{"varNameForNelectron", "minNelectron", "variable name for minNelectron"};
58+
Configurable<float> maxMinvPair{"maxMinvPair", -1.f, "keep events only if at least one photon pair has q_inv below this (GeV/c); negative = disabled"};
5659

5760
HistogramRegistry fRegistry{"output"};
5861
void init(o2::framework::InitContext& initContext)
@@ -65,8 +68,9 @@ struct filterEoI {
6568
LOGF(info, "minNelectron = %d", minNelectron.value);
6669
LOGF(info, "minNmuon = %d", minNmuon.value);
6770
LOGF(info, "minNphotons = %d", minNphotons.value);
71+
LOGF(info, "maxMinvPair = %f", static_cast<float>(maxMinvPair.value));
6872

69-
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{8, 0.5f, 8.5f}});
73+
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{10, 0.5f, 10.5f}});
7074
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
7175
hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron");
7276
hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon");
@@ -75,6 +79,8 @@ struct filterEoI {
7579
hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron and forward muon");
7680
hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron or forward muon or v0");
7781
hEventCounter->GetXaxis()->SetBinLabel(8, "event with v0 or electrons from dalitz");
82+
hEventCounter->GetXaxis()->SetBinLabel(9, "event with minNphotons v0s selection");
83+
hEventCounter->GetXaxis()->SetBinLabel(10, "event with minNphotons v0s and low-M pair selection");
7884
}
7985

8086
SliceCache cache;
@@ -109,10 +115,27 @@ struct filterEoI {
109115
}
110116
if constexpr (static_cast<bool>(system & kPCM)) {
111117
auto v0s_coll = v0s.sliceBy(perCollision_v0, collision.globalIndex());
112-
if (v0s_coll.size() >= minNphotons) {
113-
does_pcm_exist = true;
118+
if (v0s_coll.size() >= 1) {
114119
fRegistry.fill(HIST("hEventCounter"), 4);
115120
}
121+
if (v0s_coll.size() >= minNphotons) {
122+
fRegistry.fill(HIST("hEventCounter"), 9);
123+
bool hasLowMPair = (maxMinvPair < 0.f);
124+
if (!hasLowMPair) {
125+
for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(v0s_coll, v0s_coll))) {
126+
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.f);
127+
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.f);
128+
if ((v1 + v2).M() < maxMinvPair) {
129+
hasLowMPair = true;
130+
break;
131+
}
132+
}
133+
}
134+
if (hasLowMPair) {
135+
does_pcm_exist = true;
136+
fRegistry.fill(HIST("hEventCounter"), 10);
137+
}
138+
}
116139
}
117140
if constexpr (static_cast<bool>(system & kElectronFromDalitz)) {
118141
auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex());

0 commit comments

Comments
 (0)