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,
95 bool enforceGUIDInFileName);
100 std::shared_ptr<InputFile> filePtr,
101 unsigned int nStreams,
102 int treeMaxVirtualSize,
107 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
108 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
109 std::vector<BranchID>
const* associationsFromSecondary,
110 bool dropDescendantsOfDroppedProducts,
112 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
113 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
114 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
115 bool bypassVersionCheck,
116 bool labelRawDataLikeMC,
117 bool enablePrefetching,
118 bool enforceGUIDInFileName)
120 processConfiguration,
133 productSelectorRules,
136 thinnedAssociationsHelper,
137 associationsFromSecondary,
139 dropDescendantsOfDroppedProducts,
140 processHistoryRegistry,
142 currentIndexIntoFile,
143 orderedProcessHistoryIDs,
148 enforceGUIDInFileName) {}
153 std::shared_ptr<InputFile> filePtr,
154 unsigned int nStreams,
155 unsigned int treeCacheSize,
156 int treeMaxVirtualSize,
161 std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
162 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile,
163 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
164 bool bypassVersionCheck,
165 bool enablePrefetching,
166 bool enforceGUIDInFileName)
168 processConfiguration,
181 productSelectorRules,
188 processHistoryRegistry,
190 currentIndexIntoFile,
191 orderedProcessHistoryIDs,
196 enforceGUIDInFileName) {}
208 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
209 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
210 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
215 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_; }
228 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() !=
nullptr; }
229 std::unique_ptr<FileBlock> createFileBlock()
const;
231 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
241 indexIntoFileIter_ = indexIntoFileBegin_;
250 bool goToEvent(
EventID const& eventID);
261 bool wasLastEventJustRead()
const;
262 bool wasFirstEventJustRead()
const;
265 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
273 bool skipThisEntry();
274 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
275 void validateFile(
InputType inputType,
bool usingGoToEvent);
276 void fillIndexIntoFile();
278 void fillThisEventAuxiliary();
279 void fillEventHistory();
280 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
281 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
283 void markBranchToBeDropped(
bool dropDescendants,
285 std::set<BranchID>& branchesToDrop,
286 std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
288 void readParentageTree(
InputType inputType);
289 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
291 void readEventHistoryTree();
292 bool isDuplicateEvent();
294 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile>>
const& indexesIntoFiles,
295 std::vector<std::shared_ptr<IndexIntoFile>>::
size_type currentIndexIntoFile);
297 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
298 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
bool enforceGUIDInFileName_
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_
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)
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, bool enforceGUIDInFileName)
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
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_