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;
66 std::shared_ptr<InputFile> filePtr,
67 std::shared_ptr<EventSkipperByID> eventSkipperByID,
71 unsigned int nStreams,
72 unsigned int treeCacheSize,
73 int treeMaxVirtualSize,
79 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
80 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
81 std::vector<BranchID>
const* associationsFromSecondary,
82 std::shared_ptr<DuplicateChecker> duplicateChecker,
83 bool dropDescendantsOfDroppedProducts,
85 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
86 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
87 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
88 bool bypassVersionCheck,
89 bool labelRawDataLikeMC,
91 bool enablePrefetching);
96 std::shared_ptr<InputFile> filePtr,
97 unsigned int nStreams,
98 int treeMaxVirtualSize,
103 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
104 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
105 std::vector<BranchID>
const* associationsFromSecondary,
106 bool dropDescendantsOfDroppedProducts,
108 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
109 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
110 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
111 bool bypassVersionCheck,
112 bool labelRawDataLikeMC,
114 fileName, processConfiguration, logicalFileName, filePtr,
116 processingMode, runHelper,
117 false, productSelectorRules, inputType, branchIDListHelper,
118 thinnedAssociationsHelper, associationsFromSecondary,
119 nullptr, dropDescendantsOfDroppedProducts, processHistoryRegistry,
120 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
121 bypassVersionCheck, labelRawDataLikeMC,
122 false, enablePrefetching) {}
127 std::shared_ptr<InputFile> filePtr,
128 unsigned int nStreams,
129 unsigned int treeCacheSize,
130 int treeMaxVirtualSize,
135 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
136 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
137 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
138 bool bypassVersionCheck,
140 fileName, processConfiguration, logicalFileName, filePtr,
141 nullptr,
false, -1, -1, nStreams, treeCacheSize, treeMaxVirtualSize,
145 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
146 bypassVersionCheck,
false,
147 false, enablePrefetching) {}
159 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
160 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
161 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
166 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_;}
179 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() != 0;}
180 std::unique_ptr<FileBlock> createFileBlock()
const;
182 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
192 indexIntoFileIter_ = indexIntoFileBegin_;
198 indexIntoFileIter_ = indexIntoFileEnd_;
203 bool goToEvent(
EventID const& eventID);
210 bool wasLastEventJustRead()
const;
211 bool wasFirstEventJustRead()
const;
214 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
220 bool skipThisEntry();
221 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
222 void validateFile(
InputType inputType,
bool usingGoToEvent);
223 void fillIndexIntoFile();
225 void fillThisEventAuxiliary();
226 void fillEventHistory();
227 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
228 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
230 void markBranchToBeDropped(
bool dropDescendants,
BranchID const& branchID, std::set<BranchID>& branchesToDrop)
const;
232 void readParentageTree(
InputType inputType);
233 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
InputType inputType);
234 void readEventHistoryTree();
235 bool isDuplicateEvent();
237 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
238 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile);
240 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
241 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
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_
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_