56 #include "TTreeCache.h"
89 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
92 for(
auto const& ph : processHistoryVector) {
93 for(
auto const& pc : ph) {
97 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n"
98 <<
"Forward compatibility cannot be supported.\n";
118 return eventAux.
event();
129 std::shared_ptr<InputFile> filePtr,
130 std::shared_ptr<EventSkipperByID> eventSkipperByID,
134 unsigned int nStreams,
135 unsigned int treeCacheSize,
136 int treeMaxVirtualSize,
142 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
143 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
144 std::vector<BranchID>
const* associationsFromSecondary,
145 std::shared_ptr<DuplicateChecker> duplicateChecker,
146 bool dropDescendants,
148 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
149 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
150 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
151 bool bypassVersionCheck,
152 bool labelRawDataLikeMC,
154 bool enablePrefetching,
155 bool enforceGUIDInFileName) :
157 logicalFile_(logicalFileName),
158 processConfiguration_(processConfiguration),
159 processHistoryRegistry_(&processHistoryRegistry),
161 eventSkipperByID_(eventSkipperByID),
162 fileFormatVersion_(),
165 indexIntoFile_(*indexIntoFileSharedPtr_),
166 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
168 indexIntoFileEnd_(indexIntoFileBegin_),
169 indexIntoFileIter_(indexIntoFileBegin_),
170 eventProcessHistoryIDs_(),
171 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
172 savedRunAuxiliary_(),
173 skipAnyEvents_(skipAnyEvents),
174 noEventSort_(noEventSort),
175 enforceGUIDInFileName_(enforceGUIDInFileName),
176 whyNotFastClonable_(0),
177 hasNewlyDroppedBranch_(),
178 branchListIndexesUnchanged_(
false),
187 branchIDListHelper_(branchIDListHelper),
188 fileThinnedAssociationsHelper_(),
189 thinnedAssociationsHelper_(thinnedAssociationsHelper),
190 processingMode_(processingMode),
191 runHelper_(runHelper),
192 newBranchToOldBranch_(),
194 eventSelectionIDs_(),
195 branchListIndexes_(),
198 duplicateChecker_(duplicateChecker),
199 provenanceAdaptor_(),
200 provenanceReaderMaker_(),
201 eventProductProvenanceRetrievers_(),
202 parentageIDLookup_(),
203 daqProvenanceHelper_(),
204 edProductClass_(TClass::GetClass(
"edm::WrapperBase")) {
215 if(
nullptr == metaDataTree.get()) {
217 <<
" in the input file.\n";
226 fft->SetAddress(&fftPtr);
247 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
249 PsetMap *psetMapPtr = &psetMap;
258 if(
nullptr == psetTree.get()) {
260 <<
" in the input file.\n";
263 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
265 IdToBlobs* pIdToBlob = &idToBlob;
269 psetTreeCache->SetEnablePrefetching(
false);
270 filePtr_->SetCacheRead(psetTreeCache.get());
271 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
272 psetTree->GetEntry(
i);
273 psetMap.insert(idToBlob);
298 std::unique_ptr<BranchIDLists> branchIDListsAPtr(
new BranchIDLists);
345 for(
auto const& psetEntry : psetMap) {
347 pset.setID(psetEntry.first);
358 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
366 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
371 <<
"Failed to find branchIDLists branch in metaData tree.\n";
379 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
383 if(!bypassVersionCheck) {
384 checkReleaseVersion(pHistVector,
file());
387 if(labelRawDataLikeMC) {
391 BranchKey finder(rawData, source,
"",
"");
392 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
393 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
409 it = pList.lower_bound(finder);
410 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
420 for(
auto const& history : pHistVector) {
452 for(
auto& product : pList) {
463 for(
auto const& product : prodList) {
467 newReg->copyProduct(prod);
471 <<
"Cannot change friendly class name algorithm without more development work\n"
472 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
476 newReg->copyProduct(newBD);
480 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
483 *associationsFromSecondary);
494 for(
auto const& product : prodList) {
524 if(
nullptr == entryDescriptionTree.get()) {
526 <<
" in the input file.\n";
542 if(idBuffer != entryDescriptionBuffer.
id()) {
545 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
570 if(
nullptr == parentageTree.get()) {
572 <<
" in the input file.\n";
647 std::unique_ptr<FileBlock>
822 phid_(phid), run_(run) {}
826 struct RunItemSortByRun {
827 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
828 return a.run_ < b.run_;
831 struct RunItemSortByRunPhid {
832 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
833 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
839 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
840 lastEventEntry_(entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry : entry + 1) {}
847 struct LumiItemSortByRunLumi {
848 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
849 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
852 struct LumiItemSortByRunLumiPhid {
853 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
854 if(a.run_ < b.run_)
return true;
855 if(b.run_ < a.run_)
return false;
856 if(a.lumi_ < b.lumi_)
return true;
857 if(b.lumi_ < a.lumi_)
return false;
858 return a.phid_ < b.phid_;
874 typedef std::list<LumiItem> LumiList;
877 typedef std::set<LuminosityBlockID> RunLumiSet;
878 RunLumiSet runLumiSet;
880 typedef std::list<RunItem>
RunList;
883 typedef std::set<RunNumber_t> RunSet;
886 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
887 RunItemSet runItemSet;
889 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
903 bool newLumi =
false;
914 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
916 newRun = newLumi =
true;
917 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
920 prevPhid = reducedPHID;
924 lumis.emplace_back(reducedPHID,
928 LumiItem& currentLumi = lumis.back();
930 ++currentLumi.lastEventEntry_;
935 if(runItemSet.insert(item).second) {
938 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
949 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
952 typedef std::vector<RunItem> RunVector;
962 if(runSet.insert(runAux->run()).
second) {
964 emptyRuns.emplace_back(reducedPHID, runAux->run());
967 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
974 RunItemSortByRun runItemSortByRun;
977 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
978 for(
auto const& emptyRun : emptyRuns) {
979 for(; itRuns != endRuns; ++itRuns) {
980 if(runItemSortByRun(emptyRun, *itRuns)) {
984 runs.insert(itRuns, emptyRun);
989 typedef std::vector<LumiItem> LumiVector;
990 LumiVector emptyLumis;
992 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
993 RunLumiMap runLumiMap;
1000 if(runLumiSet.insert(lumiID).second) {
1005 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1006 assert(iPhidMap != phidMap.end());
1016 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1019 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1020 for(
auto const& emptyLumi : emptyLumis) {
1021 for(; itLumis != endLumis; ++itLumis) {
1022 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1026 lumis.insert(itLumis, emptyLumi);
1031 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1032 RunCountMap runCountMap;
1038 for(
auto&
run : runs) {
1039 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1040 if(countMapItem == runCountMap.end()) {
1041 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1042 assert(countMapItem != runCountMap.end());
1045 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1046 if(phidItem == phids.end()) {
1047 phids.push_back(
run.phid_);
1048 phidItem = phids.end() - 1;
1050 entries.emplace_back(
1051 countMapItem->second,
1054 phidItem - phids.begin(),
1062 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1063 LumiCountMap lumiCountMap;
1065 for(
auto&
lumi : lumis) {
1066 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1067 assert(runCountMapItem != runCountMap.end());
1068 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1069 if(countMapItem == lumiCountMap.end()) {
1070 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1071 assert(countMapItem != lumiCountMap.end());
1074 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1075 assert(phidItem != phids.end());
1076 entries.emplace_back(
1077 runCountMapItem->second,
1078 countMapItem->second,
1080 phidItem - phids.begin(),
1083 lumi.firstEventEntry_,
1084 lumi.lastEventEntry_);
1096 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1100 if (guidFromName !=
fid_.
fid()) {
1102 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_
1103 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1114 for(
auto& phid : phidVec) {
1131 bool needEventNumbers =
false;
1133 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1134 needEventNumbers =
true;
1136 bool needEventEntries =
false;
1139 needEventEntries =
true;
1163 treePointer->close();
1164 treePointer =
nullptr;
1219 if(!eventHistoryBranch) {
1221 <<
"Failed to find history branch in event history tree.\n";
1223 eventHistoryBranch->SetAddress(&pHistory);
1232 assert(eventSelectionIDBranch !=
nullptr);
1236 assert(branchListIndexesBranch !=
nullptr);
1257 std::shared_ptr<LuminosityBlockAuxiliary>
1259 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1270 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1273 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1278 return lumiAuxiliary;
1281 std::shared_ptr<RunAuxiliary>
1283 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1289 RunAux *pRunAux = &runAux;
1294 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1297 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1299 return runAuxiliary;
1460 std::shared_ptr<RunAuxiliary>
1488 runHelper_->overrideRunNumber(runAuxiliary->id());
1489 filePtr_->reportInputRunNumber(runAuxiliary->run());
1509 runAuxiliary->setBeginTime(
eventAux().time());
1518 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1523 return runAuxiliary;
1545 std::shared_ptr<LuminosityBlockAuxiliary>
1565 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1566 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1573 lumiAuxiliary->setBeginTime(
eventAux().time());
1580 return lumiAuxiliary;
1642 history_ = std::make_unique<History>();
1644 if(!eventHistoryTree_) {
1646 <<
"Failed to find the event history tree.\n";
1653 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1654 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1661 currentIndexIntoFile);
1669 if(dropDescendants) {
1672 branchesToDrop.insert(branchID);
1683 std::vector<BranchDescription const*> associationDescriptions;
1687 std::set<BranchID> branchesToDrop;
1688 for(
auto const& product : prodList) {
1693 associationDescriptions.push_back(&prod);
1697 }
else if(!productSelector.
selected(prod)) {
1711 std::set<BranchID> keptProductsInEvent;
1712 for(
auto const& product : prodList) {
1714 if( branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() &&
1717 keptProductsInEvent.insert(prod.
branchID());
1722 std::map<BranchID, bool> keepAssociation;
1724 keptProductsInEvent,
1727 for(
auto association : associationDescriptions) {
1728 if(!keepAssociation[association->branchID()]) {
1736 auto iter = keepAssociation.find(associationBranches.association());
1737 if(iter != keepAssociation.end() && iter->second) {
1738 temp->addAssociation(associationBranches);
1746 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1747 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1749 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1753 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n"
1754 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1755 <<
"that was explicitly dropped.\n";
1759 ProductRegistry::ProductList::iterator icopy = it;
1761 prodList.erase(icopy);
1770 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1774 void*
p = cp->New();
1777 if(edp->isMergeable()) {
1779 ProductRegistry::ProductList::iterator icopy = it;
1781 prodList.erase(icopy);
1791 std::unique_ptr<MakeProvenanceReader>
1808 std::shared_ptr<ProductProvenanceRetriever>
1825 virtual std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
1837 std::vector<ParentageID>
const& iParentageIDLookup,
1840 rootTree_(iRootTree),
1841 pProvVector_(&provVector_),
1842 parentageIDLookup_(iParentageIDLookup),
1843 daqProvenanceHelper_(daqProvenanceHelper),
1849 std::set<ProductProvenance>
1857 std::set<ProductProvenance> retValue;
1868 <<
"ReducedProvenanceReader::ReadProvenance\n"
1869 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n"
1870 <<
"This should never happen.\n"
1871 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1884 virtual std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1894 rootTree_(rootTree),
1896 pInfoVector_(&infoVector_),
1897 daqProvenanceHelper_(daqProvenanceHelper),
1901 std::set<ProductProvenance>
1908 std::set<ProductProvenance> retValue;
1916 retValue.emplace(
info);
1927 virtual std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1938 rootTree_(rootTree),
1940 pInfoVector_(&infoVector_),
1941 entryDescriptionMap_(theMap),
1942 daqProvenanceHelper_(daqProvenanceHelper),
1946 std::set<ProductProvenance>
1954 std::set<ProductProvenance> retValue;
1958 Parentage parentage(iter->second.parents());
1963 retValue.emplace(
info.branchID(), parentage.id());
1974 virtual std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
1981 std::set<ProductProvenance>
1984 return std::set<ProductProvenance>{};
1987 std::unique_ptr<ProvenanceReaderBase>
1992 std::unique_ptr<ProvenanceReaderBase>
1997 std::unique_ptr<ProvenanceReaderBase>
1999 return std::unique_ptr<ProvenanceReaderBase>(
new FullProvenanceReader(&rootTree, daqProvenanceHelper));
2002 std::unique_ptr<ProvenanceReaderBase>
void dropOnInput(ProductRegistry ®, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
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
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
static int const 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)
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_
EntryNumber_t firstEventEntryThisRun() const
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_
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
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 setRefCoreStreamer(bool resetAll=false)
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_
InputSource::ProcessingMode processingMode_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
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)
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
std::shared_ptr< ProductRegistry const > productRegistry() const
unsigned int LuminosityBlockNumber_t
virtual ~OldProvenanceReader()
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
TBranch * branchEntryInfoBranch() const
void advanceToNextLumiOrRun()
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
MakeReducedProvenanceReader(std::vector< ParentageID > const &parentageIDLookup)
virtual ~DummyProvenanceReader()
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)
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
std::string friendlyName(std::string const &iFullName)
static RunNumber_t const invalidRun
std::string const & entryDescriptionTreeName()
std::string const & fid() const
RootTree const & runTree() const
virtual std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
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()
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
Long64_t numEntries(TFile *hdl, std::string const &trname)
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
virtual std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
StreamID streamID() const
virtual std::set< ProductProvenance > readProvenance(unsigned int) const override
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
std::vector< BranchDescription const * > allBranchDescriptions() const
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
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()
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 stemFromPath(const std::string &path)
std::string const & parameterSetMapBranchName()
Hash< ProcessHistoryType > ProcessHistoryID
edm::propagate_const< std::unique_ptr< History > > history_
ProcessHistoryVector vector_type
std::vector< ProductProvenance > ProductProvenanceVector
std::string const & processHistoryBranchName()
IndexIntoFile & indexIntoFile_
virtual ~FullProvenanceReader()
void readEvent(EventPrincipal &cache)
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
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 EntryNumber_t const invalidEntry
SharedResourcesAcquirer resourceAcquirer_
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)
void fillBranchEntry(TBranch *branch, T *&pbuf)
static LuminosityBlockNumber_t const invalidLumi
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
virtual EventNumber_t getEventNumberOfEntry(roottree::EntryNumber entry) const override
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
std::vector< ParentageID > const & parentageIDLookup_
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_
EntryNumber_t firstEventEntryThisLumi() const
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_
SharedResourcesAcquirer resourceAcquirer_
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
std::vector< EventEntryInfo > * pInfoVector_
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()
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()
std::string const & branchListIndexesBranchName()
std::vector< ParentageID > parentageIDLookup_
void fillThisEventAuxiliary()
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
volatile std::atomic< bool > shutdown_flag false
void markBranchToBeDropped(bool dropDescendants, BranchID const &branchID, std::set< BranchID > &branchesToDrop) const
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)
bool insertMapped(value_type const &v)
virtual std::set< ProductProvenance > readProvenance(unsigned int) const override
IndexIntoFile::IndexIntoFileItr indexIntoFileIter() const
std::string const & newBranchToOldBranch(std::string const &newBranch) const
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)
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
unsigned int const defaultLearningEntries
EntryNumber_t entry() const
std::vector< EventEntryInfo > infoVector_
LuminosityBlockNumber_t peekAheadAtLumi() const
std::string const & fileIdentifierBranchName()
SharedResourcesAcquirer resourceAcquirer_
std::string const & wrappedName() const
virtual ~RootFileEventFinder()
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()
DaqProvenanceHelper const * daqProvenanceHelper_
std::string createGlobalIdentifier()
void copyProduct(BranchDescription const &productdesc)
void readEventHistoryTree()
void setEntryNumber(EntryNumber theEntryNumber)
void reportOpened(std::string const &inputType)