54 #include "TTreeCache.h"
88 if(inxBegin == inxEnd)
return 0;
89 int defaultOffset = (inxBegin.
run() != 0 ? 0 : 1);
90 int offset = (forcedRunNumber != 0U ? forcedRunNumber - inxBegin.
run() : defaultOffset);
93 <<
"The value of the 'setRunNumber' parameter must not be\n"
94 <<
"less than the first run number in the first input file.\n"
95 <<
"'setRunNumber' was " << forcedRunNumber <<
", while the first run was "
96 << forcedRunNumber - offset <<
".\n";
102 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
104 releaseversion::DecomposedReleaseVersion currentRelease(releaseVersion);
105 for(
auto const& ph : processHistoryVector) {
106 for(
auto const& pc : ph) {
110 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n"
111 <<
"Forward compatibility cannot be supported.\n";
131 return eventAux.
event();
142 boost::shared_ptr<InputFile> filePtr,
143 boost::shared_ptr<EventSkipperByID> eventSkipperByID,
147 unsigned int nStreams,
148 unsigned int treeCacheSize,
149 int treeMaxVirtualSize,
155 boost::shared_ptr<BranchIDListHelper> branchIDListHelper,
156 boost::shared_ptr<DuplicateChecker> duplicateChecker,
157 bool dropDescendants,
159 std::vector<boost::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
160 std::vector<boost::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
161 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
162 bool bypassVersionCheck,
163 bool labelRawDataLikeMC,
165 bool enablePrefetching,
166 bool enforceGUIDInFileName) :
168 logicalFile_(logicalFileName),
169 processConfiguration_(processConfiguration),
170 processHistoryRegistry_(&processHistoryRegistry),
172 eventSkipperByID_(eventSkipperByID),
173 fileFormatVersion_(),
176 indexIntoFile_(*indexIntoFileSharedPtr_),
177 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
179 indexIntoFileEnd_(indexIntoFileBegin_),
180 indexIntoFileIter_(indexIntoFileBegin_),
181 eventProcessHistoryIDs_(),
182 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
183 savedRunAuxiliary_(),
184 skipAnyEvents_(skipAnyEvents),
185 noEventSort_(noEventSort),
186 enforceGUIDInFileName_(enforceGUIDInFileName),
187 whyNotFastClonable_(0),
188 hasNewlyDroppedBranch_(),
189 branchListIndexesUnchanged_(
false),
198 branchIDListHelper_(branchIDListHelper),
199 processingMode_(processingMode),
201 newBranchToOldBranch_(),
203 eventSelectionIDs_(),
204 branchListIndexes_(),
207 duplicateChecker_(duplicateChecker),
208 provenanceAdaptor_(),
209 provenanceReaderMaker_(),
210 eventProductProvenanceRetrievers_(),
211 parentageIDLookup_(),
212 daqProvenanceHelper_() {
223 if(
nullptr == metaDataTree.get()) {
225 <<
" in the input file.\n";
234 fft->SetAddress(&fftPtr);
255 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
257 PsetMap *psetMapPtr = &psetMap;
266 if(
nullptr == psetTree.get()) {
268 <<
" in the input file.\n";
271 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
273 IdToBlobs* pIdToBlob = &idToBlob;
277 psetTreeCache->SetEnablePrefetching(
false);
278 filePtr_->SetCacheRead(psetTreeCache.get());
279 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
280 psetTree->GetEntry(
i);
281 psetMap.insert(idToBlob);
306 std::unique_ptr<BranchIDLists> branchIDListsAPtr(
new BranchIDLists);
345 for(
auto const& psetEntry : psetMap) {
347 pset.
setID(psetEntry.first);
357 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true));
364 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false));
369 <<
"Failed to find branchIDLists branch in metaData tree.\n";
374 if(!bypassVersionCheck) {
375 checkReleaseVersion(pHistVector,
file());
378 if(labelRawDataLikeMC) {
382 BranchKey finder(rawData, source,
"",
"");
383 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
384 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
399 it = pList.lower_bound(finder);
400 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
410 for(
auto const& history : pHistVector) {
441 for(
auto& product : pList) {
452 for(
auto const& product : prodList) {
456 newReg->copyProduct(prod);
460 <<
"Cannot change friendly class name algorithm without more development work\n"
461 <<
"to update BranchIDLists. Contact the framework group.\n";
465 newReg->copyProduct(newBD);
469 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
477 for(
auto const& product : prodList) {
507 if(
nullptr == entryDescriptionTree.get()) {
509 <<
" in the input file.\n";
525 if(idBuffer != entryDescriptionBuffer.
id()) {
528 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
553 if(
nullptr == parentageTree.get()) {
555 <<
" in the input file.\n";
638 std::unique_ptr<FileBlock>
807 phid_(phid), run_(run) {}
811 struct RunItemSortByRun {
812 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
813 return a.run_ < b.run_;
816 struct RunItemSortByRunPhid {
817 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
818 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
824 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
825 lastEventEntry_(entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry : entry + 1) {}
832 struct LumiItemSortByRunLumi {
833 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
834 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
837 struct LumiItemSortByRunLumiPhid {
838 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
839 if(a.run_ < b.run_)
return true;
840 if(b.run_ < a.run_)
return false;
841 if(a.lumi_ < b.lumi_)
return true;
842 if(b.lumi_ < a.lumi_)
return false;
843 return a.phid_ < b.phid_;
859 typedef std::list<LumiItem> LumiList;
862 typedef std::set<LuminosityBlockID> RunLumiSet;
863 RunLumiSet runLumiSet;
865 typedef std::list<RunItem>
RunList;
868 typedef std::set<RunNumber_t> RunSet;
871 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
872 RunItemSet runItemSet;
874 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
888 bool newLumi =
false;
899 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
901 newRun = newLumi =
true;
902 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
905 prevPhid = reducedPHID;
909 lumis.emplace_back(reducedPHID,
913 LumiItem& currentLumi = lumis.back();
915 ++currentLumi.lastEventEntry_;
920 if(runItemSet.insert(item).second) {
921 runs.push_back(std::move(item));
923 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
934 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
937 typedef std::vector<RunItem> RunVector;
947 if(runSet.insert(runAux->run()).
second) {
949 emptyRuns.emplace_back(reducedPHID, runAux->run());
952 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
959 RunItemSortByRun runItemSortByRun;
962 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
963 for(
auto const& emptyRun : emptyRuns) {
964 for(; itRuns != endRuns; ++itRuns) {
965 if(runItemSortByRun(emptyRun, *itRuns)) {
969 runs.insert(itRuns, emptyRun);
974 typedef std::vector<LumiItem> LumiVector;
975 LumiVector emptyLumis;
977 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
978 RunLumiMap runLumiMap;
985 if(runLumiSet.insert(lumiID).second) {
990 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
991 assert(iPhidMap != phidMap.end());
1001 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1004 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1005 for(
auto const& emptyLumi : emptyLumis) {
1006 for(; itLumis != endLumis; ++itLumis) {
1007 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1011 lumis.insert(itLumis, emptyLumi);
1016 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1017 RunCountMap runCountMap;
1019 assert(phids.empty());
1021 assert(entries.empty());
1023 for(
auto&
run : runs) {
1024 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1025 if(countMapItem == runCountMap.end()) {
1026 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1027 assert(countMapItem != runCountMap.end());
1030 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1031 if(phidItem == phids.end()) {
1032 phids.push_back(
run.phid_);
1033 phidItem = phids.end() - 1;
1035 entries.emplace_back(
1036 countMapItem->second,
1039 phidItem - phids.begin(),
1047 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1048 LumiCountMap lumiCountMap;
1050 for(
auto&
lumi : lumis) {
1051 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1052 assert(runCountMapItem != runCountMap.end());
1053 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1054 if(countMapItem == lumiCountMap.end()) {
1055 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1056 assert(countMapItem != lumiCountMap.end());
1059 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1060 assert(phidItem != phids.end());
1061 entries.emplace_back(
1062 runCountMapItem->second,
1063 countMapItem->second,
1065 phidItem - phids.begin(),
1068 lumi.firstEventEntry_,
1069 lumi.lastEventEntry_);
1081 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1085 if (guidFromName !=
fid_.
fid()) {
1087 <<
"GUID " << guidFromName <<
" extracted from file name " <<
file_
1088 <<
" is inconsistent with the GUID read from the file " <<
fid_.
fid();
1099 for(
auto& phid : phidVec) {
1116 bool needEventNumbers =
false;
1118 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1119 needEventNumbers =
true;
1121 bool needEventEntries =
false;
1124 needEventEntries =
true;
1148 treePointer->close();
1149 treePointer =
nullptr;
1204 if(!eventHistoryBranch) {
1206 <<
"Failed to find history branch in event history tree.\n";
1208 eventHistoryBranch->SetAddress(&pHistory);
1217 assert(eventSelectionIDBranch !=
nullptr);
1221 assert(branchListIndexesBranch !=
nullptr);
1240 boost::shared_ptr<LuminosityBlockAuxiliary>
1253 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1256 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1261 return lumiAuxiliary;
1264 boost::shared_ptr<RunAuxiliary>
1266 boost::shared_ptr<RunAuxiliary> runAuxiliary(
new RunAuxiliary);
1272 RunAux *pRunAux = &runAux;
1277 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1280 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1282 return runAuxiliary;
1443 boost::shared_ptr<RunAuxiliary>
1467 filePtr_->reportInputRunNumber(runAuxiliary->run());
1496 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1504 return runAuxiliary;
1524 boost::shared_ptr<LuminosityBlockAuxiliary>
1541 boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary =
fillLumiAuxiliary();
1545 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1559 return lumiAuxiliary;
1638 <<
"The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1656 <<
"Failed to find the event history tree.\n";
1663 std::vector<boost::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1664 std::vector<boost::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1671 currentIndexIntoFile);
1685 std::set<BranchID> branchesToDrop;
1686 for(
auto const& product : prodList) {
1688 if(!productSelector.
selected(prod)) {
1689 if(dropDescendants) {
1692 branchesToDrop.insert(prod.
branchID());
1698 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1699 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1701 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1703 if(productSelector.
selected(prod)) {
1705 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n"
1706 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1707 <<
"that was explicitly dropped.\n";
1711 ProductRegistry::ProductList::iterator icopy = it;
1713 prodList.erase(icopy);
1722 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1727 if(edp.isMergeable()) {
1729 ProductRegistry::ProductList::iterator icopy = it;
1731 prodList.erase(icopy);
1741 std::unique_ptr<MakeProvenanceReader>
1758 boost::shared_ptr<ProductProvenanceRetriever>
1786 std::vector<ParentageID>
const& iParentageIDLookup,
1789 rootTree_(iRootTree),
1790 pProvVector_(&provVector_),
1791 parentageIDLookup_(iParentageIDLookup),
1792 daqProvenanceHelper_(daqProvenanceHelper),
1816 <<
"ReducedProvenanceReader::ReadProvenance\n"
1817 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n"
1818 <<
"This should never happen.\n"
1819 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1841 rootTree_(rootTree),
1843 pInfoVector_(&infoVector_),
1844 daqProvenanceHelper_(daqProvenanceHelper),
1883 rootTree_(rootTree),
1885 pInfoVector_(&infoVector_),
1886 entryDescriptionMap_(theMap),
1887 daqProvenanceHelper_(daqProvenanceHelper),
1902 Parentage parentage(iter->second.parents());
1932 std::unique_ptr<ProvenanceReaderBase>
1937 std::unique_ptr<ProvenanceReaderBase>
1942 std::unique_ptr<ProvenanceReaderBase>
1944 return std::unique_ptr<ProvenanceReaderBase>(
new FullProvenanceReader(&rootTree, daqProvenanceHelper));
1947 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
virtual void readProvenance(ProductProvenanceRetriever const &provRetriever, unsigned int) const override
void setID(ParameterSetID const &id)
EventNumber_t event() const
std::string const & idToParameterSetBlobsBranchName()
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
std::vector< ProcessConfiguration > ProcessConfigurationVector
std::string const & branchName() const
boost::shared_ptr< BranchChildren > branchChildren_
StoredProductProvenanceVector provVector_
bool selected(BranchDescription const &desc) const
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
unsigned int const defaultNonEventLearningEntries
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
std::unique_ptr< History > history_
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()
static LuminosityBlockID firstValidLuminosityBlock()
std::vector< BranchIDList > BranchIDLists
std::string const & entryDescriptionBranchName()
bool skipEvents(int &offset)
FileFormatVersion fileFormatVersion() const
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)
StoredProductProvenanceVector * pProvVector_
bool enforceGUIDInFileName_
unsigned int EventNumber_t
static PFTauRenderPlugin instance
MakeOldProvenanceReader(std::unique_ptr< EntryDescriptionMap > &&entryDescriptionMap)
std::vector< BranchID > & parentsForUpdate()
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
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
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
boost::shared_ptr< BranchIDLists const > branchIDLists_
std::string const & eventSelectionsBranchName()
InputSource::ProcessingMode processingMode_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
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
static RunID firstValidRun()
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 void readProvenance(ProductProvenanceRetriever const &provRetriever, unsigned int) const override
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
unsigned int LuminosityBlockNumber_t
virtual ~OldProvenanceReader()
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
TBranch * branchEntryInfoBranch() const
void advanceToNextLumiOrRun()
void readImmediate() const
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
LuminosityBlockNumber_t luminosityBlock() const
FileFormatVersion fileFormatVersion_
TTree const * metaTree() const
std::string const & parameterSetsTreeName()
void setPosition(IndexIntoFile::IndexIntoFileItr const &position)
ProductList const & productList() const
U second(std::pair< T, U > const &p)
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
virtual void readProvenance(ProductProvenanceRetriever const &provRetriever, unsigned int transitionIndex) const override
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
TTree const * tree() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
virtual void readProvenance(ProductProvenanceRetriever const &provRetriever, unsigned int transitionIndex) const override
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
std::unique_ptr< EntryDescriptionMap > entryDescriptionMap_
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
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
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)
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, boost::shared_ptr< InputFile > filePtr, boost::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunNumber_t const &forcedRunNumber, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, boost::shared_ptr< BranchIDListHelper > branchIDListHelper, boost::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching, bool enforceGUIDInFileName)
Long64_t numEntries(TFile *hdl, std::string const &trname)
EventAuxiliary const & eventAux() const
EventSelectionIDVector eventSelectionIDs_
int processHistoryIDIndex() const
bool isEarlierRelease(std::string const &a, std::string const &b)
int whyNotFastClonable() const
StreamID streamID() const
BranchType branchType() const
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
WrapperInterfaceBase const * getInterface() const
void updateFriendlyClassName()
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
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
unsigned int offset(bool)
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
std::vector< boost::shared_ptr< ProductProvenanceRetriever > > eventProductProvenanceRetrievers_
IndexIntoFile::EntryNumber_t EntryNumber
bool wasFirstEventJustRead() const
std::string stemFromPath(const std::string &path)
std::string const & parameterSetMapBranchName()
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryVector vector_type
std::vector< ProductProvenance > ProductProvenanceVector
void readImmediate() const
std::string const & processHistoryBranchName()
IndexIntoFile & indexIntoFile_
virtual ~FullProvenanceReader()
void readEvent(EventPrincipal &cache)
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()
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
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
virtual EventNumber_t getEventNumberOfEntry(roottree::EntryNumber entry) const override
std::string const & parentageBranchName()
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
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::vector< StoredProductProvenance > StoredProductProvenanceVector
boost::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
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
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
bool branchListIndexesUnchanged_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void setEventFinder(boost::shared_ptr< EventFinder > ptr) const
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)
boost::shared_ptr< ProductRegistry const > productRegistry_
static int position[264][3]
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
std::string const & productDependenciesBranchName()
void setNumberOfEvents(EntryNumber_t nevents) const
void overrideRunNumber(RunID &id)
std::string const & entryDescriptionIDBranchName()
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
boost::shared_ptr< InputFile > filePtr_
void initializeDuplicateChecker(std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
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)
ProcessHistoryRegistry * processHistoryRegistry_
volatile std::atomic< bool > shutdown_flag false
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
void validateFile(InputType inputType, bool usingGoToEvent)
bool insertMapped(value_type const &v)
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
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
EntryNumber_t entry() const
std::vector< EventEntryInfo > infoVector_
TTree * eventHistoryTree_
LuminosityBlockNumber_t peekAheadAtLumi() const
std::string const & fileIdentifierBranchName()
SharedResourcesAcquirer resourceAcquirer_
boost::shared_ptr< ProductRegistry const > productRegistry() const
std::string const & wrappedName() const
virtual ~RootFileEventFinder()
EventNumber_t event() const
std::string const & moduleDescriptionMapBranchName()
bool insertMapped(value_type const &v)
boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
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)
void insertIntoSet(ProductProvenance const &provenanceProduct) const