CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::RootFile Class Reference

#include <RootFile.h>

Public Member Functions

std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
std::shared_ptr< BranchIDListHelper const > branchIDListHelper () const
 
bool branchListIndexesUnchanged () const
 
void close ()
 
bool containsItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
 
std::shared_ptr< FileBlockcreateFileBlock ()
 
bool endOfProcessBlocksReached () const
 
RootTree const & eventTree () const
 
std::string const & file () const
 
FileFormatVersion fileFormatVersion () const
 
void fillProcessBlockHelper_ ()
 
IndexIntoFile::EntryType getNextItemType (RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
 
bool goToEvent (EventID const &eventID)
 
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch () const
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter () const
 
std::shared_ptr< IndexIntoFile > & indexIntoFileSharedPtr ()
 
std::shared_ptr< IndexIntoFile const > indexIntoFileSharedPtr () const
 
void initAssociationsFromSecondary (std::vector< BranchID > const &)
 
bool initializeFirstProcessBlockEntry ()
 
RootTree const & lumiTree () const
 
bool modifiedIDs () const
 
bool nextEventEntry ()
 
bool nextProcessBlock_ (ProcessBlockPrincipal &)
 
RootFileoperator= (RootFile const &)=delete
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 
std::tuple< bool, bool > readCurrentEvent (EventPrincipal &cache, bool assertOnFailure=true)
 
bool readEvent (EventPrincipal &cache)
 
void readFakeRun_ (RunPrincipal &runPrincipal)
 
std::shared_ptr< RunAuxiliaryreadFakeRunAuxiliary_ ()
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()
 
void readProcessBlock_ (ProcessBlockPrincipal &)
 
void readRun_ (RunPrincipal &runPrincipal)
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()
 
void reportOpened (std::string const &inputType)
 
void rewind ()
 
 RootFile (RootFile const &)=delete
 
 RootFile (std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunHelperBase *runHelper, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, std::shared_ptr< BranchIDListHelper > branchIDListHelper, ProcessBlockHelper *, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, std::shared_ptr< DuplicateChecker > duplicateChecker, 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 usingGoToEvent, bool enablePrefetching, bool enforceGUIDInFileName)
 
 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)
 
 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)
 
RootTree const & runTree () const
 
void setAtEventEntry (IndexIntoFile::EntryNumber_t entry)
 
bool setEntryAtEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtNextEventInLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtRun (RunNumber_t run)
 
void setPosition (IndexIntoFile::IndexIntoFileItr const &position)
 
void setSignals (signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
 
void setToLastEntry ()
 
bool skipEntries (unsigned int &offset)
 
bool skipEvents (int &offset)
 
void updateFileBlock (FileBlock &)
 
bool wasFirstEventJustRead () const
 
bool wasLastEventJustRead () const
 
int whyNotFastClonable () const
 
 ~RootFile ()
 

Private Member Functions

std::shared_ptr< BranchChildren > & branchChildren ()
 
std::shared_ptr< BranchChildren const > branchChildren () const
 
void dropOnInputAndReorder (ProductRegistry &, ProductSelectorRules const &, bool dropDescendants, InputType, StoredProcessBlockHelper &, ProcessBlockHelper const *)
 
void dropProcessesAndReorder (StoredProcessBlockHelper &, std::set< std::string > const &processesWithKeptProcessBlockProducts, ProcessBlockHelper const *)
 
std::shared_ptr< ProductProvenanceRetriever > & eventProductProvenanceRetriever (size_t index)
 
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever (size_t index) const
 
EventAuxiliary fillEventAuxiliary (IndexIntoFile::EntryNumber_t entry)
 
bool fillEventHistory (EventAuxiliary &evtAux, EventSelectionIDVector &eventSelectionIDs, BranchListIndexes &branchListIndexes, bool assertOnFailure=true)
 
void fillEventToProcessBlockIndexes ()
 
void fillIndexIntoFile ()
 
std::shared_ptr< LuminosityBlockAuxiliaryfillLumiAuxiliary ()
 
std::shared_ptr< RunAuxiliaryfillRunAuxiliary ()
 
EventAuxiliary const & fillThisEventAuxiliary ()
 
void initializeDuplicateChecker (std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
 
bool isDuplicateEvent ()
 
void makeProcessBlockRootTrees (std::shared_ptr< InputFile > filePtr, int treeMaxVirtualSize, bool enablePrefetching, InputType inputType, StoredProcessBlockHelper const &storedProcessBlockHelper)
 
std::shared_ptr< ProductProvenanceRetrievermakeProductProvenanceRetriever (unsigned int iStreamIndex)
 
std::unique_ptr< MakeProvenanceReadermakeProvenanceReaderMaker (InputType inputType)
 
void markBranchToBeDropped (bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
 
std::string const & newBranchToOldBranch (std::string const &newBranch) const
 
void readEntryDescriptionTree (EntryDescriptionMap &entryDescriptionMap, InputType inputType)
 
void readEventHistoryTree ()
 
void readParentageTree (InputType inputType)
 
std::shared_ptr< RunAuxiliary > & savedRunAuxiliary ()
 
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary () const
 
void setIfFastClonable (int remainingEvents, int remainingLumis)
 
void setPresenceInProductRegistry (ProductRegistry &, StoredProcessBlockHelper const &)
 
bool skipThisEntry ()
 
void validateFile (InputType inputType, bool usingGoToEvent)
 

Private Attributes

edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
 
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
 
std::shared_ptr< BranchIDLists const > branchIDLists_
 
bool branchListIndexesUnchanged_
 
unsigned int currentProcessBlockTree_ = 0
 
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
 
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
 
edm::propagate_const< TClass * > edProductClass_
 
bool enforceGUIDInFileName_
 
EventAuxiliary eventAuxCache_
 
edm::propagate_const< TTree * > eventHistoryTree_
 
std::vector< EventProcessHistoryIDeventProcessHistoryIDs_
 
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
 
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
 
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
 
EventToProcessBlockIndexes eventToProcessBlockIndexes_
 
edm::propagate_const< TBranch * > eventToProcessBlockIndexesBranch_
 
RootTree eventTree_
 
FileID fid_
 
const std::string file_
 
FileFormatVersion fileFormatVersion_
 
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
 
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
 
std::array< bool, NumBranchTypeshasNewlyDroppedBranch_
 
edm::propagate_const< std::unique_ptr< History > > history_
 
IndexIntoFileindexIntoFile_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
 
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
 
InputType inputType_
 
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
 
const std::string logicalFile_
 
RootTree lumiTree_
 
std::map< std::string, std::string > newBranchToOldBranch_
 
bool noEventSort_
 
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
 
std::vector< ParentageIDparentageIDLookup_
 
edm::propagate_const< ProcessBlockHelper * > processBlockHelper_
 
std::vector< edm::propagate_const< std::unique_ptr< RootTree > > > processBlockTrees_
 
ProcessConfiguration const & processConfiguration_
 
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
 
InputSource::ProcessingMode processingMode_
 
std::shared_ptr< ProductRegistry const > productRegistry_
 
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
 
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
 
edm::propagate_const< RunHelperBase * > runHelper_
 
RootTree runTree_
 
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
 
bool skipAnyEvents_
 
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
 
edm::propagate_const< std::unique_ptr< StoredProcessBlockHelper > > storedProcessBlockHelper_
 
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
std::vector< edm::propagate_const< RootTree * > > treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 71 of file RootFile.h.

Constructor & Destructor Documentation

◆ RootFile() [1/4]

edm::RootFile::RootFile ( std::string const &  fileName,
ProcessConfiguration const &  processConfiguration,
std::string const &  logicalFileName,
std::shared_ptr< InputFile filePtr,
std::shared_ptr< EventSkipperByID eventSkipperByID,
bool  skipAnyEvents,
int  remainingEvents,
int  remainingLumis,
unsigned int  nStreams,
unsigned int  treeCacheSize,
int  treeMaxVirtualSize,
InputSource::ProcessingMode  processingMode,
RunHelperBase runHelper,
bool  noEventSort,
ProductSelectorRules const &  productSelectorRules,
InputType  inputType,
std::shared_ptr< BranchIDListHelper branchIDListHelper,
ProcessBlockHelper processBlockHelper,
std::shared_ptr< ThinnedAssociationsHelper thinnedAssociationsHelper,
std::vector< BranchID > const *  associationsFromSecondary,
std::shared_ptr< DuplicateChecker duplicateChecker,
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  usingGoToEvent,
bool  enablePrefetching,
bool  enforceGUIDInFileName 
)

Definition at line 145 of file RootFile.cc.

176  : file_(fileName),
177  logicalFile_(logicalFileName),
178  processConfiguration_(processConfiguration),
179  processHistoryRegistry_(&processHistoryRegistry),
180  filePtr_(filePtr),
181  eventSkipperByID_(eventSkipperByID),
183  fid_(),
184  indexIntoFileSharedPtr_(new IndexIntoFile),
186  orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
191  storedMergeableRunProductMetadata_((inputType == InputType::Primary) ? new StoredMergeableRunProductMetadata
192  : nullptr),
196  skipAnyEvents_(skipAnyEvents),
197  noEventSort_(noEventSort),
198  enforceGUIDInFileName_(enforceGUIDInFileName),
202  eventAuxCache_(),
203  eventTree_(filePtr,
204  InEvent,
205  nStreams,
206  treeMaxVirtualSize,
207  treeCacheSize,
209  enablePrefetching,
210  inputType),
211  lumiTree_(filePtr,
212  InLumi,
213  1,
214  treeMaxVirtualSize,
217  enablePrefetching,
218  inputType),
219  runTree_(filePtr,
220  InRun,
221  1,
222  treeMaxVirtualSize,
225  enablePrefetching,
226  inputType),
227  treePointers_(),
230  branchIDLists_(),
232  processBlockHelper_(processBlockHelper),
234  thinnedAssociationsHelper_(thinnedAssociationsHelper),
236  runHelper_(runHelper),
238  eventHistoryTree_(nullptr),
240  inputType == InputType::Primary
242  : nullptr),
243  history_(),
244  branchChildren_(new BranchChildren),
245  duplicateChecker_(duplicateChecker),
251  edProductClass_(TypeWithDict::byName("edm::WrapperBase").getClass()),
252  inputType_(inputType) {
253  hasNewlyDroppedBranch_.fill(false);
254 
255  treePointers_.resize(3);
259 
260  // Read the metadata tree.
261  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
262  std::unique_ptr<TTree> metaDataTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::metaDataTreeName().c_str())));
263  if (nullptr == metaDataTree.get()) {
265  << "Could not find tree " << poolNames::metaDataTreeName() << " in the input file.\n";
266  }
267 
268  // To keep things simple, we just read in every possible branch that exists.
269  // We don't pay attention to which branches exist in which file format versions
270 
271  FileFormatVersion* fftPtr = &fileFormatVersion_;
272  if (metaDataTree->FindBranch(poolNames::fileFormatVersionBranchName().c_str()) != nullptr) {
273  TBranch* fft = metaDataTree->GetBranch(poolNames::fileFormatVersionBranchName().c_str());
274  fft->SetAddress(&fftPtr);
275  roottree::getEntry(fft, 0);
276  metaDataTree->SetBranchAddress(poolNames::fileFormatVersionBranchName().c_str(), &fftPtr);
277  }
278 
279  FileID* fidPtr = &fid_;
280  if (metaDataTree->FindBranch(poolNames::fileIdentifierBranchName().c_str()) != nullptr) {
281  metaDataTree->SetBranchAddress(poolNames::fileIdentifierBranchName().c_str(), &fidPtr);
282  }
283 
284  IndexIntoFile* iifPtr = &indexIntoFile_;
285  if (metaDataTree->FindBranch(poolNames::indexIntoFileBranchName().c_str()) != nullptr) {
286  metaDataTree->SetBranchAddress(poolNames::indexIntoFileBranchName().c_str(), &iifPtr);
287  }
288 
289  storedProcessBlockHelper_ = std::make_unique<StoredProcessBlockHelper>();
290  StoredProcessBlockHelper& storedProcessBlockHelper = *storedProcessBlockHelper_;
291  StoredProcessBlockHelper* pStoredProcessBlockHelper = storedProcessBlockHelper_.get();
292  if (inputType == InputType::Primary) {
293  if (metaDataTree->FindBranch(poolNames::processBlockHelperBranchName().c_str()) != nullptr) {
294  metaDataTree->SetBranchAddress(poolNames::processBlockHelperBranchName().c_str(), &pStoredProcessBlockHelper);
295  }
296  }
297 
298  StoredMergeableRunProductMetadata* smrc = nullptr;
299  if (inputType == InputType::Primary) {
301  if (metaDataTree->FindBranch(poolNames::mergeableRunProductMetadataBranchName().c_str()) != nullptr) {
302  metaDataTree->SetBranchAddress(poolNames::mergeableRunProductMetadataBranchName().c_str(), &smrc);
303  }
304  }
305 
306  // Need to read to a temporary registry so we can do a translation of the BranchKeys.
307  // This preserves backward compatibility against friendly class name algorithm changes.
308  ProductRegistry inputProdDescReg;
309  ProductRegistry* ppReg = &inputProdDescReg;
310  metaDataTree->SetBranchAddress(poolNames::productDescriptionBranchName().c_str(), (&ppReg));
311 
312  using PsetMap = std::map<ParameterSetID, ParameterSetBlob>;
313  PsetMap psetMap;
314  PsetMap* psetMapPtr = &psetMap;
315  if (metaDataTree->FindBranch(poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
316  //backward compatibility
317  assert(!fileFormatVersion().parameterSetsTree());
318  metaDataTree->SetBranchAddress(poolNames::parameterSetMapBranchName().c_str(), &psetMapPtr);
319  } else {
320  assert(fileFormatVersion().parameterSetsTree());
321  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
322  std::unique_ptr<TTree> psetTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parameterSetsTreeName().c_str())));
323  if (nullptr == psetTree.get()) {
325  << "Could not find tree " << poolNames::parameterSetsTreeName() << " in the input file.\n";
326  }
327 
328  using IdToBlobs = std::pair<ParameterSetID, ParameterSetBlob>;
329  IdToBlobs idToBlob;
330  IdToBlobs* pIdToBlob = &idToBlob;
331  psetTree->SetBranchAddress(poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
332 
333  std::unique_ptr<TTreeCache> psetTreeCache =
335  psetTreeCache->SetEnablePrefetching(false);
336  filePtr_->SetCacheRead(psetTreeCache.get());
337  for (Long64_t i = 0; i != psetTree->GetEntries(); ++i) {
338  psetTree->GetEntry(i);
339  psetMap.insert(idToBlob);
340  }
341  filePtr_->SetCacheRead(nullptr);
342  }
343 
344  // backward compatibility
346  ProcessHistoryRegistry::collection_type* pHistMapPtr = &pHistMap;
347  if (metaDataTree->FindBranch(poolNames::processHistoryMapBranchName().c_str()) != nullptr) {
348  metaDataTree->SetBranchAddress(poolNames::processHistoryMapBranchName().c_str(), &pHistMapPtr);
349  }
350 
352  ProcessHistoryRegistry::vector_type* pHistVectorPtr = &pHistVector;
353  if (metaDataTree->FindBranch(poolNames::processHistoryBranchName().c_str()) != nullptr) {
354  metaDataTree->SetBranchAddress(poolNames::processHistoryBranchName().c_str(), &pHistVectorPtr);
355  }
356 
357  // backward compatibility
358  ProcessConfigurationVector processConfigurations;
359  ProcessConfigurationVector* procConfigVectorPtr = &processConfigurations;
360  if (metaDataTree->FindBranch(poolNames::processConfigurationBranchName().c_str()) != nullptr) {
361  metaDataTree->SetBranchAddress(poolNames::processConfigurationBranchName().c_str(), &procConfigVectorPtr);
362  }
363 
364  auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
365  BranchIDLists* branchIDListsPtr = branchIDListsAPtr.get();
366  if (metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) != nullptr) {
367  metaDataTree->SetBranchAddress(poolNames::branchIDListBranchName().c_str(), &branchIDListsPtr);
368  }
369 
370  if (inputType != InputType::SecondarySource) {
372  std::make_unique<ThinnedAssociationsHelper>(); // propagate_const<T> has no reset() function
373  ThinnedAssociationsHelper* thinnedAssociationsHelperPtr = fileThinnedAssociationsHelper_.get();
374  if (metaDataTree->FindBranch(poolNames::thinnedAssociationsHelperBranchName().c_str()) != nullptr) {
375  metaDataTree->SetBranchAddress(poolNames::thinnedAssociationsHelperBranchName().c_str(),
376  &thinnedAssociationsHelperPtr);
377  }
378  }
379 
380  BranchChildren* branchChildrenBuffer = branchChildren_.get();
381  if (metaDataTree->FindBranch(poolNames::productDependenciesBranchName().c_str()) != nullptr) {
382  metaDataTree->SetBranchAddress(poolNames::productDependenciesBranchName().c_str(), &branchChildrenBuffer);
383  }
384 
385  // backward compatibility
386  std::vector<EventProcessHistoryID>* eventHistoryIDsPtr = &eventProcessHistoryIDs_;
387  if (metaDataTree->FindBranch(poolNames::eventHistoryBranchName().c_str()) != nullptr) {
388  metaDataTree->SetBranchAddress(poolNames::eventHistoryBranchName().c_str(), &eventHistoryIDsPtr);
389  }
390 
391  if (metaDataTree->FindBranch(poolNames::moduleDescriptionMapBranchName().c_str()) != nullptr) {
392  if (metaDataTree->GetBranch(poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
393  metaDataTree->SetBranchStatus((poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), false);
394  } else {
395  metaDataTree->SetBranchStatus(poolNames::moduleDescriptionMapBranchName().c_str(), false);
396  }
397  }
398 
399  // Here we read the metadata tree
400  roottree::getEntry(metaDataTree.get(), 0);
401 
403 
404  // Here we read the event history tree, if we have one.
406 
408  if (!fileFormatVersion().triggerPathsTracked()) {
409  ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion().parameterSetsByReference());
410  } else {
411  // Merge into the parameter set registry.
412  pset::Registry& psetRegistry = *pset::Registry::instance();
413  for (auto const& psetEntry : psetMap) {
414  ParameterSet pset(psetEntry.second.pset());
415  pset.setID(psetEntry.first);
416  // For thread safety, don't update global registries when a secondary source opens a file.
417  if (inputType != InputType::SecondarySource) {
418  psetRegistry.insertMapped(pset);
419  }
420  }
421  }
422  if (!fileFormatVersion().splitProductIDs()) {
423  // Old provenance format input file. Create a provenance adaptor.
424  // propagate_const<T> has no reset() function
425  provenanceAdaptor_ = std::make_unique<ProvenanceAdaptor>(
426  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, true);
427  // Fill in the branchIDLists branch from the provenance adaptor
428  branchIDLists_ = provenanceAdaptor_->branchIDLists();
429  } else {
430  if (!fileFormatVersion().triggerPathsTracked()) {
431  // New provenance format, but change in ParameterSet Format. Create a provenance adaptor.
432  // propagate_const<T> has no reset() function
433  provenanceAdaptor_ = std::make_unique<ProvenanceAdaptor>(
434  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, false);
435  }
436  // New provenance format input file. The branchIDLists branch was read directly from the input file.
437  if (metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) == nullptr) {
438  throw Exception(errors::EventCorruption) << "Failed to find branchIDLists branch in metaData tree.\n";
439  }
440  branchIDLists_.reset(branchIDListsAPtr.release());
441  }
442 
444  if (metaDataTree->FindBranch(poolNames::thinnedAssociationsHelperBranchName().c_str()) == nullptr) {
446  << "Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
447  }
448  }
449 
450  if (!bypassVersionCheck) {
451  checkReleaseVersion(pHistVector, file());
452  }
453 
454  if (labelRawDataLikeMC) {
455  std::string const rawData("FEDRawDataCollection");
456  std::string const source("source");
457  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
458  BranchKey finder(rawData, source, "", "");
459  ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
460  if (it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source) {
461  // We found raw data with a module label of source.
462  // We need to change the module label and process name.
463  // Create helper.
464  it->second.init();
465  // propagate_const<T> has no reset() function
466  daqProvenanceHelper_ = std::make_unique<DaqProvenanceHelper>(it->second.unwrappedTypeID());
467  // Create the new branch description
468  BranchDescription const& newBD = daqProvenanceHelper_->branchDescription();
469  // Save info from the old and new branch descriptions
470  daqProvenanceHelper_->saveInfo(it->second, newBD);
471  // Map the new branch name to the old branch name.
472  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), it->second.branchName()));
473  // Remove the old branch description from the product Registry.
474  pList.erase(it);
475  // Check that there was only one.
476  it = pList.lower_bound(finder);
477  assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source));
478  // Insert the new branch description into the product registry.
479  inputProdDescReg.copyProduct(newBD);
480  // Fix up other per file metadata.
481  daqProvenanceHelper_->fixMetaData(processConfigurations, pHistVector);
482  daqProvenanceHelper_->fixMetaData(*branchIDLists_);
483  daqProvenanceHelper_->fixMetaData(*branchChildren_);
484  }
485  }
486 
487  for (auto const& history : pHistVector) {
488  processHistoryRegistry.registerProcessHistory(history);
489  }
490 
492 
493  // Update the branch id info. This has to be done before validateFile since
494  // depending on the file format, the branchIDListHelper_ may have its fixBranchListIndexes call made
495  if (inputType == InputType::Primary) {
497  }
498 
499  validateFile(inputType, usingGoToEvent);
500 
501  // Here, we make the class that will make the ProvenanceReader
502  // It reads whatever trees it needs.
503  // propagate_const<T> has no reset() function
504  provenanceReaderMaker_ = std::unique_ptr<MakeProvenanceReader>(makeProvenanceReaderMaker(inputType).release());
505 
506  // Merge into the hashed registries.
507  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
509  }
510 
511  initializeDuplicateChecker(indexesIntoFiles, currentIndexIntoFile);
518 
519  makeProcessBlockRootTrees(filePtr, treeMaxVirtualSize, enablePrefetching, inputType, storedProcessBlockHelper);
520 
521  setPresenceInProductRegistry(inputProdDescReg, storedProcessBlockHelper);
522 
523  auto newReg = std::make_unique<ProductRegistry>();
524 
525  // Do the translation from the old registry to the new one
526  {
527  ProductRegistry::ProductList const& prodList = inputProdDescReg.productList();
528  for (auto const& product : prodList) {
529  BranchDescription const& prod = product.second;
530  std::string newFriendlyName = friendlyname::friendlyName(prod.className());
531  if (newFriendlyName == prod.friendlyClassName()) {
532  newReg->copyProduct(prod);
533  } else {
534  if (fileFormatVersion().splitProductIDs()) {
536  << "Cannot change friendly class name algorithm without more development work\n"
537  << "to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
538  }
539  BranchDescription newBD(prod);
540  newBD.updateFriendlyClassName();
541  newReg->copyProduct(newBD);
542  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), prod.branchName()));
543  }
544  }
545 
547  *newReg, productSelectorRules, dropDescendants, inputType, storedProcessBlockHelper, processBlockHelper);
548 
549  if (inputType == InputType::SecondaryFile) {
550  thinnedAssociationsHelper->updateFromSecondaryInput(*fileThinnedAssociationsHelper_,
551  *associationsFromSecondary);
552  } else if (inputType == InputType::Primary) {
553  processBlockHelper->initializeFromPrimaryInput(storedProcessBlockHelper);
554  thinnedAssociationsHelper->updateFromPrimaryInput(*fileThinnedAssociationsHelper_);
555  }
556 
557  if (inputType == InputType::Primary) {
558  for (auto& product : newReg->productListUpdator()) {
559  setIsMergeable(product.second);
560  }
561  }
562  //inform system we want to use DelayedReader
563  for (auto& product : newReg->productListUpdator()) {
564  product.second.setOnDemand(true);
565  }
566 
567  for (auto& processBlockTree : processBlockTrees_) {
568  treePointers_.push_back(processBlockTree.get());
569  }
570 
571  // freeze the product registry
572  newReg->setFrozen(inputType != InputType::Primary);
573  productRegistry_.reset(newReg.release());
574  }
575 
576  // Set up information from the product registry.
577  ProductRegistry::ProductList const& prodList = productRegistry()->productList();
578 
579  {
580  std::vector<size_t> nBranches(treePointers_.size(), 0);
581  for (auto const& product : prodList) {
582  if (product.second.branchType() == InProcess) {
583  std::vector<std::string> const& processes = storedProcessBlockHelper.processesWithProcessBlockProducts();
584  auto it = std::find(processes.begin(), processes.end(), product.second.processName());
585  if (it != processes.end()) {
586  auto index = std::distance(processes.begin(), it);
588  }
589  } else {
590  ++nBranches[product.second.branchType()];
591  }
592  }
593 
594  int i = 0;
595  for (auto& t : treePointers_) {
596  t->numberOfBranchesToAdd(nBranches[i]);
597  ++i;
598  }
599  }
600  for (auto const& product : prodList) {
601  BranchDescription const& prod = product.second;
602  if (prod.branchType() == InProcess) {
603  std::vector<std::string> const& processes = storedProcessBlockHelper.processesWithProcessBlockProducts();
604  auto it = std::find(processes.begin(), processes.end(), prod.processName());
605  if (it != processes.end()) {
606  auto index = std::distance(processes.begin(), it);
608  newBranchToOldBranch(prod.branchName()));
609  }
610  } else {
611  treePointers_[prod.branchType()]->addBranch(prod, newBranchToOldBranch(prod.branchName()));
612  }
613  }
614 
615  // Determine if this file is fast clonable.
616  setIfFastClonable(remainingEvents, remainingLumis);
617 
618  // We are done with our initial reading of EventAuxiliary.
620 
621  // Tell the event tree to begin training at the next read.
623 
624  // Train the run and lumi trees.
625  runTree_.trainCache("*");
626  lumiTree_.trainCache("*");
627  for (auto& processBlockTree : processBlockTrees_) {
628  processBlockTree->trainCache("*");
629  }
630  }

References cms::cuda::assert(), edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), branchIDListHelper_, branchIDLists_, branchListIndexesUnchanged_, edm::BranchDescription::branchName(), edm::BranchTypeToAuxiliaryBranchName(), edm::ProductRegistry::copyProduct(), daqProvenanceHelper_, edm::roottree::defaultNonEventCacheSize, HLT_FULL_cff::distance, edm::IndexIntoFile::doneFileInitialization(), dropOnInputAndReorder(), edm::IndexIntoFile::end(), edm::errors::EventCorruption, edm::poolNames::eventHistoryBranchName(), eventProcessHistoryIDs_, eventProcessHistoryIter_, eventSkipperByID_, edm::FileBlock::EventsOrLumisSelectedByID, eventTree_, Exception, fid_, file(), fileFormatVersion(), fileFormatVersion_, edm::poolNames::fileFormatVersionBranchName(), edm::poolNames::fileIdentifierBranchName(), filePtr_, edm::errors::FileReadError, fileThinnedAssociationsHelper_, spr::find(), HLT_FULL_cff::finder, edm::IndexIntoFile::firstAppearanceOrder, edm::friendlyname::friendlyName(), edm::roottree::getEntry(), hasNewlyDroppedBranch_, edm::FileFormatVersion::hasThinnedAssociations(), mps_fire::i, edm::poolNames::idToParameterSetBlobsBranchName(), indexIntoFile_, indexIntoFileBegin_, edm::poolNames::indexIntoFileBranchName(), indexIntoFileEnd_, indexIntoFileIter_, edm::InEvent, initializeDuplicateChecker(), edm::ProcessBlockHelper::initializeFromPrimaryInput(), edm::InLumi, edm::InProcess, edm::InRun, edm::pset::Registry::insertMapped(), edm::pset::Registry::instance(), lumiTree_, makeProcessBlockRootTrees(), makeProvenanceReaderMaker(), edm::poolNames::mergeableRunProductMetadataBranchName(), edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, edm::numberOfRunLumiEventProductTrees, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::Primary, edm::poolNames::processBlockHelperBranchName(), processBlockTrees_, edm::poolNames::processConfigurationBranchName(), dqmiodatasetharvest::processes, edm::StoredProcessBlockHelper::processesWithProcessBlockProducts(), edm::poolNames::processHistoryBranchName(), edm::poolNames::processHistoryMapBranchName(), dumpMFGeometry_cfg::prod, edm::poolNames::productDependenciesBranchName(), edm::poolNames::productDescriptionBranchName(), edm::ProductRegistry::productList(), edm::ProductRegistry::productListUpdator(), productRegistry(), productRegistry_, provenanceAdaptor_, provenanceReaderMaker_, muonDTDigis_cfi::pset, l1tstage2_dqm_sourceclient-live_cfg::rawData, readEventHistoryTree(), edm::ProcessHistoryRegistry::registerProcessHistory(), fetchall_from_DQM_v2::release, edm::RootTree::resetTraining(), edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, runTree_, edm::SecondaryFile, edm::SecondarySource, setIfFastClonable(), edm::setIsMergeable(), setPresenceInProductRegistry(), edm::source(), storedMergeableRunProductMetadata_, storedProcessBlockHelper_, AlCaHLTBitMon_QueryRunRegistry::string, submitPVValidationJobs::t, edm::poolNames::thinnedAssociationsHelperBranchName(), edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), validateFile(), and whyNotFastClonable_.

◆ RootFile() [2/4]

edm::RootFile::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 
)
inline

Definition at line 107 of file RootFile.h.

129  : RootFile(fileName,
130  processConfiguration,
131  logicalFileName,
132  filePtr,
133  nullptr,
134  false,
135  -1,
136  -1,
137  nStreams,
138  0U,
139  treeMaxVirtualSize,
141  runHelper,
142  false,
143  productSelectorRules,
144  inputType,
146  nullptr,
147  thinnedAssociationsHelper,
148  associationsFromSecondary,
149  nullptr,
150  dropDescendantsOfDroppedProducts,
151  processHistoryRegistry,
152  indexesIntoFiles,
153  currentIndexIntoFile,
154  orderedProcessHistoryIDs,
155  bypassVersionCheck,
156  labelRawDataLikeMC,
157  false,
158  enablePrefetching,
159  enforceGUIDInFileName) {}

◆ RootFile() [3/4]

edm::RootFile::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 
)
inline

Definition at line 162 of file RootFile.h.

179  : RootFile(fileName,
180  processConfiguration,
181  logicalFileName,
182  filePtr,
183  nullptr,
184  false,
185  -1,
186  -1,
187  nStreams,
188  treeCacheSize,
189  treeMaxVirtualSize,
191  runHelper,
192  false,
193  productSelectorRules,
194  inputType,
195  nullptr,
196  nullptr,
197  nullptr,
198  nullptr,
199  nullptr,
200  false,
201  processHistoryRegistry,
202  indexesIntoFiles,
203  currentIndexIntoFile,
204  orderedProcessHistoryIDs,
205  bypassVersionCheck,
206  false,
207  false,
208  enablePrefetching,
209  enforceGUIDInFileName) {}

◆ ~RootFile()

edm::RootFile::~RootFile ( )

Definition at line 632 of file RootFile.cc.

632 {}

◆ RootFile() [4/4]

edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

◆ branchChildren() [1/2]

std::shared_ptr<BranchChildren>& edm::RootFile::branchChildren ( )
inlineprivate

Definition at line 346 of file RootFile.h.

References branchChildren_, and edm::get_underlying_safe().

◆ branchChildren() [2/2]

std::shared_ptr<BranchChildren const> edm::RootFile::branchChildren ( ) const
inlineprivate

Definition at line 345 of file RootFile.h.

References branchChildren_, and edm::get_underlying_safe().

Referenced by createFileBlock().

◆ branchIDListHelper() [1/2]

std::shared_ptr<BranchIDListHelper>& edm::RootFile::branchIDListHelper ( )
inline

Definition at line 280 of file RootFile.h.

References branchIDListHelper_, and edm::get_underlying_safe().

◆ branchIDListHelper() [2/2]

std::shared_ptr<BranchIDListHelper const> edm::RootFile::branchIDListHelper ( ) const
inline

Definition at line 277 of file RootFile.h.

277  {
279  }

References branchIDListHelper_, and edm::get_underlying_safe().

◆ branchListIndexesUnchanged()

bool edm::RootFile::branchListIndexesUnchanged ( ) const
inline

Definition at line 245 of file RootFile.h.

245 { return branchListIndexesUnchanged_; }

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

◆ close()

void edm::RootFile::close ( void  )

Definition at line 1276 of file RootFile.cc.

1276  {
1277  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1278  eventHistoryTree_ = nullptr;
1279  for (auto& treePointer : treePointers_) {
1280  treePointer->close();
1281  treePointer = nullptr;
1282  }
1283  filePtr_->Close();
1284  filePtr_ = nullptr; // propagate_const<T> has no reset() function
1285  }

References eventHistoryTree_, filePtr_, and treePointers_.

Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().

◆ containsItem()

bool edm::RootFile::containsItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
) const

Definition at line 873 of file RootFile.cc.

873  {
875  }

References edm::IndexIntoFile::containsItem(), indexIntoFile_, and writedatasetfile::run.

◆ createFileBlock()

std::shared_ptr< FileBlock > edm::RootFile::createFileBlock ( )

Definition at line 759 of file RootFile.cc.

759  {
760  std::vector<TTree*> processBlockTrees;
761  std::vector<std::string> processesWithProcessBlockTrees;
762  processBlockTrees.reserve(processBlockTrees_.size());
763  processesWithProcessBlockTrees.reserve(processBlockTrees_.size());
764  for (auto& processBlockTree : processBlockTrees_) {
765  processBlockTrees.push_back(processBlockTree->tree());
766  processesWithProcessBlockTrees.push_back(processBlockTree->processName());
767  }
768  return std::make_shared<FileBlock>(fileFormatVersion(),
769  eventTree_.tree(),
771  lumiTree_.tree(),
773  runTree_.tree(),
774  runTree_.metaTree(),
775  std::move(processBlockTrees),
776  std::move(processesWithProcessBlockTrees),
779  file_,
781  modifiedIDs(),
782  branchChildren());
783  }

References branchChildren(), branchListIndexesUnchanged(), eventTree_, file_, fileFormatVersion(), hasNewlyDroppedBranch(), lumiTree_, edm::RootTree::metaTree(), modifiedIDs(), eostools::move(), processBlockTrees_, runTree_, edm::RootTree::tree(), and whyNotFastClonable().

◆ dropOnInputAndReorder()

void edm::RootFile::dropOnInputAndReorder ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType,
StoredProcessBlockHelper storedProcessBlockHelper,
ProcessBlockHelper const *  processBlockHelper 
)
private

Definition at line 1896 of file RootFile.cc.

1901  {
1902  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1903 
1904  // First fill in a map we will need to navigate to descendants
1905  // in the case of EDAliases.
1906  std::map<BranchID, BranchID> droppedToKeptAlias;
1907  for (auto const& product : prodList) {
1908  BranchDescription const& prod = product.second;
1909  if (prod.branchID() != prod.originalBranchID() && prod.present()) {
1910  droppedToKeptAlias[prod.originalBranchID()] = prod.branchID();
1911  }
1912  }
1913 
1914  // This object will select products based on the branchName and the
1915  // keep and drop statements which are in the source configuration.
1916  ProductSelector productSelector;
1917  productSelector.initialize(rules, reg.allBranchDescriptions());
1918 
1919  // In this pass, fill in a set of branches to be dropped.
1920  // Don't drop anything yet.
1921  std::set<BranchID> branchesToDrop;
1922  std::vector<BranchDescription const*> associationDescriptions;
1923  for (auto const& product : prodList) {
1924  BranchDescription const& prod = product.second;
1925  if (inputType != InputType::Primary && prod.branchType() == InProcess) {
1926  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1927  } else if (prod.unwrappedType() == typeid(ThinnedAssociation) && prod.present()) {
1928  // Special handling for ThinnedAssociations
1929  if (inputType != InputType::SecondarySource) {
1930  associationDescriptions.push_back(&prod);
1931  } else {
1932  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1933  }
1934  } else if (!productSelector.selected(prod)) {
1935  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1936  }
1937  }
1938 
1939  if (inputType != InputType::SecondarySource) {
1940  // Decide whether to keep the thinned associations and corresponding
1941  // entries in the helper. For secondary source they are all dropped,
1942  // but in other cases we look for thinned collections the associations
1943  // redirect a Ref or Ptr to when dereferencing them.
1944 
1945  // Need a list of kept products in order to determine which thinned associations
1946  // are kept.
1947  std::set<BranchID> keptProductsInEvent;
1948  for (auto const& product : prodList) {
1949  BranchDescription const& prod = product.second;
1950  if (branchesToDrop.find(prod.branchID()) == branchesToDrop.end() && prod.present() &&
1951  prod.branchType() == InEvent) {
1952  keptProductsInEvent.insert(prod.branchID());
1953  }
1954  }
1955 
1956  // Decide which ThinnedAssociations to keep and store the decision in keepAssociation
1957  std::map<BranchID, bool> keepAssociation;
1958  fileThinnedAssociationsHelper_->selectAssociationProducts(
1959  associationDescriptions, keptProductsInEvent, keepAssociation);
1960 
1961  for (auto association : associationDescriptions) {
1962  if (!keepAssociation[association->branchID()]) {
1963  markBranchToBeDropped(dropDescendants, *association, branchesToDrop, droppedToKeptAlias);
1964  }
1965  }
1966 
1967  // Also delete the dropped associations from the ThinnedAssociationsHelper
1968  auto temp = std::make_unique<ThinnedAssociationsHelper>();
1969  for (auto const& associationBranches : fileThinnedAssociationsHelper_->data()) {
1970  auto iter = keepAssociation.find(associationBranches.association());
1971  if (iter != keepAssociation.end() && iter->second) {
1972  temp->addAssociation(associationBranches);
1973  }
1974  }
1975  // propagate_const<T> has no reset() function
1976  fileThinnedAssociationsHelper_ = std::unique_ptr<ThinnedAssociationsHelper>(temp.release());
1977  }
1978 
1979  // On this pass, actually drop the branches.
1980  std::set<std::string> processesWithKeptProcessBlockProducts;
1981  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1982  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1983  BranchDescription const& prod = it->second;
1984  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1985  if (drop) {
1986  if (!prod.dropped()) {
1987  if (productSelector.selected(prod) && prod.unwrappedType() != typeid(ThinnedAssociation) &&
1988  prod.branchType() != InProcess) {
1989  LogWarning("RootFile") << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1990  << "of file '" << file_ << "' because it is dependent on a branch\n"
1991  << "that was explicitly dropped.\n";
1992  }
1993  if (prod.branchType() == InProcess) {
1994  std::vector<std::string> const& processes = storedProcessBlockHelper.processesWithProcessBlockProducts();
1995  auto it = std::find(processes.begin(), processes.end(), prod.processName());
1996  assert(it != processes.end());
1997  auto index = std::distance(processes.begin(), it);
1998  processBlockTrees_[index]->dropBranch(newBranchToOldBranch(prod.branchName()));
1999  } else {
2000  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
2001  }
2002  hasNewlyDroppedBranch_[prod.branchType()] = true;
2003  }
2004  ProductRegistry::ProductList::iterator icopy = it;
2005  ++it;
2006  prodList.erase(icopy);
2007  } else {
2008  if (prod.branchType() == InProcess && prod.present()) {
2009  processesWithKeptProcessBlockProducts.insert(prod.processName());
2010  }
2011  ++it;
2012  }
2013  }
2014 
2015  dropProcessesAndReorder(storedProcessBlockHelper, processesWithKeptProcessBlockProducts, processBlockHelper);
2016 
2017  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
2018  if (inputType == InputType::SecondaryFile) {
2019  TString tString;
2020  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
2021  BranchDescription const& prod = it->second;
2022  if (prod.branchType() != InEvent && prod.branchType() != InProcess) {
2023  TClass* cp = prod.wrappedType().getClass();
2024  void* p = cp->New();
2025  int offset = cp->GetBaseClassOffset(edProductClass_);
2026  std::unique_ptr<WrapperBase> edp = getWrapperBasePtr(p, offset);
2027  if (edp->isMergeable()) {
2028  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
2029  ProductRegistry::ProductList::iterator icopy = it;
2030  ++it;
2031  prodList.erase(icopy);
2032  } else {
2033  ++it;
2034  }
2035  } else
2036  ++it;
2037  }
2038  }
2039  }

References edm::ProductRegistry::allBranchDescriptions(), cms::cuda::assert(), HLT_FULL_cff::distance, drop, dropProcessesAndReorder(), edProductClass_, file_, fileThinnedAssociationsHelper_, spr::find(), edm::getWrapperBasePtr(), hasNewlyDroppedBranch_, edm::InEvent, edm::ProductSelector::initialize(), edm::InProcess, markBranchToBeDropped(), newBranchToOldBranch(), hltrates_dqm_sourceclient-live_cfg::offset, AlCaHLTBitMon_ParallelJobs::p, edm::Primary, processBlockTrees_, dqmiodatasetharvest::processes, edm::StoredProcessBlockHelper::processesWithProcessBlockProducts(), dumpMFGeometry_cfg::prod, edm::ProductRegistry::productListUpdator(), cmsCodeRulesChecker::rules, edm::SecondaryFile, edm::SecondarySource, edm::ProductSelector::selected(), groupFilesInBlocks::temp, and treePointers_.

Referenced by RootFile().

◆ dropProcessesAndReorder()

void edm::RootFile::dropProcessesAndReorder ( StoredProcessBlockHelper storedProcessBlockHelper,
std::set< std::string > const &  processesWithKeptProcessBlockProducts,
ProcessBlockHelper const *  processBlockHelper 
)
private

Definition at line 2041 of file RootFile.cc.

2043  {
2044  // Modify storedProcessBlockHelper and processBlockTrees_
2045  // This should account for dropOnInput and also make the
2046  // order of process blocks in input files after the first
2047  // be the same as the first. Processes with no ProcessBlock
2048  // products should be removed. After this executes,
2049  // the items in storedProcessBlockHelper
2050  // and processBlockTrees should be in exact one to one
2051  // correspondence and in the same order. For input files
2052  // after the first, these items should be either the same
2053  // as or a subset of the items in processBlockHelper and in
2054  // the same order.
2055 
2056  if (processBlockTrees_.empty()) {
2057  return;
2058  }
2059 
2060  std::vector<unsigned int> nEntries;
2061  nEntries.reserve(processBlockTrees_.size());
2062  for (auto const& processBlockTree : processBlockTrees_) {
2063  nEntries.push_back(processBlockTree->entries());
2064  }
2065 
2066  bool firstInputFile = !processBlockHelper->initializedFromInput();
2067  bool isModified = false;
2068  std::vector<unsigned int> finalIndexToStoredIndex;
2069 
2070  if (firstInputFile) {
2071  isModified = processBlockHelper->firstFileDropProcessesAndReorderStored(
2072  storedProcessBlockHelper, processesWithKeptProcessBlockProducts, nEntries, finalIndexToStoredIndex);
2073  } else {
2074  isModified =
2075  processBlockHelper->dropProcessesAndReorderStored(storedProcessBlockHelper,
2076  processesWithKeptProcessBlockProducts,
2077  nEntries,
2078  finalIndexToStoredIndex,
2079  processBlockHelper->processesWithProcessBlockProducts());
2080  }
2081 
2082  // At this point, any modifications to storedProcessBlockHelper are done.
2083  // Make consistent changes to processBlockTrees_ and this will cause
2084  // unneeded RootTrees to be deleted.
2085  if (isModified) {
2086  std::vector<edm::propagate_const<std::unique_ptr<RootTree>>> newProcessBlockTrees;
2087  unsigned int nFinalProducts = storedProcessBlockHelper.processesWithProcessBlockProducts().size();
2088  for (unsigned int j = 0; j < nFinalProducts; ++j) {
2089  unsigned int iStored = finalIndexToStoredIndex[j];
2090  newProcessBlockTrees.push_back(std::move(processBlockTrees_[iStored]));
2091  }
2092  processBlockTrees_.swap(newProcessBlockTrees);
2093  }
2094  }

References edm::ProcessBlockHelper::dropProcessesAndReorderStored(), edm::ProcessBlockHelper::firstFileDropProcessesAndReorderStored(), edm::ProcessBlockHelper::initializedFromInput(), dqmiolumiharvest::j, eostools::move(), processBlockTrees_, edm::ProcessBlockHelperBase::processesWithProcessBlockProducts(), and edm::StoredProcessBlockHelper::processesWithProcessBlockProducts().

Referenced by dropOnInputAndReorder().

◆ endOfProcessBlocksReached()

bool edm::RootFile::endOfProcessBlocksReached ( ) const

Definition at line 1671 of file RootFile.cc.

1671 { return currentProcessBlockTree_ >= processBlockTrees_.size(); }

References currentProcessBlockTree_, and processBlockTrees_.

Referenced by nextProcessBlock_().

◆ eventProductProvenanceRetriever() [1/2]

std::shared_ptr<ProductProvenanceRetriever>& edm::RootFile::eventProductProvenanceRetriever ( size_t  index)
inlineprivate

◆ eventProductProvenanceRetriever() [2/2]

std::shared_ptr<ProductProvenanceRetriever const> edm::RootFile::eventProductProvenanceRetriever ( size_t  index) const
inlineprivate

◆ eventTree()

RootTree const& edm::RootFile::eventTree ( ) const
inline

Definition at line 239 of file RootFile.h.

239 { return eventTree_; }

References eventTree_.

◆ file()

std::string const& edm::RootFile::file ( ) const
inline

Definition at line 234 of file RootFile.h.

234 { return file_; }

References file_.

Referenced by RootFile().

◆ fileFormatVersion()

FileFormatVersion edm::RootFile::fileFormatVersion ( ) const
inline

◆ fillEventAuxiliary()

EventAuxiliary edm::RootFile::fillEventAuxiliary ( IndexIntoFile::EntryNumber_t  entry)
private

◆ fillEventHistory()

bool edm::RootFile::fillEventHistory ( EventAuxiliary evtAux,
EventSelectionIDVector eventSelectionIDs,
BranchListIndexes branchListIndexes,
bool  assertOnFailure = true 
)
private

Definition at line 1331 of file RootFile.cc.

1334  {
1335  // We could consider doing delayed reading, but because we have to
1336  // store this History object in a different tree than the event
1337  // data tree, this is too hard to do in this first version.
1338  if (fileFormatVersion().eventHistoryBranch()) {
1339  // Lumi block number was not in EventID for the relevant releases.
1340  EventID id(evtAux.id().run(), 0, evtAux.id().event());
1341  if (eventProcessHistoryIter_->eventID() != id) {
1342  EventProcessHistoryID target(id, ProcessHistoryID());
1344  assert(eventProcessHistoryIter_->eventID() == id);
1345  }
1346  evtAux.setProcessHistoryID(eventProcessHistoryIter_->processHistoryID());
1348  } else if (fileFormatVersion().eventHistoryTree()) {
1349  // for backward compatibility.
1350  History* pHistory = history_.get();
1351  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1352  if (!eventHistoryBranch) {
1353  throw Exception(errors::EventCorruption) << "Failed to find history branch in event history tree.\n";
1354  }
1355  eventHistoryBranch->SetAddress(&pHistory);
1357  evtAux.setProcessHistoryID(history_->processHistoryID());
1358  eventSelectionIDs.swap(history_->eventSelectionIDs());
1359  branchListIndexes.swap(history_->branchListIndexes());
1360  } else if (fileFormatVersion().noMetaDataTrees()) {
1361  // Current format
1362  EventSelectionIDVector* pESV = &eventSelectionIDs;
1363  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1364  assert(eventSelectionIDBranch != nullptr);
1365  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1366  BranchListIndexes* pBLI = &branchListIndexes;
1367  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1368  assert(branchListIndexesBranch != nullptr);
1369  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1370  }
1371  if (provenanceAdaptor_) {
1372  evtAux.setProcessHistoryID(provenanceAdaptor_->convertID(evtAux.processHistoryID()));
1373  for (auto& esID : eventSelectionIDs) {
1374  esID = provenanceAdaptor_->convertID(esID);
1375  }
1376  }
1377  if (daqProvenanceHelper_) {
1378  evtAux.setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(evtAux.processHistoryID()));
1379  }
1381  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1382  provenanceAdaptor_->branchListIndexes(branchListIndexes);
1383  }
1384  if (branchIDListHelper_) {
1385  return branchIDListHelper_->fixBranchListIndexes(branchListIndexes, assertOnFailure);
1386  }
1387  return true;
1388  }

References cms::cuda::assert(), branchIDListHelper_, edm::poolNames::branchListIndexesBranchName(), daqProvenanceHelper_, edm::RootTree::entryNumber(), edm::EventID::event(), edm::errors::EventCorruption, edm::poolNames::eventHistoryBranchName(), edm::FileFormatVersion::eventHistoryTree(), eventHistoryTree_, eventProcessHistoryIDs_, eventProcessHistoryIter_, edm::poolNames::eventSelectionsBranchName(), eventTree_, Exception, fileFormatVersion(), edm::RootTree::fillBranchEntry(), edm::roottree::getEntry(), history_, triggerObjects_cff::id, edm::EventAuxiliary::id(), edm::lower_bound_all(), edm::FileFormatVersion::noMetaDataTrees(), edm::EventAuxiliary::processHistoryID(), provenanceAdaptor_, edm::EventID::run(), edm::EventAuxiliary::setProcessHistoryID(), edm::FileFormatVersion::splitProductIDs(), filterCSVwithJSON::target, and edm::RootTree::tree().

Referenced by fillIndexIntoFile(), readCurrentEvent(), and readRunAuxiliary_().

◆ fillEventToProcessBlockIndexes()

void edm::RootFile::fillEventToProcessBlockIndexes ( )
private

Definition at line 1311 of file RootFile.cc.

1311  {
1312  TBranch* eventToProcessBlockIndexesBranch = get_underlying_safe(eventToProcessBlockIndexesBranch_);
1313  if (eventToProcessBlockIndexesBranch == nullptr) {
1314  if (processBlockHelper_.get() == nullptr) {
1316  } else {
1318  }
1319  } else {
1320  if (processBlockHelper_->cacheIndexVectorsPerFile().back() == 1u) {
1322  } else {
1323  EventToProcessBlockIndexes* pEventToProcessBlockIndexes = &eventToProcessBlockIndexes_;
1324  eventTree_.fillBranchEntry(eventToProcessBlockIndexesBranch, pEventToProcessBlockIndexes);
1325  unsigned int updatedIndex = eventToProcessBlockIndexes_.index() + processBlockHelper_->outerOffset();
1326  eventToProcessBlockIndexes_.setIndex(updatedIndex);
1327  }
1328  }
1329  }

References eventToProcessBlockIndexes_, eventToProcessBlockIndexesBranch_, eventTree_, edm::RootTree::fillBranchEntry(), edm::get_underlying_safe(), edm::EventToProcessBlockIndexes::index(), processBlockHelper_, and edm::EventToProcessBlockIndexes::setIndex().

Referenced by readCurrentEvent().

◆ fillIndexIntoFile()

void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 989 of file RootFile.cc.

989  {
990  // This function is for backward compatibility.
991  // If reading a current format file, indexIntoFile_ is read from the input
992  // file and should always be there. Note that the algorithm below will work
993  // sometimes but often fail with the new format introduced in release 3_8_0.
994  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
995  // probably a separate function should be written to deal with the task.
996  // This is possible just not implemented yet.
997  assert(!fileFormatVersion().hasIndexIntoFile());
998 
999  typedef std::list<LumiItem> LumiList;
1000  LumiList lumis; // (declare 1)
1001 
1002  typedef std::set<LuminosityBlockID> RunLumiSet;
1003  RunLumiSet runLumiSet; // (declare 2)
1004 
1005  typedef std::list<RunItem> RunList;
1006  RunList runs; // (declare 5)
1007 
1008  typedef std::set<RunNumber_t> RunSet;
1009  RunSet runSet; // (declare 4)
1010 
1011  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
1012  RunItemSet runItemSet; // (declare 3)
1013 
1014  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
1015  PHIDMap phidMap;
1016 
1017  RunNumber_t prevRun = 0;
1018  LuminosityBlockNumber_t prevLumi = 0;
1019  ProcessHistoryID prevPhid;
1020  bool iFirst = true;
1021 
1022  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
1024 
1025  // First, loop through the event tree.
1026  EventSelectionIDVector eventSelectionIDs;
1027  BranchListIndexes branchListIndexes;
1028  while (eventTree_.next()) {
1029  bool newRun = false;
1030  bool newLumi = false;
1031  auto evtAux = fillThisEventAuxiliary();
1032  fillEventHistory(evtAux, eventSelectionIDs, branchListIndexes);
1033 
1034  // Save the event numbers as we loop through the event auxiliary to avoid
1035  // having to read through the event auxiliary again later. These event numbers
1036  // are not actually used in this function, but could be needed elsewhere.
1037  indexIntoFile_.unsortedEventNumbers().push_back(evtAux.event());
1038 
1039  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(evtAux.processHistoryID());
1040 
1041  if (iFirst || prevPhid != reducedPHID || prevRun != evtAux.run()) {
1042  iFirst = false;
1043  newRun = newLumi = true;
1044  } else if (prevLumi != evtAux.luminosityBlock()) {
1045  newLumi = true;
1046  }
1047  prevPhid = reducedPHID;
1048  prevRun = evtAux.run();
1049  prevLumi = evtAux.luminosityBlock();
1050  if (newLumi) {
1051  lumis.emplace_back(
1052  reducedPHID, evtAux.run(), evtAux.luminosityBlock(), eventTree_.entryNumber()); // (insert 1)
1053  runLumiSet.insert(LuminosityBlockID(evtAux.run(), evtAux.luminosityBlock())); // (insert 2)
1054  } else {
1055  LumiItem& currentLumi = lumis.back();
1056  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
1057  ++currentLumi.lastEventEntry_;
1058  }
1059  if (newRun) {
1060  // Insert run in list if it is not already there.
1061  RunItem item(reducedPHID, evtAux.run());
1062  if (runItemSet.insert(item).second) { // (check 3, insert 3)
1063  runs.push_back(std::move(item)); // (insert 5)
1064  runSet.insert(evtAux.run()); // (insert 4)
1065  phidMap.insert(std::make_pair(evtAux.run(), reducedPHID));
1066  }
1067  }
1068  }
1069  // now clean up.
1072 
1073  // Loop over run entries and fill information.
1074 
1075  typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
1076  RunMap runMap; // (declare 11)
1077 
1078  typedef std::vector<RunItem> RunVector;
1079  RunVector emptyRuns; // (declare 12)
1080 
1081  if (runTree_.isValid()) {
1082  while (runTree_.next()) {
1083  // Note: adjacent duplicates will be skipped without an explicit check.
1084 
1085  std::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
1086  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(runAux->processHistoryID());
1087 
1088  if (runSet.insert(runAux->run()).second) { // (check 4, insert 4)
1089  // This run was not associated with any events.
1090  emptyRuns.emplace_back(reducedPHID, runAux->run()); // (insert 12)
1091  }
1092  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
1093  phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1094  }
1095  // now clean up.
1097  }
1098 
1099  // Insert the ordered empty runs into the run list.
1100  RunItemSortByRun runItemSortByRun;
1101  stable_sort_all(emptyRuns, runItemSortByRun);
1102 
1103  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1104  for (auto const& emptyRun : emptyRuns) {
1105  for (; itRuns != endRuns; ++itRuns) {
1106  if (runItemSortByRun(emptyRun, *itRuns)) {
1107  break;
1108  }
1109  }
1110  runs.insert(itRuns, emptyRun);
1111  }
1112 
1113  // Loop over luminosity block entries and fill information.
1114 
1115  typedef std::vector<LumiItem> LumiVector;
1116  LumiVector emptyLumis; // (declare 7)
1117 
1118  typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1119  RunLumiMap runLumiMap; // (declare 6)
1120 
1121  if (lumiTree_.isValid()) {
1122  while (lumiTree_.next()) {
1123  // Note: adjacent duplicates will be skipped without an explicit check.
1124  std::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
1125  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
1126  if (runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
1127  // This lumi was not associated with any events.
1128  // Use the process history ID from the corresponding run. In cases of practical
1129  // importance, this should be the correct process history ID, but it is possible
1130  // to construct files where this is not the correct process history ID ...
1131  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1132  assert(iPhidMap != phidMap.end());
1133  emptyLumis.emplace_back(
1134  iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), IndexIntoFile::invalidEntry); // (insert 7)
1135  }
1136  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
1137  }
1138  // now clean up.
1140  }
1141 
1142  // Insert the ordered empty lumis into the lumi list.
1143  LumiItemSortByRunLumi lumiItemSortByRunLumi;
1144  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
1145 
1146  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1147  for (auto const& emptyLumi : emptyLumis) {
1148  for (; itLumis != endLumis; ++itLumis) {
1149  if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1150  break;
1151  }
1152  }
1153  lumis.insert(itLumis, emptyLumi);
1154  }
1155 
1156  // Create a map of RunItems that gives the order of first appearance in the list.
1157  // Also fill in the vector of process history IDs
1158  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1159  RunCountMap runCountMap; // Declare (17)
1160  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
1161  assert(phids.empty());
1162  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
1163  assert(entries.empty());
1164  int rcount = 0;
1165  for (auto& run : runs) {
1166  RunCountMap::const_iterator countMapItem = runCountMap.find(run);
1167  if (countMapItem == runCountMap.end()) {
1168  countMapItem = runCountMap.insert(std::make_pair(run, rcount)).first; // Insert (17)
1169  assert(countMapItem != runCountMap.end());
1170  ++rcount;
1171  }
1172  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, run.phid_);
1173  if (phidItem == phids.end()) {
1174  phids.push_back(run.phid_);
1175  phidItem = phids.end() - 1;
1176  }
1177  entries.emplace_back(countMapItem->second, // use (17)
1179  runMap[run.run_], // use (11)
1180  phidItem - phids.begin(),
1181  run.run_,
1182  0U,
1185  }
1186 
1187  // Create a map of LumiItems that gives the order of first appearance in the list.
1188  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1189  LumiCountMap lumiCountMap; // Declare (19)
1190  int lcount = 0;
1191  for (auto& lumi : lumis) {
1192  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(lumi.phid_, lumi.run_));
1193  assert(runCountMapItem != runCountMap.end());
1194  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(lumi);
1195  if (countMapItem == lumiCountMap.end()) {
1196  countMapItem = lumiCountMap.insert(std::make_pair(lumi, lcount)).first; // Insert (17)
1197  assert(countMapItem != lumiCountMap.end());
1198  ++lcount;
1199  }
1200  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, lumi.phid_);
1201  assert(phidItem != phids.end());
1202  entries.emplace_back(runCountMapItem->second,
1203  countMapItem->second,
1204  runLumiMap[LuminosityBlockID(lumi.run_, lumi.lumi_)],
1205  phidItem - phids.begin(),
1206  lumi.run_,
1207  lumi.lumi_,
1208  lumi.firstEventEntry_,
1209  lumi.lastEventEntry_);
1210  }
1211  stable_sort_all(entries);
1212  }

References cms::cuda::assert(), edm::RootTree::entries(), edm::RootTree::entryNumber(), eventTree_, fileFormatVersion(), fillEventHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), fillThisEventAuxiliary(), edm::find_in_all(), indexIntoFile_, edm::IndexIntoFile::invalidEntry, edm::RootTree::isValid(), B2GTnPMonitor_cfi::item, lastEventEntryNumberRead_, edmLumisInFiles::lumis, lumiTree_, eostools::move(), edm::RootTree::next(), processHistoryRegistry_, writedatasetfile::run, writedatasetfile::runs, runTree_, edm::second(), edm::RootTree::setEntryNumber(), edm::IndexIntoFile::setProcessHistoryIDs(), edm::IndexIntoFile::setRunOrLumiEntries(), edm::stable_sort_all(), mitigatedMETSequence_cff::U, and edm::IndexIntoFile::unsortedEventNumbers().

Referenced by validateFile().

◆ fillLumiAuxiliary()

std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::fillLumiAuxiliary ( )
private

Definition at line 1390 of file RootFile.cc.

1390  {
1391  auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1392  if (fileFormatVersion().newAuxiliary()) {
1393  LuminosityBlockAuxiliary* pLumiAux = lumiAuxiliary.get();
1394  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1395  } else {
1396  LuminosityBlockAux lumiAux;
1397  LuminosityBlockAux* pLumiAux = &lumiAux;
1398  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1399  conversion(lumiAux, *lumiAuxiliary);
1400  }
1401  if (provenanceAdaptor_) {
1402  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1403  }
1404  if (daqProvenanceHelper_) {
1405  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1406  }
1407  if (lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1408  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1409  }
1410  return lumiAuxiliary;
1411  }

References edm::conversion(), daqProvenanceHelper_, fileFormatVersion(), edm::RootTree::fillAux(), lumiTree_, provenanceAdaptor_, and edm::FileFormatVersion::runsAndLumis().

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

◆ fillProcessBlockHelper_()

void edm::RootFile::fillProcessBlockHelper_ ( )

Definition at line 1650 of file RootFile.cc.

1650  {
1652  std::vector<unsigned int> nEntries;
1653  nEntries.reserve(processBlockTrees_.size());
1654  for (auto const& processBlockTree : processBlockTrees_) {
1655  nEntries.push_back(processBlockTree->entries());
1656  }
1657  processBlockHelper_->fillFromPrimaryInput(*storedProcessBlockHelper_, nEntries);
1659  std::make_unique<StoredProcessBlockHelper>(); // propagate_const<T> has no reset() function
1660  }

References cms::cuda::assert(), inputType_, edm::Primary, processBlockHelper_, processBlockTrees_, and storedProcessBlockHelper_.

◆ fillRunAuxiliary()

std::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1413 of file RootFile.cc.

1413  {
1414  auto runAuxiliary = std::make_shared<RunAuxiliary>();
1415  if (fileFormatVersion().newAuxiliary()) {
1416  RunAuxiliary* pRunAux = runAuxiliary.get();
1417  runTree_.fillAux<RunAuxiliary>(pRunAux);
1418  } else {
1419  RunAux runAux;
1420  RunAux* pRunAux = &runAux;
1421  runTree_.fillAux<RunAux>(pRunAux);
1422  conversion(runAux, *runAuxiliary);
1423  }
1424  if (provenanceAdaptor_) {
1425  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1426  }
1427  if (daqProvenanceHelper_) {
1428  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1429  }
1430  return runAuxiliary;
1431  }

References edm::conversion(), daqProvenanceHelper_, fileFormatVersion(), edm::RootTree::fillAux(), provenanceAdaptor_, and runTree_.

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

◆ fillThisEventAuxiliary()

EventAuxiliary const & edm::RootFile::fillThisEventAuxiliary ( )
private

Definition at line 1287 of file RootFile.cc.

1287  {
1289  // Already read.
1290  return eventAuxCache_;
1291  }
1292  if (fileFormatVersion().newAuxiliary()) {
1293  EventAuxiliary* pEvAux = &eventAuxCache_;
1294  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1295  } else {
1296  // for backward compatibility.
1297  EventAux eventAux;
1298  EventAux* pEvAux = &eventAux;
1299  eventTree_.fillAux<EventAux>(pEvAux);
1300  conversion(eventAux, eventAuxCache_);
1301  }
1303  return eventAuxCache_;
1304  }

References edm::conversion(), edm::RootTree::entryNumber(), eventAuxCache_, eventTree_, fileFormatVersion(), edm::RootTree::fillAux(), lastEventEntryNumberRead_, and edm::FileFormatVersion::newAuxiliary().

Referenced by fillEventAuxiliary(), fillIndexIntoFile(), initializeDuplicateChecker(), and readCurrentEvent().

◆ getNextItemType()

IndexIntoFile::EntryType edm::RootFile::getNextItemType ( RunNumber_t run,
LuminosityBlockNumber_t lumi,
EventNumber_t event 
)

Definition at line 877 of file RootFile.cc.

879  {
880  // First, account for consecutive skipped entries.
881  while (skipThisEntry()) {
886  } else {
888  }
889  }
890  // OK, we have an entry that is not skipped.
892  if (entryType == IndexIntoFile::kEnd) {
893  return IndexIntoFile::kEnd;
894  }
895  if (entryType == IndexIntoFile::kRun) {
897  runHelper_->checkForNewRun(run, indexIntoFileIter_.peekAheadAtLumi());
898  return IndexIntoFile::kRun;
899  } else if (processingMode_ == InputSource::Runs) {
901  return getNextItemType(run, lumi, event);
902  }
903  if (entryType == IndexIntoFile::kLumi) {
906  return IndexIntoFile::kLumi;
909  return getNextItemType(run, lumi, event);
910  }
911  if (isDuplicateEvent()) {
913  return getNextItemType(run, lumi, event);
914  }
917  auto eventAux = fillEventAuxiliary(indexIntoFileIter_.entry());
918  event = eventAux.event();
919  return IndexIntoFile::kEvent;
920  }

References edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun(), edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun(), edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::EventAuxiliary::event(), fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileIter_, isDuplicateEvent(), edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtLumi(), processingMode_, writedatasetfile::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, edm::InputSource::Runs, edm::InputSource::RunsAndLumis, and skipThisEntry().

◆ goToEvent()

bool edm::RootFile::goToEvent ( EventID const &  eventID)

Definition at line 1489 of file RootFile.cc.

1489  {
1491 
1492  if (duplicateChecker_) {
1493  duplicateChecker_->disable();
1494  }
1495 
1497  if (noEventSort_)
1499 
1500  IndexIntoFile::IndexIntoFileItr iter =
1501  indexIntoFile_.findPosition(sortOrder, eventID.run(), eventID.luminosityBlock(), eventID.event());
1502 
1503  if (iter == indexIntoFile_.end(sortOrder)) {
1504  return false;
1505  }
1506  indexIntoFileIter_ = iter;
1507  return true;
1508  }

References duplicateChecker_, edm::IndexIntoFile::end(), edm::EventID::event(), edm::IndexIntoFile::fillEventNumbers(), edm::IndexIntoFile::findPosition(), edm::IndexIntoFile::firstAppearanceOrder, indexIntoFile_, indexIntoFileIter_, edm::EventID::luminosityBlock(), noEventSort_, edm::IndexIntoFile::numericalOrder, and edm::EventID::run().

◆ hasNewlyDroppedBranch()

std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 244 of file RootFile.h.

244 { return hasNewlyDroppedBranch_; }

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

◆ indexIntoFileIter()

IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileIter ( ) const

Definition at line 812 of file RootFile.cc.

812 { return indexIntoFileIter_; }

References indexIntoFileIter_.

◆ indexIntoFileSharedPtr() [1/2]

std::shared_ptr<IndexIntoFile>& edm::RootFile::indexIntoFileSharedPtr ( )
inline

Definition at line 284 of file RootFile.h.

References edm::get_underlying_safe(), and indexIntoFileSharedPtr_.

◆ indexIntoFileSharedPtr() [2/2]

std::shared_ptr<IndexIntoFile const> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 281 of file RootFile.h.

281  {
283  }

References edm::get_underlying_safe(), and indexIntoFileSharedPtr_.

◆ initAssociationsFromSecondary()

void edm::RootFile::initAssociationsFromSecondary ( std::vector< BranchID > const &  associationsFromSecondary)

Definition at line 818 of file RootFile.cc.

818  {
819  thinnedAssociationsHelper_->initAssociationsFromSecondary(associationsFromSecondary,
821  }

References fileThinnedAssociationsHelper_, and thinnedAssociationsHelper_.

◆ initializeDuplicateChecker()

void edm::RootFile::initializeDuplicateChecker ( std::vector< std::shared_ptr< IndexIntoFile >> const &  indexesIntoFiles,
std::vector< std::shared_ptr< IndexIntoFile >>::size_type  currentIndexIntoFile 
)
private

Definition at line 1845 of file RootFile.cc.

1847  {
1848  if (duplicateChecker_ && !duplicateChecker_->checkDisabled()) {
1849  if (eventTree_.next()) {
1850  auto const evtAux = fillThisEventAuxiliary();
1851 
1852  duplicateChecker_->inputFileOpened(evtAux.isRealData(), indexIntoFile_, indexesIntoFiles, currentIndexIntoFile);
1853  }
1855  }
1856  }

References duplicateChecker_, eventTree_, fillThisEventAuxiliary(), indexIntoFile_, edm::IndexIntoFile::invalidEntry, edm::RootTree::next(), and edm::RootTree::setEntryNumber().

Referenced by RootFile().

◆ initializeFirstProcessBlockEntry()

bool edm::RootFile::initializeFirstProcessBlockEntry ( )

Definition at line 1662 of file RootFile.cc.

1662  {
1664  processBlockTrees_[currentProcessBlockTree_]->setEntryNumber(0);
1666  return true;
1667  }
1668  return false;
1669  }

References cms::cuda::assert(), currentProcessBlockTree_, edm::IndexIntoFile::invalidEntry, and processBlockTrees_.

Referenced by nextProcessBlock_().

◆ isDuplicateEvent()

bool edm::RootFile::isDuplicateEvent ( )
private

◆ lumiTree()

RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 240 of file RootFile.h.

240 { return lumiTree_; }

References lumiTree_.

◆ makeProcessBlockRootTrees()

void edm::RootFile::makeProcessBlockRootTrees ( std::shared_ptr< InputFile filePtr,
int  treeMaxVirtualSize,
bool  enablePrefetching,
InputType  inputType,
StoredProcessBlockHelper const &  storedProcessBlockHelper 
)
private

Definition at line 2102 of file RootFile.cc.

2106  {
2107  // When this functions returns there will be exactly a 1-to-1 correspondence between the
2108  // processes listed in storedProcessBlockHelper and the RootTree objects created. processBlockTrees_
2109  // has pointers to the RootTree's and will be filled in the same order. The RootTree constructor
2110  // will throw an exception if one of these TTree's is not in the file and this should be all of
2111  // the ProcessBlock TTree's in the file. (later in the RootFile constructor, dropOnInput might
2112  // remove some and also reordering may occur).
2113  for (auto const& process : storedProcessBlockHelper.processesWithProcessBlockProducts()) {
2114  processBlockTrees_.emplace_back(std::make_unique<RootTree>(filePtr,
2115  InProcess,
2116  process,
2117  1,
2118  treeMaxVirtualSize,
2121  enablePrefetching,
2122  inputType));
2123  }
2124  }

References edm::roottree::defaultNonEventCacheSize, edm::roottree::defaultNonEventLearningEntries, edm::InProcess, LaserDQM_cfg::process, processBlockTrees_, and edm::StoredProcessBlockHelper::processesWithProcessBlockProducts().

Referenced by RootFile().

◆ makeProductProvenanceRetriever()

std::shared_ptr< ProductProvenanceRetriever > edm::RootFile::makeProductProvenanceRetriever ( unsigned int  iStreamIndex)
private

Definition at line 2142 of file RootFile.cc.

2142  {
2143  if (eventProductProvenanceRetrievers_.size() <= iStreamID) {
2144  eventProductProvenanceRetrievers_.resize(iStreamID + 1);
2145  }
2146  if (!eventProductProvenanceRetrievers_[iStreamID]) {
2147  // propagate_const<T> has no reset() function
2148  eventProductProvenanceRetrievers_[iStreamID] = std::make_shared<ProductProvenanceRetriever>(
2150  }
2151  eventProductProvenanceRetrievers_[iStreamID]->reset();
2152  return eventProductProvenanceRetriever(iStreamID);
2153  }

References daqProvenanceHelper_, eventProductProvenanceRetriever(), eventProductProvenanceRetrievers_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

◆ makeProvenanceReaderMaker()

std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 2126 of file RootFile.cc.

2126  {
2128  readParentageTree(inputType);
2129  return std::make_unique<MakeReducedProvenanceReader>(parentageIDLookup_);
2130  } else if (fileFormatVersion_.splitProductIDs()) {
2131  readParentageTree(inputType);
2132  return std::make_unique<MakeFullProvenanceReader>();
2133  } else if (fileFormatVersion_.perEventProductIDs()) {
2134  auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
2135  readEntryDescriptionTree(*entryDescriptionMap, inputType);
2136  return std::make_unique<MakeOldProvenanceReader>(std::move(entryDescriptionMap));
2137  } else {
2138  return std::make_unique<MakeDummyProvenanceReader>();
2139  }
2140  }

References fileFormatVersion_, eostools::move(), parentageIDLookup_, edm::FileFormatVersion::perEventProductIDs(), readEntryDescriptionTree(), readParentageTree(), edm::FileFormatVersion::splitProductIDs(), and edm::FileFormatVersion::storedProductProvenanceUsed().

Referenced by RootFile().

◆ markBranchToBeDropped()

void edm::RootFile::markBranchToBeDropped ( bool  dropDescendants,
BranchDescription const &  branch,
std::set< BranchID > &  branchesToDrop,
std::map< BranchID, BranchID > const &  droppedToKeptAlias 
) const
private

Definition at line 1885 of file RootFile.cc.

1888  {
1889  if (dropDescendants) {
1890  branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1891  } else {
1892  branchesToDrop.insert(branch.branchID());
1893  }
1894  }

References MicroEventContent_cff::branch, and branchChildren_.

Referenced by dropOnInputAndReorder().

◆ modifiedIDs()

bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 246 of file RootFile.h.

246 { return daqProvenanceHelper_.get() != nullptr; }

References daqProvenanceHelper_.

Referenced by createFileBlock().

◆ newBranchToOldBranch()

std::string const & edm::RootFile::newBranchToOldBranch ( std::string const &  newBranch) const
private

Definition at line 804 of file RootFile.cc.

804  {
805  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
806  if (it != newBranchToOldBranch_.end()) {
807  return it->second;
808  }
809  return newBranch;
810  }

References newBranchToOldBranch_.

Referenced by dropOnInputAndReorder(), RootFile(), and setPresenceInProductRegistry().

◆ nextEventEntry()

bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 275 of file RootFile.h.

275 { return eventTree_.nextWithCache(); }

References eventTree_, and edm::RootTree::nextWithCache().

◆ nextProcessBlock_()

bool edm::RootFile::nextProcessBlock_ ( ProcessBlockPrincipal )

Definition at line 1673 of file RootFile.cc.

1673  {
1675  if (endOfProcessBlocksReached()) {
1676  return false;
1677  }
1679  return true;
1680  }
1681  // With the current design, the RootFile should always be
1682  // set to a valid ProcessBlock entry in one of the TTrees
1683  // if it not at the end.
1685  // Try for next entry in the same TTree
1686  if (processBlockTrees_[currentProcessBlockTree_]->nextWithCache()) {
1687  return true;
1688  }
1689  // Next ProcessBlock TTree
1691  if (endOfProcessBlocksReached()) {
1692  return false;
1693  }
1694  // With current design there should always be at least one entry.
1695  // Initialize for that entry.
1696  processBlockTrees_[currentProcessBlockTree_]->setEntryNumber(0);
1698  return true;
1699  }

References cms::cuda::assert(), currentProcessBlockTree_, endOfProcessBlocksReached(), initializeFirstProcessBlockEntry(), inputType_, edm::Primary, and processBlockTrees_.

◆ operator=()

RootFile& edm::RootFile::operator= ( RootFile const &  )
delete

◆ productRegistry()

std::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 235 of file RootFile.h.

235 { return productRegistry_; }

References productRegistry_.

Referenced by RootFile().

◆ readCurrentEvent()

std::tuple< bool, bool > edm::RootFile::readCurrentEvent ( EventPrincipal cache,
bool  assertOnFailure = true 
)

Definition at line 1537 of file RootFile.cc.

1537  {
1538  bool found = true;
1539  bool succeeded = true;
1540  if (!eventTree_.current()) {
1541  found = false;
1542  return {found, succeeded};
1543  }
1544  auto evtAux = fillThisEventAuxiliary();
1545  if (!fileFormatVersion().lumiInEventID()) {
1546  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1547  const_cast<EventID&>(evtAux.id()).setLuminosityBlockNumber(evtAux.oldLuminosityBlock());
1548  evtAux.resetObsoleteInfo();
1549  }
1551  EventSelectionIDVector eventSelectionIDs;
1552  BranchListIndexes branchListIndexes;
1553  if (!fillEventHistory(evtAux, eventSelectionIDs, branchListIndexes, assertOnFailure)) {
1554  succeeded = false;
1555  }
1556  runHelper_->overrideRunNumber(evtAux.id(), evtAux.isRealData());
1557 
1558  // We're not done ... so prepare the EventPrincipal
1559  eventTree_.insertEntryForIndex(principal.transitionIndex());
1560  auto history = processHistoryRegistry_->getMapped(evtAux.processHistoryID());
1561  principal.fillEventPrincipal(evtAux,
1562  history,
1563  std::move(eventSelectionIDs),
1564  std::move(branchListIndexes),
1566  *(makeProductProvenanceRetriever(principal.streamID().value())),
1568 
1569  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1570  // The IndexIntoFile should guarantee that it never fails.
1572  ? *daqProvenanceHelper_->oldProcessHistoryID()
1573  : evtAux.processHistoryID());
1574  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1576 
1577  // report event read from file
1578  filePtr_->eventReadFromFile();
1579  return {found, succeeded};
1580  }

References cms::cuda::assert(), edm::RootTree::current(), daqProvenanceHelper_, eventToProcessBlockIndexes_, eventTree_, fileFormatVersion(), filePtr_, fillEventHistory(), edm::EventPrincipal::fillEventPrincipal(), fillEventToProcessBlockIndexes(), fillThisEventAuxiliary(), newFWLiteAna::found, indexIntoFile_, indexIntoFileIter_, edm::RootTree::insertEntryForIndex(), makeProductProvenanceRetriever(), eostools::move(), edm::IndexIntoFile::processHistoryID(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), processHistoryRegistry_, edm::RootTree::resetAndGetRootDelayedReader(), runHelper_, edm::EventPrincipal::streamID(), summarizeEdmComparisonLogfiles::succeeded, edm::EDProductGetter::transitionIndex(), edm::FileFormatVersion::useReducedProcessHistoryID(), and edm::StreamID::value().

Referenced by readEvent().

◆ readEntryDescriptionTree()

void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

Definition at line 634 of file RootFile.cc.

634  {
635  // Called only for old format files.
636  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
637  std::unique_ptr<TTree> entryDescriptionTree(
638  dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
639  if (nullptr == entryDescriptionTree.get()) {
641  << "Could not find tree " << poolNames::entryDescriptionTreeName() << " in the input file.\n";
642  }
643 
644  EntryDescriptionID idBuffer;
645  EntryDescriptionID* pidBuffer = &idBuffer;
646  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
647 
648  EventEntryDescription entryDescriptionBuffer;
649  EventEntryDescription* pEntryDescriptionBuffer = &entryDescriptionBuffer;
650  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
651 
652  // Fill in the parentage registry.
653  ParentageRegistry& registry = *ParentageRegistry::instance();
654 
655  for (Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
656  roottree::getEntry(entryDescriptionTree.get(), i);
657  if (idBuffer != entryDescriptionBuffer.id()) {
658  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
659  }
660  entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.id(), entryDescriptionBuffer));
661  Parentage parents;
662  parents.setParents(entryDescriptionBuffer.parents());
663  if (daqProvenanceHelper_) {
664  ParentageID const oldID = parents.id();
665  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
666  ParentageID newID = parents.id();
667  if (newID != oldID) {
668  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
669  }
670  }
671  // For thread safety, don't update global registries when a secondary source opens a file.
672  if (inputType != InputType::SecondarySource) {
673  registry.insertMapped(parents);
674  }
675  }
676  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
677  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
678  }

References daqProvenanceHelper_, edm::poolNames::entryDescriptionBranchName(), edm::poolNames::entryDescriptionIDBranchName(), edm::poolNames::entryDescriptionTreeName(), edm::errors::EventCorruption, Exception, filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), mps_fire::i, edm::EventEntryDescription::id(), edm::ParentageRegistry::insertMapped(), edm::ParentageRegistry::instance(), edm::numEntries(), parents, edm::EventEntryDescription::parents(), and edm::SecondarySource.

Referenced by makeProvenanceReaderMaker().

◆ readEvent()

bool edm::RootFile::readEvent ( EventPrincipal cache)

Definition at line 1522 of file RootFile.cc.

1522  {
1525  // read the event
1526  auto [found, succeeded] = readCurrentEvent(principal, false);
1527  auto const& evtAux = principal.aux();
1528 
1529  runHelper_->checkRunConsistency(evtAux.run(), indexIntoFileIter_.run());
1530  runHelper_->checkLumiConsistency(evtAux.luminosityBlock(), indexIntoFileIter_.lumi());
1531 
1533  return succeeded;
1534  }

References cms::cuda::assert(), edm::EventPrincipal::aux(), newFWLiteAna::found, edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), readCurrentEvent(), edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, and summarizeEdmComparisonLogfiles::succeeded.

◆ readEventHistoryTree()

void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1834 of file RootFile.cc.

1834  {
1835  // Read in the event history tree, if we have one...
1836  if (fileFormatVersion().eventHistoryTree()) {
1837  history_ = std::make_unique<History>(); // propagate_const<T> has no reset() function
1838  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1839  if (!eventHistoryTree_) {
1840  throw Exception(errors::EventCorruption) << "Failed to find the event history tree.\n";
1841  }
1842  }
1843  }

References edm::errors::EventCorruption, eventHistoryTree_, edm::poolNames::eventHistoryTreeName(), Exception, fileFormatVersion(), filePtr_, and history_.

Referenced by RootFile().

◆ readFakeRun_()

void edm::RootFile::readFakeRun_ ( RunPrincipal runPrincipal)

◆ readFakeRunAuxiliary_()

std::shared_ptr<RunAuxiliary> edm::RootFile::readFakeRunAuxiliary_ ( )

◆ readLuminosityBlock_()

void edm::RootFile::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)

Definition at line 1774 of file RootFile.cc.

1774  {
1777  // Begin code for backward compatibility before the existence of lumi trees.
1778  if (!lumiTree_.isValid()) {
1780  return;
1781  }
1782  // End code for backward compatibility before the existence of lumi trees.
1784  // NOTE: we use 0 for the index since do not do delayed reads for LuminosityBlockPrincipals
1786  auto history = processHistoryRegistry_->getMapped(lumiPrincipal.aux().processHistoryID());
1787  lumiPrincipal.fillLuminosityBlockPrincipal(history, lumiTree_.resetAndGetRootDelayedReader());
1788  // Read in all the products now.
1789  lumiPrincipal.readAllFromSourceAndMergeImmediately();
1791  }

References cms::cuda::assert(), edm::LuminosityBlockPrincipal::aux(), edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::LuminosityBlockPrincipal::fillLuminosityBlockPrincipal(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::RootTree::insertEntryForIndex(), edm::RootTree::isValid(), edm::IndexIntoFile::kLumi, lumiTree_, edm::LuminosityBlockAuxiliary::processHistoryID(), processHistoryRegistry_, edm::Principal::readAllFromSourceAndMergeImmediately(), edm::RootTree::resetAndGetRootDelayedReader(), and edm::RootTree::setEntryNumber().

◆ readLuminosityBlockAuxiliary_()

std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1736 of file RootFile.cc.

1736  {
1739  // Begin code for backward compatibility before the existence of lumi trees.
1740  if (!lumiTree_.isValid()) {
1742  assert(eventEntry != IndexIntoFile::invalidEntry);
1743  assert(eventTree_.current(eventEntry));
1744  auto const evtAux = fillEventAuxiliary(eventEntry);
1745 
1746  LuminosityBlockID lumi = LuminosityBlockID(indexIntoFileIter_.run(), indexIntoFileIter_.lumi());
1747  runHelper_->overrideRunNumber(lumi);
1748  return std::make_shared<LuminosityBlockAuxiliary>(
1749  lumi.run(), lumi.luminosityBlock(), evtAux.time(), Timestamp::invalidTimestamp());
1750  }
1751  // End code for backward compatibility before the existence of lumi trees.
1753  std::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1754  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1755  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1756  runHelper_->overrideRunNumber(lumiAuxiliary->id());
1757  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1758  if (lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1760  if (eventEntry != IndexIntoFile::invalidEntry) {
1761  assert(eventTree_.current(eventEntry));
1762  auto const evtAux = fillEventAuxiliary(eventEntry);
1763 
1764  lumiAuxiliary->setBeginTime(evtAux.time());
1765  }
1766  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1767  }
1768  if (!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1769  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1770  }
1771  return lumiAuxiliary;
1772  }

References cms::cuda::assert(), edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), eventTree_, fileFormatVersion(), filePtr_, fillEventAuxiliary(), fillLumiAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisLumi(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, edm::Timestamp::invalidTimestamp(), edm::RootTree::isValid(), edm::IndexIntoFile::kLumi, edm::IndexIntoFile::IndexIntoFileItr::lumi(), lumiTree_, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, savedRunAuxiliary_, and edm::RootTree::setEntryNumber().

◆ readParentageTree()

void edm::RootFile::readParentageTree ( InputType  inputType)
private

Definition at line 680 of file RootFile.cc.

680  {
681  // New format file
682  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
683  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
684  if (nullptr == parentageTree.get()) {
686  << "Could not find tree " << poolNames::parentageTreeName() << " in the input file.\n";
687  }
688 
689  Parentage parents;
690  Parentage* pParentageBuffer = &parents;
691  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
692 
693  ParentageRegistry& registry = *ParentageRegistry::instance();
694 
695  parentageIDLookup_.reserve(parentageTree->GetEntries());
696  for (Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
697  roottree::getEntry(parentageTree.get(), i);
698  if (daqProvenanceHelper_) {
699  ParentageID const oldID = parents.id();
700  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
701  ParentageID newID = parents.id();
702  if (newID != oldID) {
703  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
704  }
705  }
706  // For thread safety, don't update global registries when a secondary source opens a file.
707  if (inputType != InputType::SecondarySource) {
708  registry.insertMapped(parents);
709  }
710  parentageIDLookup_.push_back(parents.id());
711  }
712  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
713  }

References daqProvenanceHelper_, Exception, filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), mps_fire::i, edm::ParentageRegistry::insertMapped(), edm::ParentageRegistry::instance(), edm::numEntries(), edm::poolNames::parentageBranchName(), parentageIDLookup_, edm::poolNames::parentageTreeName(), parents, and edm::SecondarySource.

Referenced by makeProvenanceReaderMaker().

◆ readProcessBlock_()

void edm::RootFile::readProcessBlock_ ( ProcessBlockPrincipal processBlockPrincipal)

Definition at line 1701 of file RootFile.cc.

1701  {
1703  RootTree* rootTree = processBlockTrees_[currentProcessBlockTree_].get();
1704  rootTree->insertEntryForIndex(0);
1705  assert(!rootTree->processName().empty());
1706  processBlockPrincipal.fillProcessBlockPrincipal(rootTree->processName(), rootTree->resetAndGetRootDelayedReader());
1707  }

References cms::cuda::assert(), currentProcessBlockTree_, edm::ProcessBlockPrincipal::fillProcessBlockPrincipal(), inputType_, edm::RootTree::insertEntryForIndex(), edm::Primary, processBlockTrees_, edm::RootTree::processName(), and edm::RootTree::resetAndGetRootDelayedReader().

◆ readRun_()

void edm::RootFile::readRun_ ( RunPrincipal runPrincipal)

Definition at line 1709 of file RootFile.cc.

1709  {
1710  MergeableRunProductMetadata* mergeableRunProductMetadata = nullptr;
1711  if (inputType_ == InputType::Primary) {
1712  mergeableRunProductMetadata = runPrincipal.mergeableRunProductMetadata();
1713  RootTree::EntryNumber const& entryNumber = runTree_.entryNumber();
1714  assert(entryNumber >= 0);
1715  mergeableRunProductMetadata->readRun(
1716  entryNumber, *storedMergeableRunProductMetadata_, IndexIntoFileItrHolder(indexIntoFileIter_));
1717  }
1718 
1719  if (!runHelper_->fakeNewRun()) {
1723  }
1724  // Begin code for backward compatibility before the existence of run trees.
1725  if (!runTree_.isValid()) {
1726  return;
1727  }
1728  // End code for backward compatibility before the existence of run trees.
1729  // NOTE: we use 0 for the index since do not do delayed reads for RunPrincipals
1731  runPrincipal.fillRunPrincipal(*processHistoryRegistry_, runTree_.resetAndGetRootDelayedReader());
1732  // Read in all the products now.
1733  runPrincipal.readAllFromSourceAndMergeImmediately(mergeableRunProductMetadata);
1734  }

References cms::cuda::assert(), edm::RootTree::entryNumber(), edm::RunPrincipal::fillRunPrincipal(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, inputType_, edm::RootTree::insertEntryForIndex(), edm::RootTree::isValid(), edm::IndexIntoFile::kRun, edm::RunPrincipal::mergeableRunProductMetadata(), edm::Primary, processHistoryRegistry_, edm::Principal::readAllFromSourceAndMergeImmediately(), edm::MergeableRunProductMetadata::readRun(), edm::RootTree::resetAndGetRootDelayedReader(), runHelper_, runTree_, and storedMergeableRunProductMetadata_.

◆ readRunAuxiliary_()

std::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

Definition at line 1584 of file RootFile.cc.

1584  {
1585  if (runHelper_->fakeNewRun()) {
1586  auto runAuxiliary = std::make_shared<RunAuxiliary>(*savedRunAuxiliary());
1587  runHelper_->overrideRunNumber(runAuxiliary->id());
1588  return runAuxiliary;
1589  }
1592 
1593  // Begin code for backward compatibility before the existence of run trees.
1594  if (!runTree_.isValid()) {
1595  // prior to the support of run trees.
1596  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1598  assert(eventEntry != IndexIntoFile::invalidEntry);
1599  assert(eventTree_.current(eventEntry));
1600  auto const evtAux = fillEventAuxiliary(eventEntry);
1601 
1602  RunID run = RunID(indexIntoFileIter_.run());
1603  runHelper_->overrideRunNumber(run);
1604  savedRunAuxiliary_ = std::make_shared<RunAuxiliary>(run.run(), evtAux.time(), Timestamp::invalidTimestamp());
1605  return savedRunAuxiliary();
1606  }
1607  // End code for backward compatibility before the existence of run trees.
1609  std::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1610  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1611  runHelper_->overrideRunNumber(runAuxiliary->id());
1612  filePtr_->reportInputRunNumber(runAuxiliary->run());
1613  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1614  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1615  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1616  }
1617 
1618  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1619  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1620  // we attempt to read the first event in the run to get appropriate info.
1621  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1624  // If we have a valid event, use its information.
1625  if (eventEntry != IndexIntoFile::invalidEntry) {
1626  assert(eventTree_.current(eventEntry));
1627  auto evtAux = fillEventAuxiliary(eventEntry);
1628 
1629  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1630  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1631  runAuxiliary->setBeginTime(evtAux.time());
1632  }
1633 
1634  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1635  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1636  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1637  // and event ProcessHistory's always be the same if no file merging occurs).
1639  EventSelectionIDVector eventSelectionIDs;
1640  BranchListIndexes branchListIndexes;
1641  fillEventHistory(evtAux, eventSelectionIDs, branchListIndexes);
1642  runAuxiliary->setProcessHistoryID(evtAux.processHistoryID());
1643  }
1644  }
1645  }
1646  savedRunAuxiliary_ = runAuxiliary;
1647  return runAuxiliary;
1648  }

References cms::cuda::assert(), edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), eventTree_, fileFormatVersion(), filePtr_, fillEventAuxiliary(), fillEventHistory(), fillRunAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, edm::Timestamp::invalidTimestamp(), edm::RootTree::isValid(), edm::IndexIntoFile::kRun, edm::FileFormatVersion::processHistorySameWithinRun(), writedatasetfile::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, runTree_, savedRunAuxiliary(), savedRunAuxiliary_, and edm::RootTree::setEntryNumber().

◆ reportOpened()

void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1269 of file RootFile.cc.

1269  {
1270  // Report file opened.
1271  std::string const label = "source";
1272  std::string moduleName = "PoolSource";
1273  filePtr_->inputFileOpened(logicalFile_, inputType, moduleName, label, fid_.fid(), eventTree_.branchNames());
1274  }

References edm::RootTree::branchNames(), eventTree_, edm::FileID::fid(), fid_, filePtr_, label, logicalFile_, edm::moduleName(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ rewind()

void edm::RootFile::rewind ( )
inline

Definition at line 260 of file RootFile.h.

260  {
262  eventTree_.rewind();
263  lumiTree_.rewind();
264  runTree_.rewind();
266  for (auto& processBlockTree : processBlockTrees_) {
267  processBlockTree->rewindToInvalid();
268  }
269  }

References currentProcessBlockTree_, eventTree_, indexIntoFileBegin_, indexIntoFileIter_, lumiTree_, processBlockTrees_, edm::RootTree::rewind(), and runTree_.

◆ runTree()

RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 241 of file RootFile.h.

241 { return runTree_; }

References runTree_.

Referenced by validateFile().

◆ savedRunAuxiliary() [1/2]

std::shared_ptr<RunAuxiliary>& edm::RootFile::savedRunAuxiliary ( )
inlineprivate

Definition at line 343 of file RootFile.h.

References edm::get_underlying_safe(), and savedRunAuxiliary_.

◆ savedRunAuxiliary() [2/2]

std::shared_ptr<RunAuxiliary const> edm::RootFile::savedRunAuxiliary ( ) const
inlineprivate

Definition at line 342 of file RootFile.h.

References edm::get_underlying_safe(), and savedRunAuxiliary_.

Referenced by readRunAuxiliary_().

◆ setAtEventEntry()

void edm::RootFile::setAtEventEntry ( IndexIntoFile::EntryNumber_t  entry)

◆ setEntryAtEvent()

bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

◆ setEntryAtItem()

bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 250 of file RootFile.h.

250  {
252  }

References writedatasetfile::run, setEntryAtEvent(), setEntryAtLumi(), and setEntryAtRun().

◆ setEntryAtLumi()

bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

◆ setEntryAtNextEventInLumi()

bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1817 of file RootFile.cc.

1817  {
1820  }
1823  return false;
1824  if (run != indexIntoFileIter_.run())
1825  return false;
1826  if (lumi != indexIntoFileIter_.lumi())
1827  return false;
1828  //The following is used for its side effect of advancing the
1829  // eventTree entry.
1831  return true;
1832  }

References edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent(), edm::IndexIntoFile::IndexIntoFileItr::entry(), fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), writedatasetfile::run, and edm::IndexIntoFile::IndexIntoFileItr::run().

◆ setEntryAtRun()

bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

◆ setIfFastClonable()

void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

Definition at line 715 of file RootFile.cc.

715  {
716  if (fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
717  //we must avoid copying the old branch which stored the per product per event provenance
719  return;
720  }
721  if (!fileFormatVersion().splitProductIDs()) {
723  return;
724  }
727  return;
728  }
729  // Find entry for first event in file
730  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
731  while (it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
732  ++it;
733  }
734  if (it == indexIntoFileEnd_) {
736  return;
737  }
738 
739  // From here on, record all reasons we can't fast clone.
740  IndexIntoFile::SortOrder sortOrder =
744  }
745  if (skipAnyEvents_) {
747  }
748  if (remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
750  }
751  if (remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
753  }
754  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
756  }
757  }

References duplicateChecker_, edm::FileBlock::DuplicateEventsRemoved, edm::RootTree::entries(), edm::FileBlock::EventsToBeSorted, eventTree_, fileFormatVersion(), edm::FileBlock::FileTooOld, edm::IndexIntoFile::firstAppearanceOrder, edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFile_, indexIntoFileBegin_, indexIntoFileEnd_, edm::FileBlock::InitialEventsSkipped, edm::IndexIntoFile::iterationWillBeInEntryOrder(), edm::IndexIntoFile::kEvent, lumiTree_, edm::FileBlock::MaxEventsTooSmall, edm::FileBlock::MaxLumisTooSmall, edm::FileBlock::NoEventsInFile, noEventSort_, edm::FileBlock::NotProcessingEvents, edm::IndexIntoFile::numericalOrder, processingMode_, edm::FileBlock::RunOrLumiNotContiguous, edm::InputSource::RunsLumisAndEvents, skipAnyEvents_, and whyNotFastClonable_.

Referenced by RootFile().

◆ setPosition()

void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

◆ setPresenceInProductRegistry()

void edm::RootFile::setPresenceInProductRegistry ( ProductRegistry inputProdDescReg,
StoredProcessBlockHelper const &  storedProcessBlockHelper 
)
private

Definition at line 1858 of file RootFile.cc.

1859  {
1860  // Set product presence information in the product registry.
1861  // "Presence" is a boolean that is true if and only if the TBranch exists
1862  // in the TTree (except it will be false for ProcessBlock products in non-Primary
1863  // input files).
1864  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
1865  for (auto& product : pList) {
1866  BranchDescription& prod = product.second;
1867  prod.init();
1868  if (prod.branchType() == InProcess) {
1869  std::vector<std::string> const& processes = storedProcessBlockHelper.processesWithProcessBlockProducts();
1870  auto it = std::find(processes.begin(), processes.end(), prod.processName());
1871  if (it != processes.end()) {
1872  auto index = std::distance(processes.begin(), it);
1873  processBlockTrees_[index]->setPresence(prod, newBranchToOldBranch(prod.branchName()));
1874  } else {
1875  // Given current rules for saving BranchDescriptions, this case should only occur
1876  // in non-Primary sequences.
1877  prod.setDropped(true);
1878  }
1879  } else {
1880  treePointers_[prod.branchType()]->setPresence(prod, newBranchToOldBranch(prod.branchName()));
1881  }
1882  }
1883  }

References HLT_FULL_cff::distance, spr::find(), edm::InProcess, newBranchToOldBranch(), processBlockTrees_, dqmiodatasetharvest::processes, edm::StoredProcessBlockHelper::processesWithProcessBlockProducts(), dumpMFGeometry_cfg::prod, edm::ProductRegistry::productListUpdator(), and treePointers_.

Referenced by RootFile().

◆ setSignals()

void edm::RootFile::setSignals ( signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *  preEventReadSource,
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *  postEventReadSource 
)

Definition at line 2096 of file RootFile.cc.

2098  {
2099  eventTree_.setSignals(preEventReadSource, postEventReadSource);
2100  }

References eventTree_, and edm::RootTree::setSignals().

◆ setToLastEntry()

void edm::RootFile::setToLastEntry ( )
inline

Definition at line 270 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

◆ skipEntries()

bool edm::RootFile::skipEntries ( unsigned int &  offset)
inline

◆ skipEvents()

bool edm::RootFile::skipEvents ( int &  offset)

Definition at line 1433 of file RootFile.cc.

1433  {
1434  while (offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1435  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1436  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1439 
1441  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1442 
1443  // At the end of the file and there were no more events to skip
1444  if (skippedEventEntry == IndexIntoFile::invalidEntry)
1445  break;
1446 
1447  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1448  auto const evtAux = fillEventAuxiliary(skippedEventEntry);
1449  if (eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, evtAux.id().event())) {
1450  continue;
1451  }
1452  }
1453  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
1454  auto const evtAux = fillEventAuxiliary(skippedEventEntry);
1455  if (duplicateChecker_->isDuplicateAndCheckActive(
1456  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, evtAux.id().event(), file_)) {
1457  continue;
1458  }
1459  }
1460  --offset;
1461  }
1462 
1463  while (offset < 0) {
1464  if (duplicateChecker_) {
1465  duplicateChecker_->disable();
1466  }
1467 
1468  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1472 
1473  indexIntoFileIter_.skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
1474 
1475  if (eventEntry == IndexIntoFile::invalidEntry)
1476  break;
1477 
1478  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1479  auto const evtAux = fillEventAuxiliary(eventEntry);
1480  if (eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, evtAux.id().event())) {
1481  continue;
1482  }
1483  }
1484  ++offset;
1485  }
1487  }

References duplicateChecker_, eventSkipperByID_, file_, fillEventAuxiliary(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, hltrates_dqm_sourceclient-live_cfg::offset, edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward(), and edm::IndexIntoFile::IndexIntoFileItr::skipEventForward().

◆ skipThisEntry()

bool edm::RootFile::skipThisEntry ( )
private

Definition at line 823 of file RootFile.cc.

823  {
825  return false;
826  }
827 
828  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
829  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
831  return true;
832  }
833 
834  // The Lumi is not skipped. If this is an event, see if the event is skipped.
836  auto eventAux = fillEventAuxiliary(indexIntoFileIter_.entry());
837  if (eventSkipperByID_->skipIt(indexIntoFileIter_.run(), indexIntoFileIter_.lumi(), eventAux.id().event())) {
838  return true;
839  }
840  }
841 
842  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
844  // There are no lumis in this run, not even ones we will skip
846  return true;
847  }
848  // If we get here there are lumis in the run, check to see if we are skipping all of them
849  do {
851  return false;
852  }
853  } while (indexIntoFileIter_.skipLumiInRun());
854  return true;
855  }
856  }
857  return false;
858  }

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventSkipperByID_, fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kRun, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtLumi(), edm::IndexIntoFile::IndexIntoFileItr::run(), edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun(), and mitigatedMETSequence_cff::U.

Referenced by getNextItemType().

◆ updateFileBlock()

void edm::RootFile::updateFileBlock ( FileBlock fileBlock)

Definition at line 785 of file RootFile.cc.

785  {
786  std::vector<TTree*> processBlockTrees;
787  std::vector<std::string> processesWithProcessBlockTrees;
788  processBlockTrees.reserve(processBlockTrees_.size());
789  processesWithProcessBlockTrees.reserve(processBlockTrees_.size());
790  for (auto& processBlockTree : processBlockTrees_) {
791  processBlockTrees.push_back(processBlockTree->tree());
792  processesWithProcessBlockTrees.push_back(processBlockTree->processName());
793  }
794  fileBlock.updateTTreePointers(eventTree_.tree(),
796  lumiTree_.tree(),
798  runTree_.tree(),
799  runTree_.metaTree(),
800  std::move(processBlockTrees),
801  std::move(processesWithProcessBlockTrees));
802  }

References eventTree_, lumiTree_, edm::RootTree::metaTree(), eostools::move(), processBlockTrees_, runTree_, edm::RootTree::tree(), and edm::FileBlock::updateTTreePointers().

◆ validateFile()

void edm::RootFile::validateFile ( InputType  inputType,
bool  usingGoToEvent 
)
private

Definition at line 1214 of file RootFile.cc.

1214  {
1215  if (!fid_.isValid()) {
1216  fid_ = FileID(createGlobalIdentifier());
1217  }
1218  if (!eventTree_.isValid()) {
1219  throw Exception(errors::EventCorruption) << "'Events' tree is corrupted or not present\n"
1220  << "in the input file.\n";
1221  }
1222  if (enforceGUIDInFileName_) {
1223  auto guidFromName = stemFromPath(file_);
1224  if (guidFromName != fid_.fid()) {
1226  << "GUID " << guidFromName << " extracted from file name " << file_
1227  << " is inconsistent with the GUID read from the file " << fid_.fid();
1228  }
1229  }
1230 
1231  if (fileFormatVersion().hasIndexIntoFile()) {
1232  if (runTree().entries() > 0) {
1234  }
1236  if (daqProvenanceHelper_) {
1237  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1238  for (auto& phid : phidVec) {
1239  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1240  }
1241  }
1243  }
1244  } else {
1247  }
1248 
1252  std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(eventTree_)));
1253  // We fill the event numbers explicitly if we need to find events in closed files,
1254  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1255  bool needEventNumbers = false;
1256  bool needIndexesForDuplicateChecker =
1257  duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1258  if (inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1259  needEventNumbers = true;
1260  }
1261  bool needEventEntries = false;
1262  if (inputType != InputType::Primary || !noEventSort_) {
1263  // We need event entries for sorting or for secondary files or sources.
1264  needEventEntries = true;
1265  }
1266  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1267  }

References cms::cuda::assert(), edm::createGlobalIdentifier(), daqProvenanceHelper_, duplicateChecker_, edm::IndexIntoFile::empty(), enforceGUIDInFileName_, edm::RootTree::entries(), edm::errors::EventCorruption, eventTree_, Exception, edm::FileID::fid(), fid_, file_, fileFormatVersion(), edm::errors::FileNameInconsistentWithGUID, edm::IndexIntoFile::fillEventNumbersOrEntries(), fillIndexIntoFile(), edm::IndexIntoFile::fixIndexes(), indexIntoFile_, edm::FileID::isValid(), edm::RootTree::isValid(), noEventSort_, orderedProcessHistoryIDs_, edm::Primary, processHistoryRegistry_, edm::IndexIntoFile::reduceProcessHistoryIDs(), runTree(), edm::IndexIntoFile::setEventFinder(), edm::IndexIntoFile::setNumberOfEvents(), edm::IndexIntoFile::setProcessHistoryIDs(), edm::stemFromPath(), and edm::FileFormatVersion::useReducedProcessHistoryID().

Referenced by RootFile().

◆ wasFirstEventJustRead()

bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 928 of file RootFile.cc.

928  {
929  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
930  int phIndex;
933  IndexIntoFile::EntryNumber_t eventEntry;
934  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
935  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
936  return eventEntry == IndexIntoFile::invalidEntry;
937  }

References indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, BXlumiParameters_cfi::lumi, writedatasetfile::run, and edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward().

◆ wasLastEventJustRead()

bool edm::RootFile::wasLastEventJustRead ( ) const

Definition at line 922 of file RootFile.cc.

922  {
923  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
924  itr.advanceToEvent();
925  return itr.getEntryType() == IndexIntoFile::kEnd;
926  }

References edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileIter_, and edm::IndexIntoFile::kEnd.

◆ whyNotFastClonable()

int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 243 of file RootFile.h.

243 { return whyNotFastClonable_; }

References whyNotFastClonable_.

Referenced by createFileBlock().

Member Data Documentation

◆ branchChildren_

edm::propagate_const<std::shared_ptr<BranchChildren> > edm::RootFile::branchChildren_
private

Definition at line 402 of file RootFile.h.

Referenced by branchChildren(), markBranchToBeDropped(), and RootFile().

◆ branchIDListHelper_

edm::propagate_const<std::shared_ptr<BranchIDListHelper> > edm::RootFile::branchIDListHelper_
private

Definition at line 390 of file RootFile.h.

Referenced by branchIDListHelper(), fillEventHistory(), and RootFile().

◆ branchIDLists_

std::shared_ptr<BranchIDLists const> edm::RootFile::branchIDLists_
private

Definition at line 389 of file RootFile.h.

Referenced by RootFile().

◆ branchListIndexesUnchanged_

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 378 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

◆ currentProcessBlockTree_

unsigned int edm::RootFile::currentProcessBlockTree_ = 0
private

◆ daqProvenanceHelper_

edm::propagate_const<std::unique_ptr<DaqProvenanceHelper> > edm::RootFile::daqProvenanceHelper_
private

◆ duplicateChecker_

edm::propagate_const<std::shared_ptr<DuplicateChecker> > edm::RootFile::duplicateChecker_
private

◆ edProductClass_

edm::propagate_const<TClass*> edm::RootFile::edProductClass_
private

Definition at line 409 of file RootFile.h.

Referenced by dropOnInputAndReorder().

◆ enforceGUIDInFileName_

bool edm::RootFile::enforceGUIDInFileName_
private

Definition at line 375 of file RootFile.h.

Referenced by validateFile().

◆ eventAuxCache_

EventAuxiliary edm::RootFile::eventAuxCache_
private

Definition at line 379 of file RootFile.h.

Referenced by fillThisEventAuxiliary().

◆ eventHistoryTree_

edm::propagate_const<TTree*> edm::RootFile::eventHistoryTree_
private

Definition at line 398 of file RootFile.h.

Referenced by close(), fillEventHistory(), and readEventHistoryTree().

◆ eventProcessHistoryIDs_

std::vector<EventProcessHistoryID> edm::RootFile::eventProcessHistoryIDs_
private

Definition at line 370 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

◆ eventProcessHistoryIter_

std::vector<EventProcessHistoryID>::const_iterator edm::RootFile::eventProcessHistoryIter_
private

Definition at line 371 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

◆ eventProductProvenanceRetrievers_

std::vector<edm::propagate_const<std::shared_ptr<ProductProvenanceRetriever> > > edm::RootFile::eventProductProvenanceRetrievers_
private

Definition at line 406 of file RootFile.h.

Referenced by eventProductProvenanceRetriever(), and makeProductProvenanceRetriever().

◆ eventSkipperByID_

edm::propagate_const<std::shared_ptr<EventSkipperByID> > edm::RootFile::eventSkipperByID_
private

Definition at line 360 of file RootFile.h.

Referenced by RootFile(), skipEvents(), and skipThisEntry().

◆ eventToProcessBlockIndexes_

EventToProcessBlockIndexes edm::RootFile::eventToProcessBlockIndexes_
private

Definition at line 399 of file RootFile.h.

Referenced by fillEventToProcessBlockIndexes(), and readCurrentEvent().

◆ eventToProcessBlockIndexesBranch_

edm::propagate_const<TBranch*> edm::RootFile::eventToProcessBlockIndexesBranch_
private

Definition at line 400 of file RootFile.h.

Referenced by fillEventToProcessBlockIndexes().

◆ eventTree_

RootTree edm::RootFile::eventTree_
private

◆ fid_

FileID edm::RootFile::fid_
private

Definition at line 362 of file RootFile.h.

Referenced by reportOpened(), RootFile(), and validateFile().

◆ file_

const std::string edm::RootFile::file_
private

◆ fileFormatVersion_

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 361 of file RootFile.h.

Referenced by fileFormatVersion(), makeProvenanceReaderMaker(), and RootFile().

◆ filePtr_

edm::propagate_const<std::shared_ptr<InputFile> > edm::RootFile::filePtr_
private

◆ fileThinnedAssociationsHelper_

edm::propagate_const<std::unique_ptr<ThinnedAssociationsHelper> > edm::RootFile::fileThinnedAssociationsHelper_
private

Definition at line 393 of file RootFile.h.

Referenced by dropOnInputAndReorder(), initAssociationsFromSecondary(), and RootFile().

◆ hasNewlyDroppedBranch_

std::array<bool, NumBranchTypes> edm::RootFile::hasNewlyDroppedBranch_
private

Definition at line 377 of file RootFile.h.

Referenced by dropOnInputAndReorder(), hasNewlyDroppedBranch(), and RootFile().

◆ history_

edm::propagate_const<std::unique_ptr<History> > edm::RootFile::history_
private

Definition at line 401 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

◆ indexIntoFile_

IndexIntoFile& edm::RootFile::indexIntoFile_
private

◆ indexIntoFileBegin_

IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileBegin_
private

Definition at line 366 of file RootFile.h.

Referenced by rewind(), RootFile(), and setIfFastClonable().

◆ indexIntoFileEnd_

IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileEnd_
private

◆ indexIntoFileIter_

IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileIter_
private

◆ indexIntoFileSharedPtr_

edm::propagate_const<std::shared_ptr<IndexIntoFile> > edm::RootFile::indexIntoFileSharedPtr_
private

Definition at line 363 of file RootFile.h.

Referenced by indexIntoFileSharedPtr().

◆ inputType_

InputType edm::RootFile::inputType_
private

◆ lastEventEntryNumberRead_

IndexIntoFile::EntryNumber_t edm::RootFile::lastEventEntryNumberRead_
private

Definition at line 387 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

◆ logicalFile_

const std::string edm::RootFile::logicalFile_
private

Definition at line 356 of file RootFile.h.

Referenced by reportOpened().

◆ lumiTree_

RootTree edm::RootFile::lumiTree_
private

◆ newBranchToOldBranch_

std::map<std::string, std::string> edm::RootFile::newBranchToOldBranch_
private

Definition at line 397 of file RootFile.h.

Referenced by newBranchToOldBranch(), and RootFile().

◆ noEventSort_

bool edm::RootFile::noEventSort_
private

Definition at line 374 of file RootFile.h.

Referenced by goToEvent(), setIfFastClonable(), and validateFile().

◆ orderedProcessHistoryIDs_

std::vector<ProcessHistoryID>& edm::RootFile::orderedProcessHistoryIDs_
private

Definition at line 365 of file RootFile.h.

Referenced by validateFile().

◆ parentageIDLookup_

std::vector<ParentageID> edm::RootFile::parentageIDLookup_
private

Definition at line 407 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

◆ processBlockHelper_

edm::propagate_const<ProcessBlockHelper*> edm::RootFile::processBlockHelper_
private

Definition at line 391 of file RootFile.h.

Referenced by fillEventToProcessBlockIndexes(), and fillProcessBlockHelper_().

◆ processBlockTrees_

std::vector<edm::propagate_const<std::unique_ptr<RootTree> > > edm::RootFile::processBlockTrees_
private

◆ processConfiguration_

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 357 of file RootFile.h.

◆ processHistoryRegistry_

edm::propagate_const<ProcessHistoryRegistry*> edm::RootFile::processHistoryRegistry_
private

◆ processingMode_

InputSource::ProcessingMode edm::RootFile::processingMode_
private

Definition at line 395 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

◆ productRegistry_

std::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry_
private

Definition at line 388 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

◆ provenanceAdaptor_

edm::propagate_const<std::unique_ptr<ProvenanceAdaptor> > edm::RootFile::provenanceAdaptor_
private

Definition at line 404 of file RootFile.h.

Referenced by fillEventHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), and RootFile().

◆ provenanceReaderMaker_

edm::propagate_const<std::unique_ptr<MakeProvenanceReader> > edm::RootFile::provenanceReaderMaker_
private

Definition at line 405 of file RootFile.h.

Referenced by makeProductProvenanceRetriever(), and RootFile().

◆ runHelper_

edm::propagate_const<RunHelperBase*> edm::RootFile::runHelper_
private

◆ runTree_

RootTree edm::RootFile::runTree_
private

◆ savedRunAuxiliary_

edm::propagate_const<std::shared_ptr<RunAuxiliary> > edm::RootFile::savedRunAuxiliary_
private

Definition at line 372 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), readRunAuxiliary_(), and savedRunAuxiliary().

◆ skipAnyEvents_

bool edm::RootFile::skipAnyEvents_
private

Definition at line 373 of file RootFile.h.

Referenced by setIfFastClonable().

◆ storedMergeableRunProductMetadata_

edm::propagate_const<std::unique_ptr<StoredMergeableRunProductMetadata> > edm::RootFile::storedMergeableRunProductMetadata_
private

Definition at line 369 of file RootFile.h.

Referenced by readRun_(), and RootFile().

◆ storedProcessBlockHelper_

edm::propagate_const<std::unique_ptr<StoredProcessBlockHelper> > edm::RootFile::storedProcessBlockHelper_
private

Definition at line 392 of file RootFile.h.

Referenced by fillProcessBlockHelper_(), and RootFile().

◆ thinnedAssociationsHelper_

edm::propagate_const<std::shared_ptr<ThinnedAssociationsHelper> > edm::RootFile::thinnedAssociationsHelper_
private

Definition at line 394 of file RootFile.h.

Referenced by initAssociationsFromSecondary().

◆ treePointers_

std::vector<edm::propagate_const<RootTree*> > edm::RootFile::treePointers_
private

Definition at line 385 of file RootFile.h.

Referenced by close(), dropOnInputAndReorder(), RootFile(), and setPresenceInProductRegistry().

◆ whyNotFastClonable_

int edm::RootFile::whyNotFastClonable_
private

Definition at line 376 of file RootFile.h.

Referenced by RootFile(), setIfFastClonable(), and whyNotFastClonable().

edm::poolNames::idToParameterSetBlobsBranchName
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:218
edm::IndexIntoFile::IndexIntoFileItr::copyPosition
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
Definition: IndexIntoFile.cc:1760
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
edm::IndexIntoFile::doneFileInitialization
void doneFileInitialization()
Clears the temporary vector of event numbers to reduce memory usage.
Definition: IndexIntoFile.cc:306
edm::RootTree::tree
TTree const * tree() const
Definition: RootTree.h:169
edm::FileFormatVersion::hasThinnedAssociations
bool hasThinnedAssociations() const
Definition: FileFormatVersion.cc:45
edm::RootFile::endOfProcessBlocksReached
bool endOfProcessBlocksReached() const
Definition: RootFile.cc:1671
edm::IndexIntoFile::IndexIntoFileItr::run
RunNumber_t run() const
Definition: IndexIntoFile.h:702
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
edm::source
static const std::string source("source")
edm::EventToProcessBlockIndexes::setIndex
void setIndex(unsigned int value)
Definition: EventToProcessBlockIndexes.h:17
edm::EventAuxiliary::event
EventNumber_t event() const
Definition: EventAuxiliary.h:72
edm::IndexIntoFile::kLumi
Definition: IndexIntoFile.h:238
edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisLumi
EntryNumber_t firstEventEntryThisLumi()
Definition: IndexIntoFile.h:720
edm::RootFile::eventSkipperByID_
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:360
edm::TypeWithDict::byName
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
edm::poolNames::branchIDListBranchName
std::string const & branchIDListBranchName()
Definition: BranchType.cc:183
edm::RootTree::trainCache
void trainCache(char const *branchNames)
Definition: RootTree.cc:478
edm::FileID::isValid
bool isValid() const
Definition: FileID.h:18
mps_fire.i
i
Definition: mps_fire.py:428
edm::IndexIntoFile::IndexIntoFileItr::lumi
LuminosityBlockNumber_t lumi() const
Definition: IndexIntoFile.h:703
edm::RootTree::setEntryNumber
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:219
edm::RootFile::eventProductProvenanceRetrievers_
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:406
edm::FileFormatVersion::useReducedProcessHistoryID
bool useReducedProcessHistoryID() const
Definition: FileFormatVersion.cc:43
edm::RootFile::eventProcessHistoryIter_
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:371
edm::RootFile::makeProductProvenanceRetriever
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:2142
edm::poolNames::fileFormatVersionBranchName
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:189
edm::FileFormatVersion::splitProductIDs
bool splitProductIDs() const
Definition: FileFormatVersion.cc:21
edm::find_in_all
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:26
edm::RootFile::indexIntoFileSharedPtr_
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:363
edm::conversion
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
edm::roottree::trainCache
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:535
edm::getWrapperBasePtr
std::unique_ptr< WrapperBase > getWrapperBasePtr(void *p, int offset)
Definition: getWrapperBasePtr.h:8
edm::roottree::defaultNonEventLearningEntries
unsigned const int defaultNonEventLearningEntries
Definition: RootTree.h:41
edm::IndexIntoFile::iterationWillBeInEntryOrder
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
Definition: IndexIntoFile.cc:474
edm::RootFile::productRegistry
std::shared_ptr< ProductRegistry const > productRegistry() const
Definition: RootFile.h:235
edm::RootFile::lumiTree_
RootTree lumiTree_
Definition: RootFile.h:381
edm::RootFile::processHistoryRegistry_
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:358
edm::RootFile::indexIntoFileEnd_
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:367
edm::RootFile::daqProvenanceHelper_
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:408
edm::IndexIntoFile::findRunPosition
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
Definition: IndexIntoFile.cc:692
edm::RootFile::runHelper_
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:396
LumiList
Definition: LumiList.py:1
edm::RootFile::readParentageTree
void readParentageTree(InputType inputType)
Definition: RootFile.cc:680
edm::setIsMergeable
void setIsMergeable(BranchDescription &)
Definition: setIsMergeable.cc:15
HLT_FULL_cff.finder
finder
Definition: HLT_FULL_cff.py:51974
RunList
Definition: RunList.h:16
edm::RootFile::eventHistoryTree_
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:398
edm::FileID::fid
std::string const & fid() const
Definition: FileID.h:19
edm::RootFile::branchListIndexesUnchanged
bool branchListIndexesUnchanged() const
Definition: RootFile.h:245
edm::IndexIntoFile::kEvent
Definition: IndexIntoFile.h:238
converter
Definition: CandidateProducer.h:25
edm::IndexIntoFile::setNumberOfEvents
void setNumberOfEvents(EntryNumber_t nevents)
Definition: IndexIntoFile.h:945
edm::IndexIntoFile::IndexIntoFileItr::peekAheadAtLumi
LuminosityBlockNumber_t peekAheadAtLumi() const
Definition: IndexIntoFile.h:708
edm::IndexIntoFile::numericalOrder
Definition: IndexIntoFile.h:266
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:174
edm::RootFile::runTree
RootTree const & runTree() const
Definition: RootFile.h:241
mps_splice.entry
entry
Definition: mps_splice.py:68
edm::RootFile::initializeFirstProcessBlockEntry
bool initializeFirstProcessBlockEntry()
Definition: RootFile.cc:1662
edm::RootFile::indexIntoFileIter_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:368
edm::errors::EventCorruption
Definition: EDMException.h:43
edm::ParentageRegistry::instance
static ParentageRegistry * instance()
Definition: ParentageRegistry.cc:5
edm::moduleName
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
edm::IndexIntoFile::invalidEntry
static constexpr EntryNumber_t invalidEntry
Definition: IndexIntoFile.h:236
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:163
edm::IndexIntoFile::processHistoryID
ProcessHistoryID const & processHistoryID(int i) const
Definition: IndexIntoFile.cc:55
edm::EventToProcessBlockIndexes::index
unsigned int index() const
Definition: EventToProcessBlockIndexes.h:16
edm::poolNames::parameterSetsTreeName
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:216
edm::FileBlock::NotProcessingEvents
Definition: FileBlock.h:31
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
edm::IndexIntoFile::unsortedEventNumbers
std::vector< EventNumber_t > & unsortedEventNumbers()
Definition: IndexIntoFile.h:994
edm::BranchListIndexes
std::vector< BranchListIndex > BranchListIndexes
Definition: BranchListIndex.h:18
cms::cuda::assert
assert(be >=bs)
edm::FileBlock::RunOrLumiNotContiguous
Definition: FileBlock.h:38
edm::RootFile::branchIDListHelper_
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:390
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::poolNames::indexIntoFileBranchName
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:198
edm::InputType::SecondaryFile
edm::RootFile::eventTree_
RootTree eventTree_
Definition: RootFile.h:380
edm::RootFile::currentProcessBlockTree_
unsigned int currentProcessBlockTree_
Definition: RootFile.h:384
edm::stemFromPath
std::string_view stemFromPath(std::string_view path)
Definition: stemFromPath.cc:4
edm::RootFile::readEntryDescriptionTree
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:634
hgcal_conditions::parameters
Definition: HGCConditions.h:86
edm::get_underlying_safe
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:41
edm::RootFile::storedProcessBlockHelper_
edm::propagate_const< std::unique_ptr< StoredProcessBlockHelper > > storedProcessBlockHelper_
Definition: RootFile.h:392
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::RootFile::isDuplicateEvent
bool isDuplicateEvent()
Definition: RootFile.cc:860
edm::RootFile::enforceGUIDInFileName_
bool enforceGUIDInFileName_
Definition: RootFile.h:375
edm::FileBlock::EventsToBeSorted
Definition: FileBlock.h:37
edm::RootFile::skipThisEntry
bool skipThisEntry()
Definition: RootFile.cc:823
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::IndexIntoFile::findPosition
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
Definition: IndexIntoFile.cc:489
edm::RootFile::fileFormatVersion
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:242
edm::FileFormatVersion::perEventProductIDs
bool perEventProductIDs() const
Definition: FileFormatVersion.cc:19
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
edm::RootFile::eventProcessHistoryIDs_
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:370
edm::poolNames::branchListIndexesBranchName
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:212
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
edm::InRun
Definition: BranchType.h:11
edm::IndexIntoFile::empty
bool empty() const
True if no runs, lumis, or events are in the file.
Definition: IndexIntoFile.cc:487
edm::BranchTypeToAuxiliaryBranchName
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:116
runTheMatrix.nStreams
nStreams
Definition: runTheMatrix.py:372
edm::RootFile::setEntryAtLumi
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1801
edm::RootFile::file
std::string const & file() const
Definition: RootFile.h:234
edm::RootFile::setEntryAtRun
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1809
edm::RootTree::resetTraining
void resetTraining()
Definition: RootTree.h:182
edm::poolNames::mergeableRunProductMetadataBranchName
std::string const & mergeableRunProductMetadataBranchName()
Definition: BranchType.cc:201
edm::numberOfRunLumiEventProductTrees
constexpr unsigned int numberOfRunLumiEventProductTrees
Definition: BranchType.h:15
edm::RootFile::inputType_
InputType inputType_
Definition: RootFile.h:410
edm::InProcess
Definition: BranchType.h:11
edm::RootFile::fileThinnedAssociationsHelper_
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:393
BXlumiParameters_cfi.lumi
lumi
Definition: BXlumiParameters_cfi.py:6
edm::FileFormatVersion::noMetaDataTrees
bool noMetaDataTrees() const
Definition: FileFormatVersion.cc:39
edm::poolNames::parentageBranchName
std::string const & parentageBranchName()
Definition: BranchType.cc:156
edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun
void advanceToNextRun()
Definition: IndexIntoFile.h:774
edm::RootTree::skipEntries
bool skipEntries(unsigned int &offset)
Definition: RootTree.cc:398
edm::IndexIntoFile::setEventFinder
void setEventFinder(std::shared_ptr< EventFinder > ptr)
Definition: IndexIntoFile.h:952
edm::RootFile::eventToProcessBlockIndexes_
EventToProcessBlockIndexes eventToProcessBlockIndexes_
Definition: RootFile.h:399
edm::FileFormatVersion::runsAndLumis
bool runsAndLumis() const
Definition: FileFormatVersion.cc:13
edm::RootFile::eventAuxCache_
EventAuxiliary eventAuxCache_
Definition: RootFile.h:379
edm::IndexIntoFile::invalidIndex
static constexpr int invalidIndex
Definition: IndexIntoFile.h:232
edm::RootTree::metaTree
TTree const * metaTree() const
Definition: RootTree.h:171
edm::RootFile::provenanceAdaptor_
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:404
edm::IndexIntoFile::kRun
Definition: IndexIntoFile.h:238
edm::FileFormatVersion::eventHistoryTree
bool eventHistoryTree() const
Definition: FileFormatVersion.cc:17
edm::RootFile::modifiedIDs
bool modifiedIDs() const
Definition: RootFile.h:246
edm::poolNames::processHistoryBranchName
std::string const & processHistoryBranchName()
Definition: BranchType.cc:177
edm::RootFile::fillRunAuxiliary
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1413
edm::RootFile::branchChildren_
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:402
edmLumisInFiles.lumis
lumis
Definition: edmLumisInFiles.py:31
edm::RootFile::treePointers_
std::vector< edm::propagate_const< RootTree * > > treePointers_
Definition: RootFile.h:385
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::RootTree::fillAux
void fillAux(T *&pAux)
Definition: RootTree.h:141
edm::RootFile::processBlockHelper_
edm::propagate_const< ProcessBlockHelper * > processBlockHelper_
Definition: RootFile.h:391
edm::poolNames::eventToProcessBlockIndexesBranchName
std::string const & eventToProcessBlockIndexesBranchName()
Definition: BranchType.cc:214
edm::RootFile::getNextItemType
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:877
edm::RootFile::fillEventAuxiliary
EventAuxiliary fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1306
edm::RootFile::RootFile
RootFile(std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, std::shared_ptr< InputFile > filePtr, std::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunHelperBase *runHelper, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, std::shared_ptr< BranchIDListHelper > branchIDListHelper, ProcessBlockHelper *, std::shared_ptr< ThinnedAssociationsHelper > thinnedAssociationsHelper, std::vector< BranchID > const *associationsFromSecondary, std::shared_ptr< DuplicateChecker > duplicateChecker, 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 usingGoToEvent, bool enablePrefetching, bool enforceGUIDInFileName)
Definition: RootFile.cc:145
edm::RootTree::fillBranchEntry
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:147
edm::RootFile::savedRunAuxiliary
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
Definition: RootFile.h:342
edm::ProcessHistoryRegistry::vector_type
ProcessHistoryVector vector_type
Definition: ProcessHistoryRegistry.h:22
edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex
int processHistoryIDIndex() const
Definition: IndexIntoFile.h:701
edm::InEvent
Definition: BranchType.h:11
edm::poolNames::parameterSetMapBranchName
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:168
edm::RootFile::whyNotFastClonable_
int whyNotFastClonable_
Definition: RootFile.h:376
edm::RootFile::thinnedAssociationsHelper_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: RootFile.h:394
edm::InputSource::RunsAndLumis
Definition: InputSource.h:56
edm::RootFile::hasNewlyDroppedBranch
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:244
edm::poolNames::entryDescriptionIDBranchName
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:149
edm::RootTree::resetAndGetRootDelayedReader
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:142
edm::RootFile::fillIndexIntoFile
void fillIndexIntoFile()
Definition: RootFile.cc:989
edm::IndexIntoFile::invalidLumi
static constexpr LuminosityBlockNumber_t invalidLumi
Definition: IndexIntoFile.h:234
edm::poolNames::parentageTreeName
std::string const & parentageTreeName()
Definition: BranchType.cc:154
edm::FileFormatVersion::newAuxiliary
bool newAuxiliary() const
Definition: FileFormatVersion.cc:11
edm::BranchIDLists
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::RootFile::indexIntoFile_
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:364
edm::numEntries
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
edm::IndexIntoFile::IndexIntoFileItr::skipEventForward
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
Definition: IndexIntoFile.h:745
edm::IndexIntoFile::begin
IndexIntoFileItr begin(SortOrder sortOrder) const
Definition: IndexIntoFile.cc:461
edm::RootFile::newBranchToOldBranch
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:804
edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun
bool skipLumiInRun()
Definition: IndexIntoFile.h:768
edm::RootFile::fid_
FileID fid_
Definition: RootFile.h:362
edm::RootFile::orderedProcessHistoryIDs_
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:365
edm::poolNames::eventSelectionsBranchName
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:210
summarizeEdmComparisonLogfiles.succeeded
succeeded
Definition: summarizeEdmComparisonLogfiles.py:100
edm::ProductRegistry::ProductList
std::map< BranchKey, BranchDescription > ProductList
Definition: ProductRegistry.h:39
edm::RootFile::savedRunAuxiliary_
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:372
edm::RootFile::storedMergeableRunProductMetadata_
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
Definition: RootFile.h:369
edm::RootFile::dropProcessesAndReorder
void dropProcessesAndReorder(StoredProcessBlockHelper &, std::set< std::string > const &processesWithKeptProcessBlockProducts, ProcessBlockHelper const *)
Definition: RootFile.cc:2041
edm::RootFile::hasNewlyDroppedBranch_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:377
edm::RootFile::makeProvenanceReaderMaker
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
Definition: RootFile.cc:2126
edm::IndexIntoFile::firstAppearanceOrder
Definition: IndexIntoFile.h:266
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
fetchall_from_DQM_v2.release
release
Definition: fetchall_from_DQM_v2.py:92
ParameterSet
Definition: Functions.h:16
edm::InLumi
Definition: BranchType.h:11
edm::IndexIntoFile::SortOrder
SortOrder
Definition: IndexIntoFile.h:266
edm::poolNames::productDescriptionBranchName
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:162
edm::RootFile::setEntryAtEvent
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: RootFile.cc:1793
edm::RootFile::setIfFastClonable
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:715
edm::RootFile::logicalFile_
const std::string logicalFile_
Definition: RootFile.h:356
edm::errors::FileNameInconsistentWithGUID
Definition: EDMException.h:68
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
edm::RootFile::initializeDuplicateChecker
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
Definition: RootFile.cc:1845
edm::RootFile::processingMode_
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:395
edm::friendlyname::friendlyName
std::string friendlyName(std::string const &iFullName)
Definition: FriendlyName.cc:278
edm::RootFile::validateFile
void validateFile(InputType inputType, bool usingGoToEvent)
Definition: RootFile.cc:1214
edm::FileBlock::FileTooOld
Definition: FileBlock.h:35
edm::RootFile::markBranchToBeDropped
void markBranchToBeDropped(bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
Definition: RootFile.cc:1885
edm::RootFile::fillEventHistory
bool fillEventHistory(EventAuxiliary &evtAux, EventSelectionIDVector &eventSelectionIDs, BranchListIndexes &branchListIndexes, bool assertOnFailure=true)
Definition: RootFile.cc:1331
edm::RootFile::filePtr_
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:359
edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun
EntryNumber_t firstEventEntryThisRun()
Definition: IndexIntoFile.h:719
edm::RootFile::processBlockTrees_
std::vector< edm::propagate_const< std::unique_ptr< RootTree > > > processBlockTrees_
Definition: RootFile.h:383
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::poolNames::entryDescriptionTreeName
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:147
edm::IndexIntoFile::findLumiPosition
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
Definition: IndexIntoFile.cc:685
edm::ProcessConfigurationVector
std::vector< ProcessConfiguration > ProcessConfigurationVector
Definition: ProcessConfiguration.h:62
edm::FileBlock::EventsOrLumisSelectedByID
Definition: FileBlock.h:39
edm::createGlobalIdentifier
std::string createGlobalIdentifier(bool binary=false)
Definition: GlobalIdentifier.cc:5
edm::RootFile::branchChildren
std::shared_ptr< BranchChildren const > branchChildren() const
Definition: RootFile.h:345
edm::poolNames::processHistoryMapBranchName
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:174
edm::FileBlock::NoEventsInFile
Definition: FileBlock.h:36
edm::RootFile::eventToProcessBlockIndexesBranch_
edm::propagate_const< TBranch * > eventToProcessBlockIndexesBranch_
Definition: RootFile.h:400
edm::RootFile::skipAnyEvents_
bool skipAnyEvents_
Definition: RootFile.h:373
edm::roottree::defaultLearningEntries
unsigned const int defaultLearningEntries
Definition: RootTree.h:40
edm::RootFile::edProductClass_
edm::propagate_const< TClass * > edProductClass_
Definition: RootFile.h:409
edm::RootFile::fileFormatVersion_
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:361
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::RootFile::fillEventToProcessBlockIndexes
void fillEventToProcessBlockIndexes()
Definition: RootFile.cc:1311
edm::IndexIntoFile::end
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
Definition: IndexIntoFile.cc:470
edm::FileFormatVersion::processHistorySameWithinRun
bool processHistorySameWithinRun() const
Definition: FileFormatVersion.cc:33
edm::RootFile::readEventHistoryTree
void readEventHistoryTree()
Definition: RootFile.cc:1834
edm::lower_bound_all
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
Definition: Algorithms.h:69
edm::RootTree::branchNames
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:137
edm::RootTree::insertEntryForIndex
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:118
edm::IndexIntoFile::findEventPosition
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: IndexIntoFile.cc:676
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::FileFormatVersion::storedProductProvenanceUsed
bool storedProductProvenanceUsed() const
Definition: FileFormatVersion.cc:41
edm::IndexIntoFile::containsItem
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: IndexIntoFile.cc:696
edm::InputSource::Runs
Definition: InputSource.h:56
edm::EntryDescriptionID
Hash< EntryDescriptionType > EntryDescriptionID
Definition: EntryDescriptionID.h:8
edm::IndexIntoFile::IndexIntoFileItr::getEntryType
EntryType getEntryType() const
Definition: IndexIntoFile.h:700
edm::roottree::defaultNonEventCacheSize
unsigned const int defaultNonEventCacheSize
Definition: RootTree.h:39
edm::RootFile::history_
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:401
edm::RootFile::makeProcessBlockRootTrees
void makeProcessBlockRootTrees(std::shared_ptr< InputFile > filePtr, int treeMaxVirtualSize, bool enablePrefetching, InputType inputType, StoredProcessBlockHelper const &storedProcessBlockHelper)
Definition: RootFile.cc:2102
edm::Timestamp::invalidTimestamp
static Timestamp invalidTimestamp()
Definition: Timestamp.h:82
edm::RootFile::noEventSort_
bool noEventSort_
Definition: RootFile.h:374
edm::RootTree::current
bool current() const
Definition: RootTree.h:126
edm::RootTree::isValid
bool isValid() const
Definition: RootTree.cc:123
edm::RootFile::setPresenceInProductRegistry
void setPresenceInProductRegistry(ProductRegistry &, StoredProcessBlockHelper const &)
Definition: RootFile.cc:1858
edm::RootFile::provenanceReaderMaker_
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
Definition: RootFile.h:405
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::RootFile::parentageIDLookup_
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:407
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
edm::RootTree::entryNumber
EntryNumber const & entryNumber() const
Definition: RootTree.h:132
edm::RootTree::rewind
void rewind()
Definition: RootTree.h:128
edm::RootTree::EntryNumber
roottree::EntryNumber EntryNumber
Definition: RootTree.h:82
edm::RootFile::lastEventEntryNumberRead_
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:387
edm::RootTree::entries
EntryNumber const & entries() const
Definition: RootTree.h:134
edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun
void advanceToNextLumiOrRun()
Definition: IndexIntoFile.h:775
edm::poolNames::metaDataTreeName
std::string const & metaDataTreeName()
Definition: BranchType.cc:159
edm::ProcessHistoryRegistry::collection_type
ProcessHistoryMap collection_type
Definition: ProcessHistoryRegistry.h:21
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
edm::InputType::Primary
edm::ParentageID
Hash< ParentageType > ParentageID
Definition: ParentageID.h:8
Exception
Definition: hltDiff.cc:245
edm::IndexIntoFile::fillEventNumbersOrEntries
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
Definition: IndexIntoFile.cc:202
edm::RootFile::productRegistry_
std::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:388
edm::RootFile::whyNotFastClonable
int whyNotFastClonable() const
Definition: RootFile.h:243
edm::IndexIntoFile::reduceProcessHistoryIDs
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
Definition: IndexIntoFile.cc:308
edm::InputType::SecondarySource
hgcal::association
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
Definition: LCToCPAssociatorByEnergyScoreImpl.h:44
dqmiodatasetharvest.processes
processes
Definition: dqmiodatasetharvest.py:190
edm::poolNames::thinnedAssociationsHelperBranchName
std::string const & thinnedAssociationsHelperBranchName()
Definition: BranchType.cc:186
edm::RootFile::dropOnInputAndReorder
void dropOnInputAndReorder(ProductRegistry &, ProductSelectorRules const &, bool dropDescendants, InputType, StoredProcessBlockHelper &, ProcessBlockHelper const *)
Definition: RootFile.cc:1896
edm::IndexIntoFile::EntryNumber_t
long long EntryNumber_t
Definition: IndexIntoFile.h:231
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::poolNames::productDependenciesBranchName
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:165
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
edm::RootFile::newBranchToOldBranch_
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:397
edm::poolNames::eventHistoryTreeName
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:224
drop
const int drop
Definition: GenParticlePruner.cc:50
DTskim_cfg.processingMode
processingMode
Definition: DTskim_cfg.py:82
edm::poolNames::processBlockHelperBranchName
std::string const & processBlockHelperBranchName()
Definition: BranchType.cc:204
edm::IndexIntoFile::kEnd
Definition: IndexIntoFile.h:238
edm::RootFile::fillThisEventAuxiliary
EventAuxiliary const & fillThisEventAuxiliary()
Definition: RootFile.cc:1287
edm::RootFile::indexIntoFileBegin_
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:366
edm::roottree::getEntry
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:515
cmsCodeRulesChecker.rules
rules
Definition: cmsCodeRulesChecker.py:152
edm::IndexIntoFile::fixIndexes
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
Definition: IndexIntoFile.cc:370
edm::stable_sort_all
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
Definition: Algorithms.h:103
edm::IndexIntoFile::setRunOrLumiEntries
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
Definition: IndexIntoFile.h:1007
edm::FileBlock::MaxEventsTooSmall
Definition: FileBlock.h:41
edm::poolNames::fileIdentifierBranchName
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:192
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::RootFile::branchListIndexesUnchanged_
bool branchListIndexesUnchanged_
Definition: RootFile.h:378
parents
TPRegexp parents
Definition: eve_filter.cc:21
event
Definition: event.py:1
edm::RootTree::setSignals
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
Definition: RootTree.cc:508
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
edm::EventSelectionIDVector
std::vector< EventSelectionID > EventSelectionIDVector
Definition: EventSelectionID.h:16
edm::poolNames::entryDescriptionBranchName
std::string const & entryDescriptionBranchName()
Definition: BranchType.cc:151
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7746
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
Definition: IndexIntoFile.h:759
lumi
Definition: LumiSectionData.h:20
edm::RootFile::runTree_
RootTree runTree_
Definition: RootFile.h:382
edm::errors::FileReadError
Definition: EDMException.h:50
edm::RootTree::nextWithCache
bool nextWithCache()
Definition: RootTree.cc:211
edm::RootFile::readCurrentEvent
std::tuple< bool, bool > readCurrentEvent(EventPrincipal &cache, bool assertOnFailure=true)
Definition: RootFile.cc:1537
edm::poolNames::processConfigurationBranchName
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:180
edm::RootFile::eventProductProvenanceRetriever
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
Definition: RootFile.h:348
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
edm::FileBlock::MaxLumisTooSmall
Definition: FileBlock.h:42
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::InputSource::RunsLumisAndEvents
Definition: InputSource.h:56
edm::RootFile::branchIDLists_
std::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:389
edm::IndexIntoFile::setProcessHistoryIDs
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
Definition: IndexIntoFile.h:1012
edm::RootFile::branchIDListHelper
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:277
edm::poolNames::moduleDescriptionMapBranchName
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:171
edm::RootTree::next
bool next()
Definition: RootTree.h:124
edm::RootFile::duplicateChecker_
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:403
edm::FileBlock::DuplicateEventsRemoved
Definition: FileBlock.h:44
edm::ParameterSetConverter::ParameterSetIdConverter
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
Definition: ParameterSetConverter.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::RootFile::fillLumiAuxiliary
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1390
edm::IndexIntoFile::IndexIntoFileItr::entry
EntryNumber_t entry() const
Definition: IndexIntoFile.h:704
edm::IndexIntoFile::invalidRun
static constexpr RunNumber_t invalidRun
Definition: IndexIntoFile.h:233
edm::poolNames::eventHistoryBranchName
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:207
edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent
void advanceToEvent()
Definition: IndexIntoFile.cc:1748
edm::IndexIntoFile::fillEventNumbers
void fillEventNumbers() const
Definition: IndexIntoFile.cc:198
edm::IndexIntoFile::EntryType
EntryType
Definition: IndexIntoFile.h:238
edm::FileBlock::InitialEventsSkipped
Definition: FileBlock.h:40
edm::RootFile::processConfiguration_
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:357
edm::RootFile::file_
const std::string file_
Definition: RootFile.h:355