Skip to content

Commit e17bd75

Browse files
authored
[PWGEM/Dilepton] remove unnecessary function in filterEoI.cxx (#12399)
1 parent 052c688 commit e17bd75

File tree

1 file changed

+15
-38
lines changed

1 file changed

+15
-38
lines changed

PWGEM/Dilepton/TableProducer/filterEoI.cxx

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,43 +32,37 @@ struct filterEoI {
3232
kElectron = 0x1,
3333
kFwdMuon = 0x2,
3434
kPCM = 0x4,
35-
kElectronFromDalitz = 0x8,
3635
};
3736
Produces<o2::aod::EMEoIs> emeoi;
3837
Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"};
3938
Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"};
4039
Configurable<int> minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"};
41-
Configurable<int> minNElectronsFromDalitz{"minNElectronsFromDalitz", 1, "min number of e+ or e- from dalitz decay at midrapidity"};
4240

4341
HistogramRegistry fRegistry{"output"};
4442
void init(o2::framework::InitContext&)
4543
{
46-
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{9, 0.5f, 9.5f}});
44+
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{7, 0.5f, 7.5f}});
4745
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
4846
hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron");
4947
hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon");
5048
hEventCounter->GetXaxis()->SetBinLabel(4, "event with v0");
51-
hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron from dalitz");
52-
hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron or forward muon");
53-
hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron and forward muon");
54-
hEventCounter->GetXaxis()->SetBinLabel(8, "event with electron or forward muon or v0");
55-
hEventCounter->GetXaxis()->SetBinLabel(9, "event with v0 or electron from dalitz");
49+
hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron or forward muon");
50+
hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron and forward muon");
51+
hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron or forward muon or v0");
5652
}
5753

5854
SliceCache cache;
5955
Preslice<aod::EMPrimaryElectrons> perCollision_el = aod::emprimaryelectron::collisionId;
6056
Preslice<aod::EMPrimaryMuons> perCollision_mu = aod::emprimarymuon::collisionId;
6157
Preslice<aod::V0PhotonsKF> perCollision_v0 = aod::v0photonkf::collisionId;
62-
Preslice<aod::EMPrimaryElectronsFromDalitz> perCollision_elda = aod::emprimaryelectron::collisionId;
6358

64-
template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s, typename TElectronsFromDalitz>
65-
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s, TElectronsFromDalitz const& electronsda)
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)
6661
{
6762
for (const auto& collision : collisions) {
6863
bool does_electron_exist = false;
6964
bool does_fwdmuon_exist = false;
7065
bool does_pcm_exist = false;
71-
bool does_electronda_exist = false;
7266
fRegistry.fill(HIST("hEventCounter"), 1);
7367

7468
if constexpr (static_cast<bool>(system & kElectron)) {
@@ -92,28 +86,18 @@ struct filterEoI {
9286
fRegistry.fill(HIST("hEventCounter"), 4);
9387
}
9488
}
95-
if constexpr (static_cast<bool>(system & kElectronFromDalitz)) {
96-
auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex());
97-
if (electronsda_coll.size() >= minNElectronsFromDalitz) {
98-
does_electronda_exist = true;
99-
fRegistry.fill(HIST("hEventCounter"), 5);
100-
}
101-
}
10289

10390
if (does_electron_exist || does_fwdmuon_exist) {
104-
fRegistry.fill(HIST("hEventCounter"), 6);
91+
fRegistry.fill(HIST("hEventCounter"), 5);
10592
}
10693
if (does_electron_exist && does_fwdmuon_exist) {
107-
fRegistry.fill(HIST("hEventCounter"), 7);
94+
fRegistry.fill(HIST("hEventCounter"), 6);
10895
}
10996
if (does_electron_exist || does_fwdmuon_exist || does_pcm_exist) {
110-
fRegistry.fill(HIST("hEventCounter"), 8);
111-
}
112-
if (does_electronda_exist || does_pcm_exist) {
113-
fRegistry.fill(HIST("hEventCounter"), 9);
97+
fRegistry.fill(HIST("hEventCounter"), 7);
11498
}
11599

116-
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist || does_electronda_exist);
100+
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist);
117101

118102
} // end of collision loop
119103

@@ -122,37 +106,31 @@ struct filterEoI {
122106
void process_Electron(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons)
123107
{
124108
const uint8_t sysflag = kElectron;
125-
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr, nullptr);
109+
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr);
126110
}
127111

128112
void process_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryMuons const& muons)
129113
{
130114
const uint8_t sysflag = kFwdMuon;
131-
selectEoI<sysflag>(collisions, nullptr, muons, nullptr, nullptr);
115+
selectEoI<sysflag>(collisions, nullptr, muons, nullptr);
132116
}
133117

134118
void process_Electron_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons)
135119
{
136120
const uint8_t sysflag = kElectron | kFwdMuon;
137-
selectEoI<sysflag>(collisions, electrons, muons, nullptr, nullptr);
121+
selectEoI<sysflag>(collisions, electrons, muons, nullptr);
138122
}
139123

140124
void process_PCM(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s)
141125
{
142126
const uint8_t sysflag = kPCM;
143-
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s, nullptr);
127+
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s);
144128
}
145129

146130
void process_Electron_FwdMuon_PCM(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons, aod::V0PhotonsKF const& v0s)
147131
{
148132
const uint8_t sysflag = kElectron | kFwdMuon | kPCM;
149-
selectEoI<sysflag>(collisions, electrons, muons, v0s, nullptr);
150-
}
151-
152-
void process_PCM_ElectronFromDalitz(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s, aod::EMPrimaryElectronsFromDalitz const& electronsda)
153-
{
154-
const uint8_t sysflag = kPCM | kElectronFromDalitz;
155-
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s, electronsda);
133+
selectEoI<sysflag>(collisions, electrons, muons, v0s);
156134
}
157135

158136
void processDummy(aod::Collisions const& collisions)
@@ -167,7 +145,6 @@ struct filterEoI {
167145
PROCESS_SWITCH(filterEoI, process_PCM, "create filter bit for PCM", false);
168146
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon, "create filter bit for Electron, FwdMuon", false);
169147
PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon_PCM, "create filter bit for Electron, FwdMuon, PCM", false);
170-
PROCESS_SWITCH(filterEoI, process_PCM_ElectronFromDalitz, "create filter bit for PCM, electron from dalitz", false);
171148
PROCESS_SWITCH(filterEoI, processDummy, "processDummy", true);
172149
};
173150
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)