diff --git a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h index 05c2975d6413a..5c2bfbd90bc5b 100644 --- a/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h +++ b/Detectors/AOD/include/AODProducerWorkflow/AODProducerWorkflowSpec.h @@ -30,7 +30,7 @@ #include "ZDCBase/Constants.h" #include "GlobalTracking/MatchGlobalFwd.h" #include "CommonUtils/TreeStreamRedirector.h" -#include "CommonUtils/EnumBitOperators.h" +#include "CommonUtils/EnumFlags.h" #include #include @@ -208,12 +208,9 @@ class BunchCrossings }; // end internal class // Steering bits for additional output during AOD production -enum struct AODProducerStreamerMask : uint8_t { - None = 0, - TrackQA = O2_ENUM_SET_BIT(0), - All = std::numeric_limits>::max(), +enum struct AODProducerStreamerFlags : uint8_t { + TrackQA, }; -O2_DEFINE_ENUM_BIT_OPERATORS(AODProducerStreamerMask) class AODProducerWorkflowDPL : public Task { @@ -251,7 +248,7 @@ class AODProducerWorkflowDPL : public Task std::unordered_set mGIDUsedBySVtx; std::unordered_set mGIDUsedByStr; - AODProducerStreamerMask mStreamerMask{0}; + o2::utils::EnumFlags mStreamerFlags; std::shared_ptr mStreamer; int mNThreads = 1; diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index 58648527f2856..1550ab2485d9e 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1675,9 +1675,10 @@ void AODProducerWorkflowDPL::init(InitContext& ic) mPropTracks = ic.options().get("propagate-tracks"); mPropMuons = ic.options().get("propagate-muons"); if (auto s = ic.options().get("with-streamers"); !s.empty()) { - mStreamerMask = static_cast(std::stoul(s, nullptr, 2)); - if (O2_ENUM_ANY_BIT(mStreamerMask)) { - LOGP(info, "Writing streamer data with mask {:0{}b}", static_cast>(mStreamerMask), std::numeric_limits>::digits); + mStreamerFlags.set(s); + if (mStreamerFlags) { + LOGP(info, "Writing streamer data with mask:"); + LOG(info) << mStreamerFlags; } else { LOGP(warn, "Specified non-default empty streamer mask!"); } @@ -1768,7 +1769,7 @@ void AODProducerWorkflowDPL::init(InitContext& ic) mTimer.Reset(); - if (O2_ENUM_ANY_BIT(mStreamerMask)) { + if (mStreamerFlags) { mStreamer = std::make_unique("AO2DStreamer.root", "RECREATE"); } } @@ -2654,7 +2655,7 @@ AODProducerWorkflowDPL::TrackQA AODProducerWorkflowDPL::processBarrelTrackQA(int trackQAHolder.dRefGloQ2Pt = safeInt8Clamp(((itsCopy.getQ2Pt() + tpcCopy.getQ2Pt()) * 0.5f - gloCopy.getQ2Pt()) * scaleGlo(4)); // - if (O2_ENUM_TEST_BIT(mStreamerMask, AODProducerStreamerMask::TrackQA)) { + if (mStreamerFlags[AODProducerStreamerFlags::TrackQA]) { (*mStreamer) << "trackQA" << "trackITSOrig=" << itsOrig << "trackTPCOrig=" << tpcOrig