60 #include "TTreeCache.h" 93 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
96 for(
auto const& ph : processHistoryVector) {
97 for(
auto const& pc : ph) {
101 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n" 102 <<
"Forward compatibility cannot be supported.\n";
117 eventTree_.setEntryNumber(entry);
121 eventTree_.setEntryNumber(saveEntry);
122 return eventAux.
event();
133 std::shared_ptr<InputFile> filePtr,
134 std::shared_ptr<EventSkipperByID> eventSkipperByID,
138 unsigned int nStreams,
139 unsigned int treeCacheSize,
140 int treeMaxVirtualSize,
146 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
147 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
148 std::vector<BranchID>
const* associationsFromSecondary,
149 std::shared_ptr<DuplicateChecker> duplicateChecker,
150 bool dropDescendants,
152 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
153 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
154 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
155 bool bypassVersionCheck,
156 bool labelRawDataLikeMC,
158 bool enablePrefetching,
159 bool enforceGUIDInFileName) :
161 logicalFile_(logicalFileName),
162 processConfiguration_(processConfiguration),
163 processHistoryRegistry_(&processHistoryRegistry),
165 eventSkipperByID_(eventSkipperByID),
166 fileFormatVersion_(),
169 indexIntoFile_(*indexIntoFileSharedPtr_),
170 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
172 indexIntoFileEnd_(indexIntoFileBegin_),
173 indexIntoFileIter_(indexIntoFileBegin_),
174 eventProcessHistoryIDs_(),
175 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
176 savedRunAuxiliary_(),
177 skipAnyEvents_(skipAnyEvents),
178 noEventSort_(noEventSort),
179 enforceGUIDInFileName_(enforceGUIDInFileName),
180 whyNotFastClonable_(0),
181 hasNewlyDroppedBranch_(),
182 branchListIndexesUnchanged_(
false),
191 branchIDListHelper_(branchIDListHelper),
192 fileThinnedAssociationsHelper_(),
193 thinnedAssociationsHelper_(thinnedAssociationsHelper),
194 processingMode_(processingMode),
195 runHelper_(runHelper),
196 newBranchToOldBranch_(),
198 eventSelectionIDs_(),
199 branchListIndexes_(),
202 duplicateChecker_(duplicateChecker),
203 provenanceAdaptor_(),
204 provenanceReaderMaker_(),
205 eventProductProvenanceRetrievers_(),
206 parentageIDLookup_(),
207 daqProvenanceHelper_(),
208 edProductClass_(TClass::GetClass(
"edm::WrapperBase")) {
219 if(
nullptr == metaDataTree.get()) {
221 <<
" in the input file.\n";
230 fft->SetAddress(&fftPtr);
251 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
253 PsetMap *psetMapPtr = &psetMap;
262 if(
nullptr == psetTree.get()) {
264 <<
" in the input file.\n";
267 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
269 IdToBlobs* pIdToBlob = &idToBlob;
273 psetTreeCache->SetEnablePrefetching(
false);
274 filePtr_->SetCacheRead(psetTreeCache.get());
275 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
276 psetTree->GetEntry(
i);
277 psetMap.insert(idToBlob);
302 auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
349 for(
auto const& psetEntry : psetMap) {
351 pset.setID(psetEntry.first);
362 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
370 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
375 <<
"Failed to find branchIDLists branch in metaData tree.\n";
383 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
387 if(!bypassVersionCheck) {
388 checkReleaseVersion(pHistVector,
file());
391 if(labelRawDataLikeMC) {
396 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
397 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
413 it = pList.lower_bound(finder);
414 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
424 for(
auto const& history : pHistVector) {
456 for(
auto& product : pList) {
462 auto newReg = std::make_unique<ProductRegistry>();
467 for(
auto const& product : prodList) {
471 newReg->copyProduct(prod);
475 <<
"Cannot change friendly class name algorithm without more development work\n" 476 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
480 newReg->copyProduct(newBD);
484 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
487 *associationsFromSecondary);
500 std::array<size_t,NumBranchTypes> nBranches;
502 for(
auto const& product : prodList) {
503 ++nBranches[product.second.branchType()];
508 t->numberOfBranchesToAdd(nBranches[i]);
512 for(
auto const& product : prodList) {
540 if(
nullptr == entryDescriptionTree.get()) {
542 <<
" in the input file.\n";
558 if(idBuffer != entryDescriptionBuffer.
id()) {
561 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
586 if(
nullptr == parentageTree.get()) {
588 <<
" in the input file.\n";
663 std::unique_ptr<FileBlock>
838 phid_(phid), run_(run) {}
842 struct RunItemSortByRun {
843 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
844 return a.run_ < b.run_;
847 struct RunItemSortByRunPhid {
848 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
849 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
855 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
863 struct LumiItemSortByRunLumi {
864 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
865 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
868 struct LumiItemSortByRunLumiPhid {
869 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
870 if(a.run_ < b.run_)
return true;
871 if(b.run_ < a.run_)
return false;
872 if(a.lumi_ < b.lumi_)
return true;
873 if(b.lumi_ < a.lumi_)
return false;
874 return a.phid_ < b.phid_;
890 typedef std::list<LumiItem>
LumiList;
893 typedef std::set<LuminosityBlockID> RunLumiSet;
894 RunLumiSet runLumiSet;
896 typedef std::list<RunItem>
RunList;
899 typedef std::set<RunNumber_t> RunSet;
902 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
903 RunItemSet runItemSet;
905 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
919 bool newLumi =
false;
930 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
932 newRun = newLumi =
true;
933 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
936 prevPhid = reducedPHID;
940 lumis.emplace_back(reducedPHID,
944 LumiItem& currentLumi = lumis.back();
946 ++currentLumi.lastEventEntry_;
951 if(runItemSet.insert(item).second) {
954 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
965 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
968 typedef std::vector<RunItem> RunVector;
978 if(runSet.insert(runAux->run()).
second) {
980 emptyRuns.emplace_back(reducedPHID, runAux->run());
983 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
990 RunItemSortByRun runItemSortByRun;
993 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
994 for(
auto const& emptyRun : emptyRuns) {
995 for(; itRuns != endRuns; ++itRuns) {
996 if(runItemSortByRun(emptyRun, *itRuns)) {
1000 runs.insert(itRuns, emptyRun);
1005 typedef std::vector<LumiItem> LumiVector;
1006 LumiVector emptyLumis;
1008 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1009 RunLumiMap runLumiMap;
1016 if(runLumiSet.insert(lumiID).second) {
1021 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1022 assert(iPhidMap != phidMap.end());
1032 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1035 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1036 for(
auto const& emptyLumi : emptyLumis) {
1037 for(; itLumis != endLumis; ++itLumis) {
1038 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1042 lumis.insert(itLumis, emptyLumi);
1047 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1048 RunCountMap runCountMap;
1050 assert(phids.empty());
1052 assert(entries.empty());
1054 for(
auto&
run : runs) {
1055 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1056 if(countMapItem == runCountMap.end()) {
1057 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1058 assert(countMapItem != runCountMap.end());
1061 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1062 if(phidItem == phids.end()) {
1063 phids.push_back(
run.phid_);
1064 phidItem = phids.end() - 1;
1066 entries.emplace_back(
1067 countMapItem->second,
1070 phidItem - phids.begin(),
1078 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1079 LumiCountMap lumiCountMap;
1081 for(
auto&
lumi : lumis) {
1082 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1083 assert(runCountMapItem != runCountMap.end());
1084 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1085 if(countMapItem == lumiCountMap.end()) {
1086 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1087 assert(countMapItem != lumiCountMap.end());
1090 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1091 assert(phidItem != phids.end());
1092 entries.emplace_back(
1093 runCountMapItem->second,
1094 countMapItem->second,
1096 phidItem - phids.begin(),
1099 lumi.firstEventEntry_,
1100 lumi.lastEventEntry_);
1112 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1116 if (guidFromName !=
fid_.
fid()) {
1118 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_ 1119 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1130 for(
auto& phid : phidVec) {
1147 bool needEventNumbers =
false;
1149 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1150 needEventNumbers =
true;
1152 bool needEventEntries =
false;
1155 needEventEntries =
true;
1179 treePointer->close();
1180 treePointer =
nullptr;
1235 if(!eventHistoryBranch) {
1237 <<
"Failed to find history branch in event history tree.\n";
1239 eventHistoryBranch->SetAddress(&pHistory);
1248 assert(eventSelectionIDBranch !=
nullptr);
1252 assert(branchListIndexesBranch !=
nullptr);
1273 std::shared_ptr<LuminosityBlockAuxiliary>
1275 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1286 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1289 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1294 return lumiAuxiliary;
1297 std::shared_ptr<RunAuxiliary>
1299 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1305 RunAux *pRunAux = &runAux;
1310 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1313 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1315 return runAuxiliary;
1476 std::shared_ptr<RunAuxiliary>
1504 runHelper_->overrideRunNumber(runAuxiliary->id());
1505 filePtr_->reportInputRunNumber(runAuxiliary->run());
1534 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1539 return runAuxiliary;
1562 std::shared_ptr<LuminosityBlockAuxiliary>
1582 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1583 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1597 return lumiAuxiliary;
1660 history_ = std::make_unique<History>();
1662 if(!eventHistoryTree_) {
1664 <<
"Failed to find the event history tree.\n";
1671 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1672 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1679 currentIndexIntoFile);
1687 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const {
1688 if(dropDescendants) {
1689 branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1691 branchesToDrop.insert(branch.
branchID());
1702 std::vector<BranchDescription const*> associationDescriptions;
1706 std::set<BranchID> branchesToDrop;
1707 std::map<BranchID, BranchID> droppedToKeptAlias;
1708 for(
auto const& product : prodList) {
1714 for(
auto const& product : prodList) {
1719 associationDescriptions.push_back(&prod);
1723 }
else if(!productSelector.
selected(prod)) {
1737 std::set<BranchID> keptProductsInEvent;
1738 for(
auto const& product : prodList) {
1740 if( branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() &&
1743 keptProductsInEvent.insert(prod.
branchID());
1748 std::map<BranchID, bool> keepAssociation;
1750 keptProductsInEvent,
1760 auto temp = std::make_unique<ThinnedAssociationsHelper>();
1762 auto iter = keepAssociation.find(associationBranches.association());
1763 if(iter != keepAssociation.end() && iter->second) {
1764 temp->addAssociation(associationBranches);
1772 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1773 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1775 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1780 <<
"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);
1826 std::unique_ptr<MakeProvenanceReader>
1833 return std::make_unique<MakeFullProvenanceReader>();
1835 auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1837 return std::make_unique<MakeOldProvenanceReader>(
std::move(entryDescriptionMap));
1839 return std::make_unique<MakeDummyProvenanceReader>();
1843 std::shared_ptr<ProductProvenanceRetriever>
1860 std::set<ProductProvenance> readProvenance(
unsigned int)
const override;
1864 unsigned int transitionIndex,
1865 std::atomic<
const std::set<ProductProvenance>*>& writeTo
1874 std::shared_ptr<std::recursive_mutex>
mutex_;
1880 std::vector<ParentageID>
const& iParentageIDLookup,
1883 rootTree_(iRootTree),
1884 pProvVector_(&provVector_),
1895 template<
typename R>
1896 void readProvenanceAsyncImpl(
R const* iThis,
1899 unsigned int transitionIndex,
1900 std::atomic<
const std::set<ProductProvenance>*>& writeTo,
1902 SignalType
const* pre,
1903 SignalType
const* post) {
1904 if(
nullptr == writeTo.load()) {
1907 auto pWriteTo = &writeTo;
1911 chain.
push([holder =
std::move(taskHolder), pWriteTo,iThis,transitionIndex, iContext, pre,post, serviceToken]()
mutable {
1913 if(
nullptr == pWriteTo->load()) {
1915 std::unique_ptr<const std::set<ProductProvenance>> prov;
1918 prov = std::make_unique<const std::set<ProductProvenance>>(iThis->readProvenance(transitionIndex));
1924 holder.doneWaiting(std::current_exception());
1927 const std::set<ProductProvenance>* expected =
nullptr;
1929 if(pWriteTo->compare_exchange_strong(expected,prov.get())) {
1933 holder.doneWaiting(std::exception_ptr());
1942 unsigned int transitionIndex,
1943 std::atomic<
const std::set<ProductProvenance>*>& writeTo
1945 readProvenanceAsyncImpl(
this,
1950 moduleCallingContext,
1951 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1952 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1955 std::set<ProductProvenance>
1958 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
1962 std::set<ProductProvenance> retValue;
1973 <<
"ReducedProvenanceReader::ReadProvenance\n" 1974 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n" 1975 <<
"This should never happen.\n" 1976 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1988 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1992 unsigned int transitionIndex,
1993 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2000 std::shared_ptr<std::recursive_mutex>
mutex_;
2008 pInfoVector_(&infoVector_),
2018 unsigned int transitionIndex,
2019 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2021 readProvenanceAsyncImpl(
this,
2026 moduleCallingContext,
2031 std::set<ProductProvenance>
2034 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2037 std::set<ProductProvenance> retValue;
2045 retValue.emplace(
info);
2055 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2059 unsigned int transitionIndex,
2060 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2068 std::shared_ptr<std::recursive_mutex>
mutex_;
2077 entryDescriptionMap_(theMap),
2087 unsigned int transitionIndex,
2088 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2090 readProvenanceAsyncImpl(
this,
2095 moduleCallingContext,
2096 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2097 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2100 std::set<ProductProvenance>
2103 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2107 std::set<ProductProvenance> retValue;
2111 Parentage parentage(iter->second.parents());
2116 retValue.emplace(
info.branchID(), parentage.id());
2127 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2130 unsigned int transitionIndex,
2131 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2139 std::set<ProductProvenance>
2142 return std::set<ProductProvenance>{};
2147 unsigned int transitionIndex,
2148 std::atomic<
const std::set<ProductProvenance>*>& writeTo
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();
2159 std::unique_ptr<ProvenanceReaderBase>
2161 return std::make_unique<DummyProvenanceReader>();
2164 std::unique_ptr<ProvenanceReaderBase>
2166 return std::make_unique<OldProvenanceReader>(&rootTree, *entryDescriptionMap_, daqProvenanceHelper);
2169 std::unique_ptr<ProvenanceReaderBase>
2171 return std::make_unique<FullProvenanceReader>(&rootTree, daqProvenanceHelper);
2174 std::unique_ptr<ProvenanceReaderBase>
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 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
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)
void readAllFromSourceAndMergeImmediately()
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()
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_
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
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)
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
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
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]
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
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()
std::string const & wrappedName() const
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()
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)