67 #include "TTreeCache.h"
108 void checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
111 for (
auto const& ph : processHistoryVector) {
112 for (
auto const& pc : ph) {
116 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " <<
fileName <<
".\n"
117 <<
"Forward compatibility cannot be supported.\n";
137 return eventAux.
event();
148 std::shared_ptr<InputFile> filePtr,
149 std::shared_ptr<EventSkipperByID> eventSkipperByID,
154 unsigned int treeCacheSize,
155 int treeMaxVirtualSize,
161 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
163 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
164 std::vector<BranchID>
const* associationsFromSecondary,
165 std::shared_ptr<DuplicateChecker> duplicateChecker,
166 bool dropDescendants,
168 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
170 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
171 bool bypassVersionCheck,
172 bool labelRawDataLikeMC,
174 bool enablePrefetching,
175 bool enforceGUIDInFileName)
177 logicalFile_(logicalFileName),
178 processConfiguration_(processConfiguration),
179 processHistoryRegistry_(&processHistoryRegistry),
181 eventSkipperByID_(eventSkipperByID),
182 fileFormatVersion_(),
185 indexIntoFile_(*indexIntoFileSharedPtr_),
186 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
189 indexIntoFileEnd_(indexIntoFileBegin_),
190 indexIntoFileIter_(indexIntoFileBegin_),
193 eventProcessHistoryIDs_(),
194 eventProcessHistoryIter_(eventProcessHistoryIDs_.begin()),
195 savedRunAuxiliary_(),
196 skipAnyEvents_(skipAnyEvents),
197 noEventSort_(noEventSort),
198 enforceGUIDInFileName_(enforceGUIDInFileName),
199 whyNotFastClonable_(0),
200 hasNewlyDroppedBranch_(),
201 branchListIndexesUnchanged_(
false),
231 branchIDListHelper_(branchIDListHelper),
232 processBlockHelper_(processBlockHelper),
233 fileThinnedAssociationsHelper_(),
234 thinnedAssociationsHelper_(thinnedAssociationsHelper),
236 runHelper_(runHelper),
237 newBranchToOldBranch_(),
238 eventHistoryTree_(nullptr),
239 eventToProcessBlockIndexesBranch_(
245 duplicateChecker_(duplicateChecker),
246 provenanceAdaptor_(),
247 provenanceReaderMaker_(),
248 eventProductProvenanceRetrievers_(),
249 parentageIDLookup_(),
250 daqProvenanceHelper_(),
251 edProductClass_(
TypeWithDict::byName(
"edm::WrapperBase").getClass()),
252 inputType_(inputType) {
263 if (
nullptr == metaDataTree.get()) {
274 fft->SetAddress(&fftPtr);
312 using PsetMap = std::map<ParameterSetID, ParameterSetBlob>;
314 PsetMap* psetMapPtr = &psetMap;
323 if (
nullptr == psetTree.get()) {
328 using IdToBlobs = std::pair<ParameterSetID, ParameterSetBlob>;
330 IdToBlobs* pIdToBlob = &idToBlob;
333 std::unique_ptr<TTreeCache> psetTreeCache =
335 psetTreeCache->SetEnablePrefetching(
false);
336 filePtr_->SetCacheRead(psetTreeCache.get());
337 for (Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
338 psetTree->GetEntry(
i);
339 psetMap.insert(idToBlob);
364 auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
372 std::make_unique<ThinnedAssociationsHelper>();
376 &thinnedAssociationsHelperPtr);
413 for (
auto const& psetEntry : psetMap) {
415 pset.setID(psetEntry.first);
426 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
434 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
446 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
450 if (!bypassVersionCheck) {
451 checkReleaseVersion(pHistVector,
file());
454 if (labelRawDataLikeMC) {
459 ProductRegistry::ProductList::iterator it = pList.lower_bound(
finder);
460 if (it != pList.end() && it->first.friendlyClassName() ==
rawData && it->first.moduleLabel() ==
source) {
476 it = pList.lower_bound(
finder);
477 assert(!(it != pList.end() && it->first.friendlyClassName() ==
rawData && it->first.moduleLabel() ==
source));
487 for (
auto const& history : pHistVector) {
523 auto newReg = std::make_unique<ProductRegistry>();
528 for (
auto const& product : prodList) {
531 if (newFriendlyName ==
prod.friendlyClassName()) {
532 newReg->copyProduct(
prod);
536 <<
"Cannot change friendly class name algorithm without more development work\n"
537 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
541 newReg->copyProduct(newBD);
547 *newReg, productSelectorRules, dropDescendants, inputType, storedProcessBlockHelper, processBlockHelper);
551 *associationsFromSecondary);
558 for (
auto& product : newReg->productListUpdator()) {
563 for (
auto& product : newReg->productListUpdator()) {
564 product.second.setOnDemand(
true);
581 for (
auto const& product : prodList) {
582 if (product.second.branchType() ==
InProcess) {
590 ++nBranches[product.second.branchType()];
596 t->numberOfBranchesToAdd(nBranches[
i]);
600 for (
auto const& product : prodList) {
628 processBlockTree->trainCache(
"*");
637 std::unique_ptr<TTree> entryDescriptionTree(
639 if (
nullptr == entryDescriptionTree.get()) {
657 if (idBuffer != entryDescriptionBuffer.
id()) {
660 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(), entryDescriptionBuffer));
667 if (newID != oldID) {
684 if (
nullptr == parentageTree.get()) {
702 if (newID != oldID) {
760 std::vector<TTree*> processBlockTrees;
761 std::vector<std::string> processesWithProcessBlockTrees;
765 processBlockTrees.push_back(processBlockTree->tree());
766 processesWithProcessBlockTrees.push_back(processBlockTree->processName());
776 std::move(processesWithProcessBlockTrees),
786 std::vector<TTree*> processBlockTrees;
787 std::vector<std::string> processesWithProcessBlockTrees;
791 processBlockTrees.push_back(processBlockTree->tree());
792 processesWithProcessBlockTrees.push_back(processBlockTree->processName());
801 std::move(processesWithProcessBlockTrees));
869 eventAux.id().event(),
918 event = eventAux.
event();
945 struct RunItemSortByRun {
946 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
return a.run_ <
b.run_; }
948 struct RunItemSortByRunPhid {
949 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
950 return a.run_ <
b.run_ || (!(
b.run_ <
a.run_) &&
a.phid_ <
b.phid_);
961 firstEventEntry_(
entry),
962 lastEventEntry_(
entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry :
entry + 1) {}
969 struct LumiItemSortByRunLumi {
970 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
971 return a.run_ <
b.run_ || (!(
b.run_ <
a.run_) &&
a.lumi_ <
b.lumi_);
974 struct LumiItemSortByRunLumiPhid {
975 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
980 if (
a.lumi_ <
b.lumi_)
982 if (
b.lumi_ <
a.lumi_)
984 return a.phid_ <
b.phid_;
999 typedef std::list<LumiItem>
LumiList;
1002 typedef std::set<LuminosityBlockID> RunLumiSet;
1003 RunLumiSet runLumiSet;
1005 typedef std::list<RunItem>
RunList;
1008 typedef std::set<RunNumber_t> RunSet;
1011 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
1012 RunItemSet runItemSet;
1014 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
1029 bool newRun =
false;
1030 bool newLumi =
false;
1041 if (iFirst || prevPhid != reducedPHID || prevRun != evtAux.run()) {
1043 newRun = newLumi =
true;
1044 }
else if (prevLumi != evtAux.luminosityBlock()) {
1047 prevPhid = reducedPHID;
1048 prevRun = evtAux.run();
1049 prevLumi = evtAux.luminosityBlock();
1055 LumiItem& currentLumi =
lumis.back();
1057 ++currentLumi.lastEventEntry_;
1061 RunItem
item(reducedPHID, evtAux.run());
1062 if (runItemSet.insert(
item).second) {
1064 runSet.insert(evtAux.run());
1065 phidMap.insert(std::make_pair(evtAux.run(), reducedPHID));
1075 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
1078 typedef std::vector<RunItem> RunVector;
1079 RunVector emptyRuns;
1088 if (runSet.insert(runAux->run()).
second) {
1090 emptyRuns.emplace_back(reducedPHID, runAux->run());
1093 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1100 RunItemSortByRun runItemSortByRun;
1103 RunList::iterator itRuns =
runs.begin(), endRuns =
runs.end();
1104 for (
auto const& emptyRun : emptyRuns) {
1105 for (; itRuns != endRuns; ++itRuns) {
1106 if (runItemSortByRun(emptyRun, *itRuns)) {
1110 runs.insert(itRuns, emptyRun);
1115 typedef std::vector<LumiItem> LumiVector;
1116 LumiVector emptyLumis;
1118 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1119 RunLumiMap runLumiMap;
1126 if (runLumiSet.insert(lumiID).second) {
1131 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1132 assert(iPhidMap != phidMap.end());
1133 emptyLumis.emplace_back(
1143 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1146 LumiList::iterator itLumis =
lumis.begin(), endLumis =
lumis.end();
1147 for (
auto const& emptyLumi : emptyLumis) {
1148 for (; itLumis != endLumis; ++itLumis) {
1149 if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1153 lumis.insert(itLumis, emptyLumi);
1158 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1159 RunCountMap runCountMap;
1166 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1167 if (countMapItem == runCountMap.end()) {
1168 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1169 assert(countMapItem != runCountMap.end());
1172 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1173 if (phidItem == phids.end()) {
1174 phids.push_back(
run.phid_);
1175 phidItem = phids.end() - 1;
1177 entries.emplace_back(countMapItem->second,
1180 phidItem - phids.begin(),
1188 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1189 LumiCountMap lumiCountMap;
1192 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1193 assert(runCountMapItem != runCountMap.end());
1194 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1195 if (countMapItem == lumiCountMap.end()) {
1196 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1197 assert(countMapItem != lumiCountMap.end());
1200 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1201 assert(phidItem != phids.end());
1202 entries.emplace_back(runCountMapItem->second,
1203 countMapItem->second,
1205 phidItem - phids.begin(),
1208 lumi.firstEventEntry_,
1209 lumi.lastEventEntry_);
1220 <<
"in the input file.\n";
1224 if (guidFromName !=
fid_.
fid()) {
1226 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_
1227 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1232 if (
runTree().entries() > 0) {
1238 for (
auto& phid : phidVec) {
1252 std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(
eventTree_)));
1255 bool needEventNumbers =
false;
1256 bool needIndexesForDuplicateChecker =
1258 if (inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1259 needEventNumbers =
true;
1261 bool needEventEntries =
false;
1264 needEventEntries =
true;
1280 treePointer->close();
1281 treePointer =
nullptr;
1313 if (eventToProcessBlockIndexesBranch ==
nullptr) {
1334 bool assertOnFailure) {
1352 if (!eventHistoryBranch) {
1355 eventHistoryBranch->SetAddress(&pHistory);
1358 eventSelectionIDs.swap(
history_->eventSelectionIDs());
1359 branchListIndexes.swap(
history_->branchListIndexes());
1364 assert(eventSelectionIDBranch !=
nullptr);
1368 assert(branchListIndexesBranch !=
nullptr);
1373 for (
auto& esID : eventSelectionIDs) {
1391 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1402 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1405 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1410 return lumiAuxiliary;
1414 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1420 RunAux* pRunAux = &runAux;
1425 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1428 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1430 return runAuxiliary;
1441 phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1449 if (
eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, evtAux.id().event())) {
1456 phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, evtAux.id().event(),
file_)) {
1527 auto const& evtAux = principal.
aux();
1547 const_cast<EventID&>(evtAux.id()).setLuminosityBlockNumber(evtAux.oldLuminosityBlock());
1548 evtAux.resetObsoleteInfo();
1553 if (!
fillEventHistory(evtAux, eventSelectionIDs, branchListIndexes, assertOnFailure)) {
1556 runHelper_->overrideRunNumber(evtAux.id(), evtAux.isRealData());
1573 : evtAux.processHistoryID());
1587 runHelper_->overrideRunNumber(runAuxiliary->id());
1588 return runAuxiliary;
1611 runHelper_->overrideRunNumber(runAuxiliary->id());
1612 filePtr_->reportInputRunNumber(runAuxiliary->run());
1631 runAuxiliary->setBeginTime(evtAux.time());
1642 runAuxiliary->setProcessHistoryID(evtAux.processHistoryID());
1647 return runAuxiliary;
1652 std::vector<unsigned int> nEntries;
1655 nEntries.push_back(processBlockTree->entries());
1659 std::make_unique<StoredProcessBlockHelper>();
1714 assert(entryNumber >= 0);
1715 mergeableRunProductMetadata->
readRun(
1748 return std::make_shared<LuminosityBlockAuxiliary>(
1756 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1757 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1764 lumiAuxiliary->setBeginTime(evtAux.time());
1771 return lumiAuxiliary;
1837 history_ = std::make_unique<History>();
1846 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
1865 for (
auto& product : pList) {
1877 prod.setDropped(
true);
1887 std::set<BranchID>& branchesToDrop,
1888 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const {
1889 if (dropDescendants) {
1892 branchesToDrop.insert(
branch.branchID());
1898 bool dropDescendants,
1906 std::map<BranchID, BranchID> droppedToKeptAlias;
1907 for (
auto const& product : prodList) {
1909 if (
prod.branchID() !=
prod.originalBranchID() &&
prod.present()) {
1910 droppedToKeptAlias[
prod.originalBranchID()] =
prod.branchID();
1921 std::set<BranchID> branchesToDrop;
1922 std::vector<BranchDescription const*> associationDescriptions;
1923 for (
auto const& product : prodList) {
1930 associationDescriptions.push_back(&
prod);
1947 std::set<BranchID> keptProductsInEvent;
1948 for (
auto const& product : prodList) {
1950 if (branchesToDrop.find(
prod.branchID()) == branchesToDrop.end() &&
prod.present() &&
1952 keptProductsInEvent.insert(
prod.branchID());
1957 std::map<BranchID, bool> keepAssociation;
1959 associationDescriptions, keptProductsInEvent, keepAssociation);
1961 for (
auto association : associationDescriptions) {
1968 auto temp = std::make_unique<ThinnedAssociationsHelper>();
1970 auto iter = keepAssociation.find(associationBranches.association());
1971 if (iter != keepAssociation.end() && iter->second) {
1972 temp->addAssociation(associationBranches);
1980 std::set<std::string> processesWithKeptProcessBlockProducts;
1981 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1982 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1984 bool drop = branchesToDrop.find(
prod.branchID()) != branchesToDropEnd;
1986 if (!
prod.dropped()) {
1989 LogWarning(
"RootFile") <<
"Branch '" <<
prod.branchName() <<
"' is being dropped from the input\n"
1990 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1991 <<
"that was explicitly dropped.\n";
2004 ProductRegistry::ProductList::iterator icopy = it;
2006 prodList.erase(icopy);
2009 processesWithKeptProcessBlockProducts.insert(
prod.processName());
2020 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
2023 TClass*
cp =
prod.wrappedType().getClass();
2024 void*
p =
cp->New();
2027 if (edp->isMergeable()) {
2029 ProductRegistry::ProductList::iterator icopy = it;
2031 prodList.erase(icopy);
2042 std::set<std::string>
const& processesWithKeptProcessBlockProducts,
2060 std::vector<unsigned int> nEntries;
2063 nEntries.push_back(processBlockTree->entries());
2067 bool isModified =
false;
2068 std::vector<unsigned int> finalIndexToStoredIndex;
2070 if (firstInputFile) {
2072 storedProcessBlockHelper, processesWithKeptProcessBlockProducts, nEntries, finalIndexToStoredIndex);
2076 processesWithKeptProcessBlockProducts,
2078 finalIndexToStoredIndex,
2086 std::vector<edm::propagate_const<std::unique_ptr<RootTree>>> newProcessBlockTrees;
2088 for (
unsigned int j = 0;
j < nFinalProducts; ++
j) {
2089 unsigned int iStored = finalIndexToStoredIndex[
j];
2103 int treeMaxVirtualSize,
2104 bool enablePrefetching,
2132 return std::make_unique<MakeFullProvenanceReader>();
2134 auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
2136 return std::make_unique<MakeOldProvenanceReader>(
std::move(entryDescriptionMap));
2138 return std::make_unique<MakeDummyProvenanceReader>();
2158 std::vector<ParentageID>
const& iParentageIDLookup,
2161 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2166 unsigned int transitionIndex,
2167 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2175 std::shared_ptr<std::recursive_mutex>
mutex_;
2180 std::vector<ParentageID>
const& iParentageIDLookup,
2183 rootTree_(iRootTree),
2184 pProvVector_(&provVector_),
2185 parentageIDLookup_(iParentageIDLookup),
2186 daqProvenanceHelper_(daqProvenanceHelper),
2195 template <
typename R>
2196 void readProvenanceAsyncImpl(
R const* iThis,
2199 unsigned int transitionIndex,
2200 std::atomic<
const std::set<ProductProvenance>*>& writeTo,
2202 SignalType
const* pre,
2203 SignalType
const* post) {
2204 if (
nullptr == writeTo.load()) {
2207 auto pWriteTo = &writeTo;
2212 *taskHolder.group(),
2220 serviceToken]()
mutable {
2221 if (
nullptr == pWriteTo->load()) {
2223 std::unique_ptr<const std::set<ProductProvenance>> prov;
2226 pre->emit(*(iContext->getStreamContext()), *iContext);
2228 prov = std::make_unique<const std::set<ProductProvenance>>(iThis->readProvenance(transitionIndex));
2230 post->emit(*(iContext->getStreamContext()), *iContext);
2235 post->emit(*(iContext->getStreamContext()), *iContext);
2238 holder.doneWaiting(std::current_exception());
2241 const std::set<ProductProvenance>* expected =
nullptr;
2243 if (pWriteTo->compare_exchange_strong(expected, prov.get())) {
2247 holder.doneWaiting(std::exception_ptr());
2255 unsigned int transitionIndex,
2256 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2257 readProvenanceAsyncImpl(
this,
2262 moduleCallingContext,
2263 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2264 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2269 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2271 me->rootTree_->fillBranchEntry(
2272 me->provBranch_,
me->rootTree_->entryNumberForIndex(transitionIndex),
me->pProvVector_);
2274 std::set<ProductProvenance> retValue;
2285 <<
"ReducedProvenanceReader::ReadProvenance\n"
2286 <<
"The parentage ID index value " << prov.parentageIDIndex_
2287 <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size() - 1 <<
".\n"
2288 <<
"This should never happen.\n"
2289 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2301 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2306 unsigned int transitionIndex,
2307 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2314 std::shared_ptr<std::recursive_mutex>
mutex_;
2320 rootTree_(rootTree),
2322 pInfoVector_(&infoVector_),
2323 daqProvenanceHelper_(daqProvenanceHelper),
2329 unsigned int transitionIndex,
2330 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2331 readProvenanceAsyncImpl(
this,
2336 moduleCallingContext,
2343 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2347 std::set<ProductProvenance> retValue;
2355 retValue.emplace(
info);
2367 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2372 unsigned int transitionIndex,
2373 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2381 std::shared_ptr<std::recursive_mutex>
mutex_;
2389 rootTree_(rootTree),
2391 pInfoVector_(&infoVector_),
2392 entryDescriptionMap_(theMap),
2393 daqProvenanceHelper_(daqProvenanceHelper),
2399 unsigned int transitionIndex,
2400 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2401 readProvenanceAsyncImpl(
this,
2406 moduleCallingContext,
2407 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2408 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2413 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2417 std::set<ProductProvenance> retValue;
2421 Parentage parentage(iter->second.parents());
2426 retValue.emplace(
info.branchID(), parentage.id());
2438 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2441 unsigned int transitionIndex,
2442 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2449 return std::set<ProductProvenance>{};
2453 unsigned int transitionIndex,
2454 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2455 if (
nullptr == writeTo.load()) {
2456 auto emptyProv = std::make_unique<const std::set<ProductProvenance>>();
2457 const std::set<ProductProvenance>* expected =
nullptr;
2458 if (writeTo.compare_exchange_strong(expected, emptyProv.get())) {
2459 emptyProv.release();
2466 return std::make_unique<DummyProvenanceReader>();
2471 return std::make_unique<OldProvenanceReader>(&rootTree, *
entryDescriptionMap_, daqProvenanceHelper);
2476 return std::make_unique<FullProvenanceReader>(&rootTree, daqProvenanceHelper);
2481 return std::make_unique<ReducedProvenanceReader>(&rootTree,
parentageIDLookup_, daqProvenanceHelper);