From 1d8afae72602376738a8ebf8ff8e6e35037cb3e2 Mon Sep 17 00:00:00 2001 From: nburmaso Date: Mon, 29 Nov 2021 17:33:08 +0100 Subject: [PATCH] Write CTP masks only if requested --- Detectors/AOD/src/AODProducerWorkflowSpec.cxx | 32 +++++++++++-------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx index ccf1b3fd3886b..f0d2306d8f48c 100644 --- a/Detectors/AOD/src/AODProducerWorkflowSpec.cxx +++ b/Detectors/AOD/src/AODProducerWorkflowSpec.cxx @@ -1322,9 +1322,6 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) } } - // hash map for track indices of secondary vertices - std::unordered_map v0sIndices; - // filling unassigned tracks first // so that all unassigned tracks are stored in the beginning of the table together auto& trackRef = primVer2TRefs.back(); // references to unassigned tracks are at the end @@ -1412,21 +1409,25 @@ void AODProducerWorkflowDPL::run(ProcessingContext& pc) // helper map for fast search of a corresponding class mask for a bc std::unordered_map bcToClassMask; - for (auto& ctpDigit : ctpDigits) { - uint64_t bc = ctpDigit.intRecord.toLong(); - uint64_t classMask = ctpDigit.CTPClassMask.to_ulong(); - bcToClassMask[bc] = classMask; + if (mInputSources[GID::CTP]) { + for (auto& ctpDigit : ctpDigits) { + uint64_t bc = ctpDigit.intRecord.toLong(); + uint64_t classMask = ctpDigit.CTPClassMask.to_ulong(); + bcToClassMask[bc] = classMask; + } } // filling BC table - uint64_t triggerMask; + uint64_t triggerMask = 0; for (auto& item : bcsMap) { uint64_t bc = item.first; - auto bcClassPair = bcToClassMask.find(bc); - if (bcClassPair != bcToClassMask.end()) { - triggerMask = bcClassPair->second; - } else { - triggerMask = 0; + if (mInputSources[GID::CTP]) { + auto bcClassPair = bcToClassMask.find(bc); + if (bcClassPair != bcToClassMask.end()) { + triggerMask = bcClassPair->second; + } else { + triggerMask = 0; + } } bcCursor(0, runNumber, @@ -1485,7 +1486,10 @@ DataProcessorSpec getAODProducerWorkflowSpec(GID::mask_t src, bool enableSV, boo dataRequest->requestTracks(src, useMC); dataRequest->requestPrimaryVertertices(useMC); - dataRequest->requestCTPDigits(useMC); + if (src[GID::CTP]) { + LOGF(info, "Requesting CTP digits"); + dataRequest->requestCTPDigits(useMC); + } if (enableSV) { dataRequest->requestSecondaryVertertices(useMC); }