Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions PWGEM/PhotonMeson/Core/EMPhotonEventCut.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class EMPhotonEventCut
kNCuts
};

const std::string getName() const { return name; }
const std::string getTitle() const { return title; }
[[nodiscard]] const std::string& getName() const { return name; }
[[nodiscard]] const std::string& getTitle() const { return title; }

template <typename T>
bool IsSelected(T const& collision) const
Expand Down
62 changes: 37 additions & 25 deletions PWGEM/PhotonMeson/DataModel/EventTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,57 +29,69 @@
#include <Rtypes.h> // for BIT

#include <cstdint>
#include <vector>

namespace o2::aod
{

namespace pmevsel
{
// Event selection criteria. See O2Physics/Common/CCDB/EventSelectionParams.h
enum EventSelectionFlags {
kIsTriggerTVX = 0, // FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level
kNoITSROFrameBorder, // bunch crossing is far from ITS RO Frame border
kNoTimeFrameBorder, // bunch crossing is far from Time Frame borders
kNoSameBunchPileup, // reject collisions in case of pileup with another collision in the same foundBC
kIsGoodZvtxFT0vsPV, // small difference between z-vertex from PV and from FT0
kIsVertexITSTPC, // at least one ITS-TPC track (reject vertices built from ITS-only tracks)
kIsVertexTOFmatched, // at least one of vertex contributors is matched to TOF
kIsVertexTRDmatched, // at least one of vertex contributors is matched to TRD
kNoCollInTimeRangeNarrow, // no other collisions in specified time range (narrower than Strict)
kNoCollInTimeRangeStrict, // no other collisions in specified time range
kNoCollInTimeRangeStandard, // no other collisions in specified time range with per-collision multiplicity above threshold
kNoCollInRofStrict, // no other collisions in this Readout Frame
kNoCollInRofStandard, // no other collisions in this Readout Frame with per-collision multiplicity above threshold
kNoHighMultCollInPrevRof, // veto an event if FT0C amplitude in previous ITS ROF is above threshold
kIsGoodITSLayer3, // number of inactive chips on ITS layer 3 is below maximum allowed value
kIsGoodITSLayer0123, // numbers of inactive chips on ITS layers 0-3 are below maximum allowed values
kIsGoodITSLayersAll, // numbers of inactive chips on all ITS layers are below maximum allowed values
kNsel // counter
};

DECLARE_SOA_BITMAP_COLUMN(Selection, selection, 32); //! Bitmask of selection flags
DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint32_t selection_bit) -> bool { return (selection_bit & BIT(o2::aod::pmevsel::kIsTriggerTVX)) && (selection_bit & BIT(o2::aod::pmevsel::kNoTimeFrameBorder)) && (selection_bit & BIT(o2::aod::pmevsel::kNoITSROFrameBorder)); });
DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint64_t selection_bit, int runNumber) -> bool {
return (selection_bit & BIT(o2::aod::evsel::kIsTriggerTVX)) && (selection_bit & BIT(o2::aod::evsel::kNoTimeFrameBorder)) && (runNumber < 568873 ? (selection_bit & BIT(o2::aod::evsel::kNoITSROFrameBorder)) : true); // o2-linter: disable=magic-number (hard-coded run range to indicate 2026 datataking)
});

// Enum used for filling table for event-norm purposes
enum EventAcceptanceBits {
kAll = 0, // o2-linter: disable=magic-number (enum)
kHasMCColl,
kGoodZVtx,
kIsFT0AND,
kNoTFB,
kITSROFB,
kNoSameBunchPileUp,
kGoodZVtxFTOPV,
kNoCollInTimeRange,
kGoodTrackOccupancy,
kGoodFT0Occupancy,
kTVXInEMC,
kGoodCent,
kGoodRCT,
kGoodSel8,
kSize
};

} // namespace pmevsel

namespace pmevent
{
DECLARE_SOA_COLUMN(CollisionId, collisionId, int);

DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint64_t selection_bit) -> bool { return (selection_bit & BIT(o2::aod::evsel::kIsTriggerTVX)) && (selection_bit & BIT(o2::aod::evsel::kNoTimeFrameBorder)) && (selection_bit & BIT(o2::aod::evsel::kNoITSROFrameBorder)); });
} // namespace pmevent

DECLARE_SOA_TABLE(PMEvents, "AOD", "PMEVENT", //! Main event information table
o2::soa::Index<>, pmevent::CollisionId, bc::RunNumber, bc::GlobalBC, evsel::Selection, evsel::Rct, timestamp::Timestamp,
collision::PosZ,
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, pmevent::Sel8<evsel::Selection>);
collision::NumContrib, evsel::NumTracksInTimeRange, evsel::SumAmpFT0CInTimeRange, pmevsel::Sel8<evsel::Selection, bc::RunNumber>);

using PMEvent = PMEvents::iterator;

// Tables for event selection and event bookkeeping

DECLARE_SOA_COLUMN(IsSelected, isSelected, bool); //! MB event selection info
DECLARE_SOA_TABLE(PMEvSels, "AOD", "PMEVSEL", //! joinable to o2::aod::Collisions
IsSelected);
using PMEvSel = PMEvSels::iterator;

DECLARE_SOA_COLUMN(EventSelectionBit, eventSelectionBit, std::vector<uint64_t>); //! Event selection info stored in binned data for each DF
DECLARE_SOA_TABLE(PMEvSelBits, "AOD", "PMEVSELBITS", //! produces binned data that can be loaded in analysis task for event counting
EventSelectionBit);
using PMEvSelBit = PMEvSelBits::iterator;

namespace ccdbPcm
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "GLO/Config/GRPMagField"); //!

Check failure on line 94 in PWGEM/PhotonMeson/DataModel/EventTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} // namespace ccdbPcm

/// Full table — join with aod::BCsWithTimestamps to obtain all four objects.
Expand All @@ -89,7 +101,7 @@
namespace em::ccdbMagField
{
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
DECLARE_SOA_CCDB_COLUMN(GRPMagField, grpMagField, o2::parameters::GRPMagField, "GLO/Config/GRPMagField"); //!

Check failure on line 104 in PWGEM/PhotonMeson/DataModel/EventTables.h

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-column]

Use UpperCamelCase for names of O2 columns and matching lowerCamelCase names for their getters.
} // namespace em::ccdbMagField

/// Full table — join with aod::BCsWithTimestamps to obtain all four objects.
Expand Down
5 changes: 5 additions & 0 deletions PWGEM/PhotonMeson/TableProducer/CMakeLists.txt
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/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Use kebab-case for names of workflows and match the name of the workflow file.
# See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
# All rights not expressly granted are reserved.
#
Expand All @@ -11,17 +11,17 @@

add_subdirectory(Converters)

o2physics_add_dpl_workflow(photon-conversion-builder

Check failure on line 14 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name photon-conversion-builder does not match its file name photonconversionbuilder.cxx. (Matches photonConversionBuilder.cxx.)
SOURCES photonconversionbuilder.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2::DCAFitter O2Physics::AnalysisCore O2Physics::MLCore KFParticle::KFParticle O2Physics::TPCDriftManager
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(create-emevent-photon

Check failure on line 19 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name create-emevent-photon does not match its file name createEMEventPhoton.cxx. (Matches createEmeventPhoton.cxx.)
SOURCES createEMEventPhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGJECore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(associate-mc-info-photon

Check failure on line 24 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name associate-mc-info-photon does not match its file name associateMCinfoPhoton.cxx. (Matches associateMcInfoPhoton.cxx.)
SOURCES associateMCinfoPhoton.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -36,12 +36,12 @@
PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2Physics::AnalysisCCDB O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-phos

Check failure on line 39 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name skimmer-phos does not match its file name skimmerPHOS.cxx. (Matches skimmerPhos.cxx.)
SOURCES skimmerPHOS.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::PHOSBase
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(skimmer-primary-electron-from-dalitzee

Check failure on line 44 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name skimmer-primary-electron-from-dalitzee does not match its file name skimmerPrimaryElectronFromDalitzEE.cxx. (Matches skimmerPrimaryElectronFromDalitzee.cxx.)
SOURCES skimmerPrimaryElectronFromDalitzEE.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
Expand All @@ -60,3 +60,8 @@
SOURCES materialBudgetWeights.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2::CCDB ROOT::Hist ROOT::Core
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(event-selection-photon

Check failure on line 64 in PWGEM/PhotonMeson/TableProducer/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / O2 linter

[name/o2-workflow]

Workflow name event-selection-photon does not match its file name eventSelection.cxx. (Matches eventSelectionPhoton.cxx.)
SOURCES eventSelection.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)
3 changes: 2 additions & 1 deletion PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/// \brief This code produces EmMc tables were the McParticleIds get reshuffled due to not storing all McParticles
/// \author Daiki Sekihata (daiki.sekihata@cern.ch), Marvin Hemmer (marvin.hemmer@cern.ch), Nicolas Strangmann (nicolas.strangmann@cern.ch)

#include "PWGEM/PhotonMeson/DataModel/EventTables.h"
#include "PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h"
#include "PWGEM/PhotonMeson/DataModel/gammaTables.h"
#include "PWGEM/PhotonMeson/Utils/MCUtilities.h"
Expand Down Expand Up @@ -56,7 +57,7 @@
using namespace o2::aod::pwgem::photonmeson::utils::mcutil;
using namespace o2::constants::physics;

using MyCollisionsMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::EMEvSels>;
using MyCollisionsMC = soa::Join<aod::Collisions, aod::McCollisionLabels, aod::EvSels, aod::PMEvSels>;
using TracksMC = soa::Join<aod::TracksIU, aod::McTrackLabels>;
using FwdTracksMC = soa::Join<aod::FwdTracks, aod::McFwdTrackLabels>;
using MyEMCClusters = soa::Join<aod::MinClusters, aod::EMCClusterMCLabels_001>;
Expand Down Expand Up @@ -324,7 +325,7 @@
mceventlabels(fEventLabels.find(mcCollisionIter.globalIndex())->second, collision.mcMask());

for (const auto& mcParticle : groupedMcParticles) { // store necessary information for denominator of efficiency
if (mcParticle.pt() < 1e-3 || std::fabs(mcParticle.vz()) > 250 || std::sqrt(std::pow(mcParticle.vx(), 2) + std::pow(mcParticle.vy(), 2)) > max_rxy_gen) {

Check failure on line 328 in PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.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.
continue;
}
int pdg = mcParticle.pdgCode();
Expand Down
3 changes: 2 additions & 1 deletion PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using namespace o2::soa;
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::BcSels>;
using MyQvectors = soa::Join<aod::QvectorFT0CVecs, aod::QvectorFT0AVecs, aod::QvectorFT0MVecs, aod::QvectorFV0AVecs, aod::QvectorBPosVecs, aod::QvectorBNegVecs, aod::QvectorBTotVecs>;

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::EMEvSels, aod::EMEoIs, aod::Mults>;
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::PMEvSels, aod::EMEoIs, aod::Mults>;
using MyCollisionsCent = soa::Join<MyCollisions, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>; // centrality table has dependency on multiplicity table.
using MyCollisionsCentQvec = soa::Join<MyCollisionsCent, MyQvectors>;

Expand Down Expand Up @@ -95,6 +95,7 @@ struct CreateEMEventPhoton {
template <bool isMC, bool isTriggerAnalysis, EMEventType eventtype, typename TCollisions, typename TBCs>
void skimEvent(TCollisions const& collisions, TBCs const&)
{

for (const auto& collision : collisions) {
if constexpr (isMC) {
if (!collision.has_mcCollision()) {
Expand Down
196 changes: 196 additions & 0 deletions PWGEM/PhotonMeson/TableProducer/eventSelection.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// 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.
//
// ========================
//
// This code produces event selection table for PWG-EM Photon/Meson.

#include "PWGEM/PhotonMeson/DataModel/EventTables.h"
//
#include "Common/CCDB/EventSelectionParams.h"
#include "Common/CCDB/RCTSelectionFlags.h"
#include "Common/CCDB/TriggerAliases.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "Common/DataModel/Multiplicity.h"

#include <Framework/AnalysisDataModel.h>
#include <Framework/AnalysisHelpers.h>
#include <Framework/AnalysisTask.h>
#include <Framework/Configurable.h>
#include <Framework/InitContext.h>
#include <Framework/runDataProcessing.h>

#include <array>
#include <cstdint>
#include <string>
#include <type_traits>
#include <vector>

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
using namespace o2::soa;
using EventAccBits = o2::aod::pmevsel::EventAcceptanceBits;

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels>;
using MyCollisions_Cent = soa::Join<MyCollisions, aod::Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;

using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
using MyCollisionsMC_Cent = soa::Join<MyCollisionsMC, aod::Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;

struct PMEventSelection {
Produces<o2::aod::PMEvSels> pmevsel;
Produces<o2::aod::PMEvSelBits> pmevselbits;

// Configurables
Configurable<int> cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"};
Configurable<float> cfgCentMin{"cfgCentMin", -1.f, "min. centrality"};
Configurable<float> cfgCentMax{"cfgCentMax", 999.f, "max. centrality"};

// for RCT
Configurable<bool> cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"};
Configurable<std::string> cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"};
Configurable<bool> cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"};
Configurable<bool> cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"};

Configurable<float> cfgZvtxMin{"cfgZvtxMin", -1e+10, "min. Zvtx"};
Configurable<float> cfgZvtxMax{"cfgZvtxMax", 1e+10, "max. Zvtx"};
Configurable<bool> cfgRequireFT0AND{"cfgRequireFT0AND", false, "require FT0AND in event cut"};
Configurable<bool> cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"};
Configurable<bool> cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"};
Configurable<bool> cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"};
Configurable<bool> cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"};
Configurable<int> cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. track occupancy"};
Configurable<int> cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. track occupancy"};
Configurable<float> cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. occupancy"};
Configurable<float> cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. occupancy"};
Configurable<bool> cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"};

Configurable<bool> cfgRequireTVXinEMC{"cfgRequireTVXinEMC", false, "require kTVXinEMC (only for EMC analyses)"};

Configurable<bool> cfgRequireSel8{"cfgRequireSel8", false, "require sel8 condition"};

o2::aod::rctsel::RCTFlagsChecker rctChecker;

std::vector<uint64_t> vecEvSelBits;

void init(InitContext&)
{
rctChecker.init(cfgRCTLabel.value, cfgCheckZDC.value, cfgTreatLimitedAcceptanceAsBad.value);
vecEvSelBits.assign(EventAccBits::kSize, 0);
}

template <typename TCollision>
bool isSelectedEvent(TCollision const& collision)
{
vecEvSelBits[EventAccBits::kAll]++;
if constexpr (std::is_same_v<std::decay_t<TCollision>, MyCollisionsMC::iterator> || std::is_same_v<std::decay_t<TCollision>, MyCollisionsMC_Cent::iterator>) {
if (!collision.has_mcCollision()) {
return false;
}
}
vecEvSelBits[EventAccBits::kHasMCColl]++;

if (collision.posZ() < cfgZvtxMin || cfgZvtxMax < collision.posZ()) {
return false;
}
vecEvSelBits[EventAccBits::kGoodZVtx]++;

if (cfgRequireFT0AND && !collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) {
return false;
}
vecEvSelBits[EventAccBits::kIsFT0AND]++;

if (cfgRequireNoTFB && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) {
return false;
}
vecEvSelBits[EventAccBits::kNoTFB]++;

if (cfgRequireNoITSROFB && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) {
return false;
}
vecEvSelBits[EventAccBits::kITSROFB]++;

if (cfgRequireNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
return false;
}
vecEvSelBits[EventAccBits::kNoSameBunchPileUp]++;

if (cfgRequireGoodZvtxFT0vsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) {
return false;
}
vecEvSelBits[EventAccBits::kGoodZVtxFTOPV]++;

if (cfgRequireNoCollInTimeRangeStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) {
return false;
}
vecEvSelBits[EventAccBits::kNoCollInTimeRange]++;

if (!(cfgTrackOccupancyMin <= collision.trackOccupancyInTimeRange() && collision.trackOccupancyInTimeRange() < cfgTrackOccupancyMax)) {
return false;
}
vecEvSelBits[EventAccBits::kGoodTrackOccupancy]++;

if (!(cfgFT0COccupancyMin <= collision.ft0cOccupancyInTimeRange() && collision.ft0cOccupancyInTimeRange() < cfgFT0COccupancyMax)) {
return false;
}
vecEvSelBits[EventAccBits::kGoodFT0Occupancy]++;

if (cfgRequireTVXinEMC && !collision.alias_bit(triggerAliases::kTVXinEMC)) {
return false;
}
vecEvSelBits[EventAccBits::kTVXInEMC]++;

if constexpr (std::is_same_v<std::decay_t<TCollision>, MyCollisions_Cent::iterator>) {
std::array<float, 3> centralities = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()};
if (centralities[cfgCentEstimator] < cfgCentMin || cfgCentMax < centralities[cfgCentEstimator]) {
return false;
}
}
vecEvSelBits[EventAccBits::kGoodCent]++;

if (cfgRequireGoodRCT && !rctChecker.checkTable(collision)) {
// LOGF(info, "rejected by RCT flag");
return false;
}
vecEvSelBits[EventAccBits::kGoodRCT]++;

if (cfgRequireSel8 && !collision.sel8()) {
return false;
}
vecEvSelBits[EventAccBits::kGoodSel8]++;

return true;
}

template <typename TCollisions>
void processEventSelection(TCollisions const& collisions)
{
// reset the event counter to zero for all elements
vecEvSelBits.assign(EventAccBits::kSize, 0);

for (const auto& collision : collisions) {
pmevsel(isSelectedEvent(collision));
} // end of collision loop
// Write event selection info at the end of DF
pmevselbits(vecEvSelBits);
} // end of process

PROCESS_SWITCH_FULL(PMEventSelection, processEventSelection<MyCollisions>, processEventSelection, "event selection", true);
PROCESS_SWITCH_FULL(PMEventSelection, processEventSelection<MyCollisions_Cent>, processEventSelection_Cent, "event selection with cent", false);
PROCESS_SWITCH_FULL(PMEventSelection, processEventSelection<MyCollisionsMC>, processEventSelectionMC, "event selection MC", false);
PROCESS_SWITCH_FULL(PMEventSelection, processEventSelection<MyCollisionsMC_Cent>, processEventSelectionMC_Cent, "event selection MC with cent", false);
};
WorkflowSpec defineDataProcessing(o2::framework::ConfigContext const& context)
{
return WorkflowSpec{adaptAnalysisTask<PMEventSelection>(context, TaskName{"em-event-selection"})};
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ using namespace o2::constants::physics;
using namespace o2::pwgem::photonmeson;
using std::array;

using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::EMEvSels, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
using MyCollisions = soa::Join<aod::Collisions, aod::EvSels, aod::PMEvSels, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs>;
// using MyCollisionsWithSWT = soa::Join<MyCollisions, aod::EMSWTriggerBitsTMP>;
using MyCollisionsMC = soa::Join<MyCollisions, aod::McCollisionLabels>;
using MyBCs = soa::Join<aod::BCsWithTimestamps, aod::PcmObjects>;
Expand Down
Loading
Loading