Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 37 additions & 18 deletions PWGEM/Dilepton/TableProducer/filterEoI.cxx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.

Check failure on line 1 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Provide mandatory file documentation.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -8,7 +8,7 @@
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
//

Check failure on line 11 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \author is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \brief is missing, incorrect or misplaced.

Check failure on line 11 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[doc/file]

Documentation for \file is missing, incorrect or misplaced.
// ========================
//
// This code filters events that are interesting for dilepton analyses.
Expand All @@ -32,38 +32,43 @@
kElectron = 0x1,
kFwdMuon = 0x2,
kPCM = 0x4,
kElectronFromDalitz = 0x8,
};
Produces<o2::aod::EMEoIs> emeoi;
Configurable<int> minNElectrons{"minNElectrons", 1, "min number of e+ or e- at midrapidity"};
Configurable<int> minNMuons{"minNMuons", 1, "min number of mu+ or mu- at forward rapidity"};
Configurable<int> minNV0s{"minNV0s", 1, "min number of v0 photons at midrapidity"};
Configurable<int> 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<TH1>("hEventCounter", "hEventCounter", kTH1D, {{8, 0.5f, 8.5f}});
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{9, 0.5f, 9.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 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");
hEventCounter->GetXaxis()->SetBinLabel(8, "event with electron and forward muon and 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");
}

SliceCache cache;
Preslice<aod::EMPrimaryElectrons> perCollision_el = aod::emprimaryelectron::collisionId;

Check failure on line 59 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Preslice<aod::EMPrimaryMuons> perCollision_mu = aod::emprimarymuon::collisionId;

Check failure on line 60 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Preslice<aod::V0PhotonsKF> perCollision_v0 = aod::v0photonkf::collisionId;

Check failure on line 61 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
Preslice<aod::EMPrimaryElectronsFromDalitz> perCollision_elda = aod::emprimaryelectron::collisionId;

Check failure on line 62 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.

template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s>
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s)
template <uint8_t system, typename TCollisions, typename TElectrons, typename TMuons, typename TV0s, typename TElectronsFromDalitz>
void selectEoI(TCollisions const& collisions, TElectrons const& electrons, TMuons const& muons, TV0s const& v0s, TElectronsFromDalitz const& electronsda)
{
for (const auto& collision : collisions) {
bool does_electron_exist = false;

Check failure on line 68 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
bool does_fwdmuon_exist = false;

Check failure on line 69 in PWGEM/Dilepton/TableProducer/filterEoI.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[name/function-variable]

Use lowerCamelCase for names of functions and variables.
bool does_pcm_exist = false;
bool does_electronda_exist = false;
fRegistry.fill(HIST("hEventCounter"), 1);

if constexpr (static_cast<bool>(system & kElectron)) {
Expand All @@ -87,21 +92,28 @@
fRegistry.fill(HIST("hEventCounter"), 4);
}
}
if constexpr (static_cast<bool>(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"), 5);
}
if (does_electron_exist && does_fwdmuon_exist) {
fRegistry.fill(HIST("hEventCounter"), 6);
}
if (does_electron_exist || does_fwdmuon_exist || does_pcm_exist) {
if (does_electron_exist && does_fwdmuon_exist) {
fRegistry.fill(HIST("hEventCounter"), 7);
}
if (does_electron_exist && does_fwdmuon_exist && does_pcm_exist) {
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);
}

emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist);
emeoi(does_electron_exist || does_fwdmuon_exist || does_pcm_exist || does_electronda_exist);

} // end of collision loop

Expand All @@ -110,31 +122,37 @@
void process_Electron(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons)
{
const uint8_t sysflag = kElectron;
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr);
selectEoI<sysflag>(collisions, electrons, nullptr, nullptr, nullptr);
}

void process_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryMuons const& muons)
{
const uint8_t sysflag = kFwdMuon;
selectEoI<sysflag>(collisions, nullptr, muons, nullptr);
selectEoI<sysflag>(collisions, nullptr, muons, nullptr, nullptr);
}

void process_Electron_FwdMuon(aod::Collisions const& collisions, aod::EMPrimaryElectrons const& electrons, aod::EMPrimaryMuons const& muons)
{
const uint8_t sysflag = kElectron | kFwdMuon;
selectEoI<sysflag>(collisions, electrons, muons, nullptr);
selectEoI<sysflag>(collisions, electrons, muons, nullptr, nullptr);
}

void process_PCM(aod::Collisions const& collisions, aod::V0PhotonsKF const& v0s)
{
const uint8_t sysflag = kPCM;
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s);
selectEoI<sysflag>(collisions, nullptr, nullptr, v0s, nullptr);
}

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<sysflag>(collisions, electrons, muons, v0s);
selectEoI<sysflag>(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<sysflag>(collisions, nullptr, nullptr, v0s, electronsda);
}

void processDummy(aod::Collisions const& collisions)
Expand All @@ -149,6 +167,7 @@
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)
Expand Down
Loading