53 #include "TTreeCache.h"
87 if(inxBegin == inxEnd)
return 0;
88 int defaultOffset = (inxBegin.
run() != 0 ? 0 : 1);
89 int offset = (forcedRunNumber != 0U ? forcedRunNumber - inxBegin.
run() : defaultOffset);
92 <<
"The value of the 'setRunNumber' parameter must not be\n"
93 <<
"less than the first run number in the first input file.\n"
94 <<
"'setRunNumber' was " << forcedRunNumber <<
", while the first run was "
95 << forcedRunNumber - offset <<
".\n";
101 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
103 releaseversion::DecomposedReleaseVersion currentRelease(releaseVersion);
104 for(
auto const& ph : processHistoryVector) {
105 for(
auto const& pc : ph) {
109 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n"
110 <<
"Forward compatibility cannot be supported.\n";
130 return eventAux.
event();
141 boost::shared_ptr<InputFile> filePtr,
142 boost::shared_ptr<EventSkipperByID> eventSkipperByID,
146 unsigned int nStreams,
147 unsigned int treeCacheSize,
148 int treeMaxVirtualSize,
154 boost::shared_ptr<BranchIDListHelper> branchIDListHelper,
155 boost::shared_ptr<DuplicateChecker> duplicateChecker,
156 bool dropDescendants,
158 std::vector<boost::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
159 std::vector<boost::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
160 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
161 bool bypassVersionCheck,
162 bool labelRawDataLikeMC,
164 bool enablePrefetching) :
166 logicalFile_(logicalFileName),
167 processConfiguration_(processConfiguration),
168 processHistoryRegistry_(&processHistoryRegistry),
170 eventSkipperByID_(eventSkipperByID),
171 fileFormatVersion_(),
174 indexIntoFile_(*indexIntoFileSharedPtr_),
175 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
177 indexIntoFileEnd_(indexIntoFileBegin_),
178 indexIntoFileIter_(indexIntoFileBegin_),
179 eventProcessHistoryIDs_(),
180 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
181 savedRunAuxiliary_(),
182 skipAnyEvents_(skipAnyEvents),
183 noEventSort_(noEventSort),
184 whyNotFastClonable_(0),
185 hasNewlyDroppedBranch_(),
186 branchListIndexesUnchanged_(
false),
195 branchIDListHelper_(branchIDListHelper),
196 processingMode_(processingMode),
198 newBranchToOldBranch_(),
200 eventSelectionIDs_(),
201 branchListIndexes_(),
204 duplicateChecker_(duplicateChecker),
205 provenanceAdaptor_(),
206 provenanceReaderMaker_(),
207 eventProductProvenanceRetrievers_(),
208 parentageIDLookup_(),
209 daqProvenanceHelper_() {
220 if(
nullptr == metaDataTree.get()) {
222 <<
" in the input file.\n";
231 fft->SetAddress(&fftPtr);
252 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
254 PsetMap *psetMapPtr = &psetMap;
263 if(
nullptr == psetTree.get()) {
265 <<
" in the input file.\n";
268 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
270 IdToBlobs* pIdToBlob = &idToBlob;
274 psetTreeCache->SetEnablePrefetching(
false);
275 filePtr_->SetCacheRead(psetTreeCache.get());
276 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
277 psetTree->GetEntry(
i);
278 psetMap.insert(idToBlob);
303 std::unique_ptr<BranchIDLists> branchIDListsAPtr(
new BranchIDLists);
342 for(
auto const& psetEntry : psetMap) {
344 pset.
setID(psetEntry.first);
354 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true));
361 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false));
366 <<
"Failed to find branchIDLists branch in metaData tree.\n";
371 if(!bypassVersionCheck) {
372 checkReleaseVersion(pHistVector,
file());
375 if(labelRawDataLikeMC) {
379 BranchKey finder(rawData, source,
"",
"");
380 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
381 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
396 it = pList.lower_bound(finder);
397 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
407 for(
auto const& history : pHistVector) {
438 for(
auto& product : pList) {
449 for(
auto const& product : prodList) {
453 newReg->copyProduct(prod);
457 <<
"Cannot change friendly class name algorithm without more development work\n"
458 <<
"to update BranchIDLists. Contact the framework group.\n";
462 newReg->copyProduct(newBD);
466 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
474 for(
auto const& product : prodList) {
504 if(
nullptr == entryDescriptionTree.get()) {
506 <<
" in the input file.\n";
522 if(idBuffer != entryDescriptionBuffer.
id()) {
525 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
550 if(
nullptr == parentageTree.get()) {
552 <<
" in the input file.\n";
635 std::unique_ptr<FileBlock>
804 phid_(phid), run_(run) {}
808 struct RunItemSortByRun {
809 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
810 return a.run_ < b.run_;
813 struct RunItemSortByRunPhid {
814 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
815 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
821 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
822 lastEventEntry_(entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry : entry + 1) {}
829 struct LumiItemSortByRunLumi {
830 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
831 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
834 struct LumiItemSortByRunLumiPhid {
835 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
836 if(a.run_ < b.run_)
return true;
837 if(b.run_ < a.run_)
return false;
838 if(a.lumi_ < b.lumi_)
return true;
839 if(b.lumi_ < a.lumi_)
return false;
840 return a.phid_ < b.phid_;
856 typedef std::list<LumiItem> LumiList;
859 typedef std::set<LuminosityBlockID> RunLumiSet;
860 RunLumiSet runLumiSet;
862 typedef std::list<RunItem>
RunList;
865 typedef std::set<RunNumber_t> RunSet;
868 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
869 RunItemSet runItemSet;
871 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
885 bool newLumi =
false;
896 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
898 newRun = newLumi =
true;
899 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
902 prevPhid = reducedPHID;
906 lumis.emplace_back(reducedPHID,
910 LumiItem& currentLumi = lumis.back();
912 ++currentLumi.lastEventEntry_;
917 if(runItemSet.insert(item).second) {
918 runs.push_back(std::move(item));
920 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
931 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
934 typedef std::vector<RunItem> RunVector;
944 if(runSet.insert(runAux->run()).
second) {
946 emptyRuns.emplace_back(reducedPHID, runAux->run());
949 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
956 RunItemSortByRun runItemSortByRun;
959 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
960 for(
auto const& emptyRun : emptyRuns) {
961 for(; itRuns != endRuns; ++itRuns) {
962 if(runItemSortByRun(emptyRun, *itRuns)) {
966 runs.insert(itRuns, emptyRun);
971 typedef std::vector<LumiItem> LumiVector;
972 LumiVector emptyLumis;
974 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
975 RunLumiMap runLumiMap;
982 if(runLumiSet.insert(lumiID).second) {
987 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
988 assert(iPhidMap != phidMap.end());
998 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1001 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1002 for(
auto const& emptyLumi : emptyLumis) {
1003 for(; itLumis != endLumis; ++itLumis) {
1004 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1008 lumis.insert(itLumis, emptyLumi);
1013 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1014 RunCountMap runCountMap;
1016 assert(phids.empty());
1018 assert(entries.empty());
1020 for(
auto&
run : runs) {
1021 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1022 if(countMapItem == runCountMap.end()) {
1023 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1024 assert(countMapItem != runCountMap.end());
1027 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1028 if(phidItem == phids.end()) {
1029 phids.push_back(
run.phid_);
1030 phidItem = phids.end() - 1;
1032 entries.emplace_back(
1033 countMapItem->second,
1036 phidItem - phids.begin(),
1044 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1045 LumiCountMap lumiCountMap;
1047 for(
auto&
lumi : lumis) {
1048 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1049 assert(runCountMapItem != runCountMap.end());
1050 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1051 if(countMapItem == lumiCountMap.end()) {
1052 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1053 assert(countMapItem != lumiCountMap.end());
1056 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1057 assert(phidItem != phids.end());
1058 entries.emplace_back(
1059 runCountMapItem->second,
1060 countMapItem->second,
1062 phidItem - phids.begin(),
1065 lumi.firstEventEntry_,
1066 lumi.lastEventEntry_);
1078 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1088 for(
auto& phid : phidVec) {
1105 bool needEventNumbers =
false;
1107 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1108 needEventNumbers =
true;
1110 bool needEventEntries =
false;
1113 needEventEntries =
true;
1137 treePointer->close();
1138 treePointer =
nullptr;
1193 if(!eventHistoryBranch) {
1195 <<
"Failed to find history branch in event history tree.\n";
1197 eventHistoryBranch->SetAddress(&pHistory);
1206 assert(eventSelectionIDBranch !=
nullptr);
1210 assert(branchListIndexesBranch !=
nullptr);
1229 boost::shared_ptr<LuminosityBlockAuxiliary>
1242 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1245 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1250 return lumiAuxiliary;
1253 boost::shared_ptr<RunAuxiliary>
1255 boost::shared_ptr<RunAuxiliary> runAuxiliary(
new RunAuxiliary);
1261 RunAux *pRunAux = &runAux;
1266 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1269 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1271 return runAuxiliary;
1432 boost::shared_ptr<RunAuxiliary>
1456 filePtr_->reportInputRunNumber(runAuxiliary->run());
1485 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1493 return runAuxiliary;
1513 boost::shared_ptr<LuminosityBlockAuxiliary>
1530 boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary =
fillLumiAuxiliary();
1534 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1548 return lumiAuxiliary;
1627 <<
"The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1645 <<
"Failed to find the event history tree.\n";
1652 std::vector<boost::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1653 std::vector<boost::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1660 currentIndexIntoFile);
1674 std::set<BranchID> branchesToDrop;
1675 for(
auto const& product : prodList) {
1677 if(!productSelector.
selected(prod)) {
1678 if(dropDescendants) {
1681 branchesToDrop.insert(prod.
branchID());
1687 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1688 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1690 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1692 if(productSelector.
selected(prod)) {
1694 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n"
1695 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1696 <<
"that was explicitly dropped.\n";
1700 ProductRegistry::ProductList::iterator icopy = it;
1702 prodList.erase(icopy);
1711 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1716 if(edp.isMergeable()) {
1718 ProductRegistry::ProductList::iterator icopy = it;
1720 prodList.erase(icopy);
1730 std::unique_ptr<MakeProvenanceReader>
1747 boost::shared_ptr<ProductProvenanceRetriever>
1775 std::vector<ParentageID>
const& iParentageIDLookup,
1778 rootTree_(iRootTree),
1779 pProvVector_(&provVector_),
1780 parentageIDLookup_(iParentageIDLookup),
1781 daqProvenanceHelper_(daqProvenanceHelper),
1805 <<
"ReducedProvenanceReader::ReadProvenance\n"
1806 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n"
1807 <<
"This should never happen.\n"
1808 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1830 rootTree_(rootTree),
1832 pInfoVector_(&infoVector_),
1833 daqProvenanceHelper_(daqProvenanceHelper),
1872 rootTree_(rootTree),
1874 pInfoVector_(&infoVector_),
1875 entryDescriptionMap_(theMap),
1876 daqProvenanceHelper_(daqProvenanceHelper),
1891 Parentage parentage(iter->second.parents());
1921 std::unique_ptr<ProvenanceReaderBase>
1926 std::unique_ptr<ProvenanceReaderBase>
1931 std::unique_ptr<ProvenanceReaderBase>
1933 return std::unique_ptr<ProvenanceReaderBase>(
new FullProvenanceReader(&rootTree, daqProvenanceHelper));
1936 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_
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
static int position[TOTALCHAMBERS][3]
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)
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 const & parameterSetMapBranchName()
Hash< ProcessHistoryType > ProcessHistoryID
ProcessHistoryVector vector_type
std::vector< ProductProvenance > ProductProvenanceVector
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
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
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)
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 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_
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