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);
394 for (
auto const& psetEntry : psetMap) {
396 pset.setID(psetEntry.first);
407 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
415 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
427 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
431 if (!bypassVersionCheck) {
432 checkReleaseVersion(pHistVector,
file());
435 if (labelRawDataLikeMC) {
440 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
441 if (it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
457 it = pList.lower_bound(finder);
458 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
468 for (
auto const& history : pHistVector) {
502 for (
auto& product : pList) {
508 auto newReg = std::make_unique<ProductRegistry>();
513 for (
auto const& product : prodList) {
517 newReg->copyProduct(prod);
521 <<
"Cannot change friendly class name algorithm without more development work\n" 522 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
526 newReg->copyProduct(newBD);
530 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
533 *associationsFromSecondary);
539 for (
auto& product : newReg->productListUpdator()) {
553 std::array<size_t, NumBranchTypes> nBranches;
555 for (
auto const& product : prodList) {
556 ++nBranches[product.second.branchType()];
561 t->numberOfBranchesToAdd(nBranches[i]);
565 for (
auto const& product : prodList) {
589 std::unique_ptr<TTree> entryDescriptionTree(
591 if (
nullptr == entryDescriptionTree.get()) {
609 if (idBuffer != entryDescriptionBuffer.
id()) {
612 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(), entryDescriptionBuffer));
619 if (newID != oldID) {
636 if (
nullptr == parentageTree.get()) {
654 if (newID != oldID) {
869 struct RunItemSortByRun {
870 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
return a.run_ < b.run_; }
872 struct RunItemSortByRunPhid {
873 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
874 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
885 firstEventEntry_(entry),
893 struct LumiItemSortByRunLumi {
894 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
895 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
898 struct LumiItemSortByRunLumiPhid {
899 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
904 if (a.lumi_ < b.lumi_)
906 if (b.lumi_ < a.lumi_)
908 return a.phid_ < b.phid_;
923 typedef std::list<LumiItem>
LumiList;
926 typedef std::set<LuminosityBlockID> RunLumiSet;
927 RunLumiSet runLumiSet;
929 typedef std::list<RunItem>
RunList;
932 typedef std::set<RunNumber_t> RunSet;
935 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
936 RunItemSet runItemSet;
938 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
952 bool newLumi =
false;
963 if (iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
965 newRun = newLumi =
true;
966 }
else if (prevLumi !=
eventAux().luminosityBlock()) {
969 prevPhid = reducedPHID;
977 LumiItem& currentLumi = lumis.back();
979 ++currentLumi.lastEventEntry_;
984 if (runItemSet.insert(item).second) {
987 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
998 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
1001 typedef std::vector<RunItem> RunVector;
1002 RunVector emptyRuns;
1011 if (runSet.insert(runAux->run()).
second) {
1013 emptyRuns.emplace_back(reducedPHID, runAux->run());
1016 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1023 RunItemSortByRun runItemSortByRun;
1026 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1027 for (
auto const& emptyRun : emptyRuns) {
1028 for (; itRuns != endRuns; ++itRuns) {
1029 if (runItemSortByRun(emptyRun, *itRuns)) {
1033 runs.insert(itRuns, emptyRun);
1038 typedef std::vector<LumiItem> LumiVector;
1039 LumiVector emptyLumis;
1041 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1042 RunLumiMap runLumiMap;
1049 if (runLumiSet.insert(lumiID).second) {
1054 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1055 assert(iPhidMap != phidMap.end());
1056 emptyLumis.emplace_back(
1066 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1069 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1070 for (
auto const& emptyLumi : emptyLumis) {
1071 for (; itLumis != endLumis; ++itLumis) {
1072 if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1076 lumis.insert(itLumis, emptyLumi);
1081 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1082 RunCountMap runCountMap;
1084 assert(phids.empty());
1086 assert(entries.empty());
1088 for (
auto&
run : runs) {
1089 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1090 if (countMapItem == runCountMap.end()) {
1091 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1092 assert(countMapItem != runCountMap.end());
1095 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1096 if (phidItem == phids.end()) {
1097 phids.push_back(
run.phid_);
1098 phidItem = phids.end() - 1;
1100 entries.emplace_back(countMapItem->second,
1103 phidItem - phids.begin(),
1111 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1112 LumiCountMap lumiCountMap;
1114 for (
auto&
lumi : lumis) {
1115 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1116 assert(runCountMapItem != runCountMap.end());
1117 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1118 if (countMapItem == lumiCountMap.end()) {
1119 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1120 assert(countMapItem != lumiCountMap.end());
1123 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1124 assert(phidItem != phids.end());
1125 entries.emplace_back(runCountMapItem->second,
1126 countMapItem->second,
1128 phidItem - phids.begin(),
1131 lumi.firstEventEntry_,
1132 lumi.lastEventEntry_);
1143 <<
"in the input file.\n";
1147 if (guidFromName !=
fid_.
fid()) {
1149 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_ 1150 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1155 if (
runTree().entries() > 0) {
1161 for (
auto& phid : phidVec) {
1175 std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(
eventTree_)));
1178 bool needEventNumbers =
false;
1179 bool needIndexesForDuplicateChecker =
1181 if (inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1182 needEventNumbers =
true;
1184 bool needEventEntries =
false;
1187 needEventEntries =
true;
1203 treePointer->close();
1204 treePointer =
nullptr;
1256 if (!eventHistoryBranch) {
1259 eventHistoryBranch->SetAddress(&pHistory);
1268 assert(eventSelectionIDBranch !=
nullptr);
1272 assert(branchListIndexesBranch !=
nullptr);
1294 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1305 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1308 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1313 return lumiAuxiliary;
1317 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1323 RunAux* pRunAux = &runAux;
1328 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1331 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1333 return runAuxiliary;
1344 phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1366 while (offset < 0) {
1504 runHelper_->overrideRunNumber(runAuxiliary->id());
1505 filePtr_->reportInputRunNumber(runAuxiliary->run());
1533 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1538 return runAuxiliary;
1546 assert(entryNumber >= 0);
1547 mergeableRunProductMetadata->
readRun(
1580 return std::make_shared<LuminosityBlockAuxiliary>(
1588 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1589 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1603 return lumiAuxiliary;
1666 history_ = std::make_unique<History>();
1668 if (!eventHistoryTree_) {
1675 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
1676 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile) {
1689 std::set<BranchID>& branchesToDrop,
1690 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const {
1691 if (dropDescendants) {
1692 branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1694 branchesToDrop.insert(branch.
branchID());
1700 bool dropDescendants,
1706 std::vector<BranchDescription const*> associationDescriptions;
1710 std::set<BranchID> branchesToDrop;
1711 std::map<BranchID, BranchID> droppedToKeptAlias;
1712 for (
auto const& product : prodList) {
1718 for (
auto const& product : prodList) {
1723 associationDescriptions.push_back(&prod);
1727 }
else if (!productSelector.
selected(prod)) {
1740 std::set<BranchID> keptProductsInEvent;
1741 for (
auto const& product : prodList) {
1743 if (branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() && prod.
present() &&
1745 keptProductsInEvent.insert(prod.
branchID());
1750 std::map<BranchID, bool> keepAssociation;
1752 associationDescriptions, keptProductsInEvent, keepAssociation);
1754 for (
auto association : associationDescriptions) {
1761 auto temp = std::make_unique<ThinnedAssociationsHelper>();
1763 auto iter = keepAssociation.find(associationBranches.association());
1764 if (iter != keepAssociation.end() && iter->second) {
1765 temp->addAssociation(associationBranches);
1773 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1774 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1776 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1780 LogWarning(
"RootFile") <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n" 1781 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n" 1782 <<
"that was explicitly dropped.\n";
1787 ProductRegistry::ProductList::iterator icopy = it;
1789 prodList.erase(icopy);
1798 for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1802 void*
p = cp->New();
1805 if (edp->isMergeable()) {
1807 ProductRegistry::ProductList::iterator icopy = it;
1809 prodList.erase(icopy);
1831 return std::make_unique<MakeFullProvenanceReader>();
1833 auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1835 return std::make_unique<MakeOldProvenanceReader>(
std::move(entryDescriptionMap));
1837 return std::make_unique<MakeDummyProvenanceReader>();
1857 std::vector<ParentageID>
const& iParentageIDLookup,
1860 std::set<ProductProvenance> readProvenance(
unsigned int)
const override;
1865 unsigned int transitionIndex,
1866 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
1874 std::shared_ptr<std::recursive_mutex>
mutex_;
1879 std::vector<ParentageID>
const& iParentageIDLookup,
1882 rootTree_(iRootTree),
1883 pProvVector_(&provVector_),
1894 template <
typename R>
1895 void readProvenanceAsyncImpl(
R const* iThis,
1898 unsigned int transitionIndex,
1899 std::atomic<
const std::set<ProductProvenance>*>& writeTo,
1901 SignalType
const* pre,
1902 SignalType
const* post) {
1903 if (
nullptr == writeTo.load()) {
1906 auto pWriteTo = &writeTo;
1917 serviceToken]()
mutable {
1918 if (
nullptr == pWriteTo->load()) {
1920 std::unique_ptr<const std::set<ProductProvenance>> prov;
1925 prov = std::make_unique<const std::set<ProductProvenance>>(iThis->readProvenance(transitionIndex));
1935 holder.doneWaiting(std::current_exception());
1938 const std::set<ProductProvenance>* expected =
nullptr;
1940 if (pWriteTo->compare_exchange_strong(expected, prov.get())) {
1944 holder.doneWaiting(std::exception_ptr());
1952 unsigned int transitionIndex,
1953 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
1954 readProvenanceAsyncImpl(
this,
1959 moduleCallingContext,
1960 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1961 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1966 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
1971 std::set<ProductProvenance> retValue;
1982 <<
"ReducedProvenanceReader::ReadProvenance\n" 1983 <<
"The parentage ID index value " << prov.parentageIDIndex_
1984 <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size() - 1 <<
".\n" 1985 <<
"This should never happen.\n" 1986 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1998 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2003 unsigned int transitionIndex,
2004 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2010 std::shared_ptr<std::recursive_mutex>
mutex_;
2018 pInfoVector_(&infoVector_),
2025 unsigned int transitionIndex,
2026 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2027 readProvenanceAsyncImpl(
this,
2032 moduleCallingContext,
2039 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2043 std::set<ProductProvenance> retValue;
2051 retValue.emplace(
info);
2063 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2068 unsigned int transitionIndex,
2069 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2076 std::shared_ptr<std::recursive_mutex>
mutex_;
2087 entryDescriptionMap_(theMap),
2094 unsigned int transitionIndex,
2095 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2096 readProvenanceAsyncImpl(
this,
2101 moduleCallingContext,
2102 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2103 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2108 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2112 std::set<ProductProvenance> retValue;
2116 Parentage parentage(iter->second.parents());
2121 retValue.emplace(
info.branchID(), parentage.id());
2133 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2136 unsigned int transitionIndex,
2137 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const override;
2144 return std::set<ProductProvenance>{};
2148 unsigned int transitionIndex,
2149 std::atomic<
const std::set<ProductProvenance>*>& writeTo)
const {
2150 if (
nullptr == writeTo.load()) {
2151 auto emptyProv = std::make_unique<const std::set<ProductProvenance>>();
2152 const std::set<ProductProvenance>* expected =
nullptr;
2153 if (writeTo.compare_exchange_strong(expected, emptyProv.get())) {
2154 emptyProv.release();
2161 return std::make_unique<DummyProvenanceReader>();
2166 return std::make_unique<OldProvenanceReader>(&rootTree, *entryDescriptionMap_, daqProvenanceHelper);
2171 return std::make_unique<FullProvenanceReader>(&rootTree, daqProvenanceHelper);
2176 return std::make_unique<ReducedProvenanceReader>(&rootTree, parentageIDLookup_, daqProvenanceHelper);
void dropOnInput(ProductRegistry ®, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
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()
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 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