From a84ef25c2c64750aebdae7bb6ecdf0921105577c Mon Sep 17 00:00:00 2001 From: Daiki Sekihata Date: Sun, 3 Aug 2025 01:00:06 +0200 Subject: [PATCH] PWGEM/Dilepton: remove unnecessary function in filterEoI.cxx --- PWGEM/Dilepton/TableProducer/filterEoI.cxx | 53 ++++++---------------- 1 file changed, 15 insertions(+), 38 deletions(-) diff --git a/PWGEM/Dilepton/TableProducer/filterEoI.cxx b/PWGEM/Dilepton/TableProducer/filterEoI.cxx index dcbb33f9ec2..ef232718485 100644 --- a/PWGEM/Dilepton/TableProducer/filterEoI.cxx +++ b/PWGEM/Dilepton/TableProducer/filterEoI.cxx @@ -32,43 +32,37 @@ struct filterEoI { kElectron = 0x1, kFwdMuon = 0x2, kPCM = 0x4, - kElectronFromDalitz = 0x8, }; Produces emeoi; Configurable minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"}; Configurable minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"}; Configurable minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"}; - Configurable minNElectronsFromDalitz{"minNElectronsFromDalitz", 1, "min number of e+ or e- from dalitz decay at midrapidity"}; HistogramRegistry fRegistry{"output"}; void init(o2::framework::InitContext&) { - auto hEventCounter = fRegistry.add("hEventCounter", "hEventCounter", kTH1D, {{9, 0.5f, 9.5f}}); + auto hEventCounter = fRegistry.add("hEventCounter", "hEventCounter", kTH1D, {{7, 0.5f, 7.5f}}); hEventCounter->GetXaxis()->SetBinLabel(1, "all"); hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron"); hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon"); hEventCounter->GetXaxis()->SetBinLabel(4, "event with v0"); - hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron from dalitz"); - hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron or forward muon"); - hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron and forward muon"); - hEventCounter->GetXaxis()->SetBinLabel(8, "event with electron or forward muon or v0"); - hEventCounter->GetXaxis()->SetBinLabel(9, "event with v0 or electron from dalitz"); + hEventCounter->GetXaxis()->SetBinLabel(5, "event with electron or forward muon"); + hEventCounter->GetXaxis()->SetBinLabel(6, "event with electron and forward muon"); + hEventCounter->GetXaxis()->SetBinLabel(7, "event with electron or forward muon or v0"); } SliceCache cache; Preslice perCollision_el = aod::emprimaryelectron::collisionId; Preslice perCollision_mu = aod::emprimarymuon::collisionId; Preslice perCollision_v0 = aod::v0photonkf::collisionId; - Preslice perCollision_elda = aod::emprimaryelectron::collisionId; - template - void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s, TElectronsFromDalitz const& electronsda) + template + void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s) { for (const auto& collision : collisions) { bool does_electron_exist = false; bool does_fwdmuon_exist = false; bool does_pcm_exist = false; - bool does_electronda_exist = false; fRegistry.fill(HIST("hEventCounter"), 1); if constexpr (static_cast(system & kElectron)) { @@ -92,28 +86,18 @@ struct filterEoI { fRegistry.fill(HIST("hEventCounter"), 4); } } - if constexpr (static_cast(system & kElectronFromDalitz)) { - auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex()); - if (electronsda_coll.size() >= minNElectronsFromDalitz) { - does_electronda_exist = true; - fRegistry.fill(HIST("hEventCounter"), 5); - } - } if (does_electron_exist || does_fwdmuon_exist) { - fRegistry.fill(HIST("hEventCounter"), 6); + fRegistry.fill(HIST("hEventCounter"), 5); } if (does_electron_exist && does_fwdmuon_exist) { - fRegistry.fill(HIST("hEventCounter"), 7); + fRegistry.fill(HIST("hEventCounter"), 6); } if (does_electron_exist || does_fwdmuon_exist || does_pcm_exist) { - fRegistry.fill(HIST("hEventCounter"), 8); - } - if (does_electronda_exist || does_pcm_exist) { - fRegistry.fill(HIST("hEventCounter"), 9); + fRegistry.fill(HIST("hEventCounter"), 7); } - emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist || does_electronda_exist); + emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist); } // end of collision loop @@ -122,37 +106,31 @@ struct filterEoI { void process_Electron(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons) { const uint8_t sysflag = kElectron; - selectEoI(collisions, electrons, nullptr, nullptr, nullptr); + selectEoI(collisions, electrons, nullptr, nullptr); } void process_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryMuons const& muons) { const uint8_t sysflag = kFwdMuon; - selectEoI(collisions, nullptr, muons, nullptr, nullptr); + selectEoI(collisions, nullptr, muons, nullptr); } void process_Electron_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons) { const uint8_t sysflag = kElectron | kFwdMuon; - selectEoI(collisions, electrons, muons, nullptr, nullptr); + selectEoI(collisions, electrons, muons, nullptr); } void process_PCM(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s) { const uint8_t sysflag = kPCM; - selectEoI(collisions, nullptr, nullptr, v0s, nullptr); + selectEoI(collisions, nullptr, nullptr, v0s); } void process_Electron_FwdMuon_PCM(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons, aod::V0PhotonsKF const& v0s) { const uint8_t sysflag = kElectron | kFwdMuon | kPCM; - selectEoI(collisions, electrons, muons, v0s, nullptr); - } - - void process_PCM_ElectronFromDalitz(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s, aod::EMPrimaryElectronsFromDalitz const& electronsda) - { - const uint8_t sysflag = kPCM | kElectronFromDalitz; - selectEoI(collisions, nullptr, nullptr, v0s, electronsda); + selectEoI(collisions, electrons, muons, v0s); } void processDummy(aod::Collisions const& collisions) @@ -167,7 +145,6 @@ struct filterEoI { PROCESS_SWITCH(filterEoI, process_PCM, "create filter bit for PCM", false); PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon, "create filter bit for Electron, FwdMuon", false); PROCESS_SWITCH(filterEoI, process_Electron_FwdMuon_PCM, "create filter bit for Electron, FwdMuon, PCM", false); - PROCESS_SWITCH(filterEoI, process_PCM_ElectronFromDalitz, "create filter bit for PCM, electron from dalitz", false); PROCESS_SWITCH(filterEoI, processDummy, "processDummy", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)