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;
67 std::shared_ptr<InputFile> filePtr,
68 std::shared_ptr<EventSkipperByID> eventSkipperByID,
72 unsigned int nStreams,
73 unsigned int treeCacheSize,
74 int treeMaxVirtualSize,
80 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
81 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
82 std::vector<BranchID>
const* associationsFromSecondary,
83 std::shared_ptr<DuplicateChecker> duplicateChecker,
84 bool dropDescendantsOfDroppedProducts,
86 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
87 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
88 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
89 bool bypassVersionCheck,
90 bool labelRawDataLikeMC,
92 bool enablePrefetching);
97 std::shared_ptr<InputFile> filePtr,
98 unsigned int nStreams,
99 int treeMaxVirtualSize,
104 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
105 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
106 std::vector<BranchID>
const* associationsFromSecondary,
107 bool dropDescendantsOfDroppedProducts,
109 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
110 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
111 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
112 bool bypassVersionCheck,
113 bool labelRawDataLikeMC,
115 fileName, processConfiguration, logicalFileName, filePtr,
117 processingMode, runHelper,
118 false, productSelectorRules, inputType, branchIDListHelper,
119 thinnedAssociationsHelper, associationsFromSecondary,
120 nullptr, dropDescendantsOfDroppedProducts, processHistoryRegistry,
121 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
122 bypassVersionCheck, labelRawDataLikeMC,
123 false, enablePrefetching) {}
128 std::shared_ptr<InputFile> filePtr,
129 unsigned int nStreams,
130 unsigned int treeCacheSize,
131 int treeMaxVirtualSize,
136 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
137 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
138 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
139 bool bypassVersionCheck,
141 fileName, processConfiguration, logicalFileName, filePtr,
142 nullptr,
false, -1, -1, nStreams, treeCacheSize, treeMaxVirtualSize,
146 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
147 bypassVersionCheck,
false,
148 false, enablePrefetching) {}
160 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
161 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
162 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
167 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_;}
180 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() !=
nullptr;}
181 std::unique_ptr<FileBlock> createFileBlock()
const;
183 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
193 indexIntoFileIter_ = indexIntoFileBegin_;
199 indexIntoFileIter_ = indexIntoFileEnd_;
204 bool goToEvent(
EventID const& eventID);
211 bool wasLastEventJustRead()
const;
212 bool wasFirstEventJustRead()
const;
215 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
221 bool skipThisEntry();
222 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
223 void validateFile(
InputType inputType,
bool usingGoToEvent);
224 void fillIndexIntoFile();
226 void fillThisEventAuxiliary();
227 void fillEventHistory();
228 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
229 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
231 void markBranchToBeDropped(
bool dropDescendants,
BranchDescription const&
branch, std::set<BranchID>& branchesToDrop, std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
233 void readParentageTree(
InputType inputType);
234 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
InputType inputType);
235 void readEventHistoryTree();
236 bool isDuplicateEvent();
238 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
239 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile);
241 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
242 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_
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_