59 #include "TTreeCache.h" 92 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
95 for(
auto const& ph : processHistoryVector) {
96 for(
auto const& pc : ph) {
100 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n" 101 <<
"Forward compatibility cannot be supported.\n";
116 eventTree_.setEntryNumber(entry);
120 eventTree_.setEntryNumber(saveEntry);
121 return eventAux.
event();
132 std::shared_ptr<InputFile> filePtr,
133 std::shared_ptr<EventSkipperByID> eventSkipperByID,
137 unsigned int nStreams,
138 unsigned int treeCacheSize,
139 int treeMaxVirtualSize,
145 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
146 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
147 std::vector<BranchID>
const* associationsFromSecondary,
148 std::shared_ptr<DuplicateChecker> duplicateChecker,
149 bool dropDescendants,
151 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
152 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
153 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
154 bool bypassVersionCheck,
155 bool labelRawDataLikeMC,
157 bool enablePrefetching) :
159 logicalFile_(logicalFileName),
160 processConfiguration_(processConfiguration),
161 processHistoryRegistry_(&processHistoryRegistry),
163 eventSkipperByID_(eventSkipperByID),
164 fileFormatVersion_(),
167 indexIntoFile_(*indexIntoFileSharedPtr_),
168 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
170 indexIntoFileEnd_(indexIntoFileBegin_),
171 indexIntoFileIter_(indexIntoFileBegin_),
172 eventProcessHistoryIDs_(),
173 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
174 savedRunAuxiliary_(),
175 skipAnyEvents_(skipAnyEvents),
176 noEventSort_(noEventSort),
177 whyNotFastClonable_(0),
178 hasNewlyDroppedBranch_(),
179 branchListIndexesUnchanged_(
false),
188 branchIDListHelper_(branchIDListHelper),
189 fileThinnedAssociationsHelper_(),
190 thinnedAssociationsHelper_(thinnedAssociationsHelper),
191 processingMode_(processingMode),
192 runHelper_(runHelper),
193 newBranchToOldBranch_(),
195 eventSelectionIDs_(),
196 branchListIndexes_(),
199 duplicateChecker_(duplicateChecker),
200 provenanceAdaptor_(),
201 provenanceReaderMaker_(),
202 eventProductProvenanceRetrievers_(),
203 parentageIDLookup_(),
204 daqProvenanceHelper_(),
205 edProductClass_(TClass::GetClass(
"edm::WrapperBase")) {
216 if(
nullptr == metaDataTree.get()) {
218 <<
" in the input file.\n";
227 fft->SetAddress(&fftPtr);
248 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
250 PsetMap *psetMapPtr = &psetMap;
259 if(
nullptr == psetTree.get()) {
261 <<
" in the input file.\n";
264 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
266 IdToBlobs* pIdToBlob = &idToBlob;
270 psetTreeCache->SetEnablePrefetching(
false);
271 filePtr_->SetCacheRead(psetTreeCache.get());
272 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
273 psetTree->GetEntry(
i);
274 psetMap.insert(idToBlob);
299 auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
346 for(
auto const& psetEntry : psetMap) {
348 pset.setID(psetEntry.first);
359 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
367 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
372 <<
"Failed to find branchIDLists branch in metaData tree.\n";
380 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
384 if(!bypassVersionCheck) {
385 checkReleaseVersion(pHistVector,
file());
388 if(labelRawDataLikeMC) {
393 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
394 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
410 it = pList.lower_bound(finder);
411 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
421 for(
auto const& history : pHistVector) {
453 for(
auto& product : pList) {
459 auto newReg = std::make_unique<ProductRegistry>();
464 for(
auto const& product : prodList) {
468 newReg->copyProduct(prod);
472 <<
"Cannot change friendly class name algorithm without more development work\n" 473 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
477 newReg->copyProduct(newBD);
481 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
484 *associationsFromSecondary);
497 std::array<size_t,NumBranchTypes> nBranches;
499 for(
auto const& product : prodList) {
500 ++nBranches[product.second.branchType()];
505 t->numberOfBranchesToAdd(nBranches[i]);
509 for(
auto const& product : prodList) {
537 if(
nullptr == entryDescriptionTree.get()) {
539 <<
" in the input file.\n";
555 if(idBuffer != entryDescriptionBuffer.
id()) {
558 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
583 if(
nullptr == parentageTree.get()) {
585 <<
" in the input file.\n";
660 std::unique_ptr<FileBlock>
835 phid_(phid), run_(run) {}
839 struct RunItemSortByRun {
840 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
841 return a.run_ < b.run_;
844 struct RunItemSortByRunPhid {
845 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
846 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
852 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
860 struct LumiItemSortByRunLumi {
861 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
862 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
865 struct LumiItemSortByRunLumiPhid {
866 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
867 if(a.run_ < b.run_)
return true;
868 if(b.run_ < a.run_)
return false;
869 if(a.lumi_ < b.lumi_)
return true;
870 if(b.lumi_ < a.lumi_)
return false;
871 return a.phid_ < b.phid_;
887 typedef std::list<LumiItem>
LumiList;
890 typedef std::set<LuminosityBlockID> RunLumiSet;
891 RunLumiSet runLumiSet;
893 typedef std::list<RunItem>
RunList;
896 typedef std::set<RunNumber_t> RunSet;
899 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
900 RunItemSet runItemSet;
902 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
916 bool newLumi =
false;
927 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
929 newRun = newLumi =
true;
930 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
933 prevPhid = reducedPHID;
937 lumis.emplace_back(reducedPHID,
941 LumiItem& currentLumi = lumis.back();
943 ++currentLumi.lastEventEntry_;
948 if(runItemSet.insert(item).second) {
951 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
962 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
965 typedef std::vector<RunItem> RunVector;
975 if(runSet.insert(runAux->run()).
second) {
977 emptyRuns.emplace_back(reducedPHID, runAux->run());
980 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
987 RunItemSortByRun runItemSortByRun;
990 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
991 for(
auto const& emptyRun : emptyRuns) {
992 for(; itRuns != endRuns; ++itRuns) {
993 if(runItemSortByRun(emptyRun, *itRuns)) {
997 runs.insert(itRuns, emptyRun);
1002 typedef std::vector<LumiItem> LumiVector;
1003 LumiVector emptyLumis;
1005 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1006 RunLumiMap runLumiMap;
1013 if(runLumiSet.insert(lumiID).second) {
1018 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1019 assert(iPhidMap != phidMap.end());
1029 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1032 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1033 for(
auto const& emptyLumi : emptyLumis) {
1034 for(; itLumis != endLumis; ++itLumis) {
1035 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1039 lumis.insert(itLumis, emptyLumi);
1044 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1045 RunCountMap runCountMap;
1047 assert(phids.empty());
1049 assert(entries.empty());
1051 for(
auto&
run : runs) {
1052 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1053 if(countMapItem == runCountMap.end()) {
1054 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1055 assert(countMapItem != runCountMap.end());
1058 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1059 if(phidItem == phids.end()) {
1060 phids.push_back(
run.phid_);
1061 phidItem = phids.end() - 1;
1063 entries.emplace_back(
1064 countMapItem->second,
1067 phidItem - phids.begin(),
1075 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1076 LumiCountMap lumiCountMap;
1078 for(
auto&
lumi : lumis) {
1079 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1080 assert(runCountMapItem != runCountMap.end());
1081 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1082 if(countMapItem == lumiCountMap.end()) {
1083 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1084 assert(countMapItem != lumiCountMap.end());
1087 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1088 assert(phidItem != phids.end());
1089 entries.emplace_back(
1090 runCountMapItem->second,
1091 countMapItem->second,
1093 phidItem - phids.begin(),
1096 lumi.firstEventEntry_,
1097 lumi.lastEventEntry_);
1109 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1119 for(
auto& phid : phidVec) {
1136 bool needEventNumbers =
false;
1138 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1139 needEventNumbers =
true;
1141 bool needEventEntries =
false;
1144 needEventEntries =
true;
1168 treePointer->close();
1169 treePointer =
nullptr;
1224 if(!eventHistoryBranch) {
1226 <<
"Failed to find history branch in event history tree.\n";
1228 eventHistoryBranch->SetAddress(&pHistory);
1237 assert(eventSelectionIDBranch !=
nullptr);
1241 assert(branchListIndexesBranch !=
nullptr);
1262 std::shared_ptr<LuminosityBlockAuxiliary>
1264 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1275 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1278 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1283 return lumiAuxiliary;
1286 std::shared_ptr<RunAuxiliary>
1288 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1294 RunAux *pRunAux = &runAux;
1299 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1302 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1304 return runAuxiliary;
1465 std::shared_ptr<RunAuxiliary>
1493 runHelper_->overrideRunNumber(runAuxiliary->id());
1494 filePtr_->reportInputRunNumber(runAuxiliary->run());
1523 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1528 return runAuxiliary;
1551 std::shared_ptr<LuminosityBlockAuxiliary>
1571 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1572 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1586 return lumiAuxiliary;
1649 history_ = std::make_unique<History>();
1651 if(!eventHistoryTree_) {
1653 <<
"Failed to find the event history tree.\n";
1660 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1661 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1668 currentIndexIntoFile);
1676 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const {
1677 if(dropDescendants) {
1678 branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1680 branchesToDrop.insert(branch.
branchID());
1691 std::vector<BranchDescription const*> associationDescriptions;
1695 std::set<BranchID> branchesToDrop;
1696 std::map<BranchID, BranchID> droppedToKeptAlias;
1697 for(
auto const& product : prodList) {
1703 for(
auto const& product : prodList) {
1708 associationDescriptions.push_back(&prod);
1712 }
else if(!productSelector.
selected(prod)) {
1726 std::set<BranchID> keptProductsInEvent;
1727 for(
auto const& product : prodList) {
1729 if( branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() &&
1732 keptProductsInEvent.insert(prod.
branchID());
1737 std::map<BranchID, bool> keepAssociation;
1739 keptProductsInEvent,
1749 auto temp = std::make_unique<ThinnedAssociationsHelper>();
1751 auto iter = keepAssociation.find(associationBranches.association());
1752 if(iter != keepAssociation.end() && iter->second) {
1753 temp->addAssociation(associationBranches);
1761 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1762 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1764 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1769 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n" 1770 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n" 1771 <<
"that was explicitly dropped.\n";
1776 ProductRegistry::ProductList::iterator icopy = it;
1778 prodList.erase(icopy);
1787 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1791 void*
p = cp->New();
1794 if(edp->isMergeable()) {
1796 ProductRegistry::ProductList::iterator icopy = it;
1798 prodList.erase(icopy);
1815 std::unique_ptr<MakeProvenanceReader>
1822 return std::make_unique<MakeFullProvenanceReader>();
1824 auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1826 return std::make_unique<MakeOldProvenanceReader>(
std::move(entryDescriptionMap));
1828 return std::make_unique<MakeDummyProvenanceReader>();
1832 std::shared_ptr<ProductProvenanceRetriever>
1849 std::set<ProductProvenance> readProvenance(
unsigned int)
const override;
1853 unsigned int transitionIndex,
1854 std::atomic<
const std::set<ProductProvenance>*>& writeTo
1863 std::shared_ptr<std::recursive_mutex>
mutex_;
1869 std::vector<ParentageID>
const& iParentageIDLookup,
1872 rootTree_(iRootTree),
1873 pProvVector_(&provVector_),
1884 template<
typename R>
1885 void readProvenanceAsyncImpl(
R const* iThis,
1888 unsigned int transitionIndex,
1889 std::atomic<
const std::set<ProductProvenance>*>& writeTo,
1891 SignalType
const* pre,
1892 SignalType
const* post) {
1893 if(
nullptr == writeTo.load()) {
1896 auto pWriteTo = &writeTo;
1900 chain.
push([holder =
std::move(taskHolder), pWriteTo,iThis,transitionIndex, iContext, pre,post, serviceToken]()
mutable {
1902 if(
nullptr == pWriteTo->load()) {
1904 std::unique_ptr<const std::set<ProductProvenance>> prov;
1907 prov = std::make_unique<const std::set<ProductProvenance>>(iThis->readProvenance(transitionIndex));
1913 holder.doneWaiting(std::current_exception());
1916 const std::set<ProductProvenance>* expected =
nullptr;
1918 if(pWriteTo->compare_exchange_strong(expected,prov.get())) {
1922 holder.doneWaiting(std::exception_ptr());
1931 unsigned int transitionIndex,
1932 std::atomic<
const std::set<ProductProvenance>*>& writeTo
1934 readProvenanceAsyncImpl(
this,
1939 moduleCallingContext,
1940 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
1941 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
1944 std::set<ProductProvenance>
1947 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
1951 std::set<ProductProvenance> retValue;
1962 <<
"ReducedProvenanceReader::ReadProvenance\n" 1963 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n" 1964 <<
"This should never happen.\n" 1965 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1977 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1981 unsigned int transitionIndex,
1982 std::atomic<
const std::set<ProductProvenance>*>& writeTo
1989 std::shared_ptr<std::recursive_mutex>
mutex_;
1997 pInfoVector_(&infoVector_),
2007 unsigned int transitionIndex,
2008 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2010 readProvenanceAsyncImpl(
this,
2015 moduleCallingContext,
2020 std::set<ProductProvenance>
2023 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2026 std::set<ProductProvenance> retValue;
2034 retValue.emplace(
info);
2044 std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
2048 unsigned int transitionIndex,
2049 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2057 std::shared_ptr<std::recursive_mutex>
mutex_;
2066 entryDescriptionMap_(theMap),
2076 unsigned int transitionIndex,
2077 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2079 readProvenanceAsyncImpl(
this,
2084 moduleCallingContext,
2085 rootTree_->rootDelayedReader()->preEventReadFromSourceSignal(),
2086 rootTree_->rootDelayedReader()->postEventReadFromSourceSignal());
2089 std::set<ProductProvenance>
2092 std::lock_guard<std::recursive_mutex> guard(*
mutex_);
2096 std::set<ProductProvenance> retValue;
2100 Parentage parentage(iter->second.parents());
2105 retValue.emplace(
info.branchID(), parentage.id());
2116 std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
2119 unsigned int transitionIndex,
2120 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2128 std::set<ProductProvenance>
2131 return std::set<ProductProvenance>{};
2136 unsigned int transitionIndex,
2137 std::atomic<
const std::set<ProductProvenance>*>& writeTo
2139 if(
nullptr == writeTo.load()) {
2140 auto emptyProv = std::make_unique<const std::set<ProductProvenance>>();
2141 const std::set<ProductProvenance>* expected =
nullptr;
2142 if(writeTo.compare_exchange_strong(expected,emptyProv.get())) {
2143 emptyProv.release();
2148 std::unique_ptr<ProvenanceReaderBase>
2150 return std::make_unique<DummyProvenanceReader>();
2153 std::unique_ptr<ProvenanceReaderBase>
2155 return std::make_unique<OldProvenanceReader>(&rootTree, *entryDescriptionMap_, daqProvenanceHelper);
2158 std::unique_ptr<ProvenanceReaderBase>
2160 return std::make_unique<FullProvenanceReader>(&rootTree, daqProvenanceHelper);
2163 std::unique_ptr<ProvenanceReaderBase>
2165 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)
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)
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)
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
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)