Skip to content

Commit 44b7768

Browse files
authored
[PWGEM/PhotonMeson] fix in filterEoI.cxx (#12495)
1 parent fc27b45 commit 44b7768

File tree

1 file changed

+35
-15
lines changed

1 file changed

+35
-15
lines changed

PWGEM/Dilepton/TableProducer/filterEoI.cxx

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,60 +32,70 @@ struct filterEoI {
3232
kElectron = 0x1,
3333
kFwdMuon = 0x2,
3434
kPCM = 0x4,
35+
kElectronFromDalitz = 0x8,
3536
};
3637
Produces<o2::aod::EMEoIs> emeoi;
37-
Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"};
38-
Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"};
39-
Configurable<int> minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"};
38+
// Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"};
39+
// Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"};
40+
// Configurable<int> minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"};
4041

4142
HistogramRegistry fRegistry{"output"};
4243
void init(o2::framework::InitContext&)
4344
{
44-
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{7, 0.5f, 7.5f}});
45+
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{8, 0.5f, 8.5f}});
4546
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
4647
hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron");
4748
hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon");
4849
hEventCounter->GetXaxis()->SetBinLabel(4, "event with v0");
4950
hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron or forward muon");
5051
hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron and forward muon");
5152
hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron or forward muon or v0");
53+
hEventCounter->GetXaxis()->SetBinLabel(8, "event with v0 or electrons from dalitz");
5254
}
5355

5456
SliceCache cache;
5557
Preslice<aod::EMPrimaryElectrons> perCollision_el = aod::emprimaryelectron::collisionId;
5658
Preslice<aod::EMPrimaryMuons> perCollision_mu = aod::emprimarymuon::collisionId;
5759
Preslice<aod::V0PhotonsKF> perCollision_v0 = aod::v0photonkf::collisionId;
60+
Preslice<aod::EMPrimaryElectronsFromDalitz> perCollision_elda = aod::emprimaryelectron::collisionId;
5861

59-
template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s>
60-
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s)
62+
template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s, typename TElectronsDA>
63+
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s, TElectronsDA const& electronsda)
6164
{
6265
for (const auto& collision : collisions) {
6366
bool does_electron_exist = false;
6467
bool does_fwdmuon_exist = false;
6568
bool does_pcm_exist = false;
69+
bool does_electronda_exist = false;
6670
fRegistry.fill(HIST("hEventCounter"), 1);
6771

6872
if constexpr (static_cast<bool>(system & kElectron)) {
6973
auto electrons_coll = electrons.sliceBy(perCollision_el, collision.globalIndex());
70-
if (electrons_coll.size() >= minNElectrons) {
74+
if (electrons_coll.size() >= 1) {
7175
does_electron_exist = true;
7276
fRegistry.fill(HIST("hEventCounter"), 2);
7377
}
7478
}
7579
if constexpr (static_cast<bool>(system & kFwdMuon)) {
7680
auto muons_coll = muons.sliceBy(perCollision_mu, collision.globalIndex());
77-
if (muons_coll.size() >= minNMuons) {
81+
if (muons_coll.size() >= 1) {
7882
does_fwdmuon_exist = true;
7983
fRegistry.fill(HIST("hEventCounter"), 3);
8084
}
8185
}
8286
if constexpr (static_cast<bool>(system & kPCM)) {
8387
auto v0s_coll = v0s.sliceBy(perCollision_v0, collision.globalIndex());
84-
if (v0s_coll.size() >= minNV0s) {
88+
if (v0s_coll.size() >= 1) {
8589
does_pcm_exist = true;
8690
fRegistry.fill(HIST("hEventCounter"), 4);
8791
}
8892
}
93+
if constexpr (static_cast<bool>(system & kElectronFromDalitz)) {
94+
auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex());
95+
if (electronsda_coll.size() >= 2) {
96+
does_electronda_exist = true;
97+
}
98+
}
8999

90100
if (does_electron_exist || does_fwdmuon_exist) {
91101
fRegistry.fill(HIST("hEventCounter"), 5);
@@ -96,8 +106,11 @@ struct filterEoI {
96106
if (does_electron_exist || does_fwdmuon_exist || does_pcm_exist) {
97107
fRegistry.fill(HIST("hEventCounter"), 7);
98108
}
109+
if (does_pcm_exist || does_electronda_exist) {
110+
fRegistry.fill(HIST("hEventCounter"), 8);
111+
}
99112

100-
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist);
113+
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist || does_electronda_exist);
101114

102115
} // end of collision loop
103116

@@ -106,31 +119,37 @@ struct filterEoI {
106119
void process_Electron(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons)
107120
{
108121
const uint8_t sysflag = kElectron;
109-
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr);
122+
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr, nullptr);
110123
}
111124

112125
void process_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryMuons const& muons)
113126
{
114127
const uint8_t sysflag = kFwdMuon;
115-
selectEoI<sysflag>(collisions, nullptr, muons, nullptr);
128+
selectEoI<sysflag>(collisions, nullptr, muons, nullptr, nullptr);
116129
}
117130

118131
void process_Electron_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons)
119132
{
120133
const uint8_t sysflag = kElectron | kFwdMuon;
121-
selectEoI<sysflag>(collisions, electrons, muons, nullptr);
134+
selectEoI<sysflag>(collisions, electrons, muons, nullptr, nullptr);
122135
}
123136

124137
void process_PCM(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s)
125138
{
126139
const uint8_t sysflag = kPCM;
127-
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s);
140+
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s, nullptr);
128141
}
129142

130143
void process_Electron_FwdMuon_PCM(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons, aod::V0PhotonsKF const& v0s)
131144
{
132145
const uint8_t sysflag = kElectron | kFwdMuon | kPCM;
133-
selectEoI<sysflag>(collisions, electrons, muons, v0s);
146+
selectEoI<sysflag>(collisions, electrons, muons, v0s, nullptr);
147+
}
148+
149+
void process_PCM_ElectronFromDalitz(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s, aod::EMPrimaryElectronsFromDalitz const& electronsda)
150+
{
151+
const uint8_t sysflag = kPCM | kElectronFromDalitz;
152+
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s, electronsda);
134153
}
135154

136155
void processDummy(aod::Collisions const& collisions)
@@ -145,6 +164,7 @@ struct filterEoI {
145164
PROCESS_SWITCH(filterEoI, process_PCM, "create filter bit for PCM", false);
146165
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon, "create filter bit for Electron, FwdMuon", false);
147166
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon_PCM, "create filter bit for Electron, FwdMuon, PCM", false);
167+
PROCESS_SWITCH(filterEoI, process_PCM_ElectronFromDalitz, "create filter bit for PCM, ElectronFromDalitz", false);
148168
PROCESS_SWITCH(filterEoI, processDummy, "processDummy", true);
149169
};
150170
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)