1 #ifndef IOPool_Input_RootFile_h 2 #define IOPool_Input_RootFile_h 40 class BranchIDListHelper;
41 class ProductProvenanceRetriever;
42 struct DaqProvenanceHelper;
43 class DuplicateChecker;
44 class EventSkipperByID;
45 class ProcessHistoryRegistry;
46 class ProductSelectorRules;
48 class ProvenanceReaderBase;
49 class ProvenanceAdaptor;
50 class StoredMergeableRunProductMetadata;
68 std::shared_ptr<InputFile> filePtr,
69 std::shared_ptr<EventSkipperByID> eventSkipperByID,
73 unsigned int nStreams,
74 unsigned int treeCacheSize,
75 int treeMaxVirtualSize,
81 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
82 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
83 std::vector<BranchID>
const* associationsFromSecondary,
84 std::shared_ptr<DuplicateChecker> duplicateChecker,
85 bool dropDescendantsOfDroppedProducts,
87 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
88 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
89 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
90 bool bypassVersionCheck,
91 bool labelRawDataLikeMC,
93 bool enablePrefetching);
98 std::shared_ptr<InputFile> filePtr,
99 unsigned int nStreams,
100 int treeMaxVirtualSize,
105 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
106 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
107 std::vector<BranchID>
const* associationsFromSecondary,
108 bool dropDescendantsOfDroppedProducts,
110 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
111 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
112 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
113 bool bypassVersionCheck,
114 bool labelRawDataLikeMC,
116 fileName, processConfiguration, logicalFileName, filePtr,
118 processingMode, runHelper,
119 false, productSelectorRules, inputType, branchIDListHelper,
120 thinnedAssociationsHelper, associationsFromSecondary,
121 nullptr, dropDescendantsOfDroppedProducts, processHistoryRegistry,
122 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
123 bypassVersionCheck, labelRawDataLikeMC,
124 false, enablePrefetching) {}
129 std::shared_ptr<InputFile> filePtr,
130 unsigned int nStreams,
131 unsigned int treeCacheSize,
132 int treeMaxVirtualSize,
137 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
138 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
139 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
140 bool bypassVersionCheck,
142 fileName, processConfiguration, logicalFileName, filePtr,
143 nullptr,
false, -1, -1, nStreams, treeCacheSize, treeMaxVirtualSize,
147 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
148 bypassVersionCheck,
false,
149 false, enablePrefetching) {}
161 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
162 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
163 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
168 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_;}
181 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() !=
nullptr;}
182 std::unique_ptr<FileBlock> createFileBlock()
const;
184 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
194 indexIntoFileIter_ = indexIntoFileBegin_;
200 indexIntoFileIter_ = indexIntoFileEnd_;
205 bool goToEvent(
EventID const& eventID);
212 bool wasLastEventJustRead()
const;
213 bool wasFirstEventJustRead()
const;
216 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
222 bool skipThisEntry();
223 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
224 void validateFile(
InputType inputType,
bool usingGoToEvent);
225 void fillIndexIntoFile();
227 void fillThisEventAuxiliary();
228 void fillEventHistory();
229 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
230 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
232 void markBranchToBeDropped(
bool dropDescendants,
BranchDescription const&
branch, std::set<BranchID>& branchesToDrop, std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
234 void readParentageTree(
InputType inputType);
235 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
InputType inputType);
236 void readEventHistoryTree();
237 bool isDuplicateEvent();
239 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
240 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile);
242 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
243 std::shared_ptr<ProductProvenanceRetriever> makeProductProvenanceRetriever(
unsigned int iStreamIndex);
EventID const & eventID() const
bool setEntryAtItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
RootTree const & lumiTree() const
std::shared_ptr< BranchIDLists const > branchIDLists_
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
FileFormatVersion fileFormatVersion() const
virtual ~MakeProvenanceReader()=default
bool branchListIndexesUnchanged() const
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
std::map< std::string, std::string > newBranchToOldBranch_
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
unsigned long long EventNumber_t
InputSource::ProcessingMode processingMode_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
bool skipEntries(unsigned int &offset)
std::shared_ptr< IndexIntoFile > & indexIntoFileSharedPtr()
std::shared_ptr< ProductRegistry const > productRegistry() const
unsigned int LuminosityBlockNumber_t
std::vector< EventSelectionID > EventSelectionIDVector
edm::propagate_const< TClass * > edProductClass_
FileFormatVersion fileFormatVersion_
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
std::string const logicalFile_
std::vector< BranchListIndex > BranchListIndexes
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
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)
RootTree const & runTree() const
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
EventAuxiliary const & eventAux() const
EventSelectionIDVector eventSelectionIDs_
int whyNotFastClonable() const
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
std::shared_ptr< ProductProvenanceRetriever > & eventProductProvenanceRetriever(size_t index)
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
BranchListIndexes branchListIndexes_
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::unique_ptr< History > > history_
IndexIntoFile & indexIntoFile_
std::shared_ptr< BranchIDListHelper > & branchIDListHelper()
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
std::shared_ptr< RunAuxiliary > & savedRunAuxiliary()
ProcessConfiguration const & processConfiguration_
std::shared_ptr< ProductRegistry const > productRegistry_
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
std::shared_ptr< BranchChildren const > branchChildren() const
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)
std::shared_ptr< BranchChildren > & branchChildren()
std::string const & file() const
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
std::array< RootTree *, NumBranchTypes > RootTreePtrArray
edm::propagate_const< RunHelperBase * > runHelper_
bool branchListIndexesUnchanged_
edm::propagate_const< TTree * > eventHistoryTree_
RootTreePtrArray treePointers_
static int position[264][3]
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
RootTreePtrArray & treePointers()
std::shared_ptr< IndexIntoFile const > indexIntoFileSharedPtr() const
std::vector< ParentageID > parentageIDLookup_
RootTree const & eventTree() const
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
virtual std::unique_ptr< ProvenanceReaderBase > makeReader(RootTree &eventTree, DaqProvenanceHelper const *daqProvenanceHelper) const =0
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_