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
15 changes: 8 additions & 7 deletions PWGLF/Utils/collisionCuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
#ifndef PWGLF_UTILS_COLLISIONCUTS_H_
#define PWGLF_UTILS_COLLISIONCUTS_H_

#include "PWGLF/Utils/collisionCutsGroup.h"

#include "Common/DataModel/EventSelection.h"

#include "Framework/HistogramRegistry.h"
#include "Framework/Logger.h"
#include "PWGLF/Utils/collisionCutsGroup.h"

#include <map>
#include <string>
Expand Down Expand Up @@ -491,17 +492,17 @@ class CollisonCuts
private:
/// Metadata structure for event selections
struct SelectionMetadata {
int evselFlag; ///< o2::aod::evsel::EventSelectionFlags value
const char* label; ///< Histogram label
const char* debugMessage; ///< Debug message for LOGF
int histogramBin; ///< Position in EvtSel enum (for histogram bin)
int evselFlag; ///< o2::aod::evsel::EventSelectionFlags value
const char* label; ///< Histogram label
const char* debugMessage; ///< Debug message for LOGF
int histogramBin; ///< Position in EvtSel enum (for histogram bin)
};

/// Central registry mapping EvtSel enum to metadata (auto-generated from EventSelectionFlagsMapping.def)
inline static const std::map<int, SelectionMetadata> sSelectionRegistry = {
// AUTO-GENERATED from EventSelectionFlagsMapping.def
// AUTO-GENERATED from EventSelectionFlagsMapping.def
#define EVSEL_FLAG(enumVal, member, defaultVal, evtSelEnum, setter, getter, label, desc) \
{EvtSel::evtSelEnum, {aod::evsel::enumVal, label, desc " selection failed", EvtSel::evtSelEnum}},
{EvtSel::evtSelEnum, {aod::evsel::enumVal, label, desc " selection failed", EvtSel::evtSelEnum}},
#include "PWGLF/Utils/EventSelectionFlagsMapping.def"
#undef EVSEL_FLAG
};
Expand Down
6 changes: 4 additions & 2 deletions PWGLF/Utils/collisionCutsGroup.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
/// o2-linter: disable=name/workflow-file (Library implementation file, not a workflow)

#include "PWGLF/Utils/collisionCutsGroup.h"

#include "PWGLF/Utils/collisionCuts.h"

#include "Framework/Logger.h"

CollisionCutsGroup::CollisionCutsGroup()
Expand All @@ -28,9 +30,9 @@ CollisionCutsGroup::CollisionCutsGroup()
occupancyInTimeRangeMin{-1},
checkTrigger{false},
checkOffline{true},
// AUTO-GENERATED member initialization from EventSelectionFlagsMapping.def
// AUTO-GENERATED member initialization from EventSelectionFlagsMapping.def
#define EVSEL_FLAG(enumVal, member, defaultVal, evtSelEnum, setter, getter, label, desc) \
member{defaultVal},
member{defaultVal},
#include "EventSelectionFlagsMapping.def"
#undef EVSEL_FLAG
// Manual Run2 flag initialization
Expand Down
22 changes: 12 additions & 10 deletions PWGLF/Utils/collisionCutsGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
#ifndef PWGLF_UTILS_COLLISIONCUTSGROUP_H_
#define PWGLF_UTILS_COLLISIONCUTSGROUP_H_

#include <iosfwd>
#include <Rtypes.h>
#include "Common/CCDB/EventSelectionParams.h"

#include <Rtypes.h>

#include <iosfwd>

// Forward declaration to avoid circular dependency
namespace o2::analysis
{
Expand Down Expand Up @@ -84,24 +86,24 @@ class CollisionCutsGroup

private:
// ===== Basic collision parameters =====
float zvtxMax; ///< Maximum z-vertex position (cm)
int occupancyInTimeRangeMax; ///< Maximum track occupancy (-1 = no cut)
int occupancyInTimeRangeMin; ///< Minimum track occupancy (-1 = no cut)
float zvtxMax; ///< Maximum z-vertex position (cm)
int occupancyInTimeRangeMax; ///< Maximum track occupancy (-1 = no cut)
int occupancyInTimeRangeMin; ///< Minimum track occupancy (-1 = no cut)

// ===== General event selection flags =====
bool checkTrigger; ///< Check for trigger
bool checkOffline; ///< Check for offline selection
bool checkTrigger; ///< Check for trigger
bool checkOffline; ///< Check for offline selection

// ===== AUTO-GENERATED event selection flag members =====
// Generated from EventSelectionFlagsMapping.def
#define EVSEL_FLAG(enumVal, member, defaultVal, evtSelEnum, setter, getter, label, desc) \
bool member; ///< desc
bool member; ///< desc
#include "EventSelectionFlagsMapping.def"
#undef EVSEL_FLAG

// ===== Run2-specific selections (not in EventSelectionFlags) =====
bool applyRun2AliEventCuts; ///< Run2 AliEventCuts
bool applyRun2INELgtZERO; ///< Run2 INEL>0 selection
bool applyRun2AliEventCuts; ///< Run2 AliEventCuts
bool applyRun2INELgtZERO; ///< Run2 INEL>0 selection

ClassDefNV(CollisionCutsGroup, 2);
};
Expand Down
11 changes: 7 additions & 4 deletions Tutorials/PWGLF/Utils/collisionCuts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
/// \author Bong-Hwi Lim <bong-hwi.lim@cern.ch>
/// \since 30/12/2024

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"
#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"
#include "PWGLF/Utils/collisionCuts.h"

#include "PWGLF/Utils/collisionCutsGroup.h"

#include "Common/DataModel/Centrality.h"
#include "Common/DataModel/EventSelection.h"

#include "Framework/AnalysisTask.h"
#include "Framework/runDataProcessing.h"

using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
Expand Down
Loading