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 std::shared_ptr<InputFile> filePtr,
143 std::shared_ptr<EventSkipperByID> eventSkipperByID,
147 unsigned int nStreams,
148 unsigned int treeCacheSize,
149 int treeMaxVirtualSize,
155 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
156 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
157 std::vector<BranchID>
const& associationsFromSecondary,
158 std::shared_ptr<DuplicateChecker> duplicateChecker,
159 bool dropDescendants,
161 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
162 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
163 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
164 bool bypassVersionCheck,
165 bool labelRawDataLikeMC,
167 bool enablePrefetching) :
169 logicalFile_(logicalFileName),
170 processConfiguration_(processConfiguration),
171 processHistoryRegistry_(&processHistoryRegistry),
173 eventSkipperByID_(eventSkipperByID),
174 fileFormatVersion_(),
177 indexIntoFile_(*indexIntoFileSharedPtr_),
178 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
180 indexIntoFileEnd_(indexIntoFileBegin_),
181 indexIntoFileIter_(indexIntoFileBegin_),
182 eventProcessHistoryIDs_(),
183 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
184 savedRunAuxiliary_(),
185 skipAnyEvents_(skipAnyEvents),
186 noEventSort_(noEventSort),
187 whyNotFastClonable_(0),
188 hasNewlyDroppedBranch_(),
189 branchListIndexesUnchanged_(
false),
198 branchIDListHelper_(branchIDListHelper),
199 fileThinnedAssociationsHelper_(),
200 thinnedAssociationsHelper_(thinnedAssociationsHelper),
201 processingMode_(processingMode),
203 newBranchToOldBranch_(),
205 eventSelectionIDs_(),
206 branchListIndexes_(),
209 duplicateChecker_(duplicateChecker),
210 provenanceAdaptor_(),
211 provenanceReaderMaker_(),
212 eventProductProvenanceRetrievers_(),
213 parentageIDLookup_(),
214 daqProvenanceHelper_(),
215 edProductClass_(TClass::GetClass(
"edm::WrapperBase")) {
226 if(
nullptr == metaDataTree.get()) {
228 <<
" in the input file.\n";
237 fft->SetAddress(&fftPtr);
258 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
260 PsetMap *psetMapPtr = &psetMap;
269 if(
nullptr == psetTree.get()) {
271 <<
" in the input file.\n";
274 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
276 IdToBlobs* pIdToBlob = &idToBlob;
280 psetTreeCache->SetEnablePrefetching(
false);
281 filePtr_->SetCacheRead(psetTreeCache.get());
282 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
283 psetTree->GetEntry(
i);
284 psetMap.insert(idToBlob);
309 std::unique_ptr<BranchIDLists> branchIDListsAPtr(
new BranchIDLists);
356 for(
auto const& psetEntry : psetMap) {
358 pset.
setID(psetEntry.first);
368 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true));
375 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false));
380 <<
"Failed to find branchIDLists branch in metaData tree.\n";
388 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
392 if(!bypassVersionCheck) {
393 checkReleaseVersion(pHistVector,
file());
396 if(labelRawDataLikeMC) {
400 BranchKey finder(rawData, source,
"",
"");
401 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
402 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
417 it = pList.lower_bound(finder);
418 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
428 for(
auto const& history : pHistVector) {
459 for(
auto& product : pList) {
470 for(
auto const& product : prodList) {
474 newReg->copyProduct(prod);
478 <<
"Cannot change friendly class name algorithm without more development work\n"
479 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
483 newReg->copyProduct(newBD);
487 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
491 associationsFromSecondary);
500 for(
auto const& product : prodList) {
530 if(
nullptr == entryDescriptionTree.get()) {
532 <<
" in the input file.\n";
548 if(idBuffer != entryDescriptionBuffer.
id()) {
551 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
576 if(
nullptr == parentageTree.get()) {
578 <<
" in the input file.\n";
661 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),
853 lastEventEntry_(entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry : entry + 1) {}
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) {
949 runs.push_back(std::move(item));
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);
1260 std::shared_ptr<LuminosityBlockAuxiliary>
1262 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1273 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1276 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1281 return lumiAuxiliary;
1284 std::shared_ptr<RunAuxiliary>
1286 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1292 RunAux *pRunAux = &runAux;
1297 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1300 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1302 return runAuxiliary;
1463 std::shared_ptr<RunAuxiliary>
1487 filePtr_->reportInputRunNumber(runAuxiliary->run());
1516 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1524 return runAuxiliary;
1544 std::shared_ptr<LuminosityBlockAuxiliary>
1565 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1579 return lumiAuxiliary;
1658 <<
"The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1676 <<
"Failed to find the event history tree.\n";
1683 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1684 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1691 currentIndexIntoFile);
1699 if(dropDescendants) {
1702 branchesToDrop.insert(branchID);
1713 std::vector<BranchDescription const*> associationDescriptions;
1717 std::set<BranchID> branchesToDrop;
1718 for(
auto const& product : prodList) {
1723 associationDescriptions.push_back(&prod);
1727 }
else if(!productSelector.
selected(prod)) {
1741 std::set<BranchID> keptProductsInEvent;
1742 for(
auto const& product : prodList) {
1744 if( branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() &&
1747 keptProductsInEvent.insert(prod.
branchID());
1752 std::map<BranchID, bool> keepAssociation;
1754 keptProductsInEvent,
1757 for(
auto association : associationDescriptions) {
1758 if(!keepAssociation[association->branchID()]) {
1766 auto iter = keepAssociation.find(associationBranches.association());
1767 if(
iter != keepAssociation.end() &&
iter->second) {
1768 temp->addAssociation(associationBranches);
1775 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1776 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1778 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1782 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n"
1783 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1784 <<
"that was explicitly dropped.\n";
1788 ProductRegistry::ProductList::iterator icopy = it;
1790 prodList.erase(icopy);
1799 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1803 void*
p = cp->New();
1806 if(edp->isMergeable()) {
1808 ProductRegistry::ProductList::iterator icopy = it;
1810 prodList.erase(icopy);
1820 std::unique_ptr<MakeProvenanceReader>
1837 std::shared_ptr<ProductProvenanceRetriever>
1865 std::vector<ParentageID>
const& iParentageIDLookup,
1868 rootTree_(iRootTree),
1869 pProvVector_(&provVector_),
1870 parentageIDLookup_(iParentageIDLookup),
1871 daqProvenanceHelper_(daqProvenanceHelper),
1895 <<
"ReducedProvenanceReader::ReadProvenance\n"
1896 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n"
1897 <<
"This should never happen.\n"
1898 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1920 rootTree_(rootTree),
1922 pInfoVector_(&infoVector_),
1923 daqProvenanceHelper_(daqProvenanceHelper),
1962 rootTree_(rootTree),
1964 pInfoVector_(&infoVector_),
1965 entryDescriptionMap_(theMap),
1966 daqProvenanceHelper_(daqProvenanceHelper),
1981 Parentage parentage(iter->second.parents());
2011 std::unique_ptr<ProvenanceReaderBase>
2016 std::unique_ptr<ProvenanceReaderBase>
2021 std::unique_ptr<ProvenanceReaderBase>
2023 return std::unique_ptr<ProvenanceReaderBase>(
new FullProvenanceReader(&rootTree, daqProvenanceHelper));
2026 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::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper_
std::string const & idToParameterSetBlobsBranchName()
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
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
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::shared_ptr< BranchIDLists const > branchIDLists_
std::string const & entryDescriptionBranchName()
bool skipEvents(int &offset)
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)
StoredProductProvenanceVector * pProvVector_
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_
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()
InputSource::ProcessingMode processingMode_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
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
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()
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
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
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
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)
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)
int whyNotFastClonable() const
StreamID streamID() 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, RunNumber_t const &forcedRunNumber, 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)
BranchType branchType() const
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
std::vector< std::shared_ptr< ProductProvenanceRetriever > > eventProductProvenanceRetrievers_
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::type_info const & typeInfo() const
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
IndexIntoFile::EntryNumber_t EntryNumber
bool wasFirstEventJustRead() const
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()
std::shared_ptr< InputFile > filePtr_
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()
std::unique_ptr< ThinnedAssociationsHelper > fileThinnedAssociationsHelper_
std::shared_ptr< EventSkipperByID > eventSkipperByID_
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
virtual EventNumber_t getEventNumberOfEntry(roottree::EntryNumber entry) const override
std::string const & parentageBranchName()
std::shared_ptr< BranchChildren > branchChildren_
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
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
bool branchListIndexesUnchanged_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
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::shared_ptr< DuplicateChecker > duplicateChecker_
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()
void overrideRunNumber(RunID &id)
std::string const & entryDescriptionIDBranchName()
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)
ProcessHistoryRegistry * processHistoryRegistry_
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
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
EntryNumber_t entry() const
std::vector< EventEntryInfo > infoVector_
TTree * eventHistoryTree_
LuminosityBlockNumber_t peekAheadAtLumi() const
std::string const & fileIdentifierBranchName()
SharedResourcesAcquirer resourceAcquirer_
std::shared_ptr< RunAuxiliary > savedRunAuxiliary_
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)
void insertIntoSet(ProductProvenance const &provenanceProduct) const