|
![CMS Logo](/cmsdoxygen/common/rightImage.jpg) |
Go to the documentation of this file. 1 #ifndef IOPool_Input_RootFile_h
2 #define IOPool_Input_RootFile_h
48 class BranchIDListHelper;
49 class ProductProvenanceRetriever;
50 struct DaqProvenanceHelper;
51 class DuplicateChecker;
52 class EventSkipperByID;
53 class ProcessHistoryRegistry;
54 class ProductSelectorRules;
56 class ProvenanceReaderBase;
57 class ProvenanceAdaptor;
58 class StoredMergeableRunProductMetadata;
60 class ThinnedAssociationsHelper;
77 std::shared_ptr<InputFile> filePtr,
78 std::shared_ptr<EventSkipperByID> eventSkipperByID,
83 unsigned int treeCacheSize,
84 int treeMaxVirtualSize,
92 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
93 std::vector<BranchID>
const* associationsFromSecondary,
94 std::shared_ptr<DuplicateChecker> duplicateChecker,
95 bool dropDescendantsOfDroppedProducts,
97 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
99 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
100 bool bypassVersionCheck,
101 bool labelRawDataLikeMC,
103 bool enablePrefetching,
104 bool enforceGUIDInFileName);
110 std::shared_ptr<InputFile> filePtr,
112 int treeMaxVirtualSize,
118 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
119 std::vector<BranchID>
const* associationsFromSecondary,
120 bool dropDescendantsOfDroppedProducts,
122 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
124 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
125 bool bypassVersionCheck,
126 bool labelRawDataLikeMC,
127 bool enablePrefetching,
128 bool enforceGUIDInFileName)
130 processConfiguration,
143 productSelectorRules,
147 thinnedAssociationsHelper,
148 associationsFromSecondary,
150 dropDescendantsOfDroppedProducts,
151 processHistoryRegistry,
153 currentIndexIntoFile,
154 orderedProcessHistoryIDs,
159 enforceGUIDInFileName) {}
165 std::shared_ptr<InputFile> filePtr,
167 unsigned int treeCacheSize,
168 int treeMaxVirtualSize,
173 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
175 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
176 bool bypassVersionCheck,
177 bool enablePrefetching,
178 bool enforceGUIDInFileName)
180 processConfiguration,
193 productSelectorRules,
201 processHistoryRegistry,
203 currentIndexIntoFile,
204 orderedProcessHistoryIDs,
209 enforceGUIDInFileName) {}
267 processBlockTree->rewindToInvalid();
297 int treeMaxVirtualSize,
298 bool enablePrefetching,
311 bool assertOnFailure =
true);
318 std::set<BranchID>& branchesToDrop,
319 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
322 bool dropDescendants,
327 std::set<std::string>
const& processesWithKeptProcessBlockProducts,
bool endOfProcessBlocksReached() const
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
void readProcessBlock_(ProcessBlockPrincipal &)
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
std::shared_ptr< ProductRegistry const > productRegistry() const
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
edm::propagate_const< RunHelperBase * > runHelper_
void readParentageTree(InputType inputType)
edm::propagate_const< TTree * > eventHistoryTree_
void reportOpened(std::string const &inputType)
void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, unsigned int nStreams, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunHelperBase *runHelper, ProductSelectorRules const &productSelectorRules, InputType inputType, std::shared_ptr< BranchIDListHelper > branchIDListHelper, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, 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 enablePrefetching, bool enforceGUIDInFileName)
bool branchListIndexesUnchanged() const
bool setEntryAtItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
RootTree const & runTree() const
bool initializeFirstProcessBlockEntry()
RootTree const & lumiTree() const
RootTree const & eventTree() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
std::shared_ptr< IndexIntoFile > & indexIntoFileSharedPtr()
std::vector< BranchListIndex > BranchListIndexes
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
unsigned int currentProcessBlockTree_
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::unique_ptr< StoredProcessBlockHelper > > storedProcessBlockHelper_
bool enforceGUIDInFileName_
FileFormatVersion fileFormatVersion() const
unsigned int LuminosityBlockNumber_t
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
std::string const & file() const
bool setEntryAtRun(RunNumber_t run)
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
void setAtEventEntry(IndexIntoFile::EntryNumber_t entry)
bool skipEntries(unsigned int &offset)
EventToProcessBlockIndexes eventToProcessBlockIndexes_
EventAuxiliary eventAuxCache_
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
bool skipEvents(int &offset)
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
bool wasLastEventJustRead() const
RootFile & operator=(RootFile const &)=delete
std::vector< edm::propagate_const< RootTree * > > treePointers_
edm::propagate_const< ProcessBlockHelper * > processBlockHelper_
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
EventAuxiliary fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
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, ProcessBlockHelper *, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, std::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching, bool enforceGUIDInFileName)
unsigned long long EventNumber_t
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
void setPosition(IndexIntoFile::IndexIntoFileItr const &position)
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, RunHelperBase *runHelper, ProductSelectorRules const &productSelectorRules, InputType inputType, 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 enablePrefetching, bool enforceGUIDInFileName)
void updateFileBlock(FileBlock &)
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
IndexIntoFile & indexIntoFile_
std::shared_ptr< BranchIDListHelper > & branchIDListHelper()
std::string const & newBranchToOldBranch(std::string const &newBranch) const
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
void dropProcessesAndReorder(StoredProcessBlockHelper &, std::set< std::string > const &processesWithKeptProcessBlockProducts, ProcessBlockHelper const *)
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
std::shared_ptr< RunAuxiliary > & savedRunAuxiliary()
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
void setIfFastClonable(int remainingEvents, int remainingLumis)
const std::string logicalFile_
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
InputSource::ProcessingMode processingMode_
virtual ~MakeProvenanceReader()=default
void validateFile(InputType inputType, bool usingGoToEvent)
bool skipEntries(unsigned int &offset)
void markBranchToBeDropped(bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
bool fillEventHistory(EventAuxiliary &evtAux, EventSelectionIDVector &eventSelectionIDs, BranchListIndexes &branchListIndexes, bool assertOnFailure=true)
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
std::shared_ptr< RunAuxiliary > readFakeRunAuxiliary_()
std::vector< edm::propagate_const< std::unique_ptr< RootTree > > > processBlockTrees_
static int position[264][3]
std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
void fillProcessBlockHelper_()
void readFakeRun_(RunPrincipal &runPrincipal)
std::shared_ptr< BranchChildren const > branchChildren() const
std::shared_ptr< ProductProvenanceRetriever > & eventProductProvenanceRetriever(size_t index)
edm::propagate_const< TBranch * > eventToProcessBlockIndexesBranch_
edm::propagate_const< TClass * > edProductClass_
FileFormatVersion fileFormatVersion_
void fillEventToProcessBlockIndexes()
std::shared_ptr< FileBlock > createFileBlock()
void readEventHistoryTree()
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
void initAssociationsFromSecondary(std::vector< BranchID > const &)
edm::propagate_const< std::unique_ptr< History > > history_
void makeProcessBlockRootTrees(std::shared_ptr< InputFile > filePtr, int treeMaxVirtualSize, bool enablePrefetching, InputType inputType, StoredProcessBlockHelper const &storedProcessBlockHelper)
bool readEvent(EventPrincipal &cache)
void setPresenceInProductRegistry(ProductRegistry &, StoredProcessBlockHelper const &)
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
std::vector< ParentageID > parentageIDLookup_
bool goToEvent(EventID const &eventID)
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
std::shared_ptr< IndexIntoFile const > indexIntoFileSharedPtr() const
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::shared_ptr< ProductRegistry const > productRegistry_
int whyNotFastClonable() const
bool setEntryAtNextEventInLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
void dropOnInputAndReorder(ProductRegistry &, ProductSelectorRules const &, bool dropDescendants, InputType, StoredProcessBlockHelper &, ProcessBlockHelper const *)
std::shared_ptr< BranchChildren > & branchChildren()
std::map< std::string, std::string > newBranchToOldBranch_
EventAuxiliary const & fillThisEventAuxiliary()
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
bool nextProcessBlock_(ProcessBlockPrincipal &)
void readRun_(RunPrincipal &runPrincipal)
bool branchListIndexesUnchanged_
std::vector< EventSelectionID > EventSelectionIDVector
std::tuple< bool, bool > readCurrentEvent(EventPrincipal &cache, bool assertOnFailure=true)
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
std::shared_ptr< BranchIDLists const > branchIDLists_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const =0
IndexIntoFile::IndexIntoFileItr indexIntoFileIter() const
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
bool wasFirstEventJustRead() const
ProcessConfiguration const & processConfiguration_