Skip to content
Open
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
29 changes: 26 additions & 3 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

[name/workflow-file]

Name of a workflow file must match the name of the main struct in it (without the PWG prefix). (Class implementation files should be in "Core" directories.)

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Specify task name only when it cannot be derived from the struct name. Only append to the default name.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
Expand All @@ -19,6 +19,7 @@

#include "Common/Core/TableHelper.h"

#include <Framework/ASoAHelpers.h>
#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
Expand All @@ -28,6 +29,7 @@
#include <Framework/InitContext.h>
#include <Framework/runDataProcessing.h>

#include <Math/Vector4D.h>
#include <TH1.h>

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

HistogramRegistry fRegistry{"output"};
void init(o2::framework::InitContext& initContext)
Expand All @@ -65,8 +68,9 @@
LOGF(info, "minNelectron = %d", minNelectron.value);
LOGF(info, "minNmuon = %d", minNmuon.value);
LOGF(info, "minNphotons = %d", minNphotons.value);
LOGF(info, "maxMinvPair = %f", static_cast<float>(maxMinvPair.value));

auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{8, 0.5f, 8.5f}});
auto hEventCounter = fRegistry.add<TH1>("hEventCounter", "hEventCounter", kTH1D, {{10, 0.5f, 10.5f}});
hEventCounter->GetXaxis()->SetBinLabel(1, "all");
hEventCounter->GetXaxis()->SetBinLabel(2, "event with electron");
hEventCounter->GetXaxis()->SetBinLabel(3, "event with forward muon");
Expand All @@ -75,6 +79,8 @@
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 v0 or electrons from dalitz");
hEventCounter->GetXaxis()->SetBinLabel(9, "event with minNphotons v0s selection");
hEventCounter->GetXaxis()->SetBinLabel(10, "event with minNphotons v0s and low-M pair selection");
}

SliceCache cache;
Expand Down Expand Up @@ -109,14 +115,31 @@
}
if constexpr (static_cast<bool>(system & kPCM)) {
auto v0s_coll = v0s.sliceBy(perCollision_v0, collision.globalIndex());
if (v0s_coll.size() >= minNphotons) {
does_pcm_exist = true;
if (v0s_coll.size() >= 1) {
fRegistry.fill(HIST("hEventCounter"), 4);
}
if (v0s_coll.size() >= minNphotons) {
fRegistry.fill(HIST("hEventCounter"), 9);
bool hasLowMPair = (maxMinvPair < 0.f);
if (!hasLowMPair) {
for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(v0s_coll, v0s_coll))) {
ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.f);
ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.f);
if ((v1 + v2).M() < maxMinvPair) {
hasLowMPair = true;
break;
}
}
}
if (hasLowMPair) {
does_pcm_exist = true;
fRegistry.fill(HIST("hEventCounter"), 10);
}
}
}
if constexpr (static_cast<bool>(system & kElectronFromDalitz)) {
auto electronsda_coll = electronsda.sliceBy(perCollision_elda, collision.globalIndex());
if (electronsda_coll.size() >= 2) {

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

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
does_electronda_exist = true;
}
}
Expand Down Expand Up @@ -193,5 +216,5 @@
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{adaptAnalysisTask<filterEoI>(cfgc, TaskName{"filter-eoi"})};

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

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-task]

Device names filter-eoi and filter-eo-i generated from the specified task name filter-eoi and from the struct name filterEoI, respectively, differ in hyphenation. Consider fixing capitalisation of the struct name to FilterEoi and removing TaskName.
}
Loading