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;
69 std::shared_ptr<InputFile> filePtr,
70 std::shared_ptr<EventSkipperByID> eventSkipperByID,
74 unsigned int nStreams,
75 unsigned int treeCacheSize,
76 int treeMaxVirtualSize,
82 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
83 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
84 std::vector<BranchID>
const* associationsFromSecondary,
85 std::shared_ptr<DuplicateChecker> duplicateChecker,
86 bool dropDescendantsOfDroppedProducts,
88 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
89 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
90 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
91 bool bypassVersionCheck,
92 bool labelRawDataLikeMC,
94 bool enablePrefetching);
99 std::shared_ptr<InputFile> filePtr,
100 unsigned int nStreams,
101 int treeMaxVirtualSize,
106 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
107 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
108 std::vector<BranchID>
const* associationsFromSecondary,
109 bool dropDescendantsOfDroppedProducts,
111 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
112 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
113 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
114 bool bypassVersionCheck,
115 bool labelRawDataLikeMC,
116 bool enablePrefetching)
118 processConfiguration,
131 productSelectorRules,
134 thinnedAssociationsHelper,
135 associationsFromSecondary,
137 dropDescendantsOfDroppedProducts,
138 processHistoryRegistry,
140 currentIndexIntoFile,
141 orderedProcessHistoryIDs,
145 enablePrefetching) {}
150 std::shared_ptr<InputFile> filePtr,
151 unsigned int nStreams,
152 unsigned int treeCacheSize,
153 int treeMaxVirtualSize,
158 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
159 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
160 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
161 bool bypassVersionCheck,
162 bool enablePrefetching)
164 processConfiguration,
177 productSelectorRules,
184 processHistoryRegistry,
186 currentIndexIntoFile,
187 orderedProcessHistoryIDs,
191 enablePrefetching) {}
203 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
204 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
205 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
210 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_; }
223 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() !=
nullptr; }
224 std::unique_ptr<FileBlock> createFileBlock()
const;
226 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
236 indexIntoFileIter_ = indexIntoFileBegin_;
245 bool goToEvent(
EventID const& eventID);
256 bool wasLastEventJustRead()
const;
257 bool wasFirstEventJustRead()
const;
260 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
268 bool skipThisEntry();
269 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
270 void validateFile(
InputType inputType,
bool usingGoToEvent);
271 void fillIndexIntoFile();
273 void fillThisEventAuxiliary();
274 void fillEventHistory();
275 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
276 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
278 void markBranchToBeDropped(
bool dropDescendants,
280 std::set<BranchID>& branchesToDrop,
281 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
283 void readParentageTree(
InputType inputType);
284 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
286 void readEventHistoryTree();
287 bool isDuplicateEvent();
289 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
290 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile);
292 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
293 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_
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)
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)
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
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]
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::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_