55 #include "TTreeCache.h"
88 checkReleaseVersion(std::vector<ProcessHistory> processHistoryVector,
std::string const&
fileName) {
91 for(
auto const& ph : processHistoryVector) {
92 for(
auto const& pc : ph) {
96 <<
"a release (" << pc.releaseVersion() <<
") used in writing the input file, " << fileName <<
".\n"
97 <<
"Forward compatibility cannot be supported.\n";
117 return eventAux.
event();
128 std::shared_ptr<InputFile> filePtr,
129 std::shared_ptr<EventSkipperByID> eventSkipperByID,
133 unsigned int nStreams,
134 unsigned int treeCacheSize,
135 int treeMaxVirtualSize,
141 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
142 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
143 std::vector<BranchID>
const* associationsFromSecondary,
144 std::shared_ptr<DuplicateChecker> duplicateChecker,
145 bool dropDescendants,
147 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
148 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
149 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
150 bool bypassVersionCheck,
151 bool labelRawDataLikeMC,
153 bool enablePrefetching) :
155 logicalFile_(logicalFileName),
156 processConfiguration_(processConfiguration),
157 processHistoryRegistry_(&processHistoryRegistry),
159 eventSkipperByID_(eventSkipperByID),
160 fileFormatVersion_(),
163 indexIntoFile_(*indexIntoFileSharedPtr_),
164 orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
166 indexIntoFileEnd_(indexIntoFileBegin_),
167 indexIntoFileIter_(indexIntoFileBegin_),
168 eventProcessHistoryIDs_(),
169 eventProcessHistoryIter_(eventProcessHistoryIDs_.
begin()),
170 savedRunAuxiliary_(),
171 skipAnyEvents_(skipAnyEvents),
172 noEventSort_(noEventSort),
173 whyNotFastClonable_(0),
174 hasNewlyDroppedBranch_(),
175 branchListIndexesUnchanged_(
false),
184 branchIDListHelper_(branchIDListHelper),
185 fileThinnedAssociationsHelper_(),
186 thinnedAssociationsHelper_(thinnedAssociationsHelper),
187 processingMode_(processingMode),
188 runHelper_(runHelper),
189 newBranchToOldBranch_(),
191 eventSelectionIDs_(),
192 branchListIndexes_(),
195 duplicateChecker_(duplicateChecker),
196 provenanceAdaptor_(),
197 provenanceReaderMaker_(),
198 eventProductProvenanceRetrievers_(),
199 parentageIDLookup_(),
200 daqProvenanceHelper_(),
201 edProductClass_(TClass::GetClass(
"edm::WrapperBase")) {
212 if(
nullptr == metaDataTree.get()) {
214 <<
" in the input file.\n";
223 fft->SetAddress(&fftPtr);
244 typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
246 PsetMap *psetMapPtr = &psetMap;
255 if(
nullptr == psetTree.get()) {
257 <<
" in the input file.\n";
260 typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
262 IdToBlobs* pIdToBlob = &idToBlob;
266 psetTreeCache->SetEnablePrefetching(
false);
267 filePtr_->SetCacheRead(psetTreeCache.get());
268 for(Long64_t
i = 0;
i != psetTree->GetEntries(); ++
i) {
269 psetTree->GetEntry(
i);
270 psetMap.insert(idToBlob);
295 std::unique_ptr<BranchIDLists> branchIDListsAPtr(
new BranchIDLists);
342 for(
auto const& psetEntry : psetMap) {
344 pset.setID(psetEntry.first);
355 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
true);
363 inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter,
false);
368 <<
"Failed to find branchIDLists branch in metaData tree.\n";
376 <<
"Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
380 if(!bypassVersionCheck) {
381 checkReleaseVersion(pHistVector,
file());
384 if(labelRawDataLikeMC) {
388 BranchKey finder(rawData, source,
"",
"");
389 ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
390 if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source) {
406 it = pList.lower_bound(finder);
407 assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() ==
source));
417 for(
auto const& history : pHistVector) {
449 for(
auto& product : pList) {
460 for(
auto const& product : prodList) {
464 newReg->copyProduct(prod);
468 <<
"Cannot change friendly class name algorithm without more development work\n"
469 <<
"to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
473 newReg->copyProduct(newBD);
477 dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
480 *associationsFromSecondary);
491 for(
auto const& product : prodList) {
521 if(
nullptr == entryDescriptionTree.get()) {
523 <<
" in the input file.\n";
539 if(idBuffer != entryDescriptionBuffer.
id()) {
542 entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.
id(),entryDescriptionBuffer));
567 if(
nullptr == parentageTree.get()) {
569 <<
" in the input file.\n";
644 std::unique_ptr<FileBlock>
819 phid_(phid), run_(run) {}
823 struct RunItemSortByRun {
824 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
825 return a.run_ < b.run_;
828 struct RunItemSortByRunPhid {
829 bool operator()(RunItem
const&
a, RunItem
const&
b)
const {
830 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.phid_ < b.phid_);
836 phid_(phid), run_(run), lumi_(lumi), firstEventEntry_(entry),
837 lastEventEntry_(entry == IndexIntoFile::invalidEntry ? IndexIntoFile::invalidEntry : entry + 1) {}
844 struct LumiItemSortByRunLumi {
845 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
846 return a.run_ < b.run_ || (!(b.run_ < a.run_) && a.lumi_ < b.lumi_);
849 struct LumiItemSortByRunLumiPhid {
850 bool operator()(LumiItem
const&
a, LumiItem
const&
b)
const {
851 if(a.run_ < b.run_)
return true;
852 if(b.run_ < a.run_)
return false;
853 if(a.lumi_ < b.lumi_)
return true;
854 if(b.lumi_ < a.lumi_)
return false;
855 return a.phid_ < b.phid_;
871 typedef std::list<LumiItem> LumiList;
874 typedef std::set<LuminosityBlockID> RunLumiSet;
875 RunLumiSet runLumiSet;
877 typedef std::list<RunItem>
RunList;
880 typedef std::set<RunNumber_t> RunSet;
883 typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
884 RunItemSet runItemSet;
886 typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
900 bool newLumi =
false;
911 if(iFirst || prevPhid != reducedPHID || prevRun !=
eventAux().
run()) {
913 newRun = newLumi =
true;
914 }
else if(prevLumi !=
eventAux().luminosityBlock()) {
917 prevPhid = reducedPHID;
921 lumis.emplace_back(reducedPHID,
925 LumiItem& currentLumi = lumis.back();
927 ++currentLumi.lastEventEntry_;
932 if(runItemSet.insert(item).second) {
935 phidMap.insert(std::make_pair(
eventAux().
run(), reducedPHID));
946 typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
949 typedef std::vector<RunItem> RunVector;
959 if(runSet.insert(runAux->run()).
second) {
961 emptyRuns.emplace_back(reducedPHID, runAux->run());
964 phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
971 RunItemSortByRun runItemSortByRun;
974 RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
975 for(
auto const& emptyRun : emptyRuns) {
976 for(; itRuns != endRuns; ++itRuns) {
977 if(runItemSortByRun(emptyRun, *itRuns)) {
981 runs.insert(itRuns, emptyRun);
986 typedef std::vector<LumiItem> LumiVector;
987 LumiVector emptyLumis;
989 typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
990 RunLumiMap runLumiMap;
997 if(runLumiSet.insert(lumiID).second) {
1002 PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1003 assert(iPhidMap != phidMap.end());
1013 LumiItemSortByRunLumi lumiItemSortByRunLumi;
1016 LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1017 for(
auto const& emptyLumi : emptyLumis) {
1018 for(; itLumis != endLumis; ++itLumis) {
1019 if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1023 lumis.insert(itLumis, emptyLumi);
1028 typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1029 RunCountMap runCountMap;
1035 for(
auto&
run : runs) {
1036 RunCountMap::const_iterator countMapItem = runCountMap.find(
run);
1037 if(countMapItem == runCountMap.end()) {
1038 countMapItem = runCountMap.insert(std::make_pair(
run, rcount)).first;
1039 assert(countMapItem != runCountMap.end());
1042 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
run.phid_);
1043 if(phidItem == phids.end()) {
1044 phids.push_back(
run.phid_);
1045 phidItem = phids.end() - 1;
1047 entries.emplace_back(
1048 countMapItem->second,
1051 phidItem - phids.begin(),
1059 typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1060 LumiCountMap lumiCountMap;
1062 for(
auto&
lumi : lumis) {
1063 RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(
lumi.phid_,
lumi.run_));
1064 assert(runCountMapItem != runCountMap.end());
1065 LumiCountMap::const_iterator countMapItem = lumiCountMap.find(
lumi);
1066 if(countMapItem == lumiCountMap.end()) {
1067 countMapItem = lumiCountMap.insert(std::make_pair(
lumi, lcount)).first;
1068 assert(countMapItem != lumiCountMap.end());
1071 std::vector<ProcessHistoryID>::const_iterator phidItem =
find_in_all(phids,
lumi.phid_);
1072 assert(phidItem != phids.end());
1073 entries.emplace_back(
1074 runCountMapItem->second,
1075 countMapItem->second,
1077 phidItem - phids.begin(),
1080 lumi.firstEventEntry_,
1081 lumi.lastEventEntry_);
1093 "'Events' tree is corrupted or not present\n" <<
"in the input file.\n";
1103 for(
auto& phid : phidVec) {
1120 bool needEventNumbers =
false;
1122 if(inputType !=
InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1123 needEventNumbers =
true;
1125 bool needEventEntries =
false;
1128 needEventEntries =
true;
1152 treePointer->close();
1153 treePointer =
nullptr;
1208 if(!eventHistoryBranch) {
1210 <<
"Failed to find history branch in event history tree.\n";
1212 eventHistoryBranch->SetAddress(&pHistory);
1221 assert(eventSelectionIDBranch !=
nullptr);
1225 assert(branchListIndexesBranch !=
nullptr);
1246 std::shared_ptr<LuminosityBlockAuxiliary>
1248 auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1259 lumiAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1262 lumiAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1267 return lumiAuxiliary;
1270 std::shared_ptr<RunAuxiliary>
1272 auto runAuxiliary = std::make_shared<RunAuxiliary>();
1278 RunAux *pRunAux = &runAux;
1283 runAuxiliary->setProcessHistoryID(
provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1286 runAuxiliary->setProcessHistoryID(
daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1288 return runAuxiliary;
1449 std::shared_ptr<RunAuxiliary>
1477 runHelper_->overrideRunNumber(runAuxiliary->id());
1478 filePtr_->reportInputRunNumber(runAuxiliary->run());
1498 runAuxiliary->setBeginTime(
eventAux().time());
1507 runAuxiliary->setProcessHistoryID(
eventAux().processHistoryID());
1512 return runAuxiliary;
1534 std::shared_ptr<LuminosityBlockAuxiliary>
1554 runHelper_->overrideRunNumber(lumiAuxiliary->id());
1555 filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1562 lumiAuxiliary->setBeginTime(
eventAux().time());
1569 return lumiAuxiliary;
1631 history_ = std::make_unique<History>();
1633 if(!eventHistoryTree_) {
1635 <<
"Failed to find the event history tree.\n";
1642 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
1643 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile) {
1650 currentIndexIntoFile);
1658 if(dropDescendants) {
1661 branchesToDrop.insert(branchID);
1672 std::vector<BranchDescription const*> associationDescriptions;
1676 std::set<BranchID> branchesToDrop;
1677 for(
auto const& product : prodList) {
1682 associationDescriptions.push_back(&prod);
1686 }
else if(!productSelector.
selected(prod)) {
1700 std::set<BranchID> keptProductsInEvent;
1701 for(
auto const& product : prodList) {
1703 if( branchesToDrop.find(prod.
branchID()) == branchesToDrop.end() &&
1706 keptProductsInEvent.insert(prod.
branchID());
1711 std::map<BranchID, bool> keepAssociation;
1713 keptProductsInEvent,
1716 for(
auto association : associationDescriptions) {
1717 if(!keepAssociation[association->branchID()]) {
1725 auto iter = keepAssociation.find(associationBranches.association());
1726 if(iter != keepAssociation.end() && iter->second) {
1727 temp->addAssociation(associationBranches);
1735 std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1736 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1738 bool drop = branchesToDrop.find(prod.
branchID()) != branchesToDropEnd;
1742 <<
"Branch '" << prod.
branchName() <<
"' is being dropped from the input\n"
1743 <<
"of file '" <<
file_ <<
"' because it is dependent on a branch\n"
1744 <<
"that was explicitly dropped.\n";
1748 ProductRegistry::ProductList::iterator icopy = it;
1750 prodList.erase(icopy);
1759 for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1763 void*
p = cp->New();
1766 if(edp->isMergeable()) {
1768 ProductRegistry::ProductList::iterator icopy = it;
1770 prodList.erase(icopy);
1780 std::unique_ptr<MakeProvenanceReader>
1797 std::shared_ptr<ProductProvenanceRetriever>
1814 virtual std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
1826 std::vector<ParentageID>
const& iParentageIDLookup,
1829 rootTree_(iRootTree),
1830 pProvVector_(&provVector_),
1831 parentageIDLookup_(iParentageIDLookup),
1832 daqProvenanceHelper_(daqProvenanceHelper),
1838 std::set<ProductProvenance>
1846 std::set<ProductProvenance> retValue;
1857 <<
"ReducedProvenanceReader::ReadProvenance\n"
1858 <<
"The parentage ID index value " << prov.parentageIDIndex_ <<
" is out of bounds. The maximum value is " <<
parentageIDLookup_.size()-1 <<
".\n"
1859 <<
"This should never happen.\n"
1860 <<
"Please report this to the framework hypernews forum 'hn-cms-edmFramework@cern.ch'.\n";
1873 virtual std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1883 rootTree_(rootTree),
1885 pInfoVector_(&infoVector_),
1886 daqProvenanceHelper_(daqProvenanceHelper),
1890 std::set<ProductProvenance>
1897 std::set<ProductProvenance> retValue;
1905 retValue.emplace(
info);
1916 virtual std::set<ProductProvenance>
readProvenance(
unsigned int transitionIndex)
const override;
1927 rootTree_(rootTree),
1929 pInfoVector_(&infoVector_),
1930 entryDescriptionMap_(theMap),
1931 daqProvenanceHelper_(daqProvenanceHelper),
1935 std::set<ProductProvenance>
1943 std::set<ProductProvenance> retValue;
1947 Parentage parentage(iter->second.parents());
1952 retValue.emplace(
info.branchID(), parentage.id());
1963 virtual std::set<ProductProvenance>
readProvenance(
unsigned int)
const override;
1970 std::set<ProductProvenance>
1973 return std::set<ProductProvenance>{};
1976 std::unique_ptr<ProvenanceReaderBase>
1981 std::unique_ptr<ProvenanceReaderBase>
1986 std::unique_ptr<ProvenanceReaderBase>
1988 return std::unique_ptr<ProvenanceReaderBase>(
new FullProvenanceReader(&rootTree, daqProvenanceHelper));
1991 std::unique_ptr<ProvenanceReaderBase>
void dropOnInput(ProductRegistry ®, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
EventNumber_t event() const
std::string const & idToParameterSetBlobsBranchName()
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
std::vector< ProcessConfiguration > ProcessConfigurationVector
void setEventFinder(std::shared_ptr< EventFinder > ptr) const
std::string const & branchName() const
StoredProductProvenanceVector provVector_
bool selected(BranchDescription const &desc) const
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
unsigned int const defaultNonEventLearningEntries
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
static int const invalidIndex
BranchType const & branchType() const
std::string const & parentageTreeName()
std::vector< BranchIDList > BranchIDLists
std::shared_ptr< BranchIDLists const > branchIDLists_
std::string const & entryDescriptionBranchName()
bool skipEvents(int &offset)
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
FileFormatVersion fileFormatVersion() const
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
ProductProvenanceVector infoVector_
static std::string const source("source")
static Timestamp invalidTimestamp()
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
bool branchListIndexesUnchanged() const
std::vector< std::string > const & branchNames() const
bool setEntryAtNextEventInLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunHelperBase *runHelper, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, std::shared_ptr< BranchIDListHelper > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, std::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< std::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching)
static PFTauRenderPlugin instance
MakeOldProvenanceReader(std::unique_ptr< EntryDescriptionMap > &&entryDescriptionMap)
std::vector< BranchID > & parentsForUpdate()
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
DaqProvenanceHelper const * daqProvenanceHelper_
std::map< std::string, std::string > newBranchToOldBranch_
EntryNumber_t firstEventEntryThisRun() const
bool empty() const
True if no runs, lumis, or events are in the file.
std::map< BranchKey, BranchDescription > ProductList
BranchID const & mapBranchID(BranchID const &branchID) const
EntryType getEntryType() const
bool registerProcessHistory(ProcessHistory const &processHistory)
bool setEntryAtRun(RunNumber_t run)
void readRun_(RunPrincipal &runPrincipal)
ProductProvenanceVector * pInfoVector_
Timestamp const & time() const
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
unsigned long long EventNumber_t
EntryNumber const & entries() const
void setRefCoreStreamer(bool resetAll=false)
std::string const & fileFormatVersionBranchName()
IndexIntoFileItr begin(SortOrder sortOrder) const
FullProvenanceReader(RootTree *rootTree, DaqProvenanceHelper const *daqProvenanceHelper)
EntryDescriptionMap const & entryDescriptionMap_
std::vector< BranchID > const & parents() const
std::string const & eventSelectionsBranchName()
edm::propagate_const< std::unique_ptr< EntryDescriptionMap > > entryDescriptionMap_
InputSource::ProcessingMode processingMode_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
LuminosityBlockNumber_t lumi() const
void fillBranchEntryMeta(TBranch *branch, T *&pbuf)
std::unique_ptr< FileBlock > createFileBlock() const
LuminosityBlockNumber_t luminosityBlock() const
void trainCache(char const *branchNames)
bool readCurrentEvent(EventPrincipal &cache)
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
std::shared_ptr< ProductRegistry const > productRegistry() const
unsigned int LuminosityBlockNumber_t
virtual ~OldProvenanceReader()
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
TBranch * branchEntryInfoBranch() const
void advanceToNextLumiOrRun()
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
MakeReducedProvenanceReader(std::vector< ParentageID > const &parentageIDLookup)
virtual ~DummyProvenanceReader()
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
std::vector< EventSelectionID > EventSelectionIDVector
edm::propagate_const< TClass * > edProductClass_
LuminosityBlockNumber_t luminosityBlock() const
FileFormatVersion fileFormatVersion_
TTree const * metaTree() const
std::string const & parameterSetsTreeName()
void setPosition(IndexIntoFile::IndexIntoFileItr const &position)
void readAllFromSourceAndMergeImmediately()
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
edm::propagate_const< RootTree * > rootTree_
ProductList const & productList() const
U second(std::pair< T, U > const &p)
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
TTree const * tree() const
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setParents(std::vector< BranchID > const &parents)
DaqProvenanceHelper const * daqProvenanceHelper_
std::string const logicalFile_
std::vector< BranchListIndex > BranchListIndexes
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
std::string moduleName(Provenance const &provenance)
void fillLuminosityBlockPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
void readParentageTree(InputType inputType)
std::string const & processHistoryMapBranchName()
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
std::string const & className() const
bool wasLastEventJustRead() const
void insertEntryForIndex(unsigned int index)
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const override
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
std::string friendlyName(std::string const &iFullName)
static RunNumber_t const invalidRun
std::string const & entryDescriptionTreeName()
std::string const & fid() const
RootTree const & runTree() const
virtual std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
std::string const & indexIntoFileBranchName()
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
std::string const & eventHistoryBranchName()
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
Long64_t numEntries(TFile *hdl, std::string const &trname)
edm::propagate_const< RootTree * > rootTree_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
EventAuxiliary const & eventAux() const
EventSelectionIDVector eventSelectionIDs_
int processHistoryIDIndex() const
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
bool isEarlierRelease(std::string const &a, std::string const &b)
StoredProductProvenanceVector const * pProvVector_
int whyNotFastClonable() const
virtual std::set< ProductProvenance > readProvenance(unsigned int transitionIndex) const override
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
StreamID streamID() const
virtual std::set< ProductProvenance > readProvenance(unsigned int) const override
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
std::vector< BranchDescription const * > allBranchDescriptions() const
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
std::string const & friendlyClassName() const
BranchID const & branchID() const
TypeWithDict const & unwrappedType() const
void updateFriendlyClassName()
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
BranchListIndexes branchListIndexes_
std::string const & metaDataTreeName()
LuminosityBlockNumber_t oldLuminosityBlock() const
EntryDescriptionID id() const
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
edm::propagate_const< std::unique_ptr< History > > history_
ProcessHistoryVector vector_type
std::vector< ProductProvenance > ProductProvenanceVector
std::string const & processHistoryBranchName()
IndexIntoFile & indexIntoFile_
virtual ~FullProvenanceReader()
void readEvent(EventPrincipal &cache)
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
EntryNumber const & entryNumber() const
ProcessHistoryMap collection_type
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
bool goToEvent(EventID const &eventID)
std::string getReleaseVersion()
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
void setAtEventEntry(IndexIntoFile::EntryNumber_t entry)
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
DelayedReader * rootDelayedReader() const
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
EntryNumber const & entryNumberForIndex(unsigned int index) const
void conversion(EventAux const &from, EventAuxiliary &to)
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::vector< EventNumber_t > & unsortedEventNumbers() const
unsigned int value() const
static EntryNumber_t const invalidEntry
SharedResourcesAcquirer resourceAcquirer_
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
std::shared_ptr< ProductRegistry const > productRegistry_
void setIfFastClonable(int remainingEvents, int remainingLumis)
void fillBranchEntry(TBranch *branch, T *&pbuf)
static LuminosityBlockNumber_t const invalidLumi
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
virtual EventNumber_t getEventNumberOfEntry(roottree::EntryNumber entry) const override
std::string const & parentageBranchName()
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
std::shared_ptr< BranchChildren const > branchChildren() const
LuminosityBlockNumber_t luminosityBlock() const
ProcessHistoryID const & processHistoryID(int i) const
ProductList & productListUpdator()
void setProcessHistoryID(ProcessHistoryID const &phid)
unsigned int transitionIndex() const
std::vector< ParentageID > const & parentageIDLookup_
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
std::vector< StoredProductProvenance > StoredProductProvenanceVector
std::string const & file() const
std::string const & productDescriptionBranchName()
std::string const & processConfigurationBranchName()
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
EntryNumber_t firstEventEntryThisLumi() const
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
edm::propagate_const< RunHelperBase * > runHelper_
bool branchListIndexesUnchanged_
void fillEventPrincipal(EventAuxiliary const &aux, ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
edm::propagate_const< TTree * > eventHistoryTree_
SharedResourcesAcquirer resourceAcquirer_
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
std::vector< EventEntryInfo > * pInfoVector_
unsigned int const defaultNonEventCacheSize
RootTreePtrArray treePointers_
void fillEventNumbers() const
void initialize(ProductSelectorRules const &rules, std::vector< BranchDescription const * > const &branchDescriptions)
static int position[264][3]
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
std::string const & BranchTypeToProductProvenanceBranchName(BranchType const &BranchType)
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
std::string const & productDependenciesBranchName()
void setNumberOfEvents(EntryNumber_t nevents) const
void initAssociationsFromSecondary(std::vector< BranchID > const &)
std::string const & thinnedAssociationsHelperBranchName()
std::string const & entryDescriptionIDBranchName()
edm::propagate_const< TBranch * > provBranch_
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
std::unique_ptr< WrapperBase > getWrapperBasePtr(void *p, int offset)
std::string const & branchIDListBranchName()
std::string const & branchListIndexesBranchName()
std::vector< ParentageID > parentageIDLookup_
void fillThisEventAuxiliary()
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
volatile std::atomic< bool > shutdown_flag false
void markBranchToBeDropped(bool dropDescendants, BranchID const &branchID, std::set< BranchID > &branchesToDrop) const
std::vector< ParentageID > const & parentageIDLookup_
ReducedProvenanceReader(RootTree *iRootTree, std::vector< ParentageID > const &iParentageIDLookup, DaqProvenanceHelper const *daqProvenanceHelper)
std::string const & eventHistoryTreeName()
RootFileEventFinder(RootTree &eventTree)
ParentageID const & mapParentageID(ParentageID const &phid) const
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
void validateFile(InputType inputType, bool usingGoToEvent)
bool insertMapped(value_type const &v)
virtual std::set< ProductProvenance > readProvenance(unsigned int) const override
IndexIntoFile::IndexIntoFileItr indexIntoFileIter() const
std::string const & newBranchToOldBranch(std::string const &newBranch) const
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
static ParentageRegistry * instance()
OldProvenanceReader(RootTree *rootTree, EntryDescriptionMap const &theMap, DaqProvenanceHelper const *daqProvenanceHelper)
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
unsigned int const defaultLearningEntries
EntryNumber_t entry() const
std::vector< EventEntryInfo > infoVector_
LuminosityBlockNumber_t peekAheadAtLumi() const
std::string const & fileIdentifierBranchName()
SharedResourcesAcquirer resourceAcquirer_
std::string const & wrappedName() const
virtual ~RootFileEventFinder()
EventNumber_t event() const
std::string const & moduleDescriptionMapBranchName()
bool insertMapped(value_type const &v)
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
static Registry * instance()
DaqProvenanceHelper const * daqProvenanceHelper_
std::string createGlobalIdentifier()
void copyProduct(BranchDescription const &productdesc)
void readEventHistoryTree()
void setEntryNumber(EntryNumber theEntryNumber)
void reportOpened(std::string const &inputType)