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,
93 bool enforceGUIDInFileName);
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,
115 bool enablePrefetching,
116 bool enforceGUIDInFileName) :
RootFile(
117 fileName, processConfiguration, logicalFileName, filePtr,
119 processingMode, runHelper,
120 false, productSelectorRules, inputType, branchIDListHelper,
121 thinnedAssociationsHelper, associationsFromSecondary,
122 nullptr, dropDescendantsOfDroppedProducts, processHistoryRegistry,
123 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
124 bypassVersionCheck, labelRawDataLikeMC,
125 false, enablePrefetching, enforceGUIDInFileName) {}
130 std::shared_ptr<InputFile> filePtr,
131 unsigned int nStreams,
132 unsigned int treeCacheSize,
133 int treeMaxVirtualSize,
138 std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
139 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile,
140 std::vector<ProcessHistoryID>& orderedProcessHistoryIDs,
141 bool bypassVersionCheck,
142 bool enablePrefetching,
143 bool enforceGUIDInFileName) :
RootFile(
144 fileName, processConfiguration, logicalFileName, filePtr,
145 nullptr,
false, -1, -1, nStreams, treeCacheSize, treeMaxVirtualSize,
149 indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
150 bypassVersionCheck,
false,
151 false, enablePrefetching, enforceGUIDInFileName) {}
163 std::shared_ptr<LuminosityBlockAuxiliary> readLuminosityBlockAuxiliary_();
164 std::shared_ptr<RunAuxiliary> readRunAuxiliary_();
165 std::shared_ptr<RunAuxiliary> readFakeRunAuxiliary_();
170 std::shared_ptr<ProductRegistry const>
productRegistry()
const {
return productRegistry_;}
183 bool modifiedIDs()
const {
return daqProvenanceHelper_.get() !=
nullptr;}
184 std::unique_ptr<FileBlock> createFileBlock()
const;
186 return (event != 0) ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
196 indexIntoFileIter_ = indexIntoFileBegin_;
202 indexIntoFileIter_ = indexIntoFileEnd_;
207 bool goToEvent(
EventID const& eventID);
214 bool wasLastEventJustRead()
const;
215 bool wasFirstEventJustRead()
const;
218 void initAssociationsFromSecondary(std::vector<BranchID>
const&);
224 bool skipThisEntry();
225 void setIfFastClonable(
int remainingEvents,
int remainingLumis);
226 void validateFile(
InputType inputType,
bool usingGoToEvent);
227 void fillIndexIntoFile();
229 void fillThisEventAuxiliary();
230 void fillEventHistory();
231 std::shared_ptr<LuminosityBlockAuxiliary> fillLumiAuxiliary();
232 std::shared_ptr<RunAuxiliary> fillRunAuxiliary();
234 void markBranchToBeDropped(
bool dropDescendants,
BranchDescription const&
branch, std::set<BranchID>& branchesToDrop, std::map<BranchID, BranchID>
const& droppedToKeptAlias)
const;
236 void readParentageTree(
InputType inputType);
237 void readEntryDescriptionTree(EntryDescriptionMap& entryDescriptionMap,
InputType inputType);
238 void readEventHistoryTree();
239 bool isDuplicateEvent();
241 void initializeDuplicateChecker(std::vector<std::shared_ptr<IndexIntoFile> >
const& indexesIntoFiles,
242 std::vector<std::shared_ptr<IndexIntoFile> >::
size_type currentIndexIntoFile);
244 std::unique_ptr<MakeProvenanceReader> makeProvenanceReaderMaker(
InputType inputType);
245 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)
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)
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_
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
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)
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_