63 #include "TTreeCache.h" 94 : parentageIDLookup_(parentageIDLookup) {}
103 void checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
106 for (
auto const& ph : processHistoryVector) {
107 for (
auto const& pc : ph) {
111 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n" 112 <<
"Forward compatibility cannot be supported.\n";
127 eventTree_.setEntryNumber(entry);
131 eventTree_.setEntryNumber(saveEntry);
132 return eventAux.
event();
143 std::shared_ptr<InputFile> filePtr,
144 std::shared_ptr<EventSkipperByID> eventSkipperByID,
148 unsigned int nStreams,
149 unsigned int treeCacheSize,
150 int treeMaxVirtualSize,
156 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
157 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
158 std::vector<BranchID>
const* associationsFromSecondary,
159 std::shared_ptr<DuplicateChecker> duplicateChecker,
160 bool dropDescendants,
162 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
163 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
164 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
165 bool bypassVersionCheck,
166 bool labelRawDataLikeMC,
168 bool enablePrefetching,
169 bool enforceGUIDInFileName)
171 logicalFile_(logicalFileName),
172 processConfiguration_(processConfiguration),
173 processHistoryRegistry_(&processHistoryRegistry),
175 eventSkipperByID_(eventSkipperByID),
176 fileFormatVersion_(),
179 indexIntoFile_(*indexIntoFileSharedPtr_),
180 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
183 indexIntoFileEnd_(indexIntoFileBegin_),
184 indexIntoFileIter_(indexIntoFileBegin_),
187 eventProcessHistoryIDs_(),
188 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
189 savedRunAuxiliary_(),
190 skipAnyEvents_(skipAnyEvents),
191 noEventSort_(noEventSort),
192 enforceGUIDInFileName_(enforceGUIDInFileName),
193 whyNotFastClonable_(0),
194 hasNewlyDroppedBranch_(),
195 branchListIndexesUnchanged_(
false),
225 branchIDListHelper_(branchIDListHelper),
226 fileThinnedAssociationsHelper_(),
227 thinnedAssociationsHelper_(thinnedAssociationsHelper),
228 processingMode_(processingMode),
229 runHelper_(runHelper),
230 newBranchToOldBranch_(),
232 eventSelectionIDs_(),
233 branchListIndexes_(),
236 duplicateChecker_(duplicateChecker),
237 provenanceAdaptor_(),
238 provenanceReaderMaker_(),
239 eventProductProvenanceRetrievers_(),
240 parentageIDLookup_(),
241 daqProvenanceHelper_(),
243 inputType_(inputType) {
253 if (
nullptr == metaDataTree.get()) {
264 fft->SetAddress(&fftPtr);
293 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
295 PsetMap* psetMapPtr = &psetMap;
304 if (
nullptr == psetTree.get()) {
309 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
311 IdToBlobs* pIdToBlob = &idToBlob;
314 std::unique_ptr<TTreeCache> psetTreeCache =
316 psetTreeCache->SetEnablePrefetching(
false);
317 filePtr_->SetCacheRead(psetTreeCache.get());
318 for (Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
319 psetTree->GetEntry(
i);
320 psetMap.insert(idToBlob);
345 auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
353 std::make_unique<ThinnedAssociationsHelper>();
357 &thinnedAssociationsHelperPtr);
395 for (
auto const& psetEntry : psetMap) {
397 pset.setID(psetEntry.first);
406 exception << iExcept.
message();
407 exception.
addContext(
"Creating ParameterSets from file");
418 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
426 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
438 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
442 if (!bypassVersionCheck) {
443 checkReleaseVersion(pHistVector,
file());
446 if (labelRawDataLikeMC) {
451 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
452 if (it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
468 it = pList.lower_bound(finder);
469 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
479 for (
auto const& history : pHistVector) {
513 for (
auto& product : pList) {
519 auto newReg = std::make_unique<ProductRegistry>();
524 for (
auto const& product : prodList) {
528 newReg->copyProduct(prod);
532 <<
"Cannot change friendly class name algorithm without more development work\n" 533 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
537 newReg->copyProduct(newBD);
541 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
544 *associationsFromSecondary);
550 for (
auto& product : newReg->productListUpdator()) {
564 std::array<size_t, NumBranchTypes> nBranches;
566 for (
auto const& product : prodList) {
567 ++nBranches[product.second.branchType()];
572 t->numberOfBranchesToAdd(nBranches[i]);
576 for (
auto const& product : prodList) {
600 std::unique_ptr<TTree> entryDescriptionTree(
602 if (
nullptr == entryDescriptionTree.get()) {
620 if (idBuffer != entryDescriptionBuffer.
id()) {
623 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(), entryDescriptionBuffer));
630 if (newID != oldID) {
647 if (
nullptr == parentageTree.get()) {
665 if (newID != oldID) {
880 struct RunItemSortByRun {
881 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
return a.run_ < b.run_; }
883 struct RunItemSortByRunPhid {
884 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
885 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
896 firstEventEntry_(entry),
904 struct LumiItemSortByRunLumi {
905 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
906 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
909 struct LumiItemSortByRunLumiPhid {
910 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
915 if (a.lumi_ < b.lumi_)
917 if (b.lumi_ < a.lumi_)
919 return a.phid_ < b.phid_;
934 typedef std::list<LumiItem>
LumiList;
937 typedef std::set<LuminosityBlockID> RunLumiSet;
938 RunLumiSet runLumiSet;
940 typedef std::list<RunItem>
RunList;
943 typedef std::set<RunNumber_t> RunSet;
946 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
947 RunItemSet runItemSet;
949 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
963 bool newLumi =
false;
974 if (iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
976 newRun = newLumi =
true;
977 }
else if (prevLumi !=
eventAux().luminosityBlock()) {
980 prevPhid = reducedPHID;
988 LumiItem& currentLumi = lumis.back();
990 ++currentLumi.lastEventEntry_;
995 if (runItemSet.insert(item).second) {
998 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
1009 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
1012 typedef std::vector<RunItem> RunVector;
1013 RunVector emptyRuns;
1022 if (runSet.insert(runAux->run()).
second) {
1024 emptyRuns.emplace_back(reducedPHID, runAux->run());
1027 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1034 RunItemSortByRun runItemSortByRun;
1037 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1038 for (
auto const& emptyRun : emptyRuns) {
1039 for (; itRuns != endRuns; ++itRuns) {
1040 if (runItemSortByRun(emptyRun, *itRuns)) {
1044 runs.insert(itRuns, emptyRun);
1049 typedef std::vector<LumiItem> LumiVector;
1050 LumiVector emptyLumis;
1052 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1053 RunLumiMap runLumiMap;
1060 if (runLumiSet.insert(lumiID).second) {
1065 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1066 assert(iPhidMap != phidMap.end());
1067 emptyLumis.emplace_back(
1077 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1080 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1081 for (
auto const& emptyLumi : emptyLumis) {
1082 for (; itLumis != endLumis; ++itLumis) {
1083 if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1087 lumis.insert(itLumis, emptyLumi);
1092 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1093 RunCountMap runCountMap;
1095 assert(phids.empty());
1097 assert(entries.empty());
1099 for (
auto&
run : runs) {
1100 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1101 if (countMapItem == runCountMap.end()) {
1102 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1103 assert(countMapItem != runCountMap.end());
1106 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1107 if (phidItem == phids.end()) {
1108 phids.push_back(
run.phid_);
1109 phidItem = phids.end() - 1;
1111 entries.emplace_back(countMapItem->second,
1114 phidItem - phids.begin(),
1122 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1123 LumiCountMap lumiCountMap;
1125 for (
auto&
lumi : lumis) {
1126 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1127 assert(runCountMapItem != runCountMap.end());
1128 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1129 if (countMapItem == lumiCountMap.end()) {
1130 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1131 assert(countMapItem != lumiCountMap.end());
1134 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1135 assert(phidItem != phids.end());
1136 entries.emplace_back(runCountMapItem->second,
1137 countMapItem->second,
1139 phidItem - phids.begin(),
1142 lumi.firstEventEntry_,
1143 lumi.lastEventEntry_);
1154 <<
"in the input file.\n";
1158 if (guidFromName !=
fid_.
fid()) {
1160 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_ 1161 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1166 if (
runTree().entries() > 0) {
1172 for (
auto& phid : phidVec) {
1186 std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(
eventTree_)));
1189 bool needEventNumbers =
false;
1190 bool needIndexesForDuplicateChecker =
1192 if (inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1193 needEventNumbers =
true;
1195 bool needEventEntries =
false;
1198 needEventEntries =
true;
1214 treePointer->close();
1215 treePointer =
nullptr;
1267 if (!eventHistoryBranch) {
1270 eventHistoryBranch->SetAddress(&pHistory);
1279 assert(eventSelectionIDBranch !=
nullptr);
1283 assert(branchListIndexesBranch !=
nullptr);
1305 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1316 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1319 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1324 return lumiAuxiliary;
1328 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1334 RunAux* pRunAux = &runAux;
1339 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1342 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1344 return runAuxiliary;
1355 phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1377 while (offset < 0) {
1515 runHelper_->overrideRunNumber(runAuxiliary->id());
1516 filePtr_->reportInputRunNumber(runAuxiliary->run());
1544 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1549 return runAuxiliary;
1557 assert(entryNumber >= 0);
1558 mergeableRunProductMetadata->
readRun(
1591 return std::make_shared<LuminosityBlockAuxiliary>(
1599 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1600 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1614 return lumiAuxiliary;
1677 history_ = std::make_unique<History>();
1679 if (!eventHistoryTree_) {
1686 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
1687 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile) {
1700 std::set<BranchID>& branchesToDrop,
1701 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const {
1702 if (dropDescendants) {
1703 branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1705 branchesToDrop.insert(branch.
branchID());
1711 bool dropDescendants,
1717 std::vector<BranchDescription const*> associationDescriptions;
1721 std::set<BranchID> branchesToDrop;
1722 std::map<BranchID, BranchID> droppedToKeptAlias;
1723 for (
auto const& product : prodList) {
1729 for (
auto const& product : prodList) {
1734 associationDescriptions.push_back(&prod);
1738 }
else if (!productSelector.
selected(prod)) {
1751 std::set<BranchID> keptProductsInEvent;
1752 for (
auto const& product : prodList) {
1754 if (branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() && prod.
present() &&
1756 keptProductsInEvent.insert(prod.
branchID());
1761 std::map<BranchID, bool> keepAssociation;
1763 associationDescriptions, keptProductsInEvent, keepAssociation);
1765 for (
auto association : associationDescriptions) {
1772 auto temp = std::make_unique<ThinnedAssociationsHelper>();
1774 auto iter = keepAssociation.find(associationBranches.association());
1775 if (iter != keepAssociation.end() && iter->second) {
1776 temp->addAssociation(associationBranches);
1784 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1785 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1787 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1791 LogWarning(
"RootFile") <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n" 1792 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n" 1793 <<
"that was explicitly dropped.\n";
1798 ProductRegistry::ProductList::iterator icopy = it;
1800 prodList.erase(icopy);
1809 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1813 void*
p = cp->New();
1816 if (edp->isMergeable()) {
1818 ProductRegistry::ProductList::iterator icopy = it;
1820 prodList.erase(icopy);
1842 return std::make_unique<MakeFullProvenanceReader>();
1844 auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1846 return std::make_unique<MakeOldProvenanceReader>(
std::move(entryDescriptionMap));
1848 return std::make_unique<MakeDummyProvenanceReader>();
1868 std::vector<ParentageID>
const& iParentageIDLookup,
1871 std::set<ProductProvenance> readProvenance(
unsigned int)
const override;
1876 unsigned int transitionIndex,
1877 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
1885 std::shared_ptr<std::recursive_mutex>
mutex_;
1890 std::vector<ParentageID>
const& iParentageIDLookup,
1893 rootTree_(iRootTree),
1894 pProvVector_(&provVector_),
1905 template <
typename R>
1906 void readProvenanceAsyncImpl(
R const* iThis,
1909 unsigned int transitionIndex,
1910 std::atomic<
const std::set<ProductProvenance>*>& writeTo,
1912 SignalType
const* pre,
1913 SignalType
const* post) {
1914 if (
nullptr == writeTo.load()) {
1917 auto pWriteTo = &writeTo;
1928 serviceToken]()
mutable {
1929 if (
nullptr == pWriteTo->load()) {
1931 std::unique_ptr<const std::set<ProductProvenance>> prov;
1936 prov = std::make_unique<const std::set<ProductProvenance>>(iThis->readProvenance(transitionIndex));
1946 holder.doneWaiting(std::current_exception());
1949 const std::set<ProductProvenance>* expected =
nullptr;
1951 if (pWriteTo->compare_exchange_strong(expected, prov.get())) {
1955 holder.doneWaiting(std::exception_ptr());
1963 unsigned int transitionIndex,
1964 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
1965 readProvenanceAsyncImpl(
this,
1970 moduleCallingContext,
1971 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1972 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1977 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
1982 std::set<ProductProvenance> retValue;
1993 <<
"ReducedProvenanceReader::ReadProvenance\n" 1994 <<
"The parentage ID index value " << prov.parentageIDIndex_
1995 <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size() - 1 <<
".\n" 1996 <<
"This should never happen.\n" 1997 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
2009 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2014 unsigned int transitionIndex,
2015 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2021 std::shared_ptr<std::recursive_mutex>
mutex_;
2029 pInfoVector_(&infoVector_),
2036 unsigned int transitionIndex,
2037 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2038 readProvenanceAsyncImpl(
this,
2043 moduleCallingContext,
2050 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2054 std::set<ProductProvenance> retValue;
2062 retValue.emplace(
info);
2074 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2079 unsigned int transitionIndex,
2080 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2087 std::shared_ptr<std::recursive_mutex>
mutex_;
2098 entryDescriptionMap_(theMap),
2105 unsigned int transitionIndex,
2106 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2107 readProvenanceAsyncImpl(
this,
2112 moduleCallingContext,
2113 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2114 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2119 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2123 std::set<ProductProvenance> retValue;
2127 Parentage parentage(iter->second.parents());
2132 retValue.emplace(
info.branchID(), parentage.id());
2144 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2147 unsigned int transitionIndex,
2148 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2155 return std::set<ProductProvenance>{};
2159 unsigned int transitionIndex,
2160 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2161 if (
nullptr == writeTo.load()) {
2162 auto emptyProv = std::make_unique<const std::set<ProductProvenance>>();
2163 const std::set<ProductProvenance>* expected =
nullptr;
2164 if (writeTo.compare_exchange_strong(expected, emptyProv.get())) {
2165 emptyProv.release();
2172 return std::make_unique<DummyProvenanceReader>();
2177 return std::make_unique<OldProvenanceReader>(&rootTree, *entryDescriptionMap_, daqProvenanceHelper);
2182 return std::make_unique<FullProvenanceReader>(&rootTree, daqProvenanceHelper);
2187 return std::make_unique<ReducedProvenanceReader>(&rootTree, parentageIDLookup_, daqProvenanceHelper);
void dropOnInput(ProductRegistry ®, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
Code categoryCode() const
EventID const & eventID() const
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
EventNumber_t event() const
std::string const & idToParameterSetBlobsBranchName()
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
std::vector< ProcessConfiguration > ProcessConfigurationVector
void setEventFinder(std::shared_ptr< EventFinder > ptr) const
std::string const & branchName() const
StoredProductProvenanceVector provVector_
bool selected(BranchDescription const &desc) const
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
unsigned int const defaultNonEventLearningEntries
EntryNumber_t firstEventEntryThisRun()
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
static constexpr int invalidIndex
BranchType const & branchType() const
std::string const & parentageTreeName()
std::vector< BranchIDList > BranchIDLists
std::shared_ptr< BranchIDLists const > branchIDLists_
std::string const & entryDescriptionBranchName()
bool skipEvents(int &offset)
StreamContext const * getStreamContext() const
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
FileFormatVersion fileFormatVersion() const
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
ProductProvenanceVector infoVector_
static std::string const source("source")
static Timestamp invalidTimestamp()
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
bool branchListIndexesUnchanged() const
std::vector< std::string > const & branchNames() const
bool setEntryAtNextEventInLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
bool enforceGUIDInFileName_
static PFTauRenderPlugin instance
MakeOldProvenanceReader(std::unique_ptr< EntryDescriptionMap > &&entryDescriptionMap)
std::vector< BranchID > & parentsForUpdate()
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
std::map< std::string, std::string > newBranchToOldBranch_
bool empty() const
True if no runs, lumis, or events are in the file.
std::map< BranchKey, BranchDescription > ProductList
BranchID const & mapBranchID(BranchID const &branchID) const
EntryType getEntryType() const
bool registerProcessHistory(ProcessHistory const &processHistory)
bool setEntryAtRun(RunNumber_t run)
void readRun_(RunPrincipal &runPrincipal)
std::string_view stemFromPath(std::string_view path)
ProductProvenanceVector * pInfoVector_
Timestamp const & time() const
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
unsigned long long EventNumber_t
EntryNumber const & entries() const
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
std::string const & fileFormatVersionBranchName()
std::string message() const
IndexIntoFileItr begin(SortOrder sortOrder) const
FullProvenanceReader(RootTree *rootTree, DaqProvenanceHelper const *daqProvenanceHelper)
EntryDescriptionMap const & entryDescriptionMap_
std::vector< BranchID > const & parents() const
std::string const & eventSelectionsBranchName()
edm::propagate_const< std::unique_ptr< EntryDescriptionMap > > entryDescriptionMap_
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
void push(T &&iAction)
asynchronously pushes functor iAction into queue
InputSource::ProcessingMode processingMode_
~RootFileEventFinder() override
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
std::shared_ptr< std::recursive_mutex > mutex_
LuminosityBlockNumber_t lumi() const
void fillBranchEntryMeta(TBranch *branch, T *&pbuf)
std::unique_ptr< FileBlock > createFileBlock() const
LuminosityBlockNumber_t luminosityBlock() const
void trainCache(char const *branchNames)
bool readCurrentEvent(EventPrincipal &cache)
SharedResourcesAcquirer acquirer_
~FullProvenanceReader() override
ServiceToken presentToken() const
std::shared_ptr< ProductRegistry const > productRegistry() const
unsigned int LuminosityBlockNumber_t
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
void readProvenanceAsync(WaitingTask *task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > * > &writeTo) const override
void readAllFromSourceAndMergeImmediately(MergeableRunProductMetadata const *mergeableRunProductMetadata=0)
TBranch * branchEntryInfoBranch() const
void advanceToNextLumiOrRun()
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
MakeReducedProvenanceReader(std::vector< ParentageID > const &parentageIDLookup)
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
std::vector< EventSelectionID > EventSelectionIDVector
edm::propagate_const< TClass * > edProductClass_
LuminosityBlockNumber_t luminosityBlock() const
FileFormatVersion fileFormatVersion_
TTree const * metaTree() const
std::string const & parameterSetsTreeName()
void setPosition(IndexIntoFile::IndexIntoFileItr const &position)
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
edm::propagate_const< RootTree * > rootTree_
ProductList const & productList() const
U second(std::pair< T, U > const &p)
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
TTree const * tree() const
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setParents(std::vector< BranchID > const &parents)
DaqProvenanceHelper const * daqProvenanceHelper_
std::string const logicalFile_
std::vector< BranchListIndex > BranchListIndexes
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
std::string moduleName(Provenance const &provenance)
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void readParentageTree(InputType inputType)
std::string const & processHistoryMapBranchName()
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
TClass * getClass() const
std::string const & className() const
bool wasLastEventJustRead() const
void insertEntryForIndex(unsigned int index)
DelayedReader * resetAndGetRootDelayedReader() const
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
std::string friendlyName(std::string const &iFullName)
static constexpr RunNumber_t invalidRun
std::string const & entryDescriptionTreeName()
virtual signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * postEventReadFromSourceSignal() const =0
std::string const & fid() const
std::shared_ptr< std::recursive_mutex > mutex_
std::string const & mergeableRunProductMetadataBranchName()
RootTree const & runTree() const
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
std::string const & indexIntoFileBranchName()
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
std::string const & eventHistoryBranchName()
std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
Long64_t numEntries(TFile *hdl, std::string const &trname)
EntryNumber_t firstEventEntryThisLumi()
edm::propagate_const< RootTree * > rootTree_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
EventAuxiliary const & eventAux() const
EventSelectionIDVector eventSelectionIDs_
int processHistoryIDIndex() const
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
bool isEarlierRelease(std::string const &a, std::string const &b)
StoredProductProvenanceVector const * pProvVector_
int whyNotFastClonable() const
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
StreamID streamID() const
static ServiceRegistry & instance()
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
std::vector< BranchDescription const * > allBranchDescriptions() const
EventNumber_t getEventNumberOfEntry(roottree::EntryNumber entry) const override
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
std::string const & friendlyClassName() const
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
bool insertMapped(value_type const &v, bool forceUpdate=false)
void updateFriendlyClassName()
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
BranchListIndexes branchListIndexes_
std::string const & metaDataTreeName()
virtual signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * preEventReadFromSourceSignal() const =0
LuminosityBlockNumber_t oldLuminosityBlock() const
EntryDescriptionID id() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
IndexIntoFile::EntryNumber_t EntryNumber
bool wasFirstEventJustRead() const
std::string const & parameterSetMapBranchName()
Hash< ProcessHistoryType > ProcessHistoryID
std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
edm::propagate_const< std::unique_ptr< History > > history_
ProcessHistoryVector vector_type
SerialTaskQueueChain & serialQueueChain() const
std::vector< ProductProvenance > ProductProvenanceVector
std::string const & processHistoryBranchName()
IndexIntoFile & indexIntoFile_
void readEvent(EventPrincipal &cache)
SharedResourcesAcquirer acquirer_
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
EntryNumber const & entryNumber() const
ProcessHistoryMap collection_type
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
bool goToEvent(EventID const &eventID)
std::string getReleaseVersion()
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
std::set< ProductProvenance > readProvenance(unsigned int) const override
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunHelperBase *runHelper, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, std::shared_ptr< BranchIDListHelper > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, std::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching, bool enforceGUIDInFileName)
void setAtEventEntry(IndexIntoFile::EntryNumber_t entry)
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
DelayedReader * rootDelayedReader() const
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
EntryNumber const & entryNumberForIndex(unsigned int index) const
void conversion(EventAux const &from, EventAuxiliary &to)
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::vector< EventNumber_t > & unsortedEventNumbers() const
unsigned int value() const
static constexpr EntryNumber_t invalidEntry
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
std::shared_ptr< ProductRegistry const > productRegistry_
void setIfFastClonable(int remainingEvents, int remainingLumis)
std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
MergeableRunProductMetadata * mergeableRunProductMetadata()
void fillBranchEntry(TBranch *branch, T *&pbuf)
static constexpr LuminosityBlockNumber_t invalidLumi
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
std::string const & parentageBranchName()
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
std::shared_ptr< BranchChildren const > branchChildren() const
LuminosityBlockNumber_t luminosityBlock() const
ProcessHistoryID const & processHistoryID(int i) const
ProductList & productListUpdator()
void addContext(std::string const &context)
void setProcessHistoryID(ProcessHistoryID const &phid)
unsigned int transitionIndex() const
void readProvenanceAsync(WaitingTask *task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > * > &writeTo) const override
void readProvenanceAsync(WaitingTask *task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > * > &writeTo) const override
std::vector< ParentageID > const & parentageIDLookup_
std::shared_ptr< std::recursive_mutex > mutex_
std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
~OldProvenanceReader() override
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
std::vector< StoredProductProvenance > StoredProductProvenanceVector
std::string const & file() const
std::string const & productDescriptionBranchName()
std::string const & processConfigurationBranchName()
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
edm::propagate_const< RunHelperBase * > runHelper_
bool branchListIndexesUnchanged_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
edm::propagate_const< TTree * > eventHistoryTree_
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
std::vector< EventEntryInfo > * pInfoVector_
std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
unsigned int const defaultNonEventCacheSize
RootTreePtrArray treePointers_
void fillEventNumbers() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
static int position[264][3]
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
std::string const & productDependenciesBranchName()
void setNumberOfEvents(EntryNumber_t nevents) const
void initAssociationsFromSecondary(std::vector< BranchID > const &)
std::string const & thinnedAssociationsHelperBranchName()
std::string const & entryDescriptionIDBranchName()
~DummyProvenanceReader() override
edm::propagate_const< TBranch * > provBranch_
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
std::unique_ptr< WrapperBase > getWrapperBasePtr(void *p, int offset)
std::string const & branchIDListBranchName()
BranchID const & originalBranchID() const
std::string const & branchListIndexesBranchName()
std::vector< ParentageID > parentageIDLookup_
void readProvenanceAsync(WaitingTask *task, ModuleCallingContext const *moduleCallingContext, unsigned int transitionIndex, std::atomic< const std::set< ProductProvenance > * > &writeTo) const override
void fillThisEventAuxiliary()
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
std::vector< ParentageID > const & parentageIDLookup_
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
std::string const & eventHistoryTreeName()
RootFileEventFinder(RootTree &eventTree)
ParentageID const & mapParentageID(ParentageID const &phid) const
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
void validateFile(InputType inputType, bool usingGoToEvent)
IndexIntoFile::IndexIntoFileItr indexIntoFileIter() const
std::string const & newBranchToOldBranch(std::string const &newBranch) const
T first(std::pair< T, U > const &p)
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
static ParentageRegistry * instance()
OldProvenanceReader(RootTree *rootTree, EntryDescriptionMap const &theMap, DaqProvenanceHelper const *daqProvenanceHelper)
SharedResourcesAcquirer acquirer_
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
unsigned int const defaultLearningEntries
EntryNumber_t entry() const
std::vector< EventEntryInfo > infoVector_
void markBranchToBeDropped(bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
LuminosityBlockNumber_t peekAheadAtLumi() const
std::string const & fileIdentifierBranchName()
void setIsMergeable(BranchDescription &)
EventNumber_t event() const
std::string const & moduleDescriptionMapBranchName()
bool insertMapped(value_type const &v)
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
static Registry * instance()
std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
DaqProvenanceHelper const * daqProvenanceHelper_
std::string createGlobalIdentifier()
TypeWithDict const & wrappedType() const
void copyProduct(BranchDescription const &productdesc)
void readEventHistoryTree()
std::set< ProductProvenance > readProvenance(unsigned int) const override
void setEntryNumber(EntryNumber theEntryNumber)
void reportOpened(std::string const &inputType)
def operate(timelog, memlog, json_f, num)
roottree::EntryNumber EntryNumber