Skip to content

Commit afb61fa

Browse files
committed
Address only the bug
1 parent 0eb94bd commit afb61fa

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Framework/Core/include/Framework/AnalysisDataModel.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,16 +1990,20 @@ namespace mcparticle_v2
19901990
// note: this has to be declared in a separate namespace so it does not conflict with existing
19911991
// derived data table declarations in O2Physics
19921992
DECLARE_SOA_DYNAMIC_COLUMN(IsPhysicalPrimary, isPhysicalPrimary, //! True if particle is considered a physical primary according to the ALICE definition
1993-
[](uint8_t flags, float vx, float vy) -> bool {
1994-
if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent;
1995-
return (flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; });
1993+
[](uint8_t input_flags, float vx, float vy) -> bool {
1994+
if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){
1995+
return o2::aod::mcparticle::enums::FromBackgroundEvent;
1996+
}
1997+
return (input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary; });
19961998

19971999
// avoid that the stored flags are provided unprotected via
19982000
// the getter '.flags': analysers will get the correct bit map transparently
19992001
DECLARE_SOA_COLUMN(Flags, storedFlags, uint8_t); //! ALICE specific flags, see MCParticleFlags. Do not use directly. Use the dynamic columns, e.g. producedByGenerator()
20002002
DECLARE_SOA_DYNAMIC_COLUMN(McParticleFlags, flags, //! protected against
20012003
[](uint8_t input_flags, float vx, float vy) -> uint8_t {
2002-
if(std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) return o2::aod::mcparticle::enums::FromBackgroundEvent;
2004+
if((std::hypot(vx, vy) > o2::aod::mcparticle::maxRadiusForPhysicalPrimary) && ((input_flags & o2::aod::mcparticle::enums::PhysicalPrimary) == o2::aod::mcparticle::enums::PhysicalPrimary)){
2005+
return o2::aod::mcparticle::enums::FromBackgroundEvent;
2006+
}
20032007
return input_flags; });
20042008

20052009
} // namespace mcparticle_v2

0 commit comments

Comments
 (0)