From 6ff68621c19465d3e66ecf8237345c579bfec06b Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 17 Jul 2026 20:28:32 +0000 Subject: [PATCH 1/7] Transparent fix proposal draft 1 --- .../include/Framework/AnalysisDataModel.h | 52 ++++++++++++++----- Framework/Core/include/Framework/DataTypes.h | 4 ++ 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index c8dd33fba62ee..d38f4355c786d 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1918,6 +1918,8 @@ DECLARE_SOA_TABLE_VERSIONED(McCollisions_001, "AOD", "MCCOLLISION", 1, //! MC co using McCollisions = McCollisions_001; using McCollision = McCollisions::iterator; + + namespace mcparticle { DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle @@ -1984,34 +1986,56 @@ DECLARE_SOA_EXPRESSION_COLUMN(Y, y, float, //! Particle rapidity, conditionally (aod::mcparticle::e - aod::mcparticle::pz)))); } // namespace mcparticle +namespace mcparticle_v2 +{ +// for improved getters with protection against incorrect physical primary tagging +// note: this has to be declared in a separate namespace so it does not conflict with existing +// derived data table declarations in O2Physics +DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition + [](uint8_t flags, float vx, float vy) -> bool { + if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; + return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); + +// avoid that the stored flags are provided unprotected via +// the getter '.flags': analysers will get the correct bit map transparently +DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() +DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against + [](uint8_t input_flags, float vx, float vy) -> uint8_t { + if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; + return input_flags; }); + +} + DECLARE_SOA_TABLE_FULL(StoredMcParticles_000, "McParticles", "AOD", "MCPARTICLE", //! MC particle table, version 000 o2::soa::Index<>, mcparticle::McCollisionId, - mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags, + mcparticle::PdgCode, mcparticle::StatusCode, mcparticle_v2::Flags, mcparticle::Mother0Id, mcparticle::Mother1Id, mcparticle::Daughter0Id, mcparticle::Daughter1Id, mcparticle::Weight, mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E, mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt, mcparticle::PVector, - mcparticle::ProducedByGenerator, - mcparticle::FromBackgroundEvent, - mcparticle::GetGenStatusCode, - mcparticle::GetHepMCStatusCode, - mcparticle::GetProcess, - mcparticle::IsPhysicalPrimary); + mcparticle::ProducedByGenerator, + mcparticle::FromBackgroundEvent, + mcparticle::GetGenStatusCode, + mcparticle::GetHepMCStatusCode, + mcparticle::GetProcess, + mcparticle_v2::McParticleFlags, + mcparticle_v2::IsPhysicalPrimary); DECLARE_SOA_TABLE_FULL_VERSIONED(StoredMcParticles_001, "McParticles", "AOD", "MCPARTICLE", 1, //! MC particle table, version 001 o2::soa::Index<>, mcparticle::McCollisionId, - mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags, + mcparticle::PdgCode, mcparticle::StatusCode, mcparticle_v2::Flags, mcparticle::MothersIds, mcparticle::DaughtersIdSlice, mcparticle::Weight, mcparticle::Px, mcparticle::Py, mcparticle::Pz, mcparticle::E, mcparticle::Vx, mcparticle::Vy, mcparticle::Vz, mcparticle::Vt, mcparticle::PVector, - mcparticle::ProducedByGenerator, - mcparticle::FromBackgroundEvent, - mcparticle::GetGenStatusCode, - mcparticle::GetHepMCStatusCode, - mcparticle::GetProcess, - mcparticle::IsPhysicalPrimary); + mcparticle::ProducedByGenerator, + mcparticle::FromBackgroundEvent, + mcparticle::GetGenStatusCode, + mcparticle::GetHepMCStatusCode, + mcparticle::GetProcess, + mcparticle_v2::McParticleFlags, + mcparticle_v2::IsPhysicalPrimary); DECLARE_SOA_EXTENDED_TABLE(McParticles_000, StoredMcParticles_000, "EXMCPARTICLE", 0, //! Basic MC particle properties mcparticle::Phi, diff --git a/Framework/Core/include/Framework/DataTypes.h b/Framework/Core/include/Framework/DataTypes.h index 3d49d6d3c03d0..821decf3e8a7a 100644 --- a/Framework/Core/include/Framework/DataTypes.h +++ b/Framework/Core/include/Framework/DataTypes.h @@ -148,6 +148,10 @@ enum ForwardTrackTypeEnum : uint8_t { }; } // namespace o2::aod::fwdtrack +namespace o2::aod::mcparticle{ +constexpr float maxRadiusForPhysicalPrimary{5.f}; +} + namespace o2::aod::mcparticle::enums { enum MCParticleFlags : uint8_t { From 3a0a37a6d8fd5b7542a151b6b9d382c7f805e3d6 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 17 Jul 2026 20:45:54 +0000 Subject: [PATCH 2/7] Please consider the following formatting changes --- .../Core/include/Framework/AnalysisDataModel.h | 16 +++++++--------- Framework/Core/include/Framework/DataTypes.h | 3 ++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index d38f4355c786d..5e3f35e7d8fea 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1918,8 +1918,6 @@ DECLARE_SOA_TABLE_VERSIONED(McCollisions_001, "AOD", "MCCOLLISION", 1, //! MC co using McCollisions = McCollisions_001; using McCollision = McCollisions::iterator; - - namespace mcparticle { DECLARE_SOA_INDEX_COLUMN(McCollision, mcCollision); //! MC collision of this particle @@ -1987,24 +1985,24 @@ DECLARE_SOA_EXPRESSION_COLUMN(Y, y, float, //! Particle rapidity, conditionally } // namespace mcparticle namespace mcparticle_v2 -{ +{ // for improved getters with protection against incorrect physical primary tagging -// note: this has to be declared in a separate namespace so it does not conflict with existing -// derived data table declarations in O2Physics +// note: this has to be declared in a separate namespace so it does not conflict with existing +// derived data table declarations in O2Physics DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition - [](uint8_t flags, float vx, float vy) -> bool { + [](uint8_t flags, float vx, float vy) -> bool { if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); -// avoid that the stored flags are provided unprotected via +// avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently -DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() +DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against [](uint8_t input_flags, float vx, float vy) -> uint8_t { if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; return input_flags; }); -} +} // namespace mcparticle_v2 DECLARE_SOA_TABLE_FULL(StoredMcParticles_000, "McParticles", "AOD", "MCPARTICLE", //! MC particle table, version 000 o2::soa::Index<>, mcparticle::McCollisionId, diff --git a/Framework/Core/include/Framework/DataTypes.h b/Framework/Core/include/Framework/DataTypes.h index 821decf3e8a7a..d62aa379bf53f 100644 --- a/Framework/Core/include/Framework/DataTypes.h +++ b/Framework/Core/include/Framework/DataTypes.h @@ -148,7 +148,8 @@ enum ForwardTrackTypeEnum : uint8_t { }; } // namespace o2::aod::fwdtrack -namespace o2::aod::mcparticle{ +namespace o2::aod::mcparticle +{ constexpr float maxRadiusForPhysicalPrimary{5.f}; } From 0eb94bda3c20c0e570107acf02d24723fc62a0b2 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 17 Jul 2026 21:28:51 +0000 Subject: [PATCH 3/7] Fix whitespace --- Framework/Core/include/Framework/AnalysisDataModel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 5e3f35e7d8fea..98ae44ad4c958 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1990,16 +1990,16 @@ namespace mcparticle_v2 // note: this has to be declared in a separate namespace so it does not conflict with existing // derived data table declarations in O2Physics DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition - [](uint8_t flags, float vx, float vy) -> bool { - if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; + [](uint8_t flags, float vx, float vy) -> bool { + if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); // avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against - [](uint8_t input_flags, float vx, float vy) -> uint8_t { - if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; + [](uint8_t input_flags, float vx, float vy) -> uint8_t { + if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; return input_flags; }); } // namespace mcparticle_v2 From afb61fa7cf96074d21590ae1ad737088b58d6fbf Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Sat, 18 Jul 2026 08:12:08 +0000 Subject: [PATCH 4/7] Address only the bug --- Framework/Core/include/Framework/AnalysisDataModel.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 98ae44ad4c958..37bbe5b878733 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1990,16 +1990,20 @@ namespace mcparticle_v2 // note: this has to be declared in a separate namespace so it does not conflict with existing // derived data table declarations in O2Physics DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition - [](uint8_t flags, float vx, float vy) -> bool { - if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; - return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); + [](uint8_t input_flags, float vx, float vy) -> bool { + if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ + return o2::aod::mcparticle::enums::FromBackgroundEvent; + } + return (input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); // avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against [](uint8_t input_flags, float vx, float vy) -> uint8_t { - if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent; + if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ + return o2::aod::mcparticle::enums::FromBackgroundEvent; + } return input_flags; }); } // namespace mcparticle_v2 From 22a43b5a00726f508ae5fd249a1ff93b3bea8593 Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 21 Jul 2026 12:03:48 +0000 Subject: [PATCH 5/7] Adjustments: fix bugs, tuning --- .../include/Framework/AnalysisDataModel.h | 10 ++------- Framework/Core/include/Framework/DataTypes.h | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 37bbe5b878733..30ca3ffc70c3e 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1991,20 +1991,14 @@ namespace mcparticle_v2 // derived data table declarations in O2Physics DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition [](uint8_t input_flags, float vx, float vy) -> bool { - if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ - return o2::aod::mcparticle::enums::FromBackgroundEvent; - } - return (input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); + return (o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy) & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); // avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against [](uint8_t input_flags, float vx, float vy) -> uint8_t { - if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ - return o2::aod::mcparticle::enums::FromBackgroundEvent; - } - return input_flags; }); + return o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy); }); } // namespace mcparticle_v2 diff --git a/Framework/Core/include/Framework/DataTypes.h b/Framework/Core/include/Framework/DataTypes.h index d62aa379bf53f..d03e482832976 100644 --- a/Framework/Core/include/Framework/DataTypes.h +++ b/Framework/Core/include/Framework/DataTypes.h @@ -13,6 +13,7 @@ #include "CommonConstants/LHCConstants.h" +#include #include #include #include @@ -148,11 +149,6 @@ enum ForwardTrackTypeEnum : uint8_t { }; } // namespace o2::aod::fwdtrack -namespace o2::aod::mcparticle -{ -constexpr float maxRadiusForPhysicalPrimary{5.f}; -} - namespace o2::aod::mcparticle::enums { enum MCParticleFlags : uint8_t { @@ -163,6 +159,21 @@ enum MCParticleFlags : uint8_t { }; } // namespace o2::aod::mcparticle::enums +namespace o2::aod::mcparticle +{ +constexpr float maxRadiusForPhysicalPrimary{5.f}; + +struct Tools { +// trivial helper to remove Physical Primary bit + static uint8_t removeIsPhysicalPrimaryBit(uint8_t input_flags, float vx, float vy){ + if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ + input_flags = input_flags & ~enums::PhysicalPrimary; // remove physical primary bit, keep others + } + return input_flags; + } +}; +} + namespace o2::aod::run2 { enum Run2EventSelectionCut { From b466e9b0045dbd4908d3e05b00f7369432cba18b Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Tue, 21 Jul 2026 12:24:24 +0000 Subject: [PATCH 6/7] Improve name of ProtectedFlags --- Framework/Core/include/Framework/AnalysisDataModel.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 30ca3ffc70c3e..47dbb5361e8f4 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1996,7 +1996,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if par // avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() -DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against +DECLARE_SOA_DYNAMIC_COLUMN(ProtectedFlags, flags, //! protected against [](uint8_t input_flags, float vx, float vy) -> uint8_t { return o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy); }); @@ -2015,7 +2015,7 @@ DECLARE_SOA_TABLE_FULL(StoredMcParticles_000, "McParticles", "AOD", "MCPARTICLE" mcparticle::GetGenStatusCode, mcparticle::GetHepMCStatusCode, mcparticle::GetProcess, - mcparticle_v2::McParticleFlags, + mcparticle_v2::ProtectedFlags, mcparticle_v2::IsPhysicalPrimary); DECLARE_SOA_TABLE_FULL_VERSIONED(StoredMcParticles_001, "McParticles", "AOD", "MCPARTICLE", 1, //! MC particle table, version 001 @@ -2030,7 +2030,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredMcParticles_001, "McParticles", "AOD", "M mcparticle::GetGenStatusCode, mcparticle::GetHepMCStatusCode, mcparticle::GetProcess, - mcparticle_v2::McParticleFlags, + mcparticle_v2::ProtectedFlags, mcparticle_v2::IsPhysicalPrimary); DECLARE_SOA_EXTENDED_TABLE(McParticles_000, StoredMcParticles_000, "EXMCPARTICLE", 0, //! Basic MC particle properties From 523908ebf0a677f74cd922eb57d7f9a8eff8d578 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 21 Jul 2026 12:25:16 +0000 Subject: [PATCH 7/7] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 8 +++----- Framework/Core/include/Framework/DataTypes.h | 11 ++++++----- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 47dbb5361e8f4..5478f12a27424 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -1990,15 +1990,13 @@ namespace mcparticle_v2 // note: this has to be declared in a separate namespace so it does not conflict with existing // derived data table declarations in O2Physics DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition - [](uint8_t input_flags, float vx, float vy) -> bool { - return (o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy) & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); + [](uint8_t input_flags, float vx, float vy) -> bool { return (o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy) & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; }); // avoid that the stored flags are provided unprotected via // the getter '.flags': analysers will get the correct bit map transparently -DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() +DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator() DECLARE_SOA_DYNAMIC_COLUMN(ProtectedFlags, flags, //! protected against - [](uint8_t input_flags, float vx, float vy) -> uint8_t { - return o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy); }); + [](uint8_t input_flags, float vx, float vy) -> uint8_t { return o2::aod::mcparticle::Tools::removeIsPhysicalPrimaryBit(input_flags, vx, vy); }); } // namespace mcparticle_v2 diff --git a/Framework/Core/include/Framework/DataTypes.h b/Framework/Core/include/Framework/DataTypes.h index d03e482832976..98a40e8f561b0 100644 --- a/Framework/Core/include/Framework/DataTypes.h +++ b/Framework/Core/include/Framework/DataTypes.h @@ -164,15 +164,16 @@ namespace o2::aod::mcparticle constexpr float maxRadiusForPhysicalPrimary{5.f}; struct Tools { -// trivial helper to remove Physical Primary bit - static uint8_t removeIsPhysicalPrimaryBit(uint8_t input_flags, float vx, float vy){ - if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){ + // trivial helper to remove Physical Primary bit + static uint8_t removeIsPhysicalPrimaryBit(uint8_t input_flags, float vx, float vy) + { + if ((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)) { input_flags = input_flags & ~enums::PhysicalPrimary; // remove physical primary bit, keep others } - return input_flags; + return input_flags; } }; -} +} // namespace o2::aod::mcparticle namespace o2::aod::run2 {