CMS 3D CMS Logo

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

#include <RootFile.h>

Public Types

typedef std::array< RootTree *, NumBranchTypesRootTreePtrArray
 

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::unique_ptr< FileBlockcreateFileBlock () const
 
EventAuxiliary const & eventAux () const
 
EventID const & eventID () const
 
RootTree const & eventTree () const
 
std::string const & file () const
 
FileFormatVersion fileFormatVersion () const
 
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 &)
 
RootTree const & lumiTree () const
 
bool modifiedIDs () const
 
bool nextEventEntry ()
 
RootFileoperator= (RootFile const &)=delete
 
std::shared_ptr< ProductRegistry const > productRegistry () const
 
bool readCurrentEvent (EventPrincipal &cache)
 
void readEvent (EventPrincipal &cache)
 
void readFakeRun_ (RunPrincipal &runPrincipal)
 
std::shared_ptr< RunAuxiliaryreadFakeRunAuxiliary_ ()
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr< LuminosityBlockAuxiliaryreadLuminosityBlockAuxiliary_ ()
 
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, 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)
 
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 dropOnInput (ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
 
std::shared_ptr< ProductProvenanceRetriever > & eventProductProvenanceRetriever (size_t index)
 
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever (size_t index) const
 
bool fillEventAuxiliary (IndexIntoFile::EntryNumber_t entry)
 
void fillEventHistory ()
 
void fillIndexIntoFile ()
 
std::shared_ptr< LuminosityBlockAuxiliaryfillLumiAuxiliary ()
 
std::shared_ptr< RunAuxiliaryfillRunAuxiliary ()
 
void fillThisEventAuxiliary ()
 
void initializeDuplicateChecker (std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
 
bool isDuplicateEvent ()
 
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)
 
bool skipThisEntry ()
 
RootTreePtrArraytreePointers ()
 
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_
 
BranchListIndexes branchListIndexes_
 
bool branchListIndexesUnchanged_
 
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
 
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
 
edm::propagate_const< TClass * > edProductClass_
 
bool enforceGUIDInFileName_
 
EventAuxiliary eventAux_
 
edm::propagate_const< TTree * > eventHistoryTree_
 
std::vector< EventProcessHistoryIDeventProcessHistoryIDs_
 
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
 
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
 
EventSelectionIDVector eventSelectionIDs_
 
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
 
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_
 
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::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
 
RootTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 63 of file RootFile.h.

Member Typedef Documentation

◆ RootTreePtrArray

Definition at line 65 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,
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 141 of file RootFile.cc.

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

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, edm::IndexIntoFile::doneFileInitialization(), dropOnInput(), 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_, 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::InLumi, edm::InProcess, edm::InRun, edm::pset::Registry::insertMapped(), edm::pset::Registry::instance(), lumiTree_, makeProvenanceReaderMaker(), edm::poolNames::mergeableRunProductMetadataBranchName(), edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, benchmark-oval_cfg::noEventSort, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::Primary, edm::poolNames::processConfigurationBranchName(), 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(), edm::source(), storedMergeableRunProductMetadata_, 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 97 of file RootFile.h.

119  : RootFile(fileName,
120  processConfiguration,
121  logicalFileName,
122  filePtr,
123  nullptr,
124  false,
125  -1,
126  -1,
127  nStreams,
128  0U,
129  treeMaxVirtualSize,
131  runHelper,
132  false,
133  productSelectorRules,
134  inputType,
136  thinnedAssociationsHelper,
137  associationsFromSecondary,
138  nullptr,
139  dropDescendantsOfDroppedProducts,
140  processHistoryRegistry,
141  indexesIntoFiles,
142  currentIndexIntoFile,
143  orderedProcessHistoryIDs,
144  bypassVersionCheck,
145  labelRawDataLikeMC,
146  false,
147  enablePrefetching,
148  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 150 of file RootFile.h.

167  : RootFile(fileName,
168  processConfiguration,
169  logicalFileName,
170  filePtr,
171  nullptr,
172  false,
173  -1,
174  -1,
175  nStreams,
176  treeCacheSize,
177  treeMaxVirtualSize,
179  runHelper,
180  false,
181  productSelectorRules,
182  inputType,
183  nullptr,
184  nullptr,
185  nullptr,
186  nullptr,
187  false,
188  processHistoryRegistry,
189  indexesIntoFiles,
190  currentIndexIntoFile,
191  orderedProcessHistoryIDs,
192  bypassVersionCheck,
193  false,
194  false,
195  enablePrefetching,
196  enforceGUIDInFileName) {}

◆ ~RootFile()

edm::RootFile::~RootFile ( )

Definition at line 598 of file RootFile.cc.

598 {}

◆ 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 304 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 303 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 256 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 253 of file RootFile.h.

253  {
255  }

References branchIDListHelper_, and edm::get_underlying_safe().

◆ branchListIndexesUnchanged()

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

Definition at line 227 of file RootFile.h.

227 { return branchListIndexesUnchanged_; }

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

◆ close()

void edm::RootFile::close ( void  )

Definition at line 1212 of file RootFile.cc.

1212  {
1213  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1214  eventHistoryTree_ = nullptr;
1215  for (auto& treePointer : treePointers_) {
1216  if (treePointer == nullptr) {
1217  // ProcessBlock input not implemented yet
1218  continue;
1219  }
1220  treePointer->close();
1221  treePointer = nullptr;
1222  }
1223  filePtr_->Close();
1224  filePtr_ = nullptr; // propagate_const<T> has no reset() function
1225  }

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 810 of file RootFile.cc.

810  {
812  }

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

◆ createFileBlock()

std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

◆ dropOnInput()

void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType 
)
private

Definition at line 1718 of file RootFile.cc.

1721  {
1722  // This is the selector for drop on input.
1723  ProductSelector productSelector;
1724  productSelector.initialize(rules, reg.allBranchDescriptions());
1725 
1726  std::vector<BranchDescription const*> associationDescriptions;
1727 
1728  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1729  // Do drop on input. On the first pass, just fill in a set of branches to be dropped.
1730  std::set<BranchID> branchesToDrop;
1731  std::map<BranchID, BranchID> droppedToKeptAlias;
1732  for (auto const& product : prodList) {
1733  BranchDescription const& prod = product.second;
1734  if (prod.branchID() != prod.originalBranchID() && prod.present()) {
1735  droppedToKeptAlias[prod.originalBranchID()] = prod.branchID();
1736  }
1737  }
1738  for (auto const& product : prodList) {
1739  BranchDescription const& prod = product.second;
1740  // Special handling for ThinnedAssociations
1741  if (prod.unwrappedType() == typeid(ThinnedAssociation) && prod.present()) {
1742  if (inputType != InputType::SecondarySource) {
1743  associationDescriptions.push_back(&prod);
1744  } else {
1745  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1746  }
1747  } else if (!productSelector.selected(prod)) {
1748  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1749  }
1750  }
1751 
1752  if (inputType != InputType::SecondarySource) {
1753  // Decide whether to keep the thinned associations and corresponding
1754  // entries in the helper. For secondary source they are all dropped,
1755  // but in other cases we look for thinned collections the associations
1756  // redirect a Ref or Ptr to when dereferencing them.
1757 
1758  // Need a list of kept products in order to determine which thinned associations
1759  // are kept.
1760  std::set<BranchID> keptProductsInEvent;
1761  for (auto const& product : prodList) {
1762  BranchDescription const& prod = product.second;
1763  if (branchesToDrop.find(prod.branchID()) == branchesToDrop.end() && prod.present() &&
1764  prod.branchType() == InEvent) {
1765  keptProductsInEvent.insert(prod.branchID());
1766  }
1767  }
1768 
1769  // Decide which ThinnedAssociations to keep and store the decision in keepAssociation
1770  std::map<BranchID, bool> keepAssociation;
1771  fileThinnedAssociationsHelper_->selectAssociationProducts(
1772  associationDescriptions, keptProductsInEvent, keepAssociation);
1773 
1774  for (auto association : associationDescriptions) {
1775  if (!keepAssociation[association->branchID()]) {
1776  markBranchToBeDropped(dropDescendants, *association, branchesToDrop, droppedToKeptAlias);
1777  }
1778  }
1779 
1780  // Also delete the dropped associations from the ThinnedAssociationsHelper
1781  auto temp = std::make_unique<ThinnedAssociationsHelper>();
1782  for (auto const& associationBranches : fileThinnedAssociationsHelper_->data()) {
1783  auto iter = keepAssociation.find(associationBranches.association());
1784  if (iter != keepAssociation.end() && iter->second) {
1785  temp->addAssociation(associationBranches);
1786  }
1787  }
1788  // propagate_const<T> has no reset() function
1789  fileThinnedAssociationsHelper_ = std::unique_ptr<ThinnedAssociationsHelper>(temp.release());
1790  }
1791 
1792  // On this pass, actually drop the branches.
1793  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1794  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1795  BranchDescription const& prod = it->second;
1796  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1797  if (drop) {
1798  if (!prod.dropped()) {
1799  if (productSelector.selected(prod) && prod.unwrappedType() != typeid(ThinnedAssociation)) {
1800  LogWarning("RootFile") << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1801  << "of file '" << file_ << "' because it is dependent on a branch\n"
1802  << "that was explicitly dropped.\n";
1803  }
1804  // ProcessBlock input is not implemented yet
1805  if (prod.branchType() != InProcess) {
1806  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1807  }
1808  hasNewlyDroppedBranch_[prod.branchType()] = true;
1809  }
1810  ProductRegistry::ProductList::iterator icopy = it;
1811  ++it;
1812  prodList.erase(icopy);
1813  } else {
1814  ++it;
1815  }
1816  }
1817 
1818  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
1819  if (inputType == InputType::SecondaryFile) {
1820  TString tString;
1821  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1822  BranchDescription const& prod = it->second;
1823  if (prod.branchType() != InEvent && prod.branchType() != InProcess) {
1824  TClass* cp = prod.wrappedType().getClass();
1825  void* p = cp->New();
1826  int offset = cp->GetBaseClassOffset(edProductClass_);
1827  std::unique_ptr<WrapperBase> edp = getWrapperBasePtr(p, offset);
1828  if (edp->isMergeable()) {
1829  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1830  ProductRegistry::ProductList::iterator icopy = it;
1831  ++it;
1832  prodList.erase(icopy);
1833  } else {
1834  ++it;
1835  }
1836  } else
1837  ++it;
1838  }
1839  }
1840  }

References edm::ProductRegistry::allBranchDescriptions(), CommonMethods::cp(), drop, edProductClass_, file_, fileThinnedAssociationsHelper_, edm::getWrapperBasePtr(), hasNewlyDroppedBranch_, edm::InEvent, edm::ProductSelector::initialize(), edm::InProcess, markBranchToBeDropped(), newBranchToOldBranch(), hltrates_dqm_sourceclient-live_cfg::offset, AlCaHLTBitMon_ParallelJobs::p, dumpMFGeometry_cfg::prod, edm::ProductRegistry::productListUpdator(), cmsCodeRulesChecker::rules, edm::SecondaryFile, edm::SecondarySource, edm::ProductSelector::selected(), groupFilesInBlocks::temp, and treePointers_.

Referenced by RootFile().

◆ eventAux()

EventAuxiliary const& edm::RootFile::eventAux ( ) const
inline

◆ eventID()

EventID const& edm::RootFile::eventID ( ) const
inline

Definition at line 220 of file RootFile.h.

220 { return eventAux().id(); }

References eventAux(), and edm::EventAuxiliary::id().

Referenced by goToEvent().

◆ 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 221 of file RootFile.h.

221 { return eventTree_; }

References eventTree_.

◆ file()

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

Definition at line 214 of file RootFile.h.

214 { return file_; }

References file_.

Referenced by RootFile().

◆ fileFormatVersion()

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

◆ fillEventAuxiliary()

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

◆ fillEventHistory()

void edm::RootFile::fillEventHistory ( )
private

Definition at line 1254 of file RootFile.cc.

1254  {
1255  // We could consider doing delayed reading, but because we have to
1256  // store this History object in a different tree than the event
1257  // data tree, this is too hard to do in this first version.
1258 
1259  if (fileFormatVersion().eventHistoryBranch()) {
1260  // Lumi block number was not in EventID for the relevant releases.
1261  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1262  if (eventProcessHistoryIter_->eventID() != id) {
1263  EventProcessHistoryID target(id, ProcessHistoryID());
1265  assert(eventProcessHistoryIter_->eventID() == id);
1266  }
1269  } else if (fileFormatVersion().eventHistoryTree()) {
1270  // for backward compatibility.
1271  History* pHistory = history_.get();
1272  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1273  if (!eventHistoryBranch) {
1274  throw Exception(errors::EventCorruption) << "Failed to find history branch in event history tree.\n";
1275  }
1276  eventHistoryBranch->SetAddress(&pHistory);
1278  eventAux_.setProcessHistoryID(history_->processHistoryID());
1279  eventSelectionIDs_.swap(history_->eventSelectionIDs());
1280  branchListIndexes_.swap(history_->branchListIndexes());
1281  } else if (fileFormatVersion().noMetaDataTrees()) {
1282  // Current format
1284  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1285  assert(eventSelectionIDBranch != nullptr);
1286  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1288  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1289  assert(branchListIndexesBranch != nullptr);
1290  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1291  }
1292  if (provenanceAdaptor_) {
1293  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1294  for (auto& esID : eventSelectionIDs_) {
1295  esID = provenanceAdaptor_->convertID(esID);
1296  }
1297  }
1298  if (daqProvenanceHelper_) {
1300  }
1302  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1303  provenanceAdaptor_->branchListIndexes(branchListIndexes_);
1304  }
1305  if (branchIDListHelper_) {
1306  branchIDListHelper_->fixBranchListIndexes(branchListIndexes_);
1307  }
1308  }

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

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

◆ fillIndexIntoFile()

void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 926 of file RootFile.cc.

926  {
927  // This function is for backward compatibility.
928  // If reading a current format file, indexIntoFile_ is read from the input
929  // file and should always be there. Note that the algorithm below will work
930  // sometimes but often fail with the new format introduced in release 3_8_0.
931  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
932  // probably a separate function should be written to deal with the task.
933  // This is possible just not implemented yet.
934  assert(!fileFormatVersion().hasIndexIntoFile());
935 
936  typedef std::list<LumiItem> LumiList;
937  LumiList lumis; // (declare 1)
938 
939  typedef std::set<LuminosityBlockID> RunLumiSet;
940  RunLumiSet runLumiSet; // (declare 2)
941 
942  typedef std::list<RunItem> RunList;
943  RunList runs; // (declare 5)
944 
945  typedef std::set<RunNumber_t> RunSet;
946  RunSet runSet; // (declare 4)
947 
948  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
949  RunItemSet runItemSet; // (declare 3)
950 
951  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
952  PHIDMap phidMap;
953 
954  RunNumber_t prevRun = 0;
955  LuminosityBlockNumber_t prevLumi = 0;
956  ProcessHistoryID prevPhid;
957  bool iFirst = true;
958 
959  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
961 
962  // First, loop through the event tree.
963  while (eventTree_.next()) {
964  bool newRun = false;
965  bool newLumi = false;
968 
969  // Save the event numbers as we loop through the event auxiliary to avoid
970  // having to read through the event auxiliary again later. These event numbers
971  // are not actually used in this function, but could be needed elsewhere.
973 
974  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(eventAux().processHistoryID());
975 
976  if (iFirst || prevPhid != reducedPHID || prevRun != eventAux().run()) {
977  iFirst = false;
978  newRun = newLumi = true;
979  } else if (prevLumi != eventAux().luminosityBlock()) {
980  newLumi = true;
981  }
982  prevPhid = reducedPHID;
983  prevRun = eventAux().run();
984  prevLumi = eventAux().luminosityBlock();
985  if (newLumi) {
986  lumis.emplace_back(
987  reducedPHID, eventAux().run(), eventAux().luminosityBlock(), eventTree_.entryNumber()); // (insert 1)
988  runLumiSet.insert(LuminosityBlockID(eventAux().run(), eventAux().luminosityBlock())); // (insert 2)
989  } else {
990  LumiItem& currentLumi = lumis.back();
991  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
992  ++currentLumi.lastEventEntry_;
993  }
994  if (newRun) {
995  // Insert run in list if it is not already there.
996  RunItem item(reducedPHID, eventAux().run());
997  if (runItemSet.insert(item).second) { // (check 3, insert 3)
998  runs.push_back(std::move(item)); // (insert 5)
999  runSet.insert(eventAux().run()); // (insert 4)
1000  phidMap.insert(std::make_pair(eventAux().run(), reducedPHID));
1001  }
1002  }
1003  }
1004  // now clean up.
1006  eventAux_ = EventAuxiliary();
1008 
1009  // Loop over run entries and fill information.
1010 
1011  typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
1012  RunMap runMap; // (declare 11)
1013 
1014  typedef std::vector<RunItem> RunVector;
1015  RunVector emptyRuns; // (declare 12)
1016 
1017  if (runTree_.isValid()) {
1018  while (runTree_.next()) {
1019  // Note: adjacent duplicates will be skipped without an explicit check.
1020 
1021  std::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
1022  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(runAux->processHistoryID());
1023 
1024  if (runSet.insert(runAux->run()).second) { // (check 4, insert 4)
1025  // This run was not associated with any events.
1026  emptyRuns.emplace_back(reducedPHID, runAux->run()); // (insert 12)
1027  }
1028  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
1029  phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1030  }
1031  // now clean up.
1033  }
1034 
1035  // Insert the ordered empty runs into the run list.
1036  RunItemSortByRun runItemSortByRun;
1037  stable_sort_all(emptyRuns, runItemSortByRun);
1038 
1039  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1040  for (auto const& emptyRun : emptyRuns) {
1041  for (; itRuns != endRuns; ++itRuns) {
1042  if (runItemSortByRun(emptyRun, *itRuns)) {
1043  break;
1044  }
1045  }
1046  runs.insert(itRuns, emptyRun);
1047  }
1048 
1049  // Loop over luminosity block entries and fill information.
1050 
1051  typedef std::vector<LumiItem> LumiVector;
1052  LumiVector emptyLumis; // (declare 7)
1053 
1054  typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1055  RunLumiMap runLumiMap; // (declare 6)
1056 
1057  if (lumiTree_.isValid()) {
1058  while (lumiTree_.next()) {
1059  // Note: adjacent duplicates will be skipped without an explicit check.
1060  std::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
1061  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
1062  if (runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
1063  // This lumi was not associated with any events.
1064  // Use the process history ID from the corresponding run. In cases of practical
1065  // importance, this should be the correct process history ID, but it is possible
1066  // to construct files where this is not the correct process history ID ...
1067  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1068  assert(iPhidMap != phidMap.end());
1069  emptyLumis.emplace_back(
1070  iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), IndexIntoFile::invalidEntry); // (insert 7)
1071  }
1072  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
1073  }
1074  // now clean up.
1076  }
1077 
1078  // Insert the ordered empty lumis into the lumi list.
1079  LumiItemSortByRunLumi lumiItemSortByRunLumi;
1080  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
1081 
1082  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1083  for (auto const& emptyLumi : emptyLumis) {
1084  for (; itLumis != endLumis; ++itLumis) {
1085  if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1086  break;
1087  }
1088  }
1089  lumis.insert(itLumis, emptyLumi);
1090  }
1091 
1092  // Create a map of RunItems that gives the order of first appearance in the list.
1093  // Also fill in the vector of process history IDs
1094  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1095  RunCountMap runCountMap; // Declare (17)
1096  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
1097  assert(phids.empty());
1098  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
1099  assert(entries.empty());
1100  int rcount = 0;
1101  for (auto& run : runs) {
1102  RunCountMap::const_iterator countMapItem = runCountMap.find(run);
1103  if (countMapItem == runCountMap.end()) {
1104  countMapItem = runCountMap.insert(std::make_pair(run, rcount)).first; // Insert (17)
1105  assert(countMapItem != runCountMap.end());
1106  ++rcount;
1107  }
1108  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, run.phid_);
1109  if (phidItem == phids.end()) {
1110  phids.push_back(run.phid_);
1111  phidItem = phids.end() - 1;
1112  }
1113  entries.emplace_back(countMapItem->second, // use (17)
1115  runMap[run.run_], // use (11)
1116  phidItem - phids.begin(),
1117  run.run_,
1118  0U,
1121  }
1122 
1123  // Create a map of LumiItems that gives the order of first appearance in the list.
1124  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1125  LumiCountMap lumiCountMap; // Declare (19)
1126  int lcount = 0;
1127  for (auto& lumi : lumis) {
1128  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(lumi.phid_, lumi.run_));
1129  assert(runCountMapItem != runCountMap.end());
1130  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(lumi);
1131  if (countMapItem == lumiCountMap.end()) {
1132  countMapItem = lumiCountMap.insert(std::make_pair(lumi, lcount)).first; // Insert (17)
1133  assert(countMapItem != lumiCountMap.end());
1134  ++lcount;
1135  }
1136  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, lumi.phid_);
1137  assert(phidItem != phids.end());
1138  entries.emplace_back(runCountMapItem->second,
1139  countMapItem->second,
1140  runLumiMap[LuminosityBlockID(lumi.run_, lumi.lumi_)],
1141  phidItem - phids.begin(),
1142  lumi.run_,
1143  lumi.lumi_,
1144  lumi.firstEventEntry_,
1145  lumi.lastEventEntry_);
1146  }
1147  stable_sort_all(entries);
1148  }

References cms::cuda::assert(), edm::RootTree::entries(), edm::RootTree::entryNumber(), edmPickEvents::event, eventAux(), eventAux_, eventTree_, fileFormatVersion(), fillEventHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), fillThisEventAuxiliary(), edm::find_in_all(), indexIntoFile_, edm::IndexIntoFile::invalidEntry, edm::RootTree::isValid(), B2GTnPMonitor_cfi::item, lastEventEntryNumberRead_, edm::EventAuxiliary::luminosityBlock(), edmLumisInFiles::lumis, lumiTree_, eostools::move(), edm::RootTree::next(), processHistoryRegistry_, writedatasetfile::run, edm::EventAuxiliary::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 1310 of file RootFile.cc.

1310  {
1311  auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1312  if (fileFormatVersion().newAuxiliary()) {
1313  LuminosityBlockAuxiliary* pLumiAux = lumiAuxiliary.get();
1314  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1315  } else {
1316  LuminosityBlockAux lumiAux;
1317  LuminosityBlockAux* pLumiAux = &lumiAux;
1318  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1319  conversion(lumiAux, *lumiAuxiliary);
1320  }
1321  if (provenanceAdaptor_) {
1322  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1323  }
1324  if (daqProvenanceHelper_) {
1325  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1326  }
1327  if (lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1328  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1329  }
1330  return lumiAuxiliary;
1331  }

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

◆ fillRunAuxiliary()

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

Definition at line 1333 of file RootFile.cc.

1333  {
1334  auto runAuxiliary = std::make_shared<RunAuxiliary>();
1335  if (fileFormatVersion().newAuxiliary()) {
1336  RunAuxiliary* pRunAux = runAuxiliary.get();
1337  runTree_.fillAux<RunAuxiliary>(pRunAux);
1338  } else {
1339  RunAux runAux;
1340  RunAux* pRunAux = &runAux;
1341  runTree_.fillAux<RunAux>(pRunAux);
1342  conversion(runAux, *runAuxiliary);
1343  }
1344  if (provenanceAdaptor_) {
1345  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1346  }
1347  if (daqProvenanceHelper_) {
1348  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1349  }
1350  return runAuxiliary;
1351  }

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

◆ fillThisEventAuxiliary()

void edm::RootFile::fillThisEventAuxiliary ( )
private

Definition at line 1227 of file RootFile.cc.

1227  {
1229  // Already read.
1230  return;
1231  }
1232  if (fileFormatVersion().newAuxiliary()) {
1233  EventAuxiliary* pEvAux = &eventAux_;
1234  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1235  } else {
1236  // for backward compatibility.
1237  EventAux eventAux;
1238  EventAux* pEvAux = &eventAux;
1239  eventTree_.fillAux<EventAux>(pEvAux);
1241  }
1243  }

References edm::conversion(), edm::RootTree::entryNumber(), eventAux(), eventAux_, 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 814 of file RootFile.cc.

816  {
817  // First, account for consecutive skipped entries.
818  while (skipThisEntry()) {
823  } else {
825  }
826  }
827  // OK, we have an entry that is not skipped.
829  if (entryType == IndexIntoFile::kEnd) {
830  return IndexIntoFile::kEnd;
831  }
832  if (entryType == IndexIntoFile::kRun) {
834  runHelper_->checkForNewRun(run, indexIntoFileIter_.peekAheadAtLumi());
835  return IndexIntoFile::kRun;
836  } else if (processingMode_ == InputSource::Runs) {
838  return getNextItemType(run, lumi, event);
839  }
840  if (entryType == IndexIntoFile::kLumi) {
843  return IndexIntoFile::kLumi;
846  return getNextItemType(run, lumi, event);
847  }
848  if (isDuplicateEvent()) {
850  return getNextItemType(run, lumi, event);
851  }
855  event = eventAux_.event();
856  return IndexIntoFile::kEvent;
857  }

References edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun(), edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun(), edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::EventAuxiliary::event(), eventAux_, 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 1409 of file RootFile.cc.

1409  {
1411 
1412  if (duplicateChecker_) {
1413  duplicateChecker_->disable();
1414  }
1415 
1417  if (noEventSort_)
1419 
1420  IndexIntoFile::IndexIntoFileItr iter =
1422 
1423  if (iter == indexIntoFile_.end(sortOrder)) {
1424  return false;
1425  }
1426  indexIntoFileIter_ = iter;
1427  return true;
1428  }

References duplicateChecker_, edm::IndexIntoFile::end(), edm::EventID::event(), eventID(), 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 226 of file RootFile.h.

226 { return hasNewlyDroppedBranch_; }

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

◆ indexIntoFileIter()

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

Definition at line 749 of file RootFile.cc.

749 { return indexIntoFileIter_; }

References indexIntoFileIter_.

◆ indexIntoFileSharedPtr() [1/2]

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

Definition at line 260 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 257 of file RootFile.h.

257  {
259  }

References edm::get_underlying_safe(), and indexIntoFileSharedPtr_.

◆ initAssociationsFromSecondary()

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

Definition at line 755 of file RootFile.cc.

755  {
756  thinnedAssociationsHelper_->initAssociationsFromSecondary(associationsFromSecondary,
758  }

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 1694 of file RootFile.cc.

1696  {
1697  if (duplicateChecker_ && !duplicateChecker_->checkDisabled()) {
1698  if (eventTree_.next()) {
1700  duplicateChecker_->inputFileOpened(
1701  eventAux().isRealData(), indexIntoFile_, indexesIntoFiles, currentIndexIntoFile);
1702  }
1704  }
1705  }

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

Referenced by RootFile().

◆ isDuplicateEvent()

bool edm::RootFile::isDuplicateEvent ( )
private

◆ lumiTree()

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

Definition at line 222 of file RootFile.h.

222 { return lumiTree_; }

References lumiTree_.

◆ makeProductProvenanceRetriever()

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

Definition at line 1864 of file RootFile.cc.

1864  {
1865  if (eventProductProvenanceRetrievers_.size() <= iStreamID) {
1866  eventProductProvenanceRetrievers_.resize(iStreamID + 1);
1867  }
1868  if (!eventProductProvenanceRetrievers_[iStreamID]) {
1869  // propagate_const<T> has no reset() function
1870  eventProductProvenanceRetrievers_[iStreamID] = std::make_shared<ProductProvenanceRetriever>(
1872  }
1873  eventProductProvenanceRetrievers_[iStreamID]->reset();
1874  return eventProductProvenanceRetriever(iStreamID);
1875  }

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

Referenced by readCurrentEvent().

◆ makeProvenanceReaderMaker()

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

Definition at line 1848 of file RootFile.cc.

1848  {
1850  readParentageTree(inputType);
1851  return std::make_unique<MakeReducedProvenanceReader>(parentageIDLookup_);
1852  } else if (fileFormatVersion_.splitProductIDs()) {
1853  readParentageTree(inputType);
1854  return std::make_unique<MakeFullProvenanceReader>();
1855  } else if (fileFormatVersion_.perEventProductIDs()) {
1856  auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1857  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1858  return std::make_unique<MakeOldProvenanceReader>(std::move(entryDescriptionMap));
1859  } else {
1860  return std::make_unique<MakeDummyProvenanceReader>();
1861  }
1862  }

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 1707 of file RootFile.cc.

1710  {
1711  if (dropDescendants) {
1712  branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1713  } else {
1714  branchesToDrop.insert(branch.branchID());
1715  }
1716  }

References MicroEventContent_cff::branch, and branchChildren_.

Referenced by dropOnInput().

◆ modifiedIDs()

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

Definition at line 228 of file RootFile.h.

228 { 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 741 of file RootFile.cc.

741  {
742  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
743  if (it != newBranchToOldBranch_.end()) {
744  return it->second;
745  }
746  return newBranch;
747  }

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

◆ nextEventEntry()

bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 251 of file RootFile.h.

251 { return eventTree_.nextWithCache(); }

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

◆ operator=()

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

◆ productRegistry()

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

Definition at line 215 of file RootFile.h.

215 { return productRegistry_; }

References productRegistry_.

Referenced by RootFile().

◆ readCurrentEvent()

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

Definition at line 1466 of file RootFile.cc.

1466  {
1467  if (!eventTree_.current()) {
1468  return false;
1469  }
1471  if (!fileFormatVersion().lumiInEventID()) {
1472  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1473  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1475  }
1476  fillEventHistory();
1477  runHelper_->overrideRunNumber(eventAux_.id(), eventAux().isRealData());
1478 
1479  // We're not done ... so prepare the EventPrincipal
1480  eventTree_.insertEntryForIndex(principal.transitionIndex());
1481  auto history = processHistoryRegistry_->getMapped(eventAux().processHistoryID());
1482  principal.fillEventPrincipal(eventAux(),
1483  history,
1486  *(makeProductProvenanceRetriever(principal.streamID().value())),
1488 
1489  // report event read from file
1490  filePtr_->eventReadFromFile();
1491  return true;
1492  }

References branchListIndexes_, edm::RootTree::current(), eventAux(), eventAux_, eventSelectionIDs_, eventTree_, fileFormatVersion(), filePtr_, fillEventHistory(), edm::EventPrincipal::fillEventPrincipal(), fillThisEventAuxiliary(), edm::EventAuxiliary::id(), edm::RootTree::insertEntryForIndex(), edm::EventAuxiliary::isRealData(), makeProductProvenanceRetriever(), eostools::move(), edm::EventAuxiliary::oldLuminosityBlock(), processHistoryRegistry_, edm::RootTree::resetAndGetRootDelayedReader(), edm::EventAuxiliary::resetObsoleteInfo(), runHelper_, edm::EventPrincipal::streamID(), edm::EDProductGetter::transitionIndex(), and edm::StreamID::value().

Referenced by readEvent().

◆ readEntryDescriptionTree()

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

Definition at line 600 of file RootFile.cc.

600  {
601  // Called only for old format files.
602  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
603  std::unique_ptr<TTree> entryDescriptionTree(
604  dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
605  if (nullptr == entryDescriptionTree.get()) {
607  << "Could not find tree " << poolNames::entryDescriptionTreeName() << " in the input file.\n";
608  }
609 
610  EntryDescriptionID idBuffer;
611  EntryDescriptionID* pidBuffer = &idBuffer;
612  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
613 
614  EventEntryDescription entryDescriptionBuffer;
615  EventEntryDescription* pEntryDescriptionBuffer = &entryDescriptionBuffer;
616  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
617 
618  // Fill in the parentage registry.
619  ParentageRegistry& registry = *ParentageRegistry::instance();
620 
621  for (Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
622  roottree::getEntry(entryDescriptionTree.get(), i);
623  if (idBuffer != entryDescriptionBuffer.id()) {
624  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
625  }
626  entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.id(), entryDescriptionBuffer));
627  Parentage parents;
628  parents.setParents(entryDescriptionBuffer.parents());
629  if (daqProvenanceHelper_) {
630  ParentageID const oldID = parents.id();
631  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
632  ParentageID newID = parents.id();
633  if (newID != oldID) {
634  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
635  }
636  }
637  // For thread safety, don't update global registries when a secondary source opens a file.
638  if (inputType != InputType::SecondarySource) {
639  registry.insertMapped(parents);
640  }
641  }
642  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
643  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
644  }

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()

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

Definition at line 1442 of file RootFile.cc.

1442  {
1445  // read the event auxiliary if not alrady read.
1447 
1448  // read the event
1449  readCurrentEvent(principal);
1450 
1451  runHelper_->checkRunConsistency(eventAux().run(), indexIntoFileIter_.run());
1452  runHelper_->checkLumiConsistency(eventAux().luminosityBlock(), indexIntoFileIter_.lumi());
1453 
1454  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1455  // The IndexIntoFile should guarantee that it never fails.
1457  ? *daqProvenanceHelper_->oldProcessHistoryID()
1458  : eventAux().processHistoryID());
1459  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1461 
1463  }

References cms::cuda::assert(), daqProvenanceHelper_, edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), fileFormatVersion(), fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::EventAuxiliary::processHistoryID(), edm::IndexIntoFile::processHistoryID(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), processHistoryRegistry_, readCurrentEvent(), writedatasetfile::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, and edm::FileFormatVersion::useReducedProcessHistoryID().

◆ readEventHistoryTree()

void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1683 of file RootFile.cc.

1683  {
1684  // Read in the event history tree, if we have one...
1685  if (fileFormatVersion().eventHistoryTree()) {
1686  history_ = std::make_unique<History>(); // propagate_const<T> has no reset() function
1687  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1688  if (!eventHistoryTree_) {
1689  throw Exception(errors::EventCorruption) << "Failed to find the event history tree.\n";
1690  }
1691  }
1692  }

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 1625 of file RootFile.cc.

1625  {
1628  // Begin code for backward compatibility before the existence of lumi trees.
1629  if (!lumiTree_.isValid()) {
1631  return;
1632  }
1633  // End code for backward compatibility before the existence of lumi trees.
1635  // NOTE: we use 0 for the index since do not do delayed reads for LuminosityBlockPrincipals
1637  auto history = processHistoryRegistry_->getMapped(lumiPrincipal.aux().processHistoryID());
1638  lumiPrincipal.fillLuminosityBlockPrincipal(history, lumiTree_.resetAndGetRootDelayedReader());
1639  // Read in all the products now.
1640  lumiPrincipal.readAllFromSourceAndMergeImmediately();
1642  }

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 1587 of file RootFile.cc.

1587  {
1590  // Begin code for backward compatibility before the existence of lumi trees.
1591  if (!lumiTree_.isValid()) {
1593  assert(eventEntry != IndexIntoFile::invalidEntry);
1594  assert(eventTree_.current(eventEntry));
1595  fillEventAuxiliary(eventEntry);
1596 
1597  LuminosityBlockID lumi = LuminosityBlockID(indexIntoFileIter_.run(), indexIntoFileIter_.lumi());
1598  runHelper_->overrideRunNumber(lumi);
1599  return std::make_shared<LuminosityBlockAuxiliary>(
1600  lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp());
1601  }
1602  // End code for backward compatibility before the existence of lumi trees.
1604  std::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1605  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1606  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1607  runHelper_->overrideRunNumber(lumiAuxiliary->id());
1608  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1609  if (lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1611  if (eventEntry != IndexIntoFile::invalidEntry) {
1612  assert(eventTree_.current(eventEntry));
1613  fillEventAuxiliary(eventEntry);
1614 
1615  lumiAuxiliary->setBeginTime(eventAux().time());
1616  }
1617  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1618  }
1619  if (!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1620  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1621  }
1622  return lumiAuxiliary;
1623  }

References cms::cuda::assert(), edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), 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_, edm::RootTree::setEntryNumber(), edm::EventAuxiliary::time(), and ntuplemaker::time.

◆ readParentageTree()

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

Definition at line 646 of file RootFile.cc.

646  {
647  // New format file
648  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
649  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
650  if (nullptr == parentageTree.get()) {
652  << "Could not find tree " << poolNames::parentageTreeName() << " in the input file.\n";
653  }
654 
655  Parentage parents;
656  Parentage* pParentageBuffer = &parents;
657  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
658 
659  ParentageRegistry& registry = *ParentageRegistry::instance();
660 
661  parentageIDLookup_.reserve(parentageTree->GetEntries());
662  for (Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
663  roottree::getEntry(parentageTree.get(), i);
664  if (daqProvenanceHelper_) {
665  ParentageID const oldID = parents.id();
666  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
667  ParentageID newID = parents.id();
668  if (newID != oldID) {
669  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
670  }
671  }
672  // For thread safety, don't update global registries when a secondary source opens a file.
673  if (inputType != InputType::SecondarySource) {
674  registry.insertMapped(parents);
675  }
676  parentageIDLookup_.push_back(parents.id());
677  }
678  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
679  }

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().

◆ readRun_()

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

Definition at line 1560 of file RootFile.cc.

1560  {
1561  MergeableRunProductMetadata* mergeableRunProductMetadata = nullptr;
1562  if (inputType_ == InputType::Primary) {
1563  mergeableRunProductMetadata = runPrincipal.mergeableRunProductMetadata();
1564  RootTree::EntryNumber const& entryNumber = runTree_.entryNumber();
1565  assert(entryNumber >= 0);
1566  mergeableRunProductMetadata->readRun(
1567  entryNumber, *storedMergeableRunProductMetadata_, IndexIntoFileItrHolder(indexIntoFileIter_));
1568  }
1569 
1570  if (!runHelper_->fakeNewRun()) {
1574  }
1575  // Begin code for backward compatibility before the existence of run trees.
1576  if (!runTree_.isValid()) {
1577  return;
1578  }
1579  // End code for backward compatibility before the existence of run trees.
1580  // NOTE: we use 0 for the index since do not do delayed reads for RunPrincipals
1582  runPrincipal.fillRunPrincipal(*processHistoryRegistry_, runTree_.resetAndGetRootDelayedReader());
1583  // Read in all the products now.
1584  runPrincipal.readAllFromSourceAndMergeImmediately(mergeableRunProductMetadata);
1585  }

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 1496 of file RootFile.cc.

1496  {
1497  if (runHelper_->fakeNewRun()) {
1498  auto runAuxiliary = std::make_shared<RunAuxiliary>(*savedRunAuxiliary());
1499  runHelper_->overrideRunNumber(runAuxiliary->id());
1500  return runAuxiliary;
1501  }
1504 
1505  // Begin code for backward compatibility before the existence of run trees.
1506  if (!runTree_.isValid()) {
1507  // prior to the support of run trees.
1508  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1510  assert(eventEntry != IndexIntoFile::invalidEntry);
1511  assert(eventTree_.current(eventEntry));
1512  fillEventAuxiliary(eventEntry);
1513 
1514  RunID run = RunID(indexIntoFileIter_.run());
1515  runHelper_->overrideRunNumber(run);
1516  savedRunAuxiliary_ = std::make_shared<RunAuxiliary>(run.run(), eventAux().time(), Timestamp::invalidTimestamp());
1517  return savedRunAuxiliary();
1518  }
1519  // End code for backward compatibility before the existence of run trees.
1521  std::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1522  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1523  runHelper_->overrideRunNumber(runAuxiliary->id());
1524  filePtr_->reportInputRunNumber(runAuxiliary->run());
1525  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1526  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1527  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1528  }
1529 
1530  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1531  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1532  // we attempt to read the first event in the run to get appropriate info.
1533  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1536  // If we have a valid event, use its information.
1537  if (eventEntry != IndexIntoFile::invalidEntry) {
1538  assert(eventTree_.current(eventEntry));
1539  fillEventAuxiliary(eventEntry);
1540 
1541  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1542  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1543  runAuxiliary->setBeginTime(eventAux().time());
1544  }
1545 
1546  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1547  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1548  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1549  // and event ProcessHistory's always be the same if no file merging occurs).
1550  if (!fileFormatVersion().processHistorySameWithinRun()) {
1551  fillEventHistory();
1552  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1553  }
1554  }
1555  }
1556  savedRunAuxiliary_ = runAuxiliary;
1557  return runAuxiliary;
1558  }

References cms::cuda::assert(), edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), 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_, edm::RootTree::setEntryNumber(), edm::EventAuxiliary::time(), and ntuplemaker::time.

◆ reportOpened()

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

Definition at line 1205 of file RootFile.cc.

1205  {
1206  // Report file opened.
1207  std::string const label = "source";
1208  std::string moduleName = "PoolSource";
1209  filePtr_->inputFileOpened(logicalFile_, inputType, moduleName, label, fid_.fid(), eventTree_.branchNames());
1210  }

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

◆ rewind()

void edm::RootFile::rewind ( )
inline

◆ runTree()

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

Definition at line 223 of file RootFile.h.

223 { return runTree_; }

References runTree_.

Referenced by validateFile().

◆ savedRunAuxiliary() [1/2]

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

Definition at line 301 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 300 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 230 of file RootFile.h.

230  {
232  }

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 
)

◆ setEntryAtRun()

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

◆ setIfFastClonable()

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

Definition at line 681 of file RootFile.cc.

681  {
682  if (fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
683  //we must avoid copying the old branch which stored the per product per event provenance
685  return;
686  }
687  if (!fileFormatVersion().splitProductIDs()) {
689  return;
690  }
693  return;
694  }
695  // Find entry for first event in file
696  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
697  while (it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
698  ++it;
699  }
700  if (it == indexIntoFileEnd_) {
702  return;
703  }
704 
705  // From here on, record all reasons we can't fast clone.
706  IndexIntoFile::SortOrder sortOrder =
710  }
711  if (skipAnyEvents_) {
713  }
714  if (remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
716  }
717  if (remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
719  }
720  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
722  }
723  }

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)

◆ 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 1842 of file RootFile.cc.

1844  {
1845  eventTree_.setSignals(preEventReadSource, postEventReadSource);
1846  }

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

◆ setToLastEntry()

void edm::RootFile::setToLastEntry ( )
inline

Definition at line 246 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 1353 of file RootFile.cc.

1353  {
1354  while (offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1355  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1356  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1359 
1361  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1362 
1363  // At the end of the file and there were no more events to skip
1364  if (skippedEventEntry == IndexIntoFile::invalidEntry)
1365  break;
1366 
1367  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1368  fillEventAuxiliary(skippedEventEntry);
1369  if (eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1370  continue;
1371  }
1372  }
1373  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
1374  fillEventAuxiliary(skippedEventEntry);
1375  if (duplicateChecker_->isDuplicateAndCheckActive(
1376  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event(), file_)) {
1377  continue;
1378  }
1379  }
1380  --offset;
1381  }
1382 
1383  while (offset < 0) {
1384  if (duplicateChecker_) {
1385  duplicateChecker_->disable();
1386  }
1387 
1388  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1392 
1393  indexIntoFileIter_.skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
1394 
1395  if (eventEntry == IndexIntoFile::invalidEntry)
1396  break;
1397 
1398  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1399  fillEventAuxiliary(eventEntry);
1400  if (eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1401  continue;
1402  }
1403  }
1404  ++offset;
1405  }
1407  }

References duplicateChecker_, edm::EventID::event(), eventAux_, eventSkipperByID_, file_, fillEventAuxiliary(), edm::EventAuxiliary::id(), 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 760 of file RootFile.cc.

760  {
762  return false;
763  }
764 
765  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
766  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
768  return true;
769  }
770 
771  // The Lumi is not skipped. If this is an event, see if the event is skipped.
775  return true;
776  }
777  }
778 
779  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
781  // There are no lumis in this run, not even ones we will skip
783  return true;
784  }
785  // If we get here there are lumis in the run, check to see if we are skipping all of them
786  do {
788  return false;
789  }
790  } while (indexIntoFileIter_.skipLumiInRun());
791  return true;
792  }
793  }
794  return false;
795  }

References edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::EventID::event(), eventAux_, eventSkipperByID_, fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), edm::EventAuxiliary::id(), 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().

◆ treePointers()

RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 272 of file RootFile.h.

272 { return treePointers_; }

References treePointers_.

◆ validateFile()

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

Definition at line 1150 of file RootFile.cc.

1150  {
1151  if (!fid_.isValid()) {
1152  fid_ = FileID(createGlobalIdentifier());
1153  }
1154  if (!eventTree_.isValid()) {
1155  throw Exception(errors::EventCorruption) << "'Events' tree is corrupted or not present\n"
1156  << "in the input file.\n";
1157  }
1158  if (enforceGUIDInFileName_) {
1159  auto guidFromName = stemFromPath(file_);
1160  if (guidFromName != fid_.fid()) {
1162  << "GUID " << guidFromName << " extracted from file name " << file_
1163  << " is inconsistent with the GUID read from the file " << fid_.fid();
1164  }
1165  }
1166 
1167  if (fileFormatVersion().hasIndexIntoFile()) {
1168  if (runTree().entries() > 0) {
1170  }
1172  if (daqProvenanceHelper_) {
1173  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1174  for (auto& phid : phidVec) {
1175  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1176  }
1177  }
1179  }
1180  } else {
1183  }
1184 
1188  std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(eventTree_)));
1189  // We fill the event numbers explicitly if we need to find events in closed files,
1190  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1191  bool needEventNumbers = false;
1192  bool needIndexesForDuplicateChecker =
1193  duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1194  if (inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1195  needEventNumbers = true;
1196  }
1197  bool needEventEntries = false;
1198  if (inputType != InputType::Primary || !noEventSort_) {
1199  // We need event entries for sorting or for secondary files or sources.
1200  needEventEntries = true;
1201  }
1202  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1203  }

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 865 of file RootFile.cc.

865  {
866  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
867  int phIndex;
870  IndexIntoFile::EntryNumber_t eventEntry;
871  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
872  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
873  return eventEntry == IndexIntoFile::invalidEntry;
874  }

References indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, BXlumiParameters_cfi::lumi, and writedatasetfile::run.

◆ wasLastEventJustRead()

bool edm::RootFile::wasLastEventJustRead ( ) const

Definition at line 859 of file RootFile.cc.

859  {
860  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
861  itr.advanceToEvent();
862  return itr.getEntryType() == IndexIntoFile::kEnd;
863  }

References indexIntoFileIter_, and edm::IndexIntoFile::kEnd.

◆ whyNotFastClonable()

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

Definition at line 225 of file RootFile.h.

225 { 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 355 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 345 of file RootFile.h.

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

◆ branchIDLists_

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

Definition at line 344 of file RootFile.h.

Referenced by RootFile().

◆ branchListIndexes_

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 353 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

◆ branchListIndexesUnchanged_

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 336 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

◆ 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 362 of file RootFile.h.

Referenced by dropOnInput().

◆ enforceGUIDInFileName_

bool edm::RootFile::enforceGUIDInFileName_
private

Definition at line 333 of file RootFile.h.

Referenced by validateFile().

◆ eventAux_

EventAuxiliary edm::RootFile::eventAux_
private

◆ eventHistoryTree_

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

Definition at line 351 of file RootFile.h.

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

◆ eventProcessHistoryIDs_

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

Definition at line 328 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

◆ eventProcessHistoryIter_

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

Definition at line 329 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 359 of file RootFile.h.

Referenced by eventProductProvenanceRetriever(), and makeProductProvenanceRetriever().

◆ eventSelectionIDs_

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 352 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

◆ eventSkipperByID_

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

Definition at line 318 of file RootFile.h.

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

◆ eventTree_

RootTree edm::RootFile::eventTree_
private

◆ fid_

FileID edm::RootFile::fid_
private

Definition at line 320 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 319 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 346 of file RootFile.h.

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

◆ hasNewlyDroppedBranch_

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

Definition at line 335 of file RootFile.h.

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

◆ history_

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

Definition at line 354 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 324 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 321 of file RootFile.h.

Referenced by indexIntoFileSharedPtr().

◆ inputType_

InputType edm::RootFile::inputType_
private

Definition at line 363 of file RootFile.h.

Referenced by readRun_().

◆ lastEventEntryNumberRead_

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

Definition at line 342 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

◆ logicalFile_

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

Definition at line 314 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 350 of file RootFile.h.

Referenced by newBranchToOldBranch(), and RootFile().

◆ noEventSort_

bool edm::RootFile::noEventSort_
private

Definition at line 332 of file RootFile.h.

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

◆ orderedProcessHistoryIDs_

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

Definition at line 323 of file RootFile.h.

Referenced by validateFile().

◆ parentageIDLookup_

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

Definition at line 360 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

◆ processConfiguration_

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 315 of file RootFile.h.

◆ processHistoryRegistry_

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

◆ processingMode_

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

Definition at line 348 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

◆ productRegistry_

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

Definition at line 343 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

◆ provenanceAdaptor_

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

Definition at line 357 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 358 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 330 of file RootFile.h.

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

◆ skipAnyEvents_

bool edm::RootFile::skipAnyEvents_
private

Definition at line 331 of file RootFile.h.

Referenced by setIfFastClonable().

◆ storedMergeableRunProductMetadata_

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

Definition at line 327 of file RootFile.h.

Referenced by readRun_(), and RootFile().

◆ thinnedAssociationsHelper_

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

Definition at line 347 of file RootFile.h.

Referenced by initAssociationsFromSecondary().

◆ treePointers_

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 341 of file RootFile.h.

Referenced by close(), dropOnInput(), RootFile(), and treePointers().

◆ whyNotFastClonable_

int edm::RootFile::whyNotFastClonable_
private

Definition at line 334 of file RootFile.h.

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

edm::poolNames::idToParameterSetBlobsBranchName
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:206
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:182
edm::FileFormatVersion::hasThinnedAssociations
bool hasThinnedAssociations() const
Definition: FileFormatVersion.cc:45
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::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:318
edm::TypeWithDict::byName
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
edm::poolNames::branchIDListBranchName
std::string const & branchIDListBranchName()
Definition: BranchType.cc:176
edm::RootTree::trainCache
void trainCache(char const *branchNames)
Definition: RootTree.cc:461
edm::FileID::isValid
bool isValid() const
Definition: FileID.h:18
benchmark-oval_cfg.noEventSort
noEventSort
Definition: benchmark-oval_cfg.py:19
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:202
edm::RootFile::eventProductProvenanceRetrievers_
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:359
edm::FileFormatVersion::useReducedProcessHistoryID
bool useReducedProcessHistoryID() const
Definition: FileFormatVersion.cc:43
edm::RootFile::eventProcessHistoryIter_
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:329
edm::RootFile::makeProductProvenanceRetriever
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:1864
edm::RootTree::EntryNumber
roottree::EntryNumber EntryNumber
Definition: RootTree.h:106
edm::poolNames::fileFormatVersionBranchName
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:182
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:321
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:516
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:50
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:215
edm::RootFile::lumiTree_
RootTree lumiTree_
Definition: RootFile.h:339
edm::RootFile::processHistoryRegistry_
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:316
edm::RootFile::indexIntoFileEnd_
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:325
edm::RootFile::daqProvenanceHelper_
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:361
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:349
LumiList
Definition: LumiList.py:1
edm::RootFile::readParentageTree
void readParentageTree(InputType inputType)
Definition: RootFile.cc:646
edm::setIsMergeable
void setIsMergeable(BranchDescription &)
Definition: setIsMergeable.cc:15
HLT_FULL_cff.finder
finder
Definition: HLT_FULL_cff.py:51924
RunList
Definition: RunList.h:16
edm::RootFile::eventHistoryTree_
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:351
edm::FileID::fid
std::string const & fid() const
Definition: FileID.h:19
edm::RootFile::branchListIndexesUnchanged
bool branchListIndexesUnchanged() const
Definition: RootFile.h:227
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:180
edm::RootFile::runTree
RootTree const & runTree() const
Definition: RootFile.h:223
mps_splice.entry
entry
Definition: mps_splice.py:68
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::RootFile::indexIntoFileIter_
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:326
edm::errors::EventCorruption
Definition: EDMException.h:43
edm::ParentageRegistry::instance
static ParentageRegistry * instance()
Definition: ParentageRegistry.cc:4
edm::IndexIntoFile::invalidEntry
static constexpr EntryNumber_t invalidEntry
Definition: IndexIntoFile.h:236
hgcal::association
std::tuple< layerClusterToCaloParticle, caloParticleToLayerCluster > association
Definition: LayerClusterAssociatorByEnergyScoreImpl.h:44
edm::RootFile::readCurrentEvent
bool readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1466
l1tstage2_dqm_sourceclient-live_cfg.rawData
rawData
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:162
edm::IndexIntoFile::processHistoryID
ProcessHistoryID const & processHistoryID(int i) const
Definition: IndexIntoFile.cc:55
edm::poolNames::parameterSetsTreeName
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:204
edm::EventAuxiliary::oldLuminosityBlock
LuminosityBlockNumber_t oldLuminosityBlock() const
Definition: EventAuxiliary.h:70
edm::FileBlock::NotProcessingEvents
Definition: FileBlock.h:29
writedatasetfile.runs
runs
Definition: writedatasetfile.py:27
edm::RootFile::eventAux_
EventAuxiliary eventAux_
Definition: RootFile.h:337
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:36
edm::RootFile::branchIDListHelper_
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:345
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
edm::poolNames::indexIntoFileBranchName
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:191
edm::InputType::SecondaryFile
edm::RootFile::eventTree_
RootTree eventTree_
Definition: RootFile.h:338
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:600
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::eventID
EventID const & eventID() const
Definition: RootFile.h:220
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::RootFile::isDuplicateEvent
bool isDuplicateEvent()
Definition: RootFile.cc:797
edm::RootFile::enforceGUIDInFileName_
bool enforceGUIDInFileName_
Definition: RootFile.h:333
edm::FileBlock::EventsToBeSorted
Definition: FileBlock.h:35
edm::RootFile::skipThisEntry
bool skipThisEntry()
Definition: RootFile.cc:760
edm::IndexIntoFile::findPosition
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
Definition: IndexIntoFile.cc:489
edm::EventID::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
edm::RootFile::fileFormatVersion
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:224
edm::FileFormatVersion::perEventProductIDs
bool perEventProductIDs() const
Definition: FileFormatVersion.cc:19
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:328
edm::poolNames::branchListIndexesBranchName
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:202
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:109
runTheMatrix.nStreams
nStreams
Definition: runTheMatrix.py:362
edm::RootFile::setEntryAtLumi
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1652
edm::RootFile::dropOnInput
void dropOnInput(ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
Definition: RootFile.cc:1718
edm::RootFile::file
std::string const & file() const
Definition: RootFile.h:214
edm::RootFile::setEntryAtRun
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1660
edm::RootTree::resetTraining
void resetTraining()
Definition: RootTree.h:194
edm::poolNames::mergeableRunProductMetadataBranchName
std::string const & mergeableRunProductMetadataBranchName()
Definition: BranchType.cc:194
edm::EventAuxiliary::run
RunNumber_t run() const
Definition: EventAuxiliary.h:73
edm::RootFile::inputType_
InputType inputType_
Definition: RootFile.h:363
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, 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:141
edm::InProcess
Definition: BranchType.h:11
edm::RootFile::fileThinnedAssociationsHelper_
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:346
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:149
edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun
void advanceToNextRun()
Definition: IndexIntoFile.h:774
edm::RootTree::skipEntries
bool skipEntries(unsigned int &offset)
Definition: RootTree.cc:381
edm::RootFile::eventSelectionIDs_
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:352
edm::IndexIntoFile::setEventFinder
void setEventFinder(std::shared_ptr< EventFinder > ptr)
Definition: IndexIntoFile.h:952
edm::FileFormatVersion::runsAndLumis
bool runsAndLumis() const
Definition: FileFormatVersion.cc:13
edm::IndexIntoFile::invalidIndex
static constexpr int invalidIndex
Definition: IndexIntoFile.h:232
edm::EventAuxiliary::resetObsoleteInfo
void resetObsoleteInfo()
Definition: EventAuxiliary.h:71
edm::RootTree::metaTree
TTree const * metaTree() const
Definition: RootTree.h:184
edm::RootFile::provenanceAdaptor_
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:357
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:228
edm::poolNames::processHistoryBranchName
std::string const & processHistoryBranchName()
Definition: BranchType.cc:170
edm::RootFile::fillRunAuxiliary
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1333
edm::RootFile::branchChildren_
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:355
edmLumisInFiles.lumis
lumis
Definition: edmLumisInFiles.py:31
edm::RootFile::fillEventHistory
void fillEventHistory()
Definition: RootFile.cc:1254
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::RootTree::fillAux
void fillAux(T *&pAux)
Definition: RootTree.h:144
edm::RootFile::getNextItemType
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:814
edm::RootFile::branchListIndexes_
BranchListIndexes branchListIndexes_
Definition: RootFile.h:353
edm::EventAuxiliary::id
EventID const & id() const
Definition: EventAuxiliary.h:63
edm::RootTree::fillBranchEntry
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:160
edm::RootFile::savedRunAuxiliary
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
Definition: RootFile.h:300
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:161
edm::RootFile::whyNotFastClonable_
int whyNotFastClonable_
Definition: RootFile.h:334
edm::RootFile::thinnedAssociationsHelper_
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: RootFile.h:347
edm::InputSource::RunsAndLumis
Definition: InputSource.h:80
edm::RootFile::hasNewlyDroppedBranch
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:226
edm::poolNames::entryDescriptionIDBranchName
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:142
edm::RootTree::resetAndGetRootDelayedReader
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:123
edm::RootFile::fillIndexIntoFile
void fillIndexIntoFile()
Definition: RootFile.cc:926
edm::IndexIntoFile::invalidLumi
static constexpr LuminosityBlockNumber_t invalidLumi
Definition: IndexIntoFile.h:234
edm::poolNames::parentageTreeName
std::string const & parentageTreeName()
Definition: BranchType.cc:147
edm::FileFormatVersion::newAuxiliary
bool newAuxiliary() const
Definition: FileFormatVersion.cc:11
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
edm::BranchIDLists
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::RootFile::treePointers_
RootTreePtrArray treePointers_
Definition: RootFile.h:341
edm::RootFile::indexIntoFile_
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:322
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:741
edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun
bool skipLumiInRun()
Definition: IndexIntoFile.h:768
edm::RootFile::fid_
FileID fid_
Definition: RootFile.h:320
edm::RootFile::orderedProcessHistoryIDs_
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:323
edm::poolNames::eventSelectionsBranchName
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:200
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:330
edm::RootFile::storedMergeableRunProductMetadata_
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
Definition: RootFile.h:327
edm::RootFile::hasNewlyDroppedBranch_
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:335
edm::RootFile::makeProvenanceReaderMaker
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
Definition: RootFile.cc:1848
edm::IndexIntoFile::firstAppearanceOrder
Definition: IndexIntoFile.h:266
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:155
edm::RootFile::setEntryAtEvent
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: RootFile.cc:1644
edm::EventAuxiliary::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventAuxiliary.h:67
edm::RootFile::setIfFastClonable
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:681
edm::RootFile::logicalFile_
const std::string logicalFile_
Definition: RootFile.h:314
edm::errors::FileNameInconsistentWithGUID
Definition: EDMException.h:68
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:1694
edm::RootFile::processingMode_
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:348
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:1150
edm::FileBlock::FileTooOld
Definition: FileBlock.h:33
edm::RootFile::markBranchToBeDropped
void markBranchToBeDropped(bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
Definition: RootFile.cc:1707
edm::RootFile::filePtr_
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:317
edmPickEvents.event
event
Definition: edmPickEvents.py:273
edm::IndexIntoFile::IndexIntoFileItr::firstEventEntryThisRun
EntryNumber_t firstEventEntryThisRun()
Definition: IndexIntoFile.h:719
position
static int position[264][3]
Definition: ReadPGInfo.cc:289
edm::poolNames::entryDescriptionTreeName
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:140
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:37
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
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:303
edm::poolNames::processHistoryMapBranchName
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:167
edm::FileBlock::NoEventsInFile
Definition: FileBlock.h:34
edm::RootFile::skipAnyEvents_
bool skipAnyEvents_
Definition: RootFile.h:331
edm::RootFile::fillEventAuxiliary
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1245
edm::roottree::defaultLearningEntries
unsigned const int defaultLearningEntries
Definition: RootTree.h:49
edm::RootFile::edProductClass_
edm::propagate_const< TClass * > edProductClass_
Definition: RootFile.h:362
edm::RootFile::fileFormatVersion_
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:319
edm::EventAuxiliary::time
Timestamp const & time() const
Definition: EventAuxiliary.h:66
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
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:1683
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
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
edm::RootTree::branchNames
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:140
edm::RootTree::insertEntryForIndex
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:105
edm::IndexIntoFile::findEventPosition
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: IndexIntoFile.cc:676
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:80
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:48
edm::RootFile::history_
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:354
edm::Timestamp::invalidTimestamp
static Timestamp invalidTimestamp()
Definition: Timestamp.h:82
edm::RootFile::noEventSort_
bool noEventSort_
Definition: RootFile.h:332
edm::RootTree::current
bool current() const
Definition: RootTree.h:130
edm::RootTree::isValid
bool isValid() const
Definition: RootTree.cc:110
edm::RootFile::provenanceReaderMaker_
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
Definition: RootFile.h:358
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::RootFile::eventAux
EventAuxiliary const & eventAux() const
Definition: RootFile.h:216
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::RootFile::parentageIDLookup_
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:360
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
edm::RootTree::entryNumber
EntryNumber const & entryNumber() const
Definition: RootTree.h:135
edm::RootTree::rewind
void rewind()
Definition: RootTree.h:132
edm::RootFile::lastEventEntryNumberRead_
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:342
edm::RootTree::entries
EntryNumber const & entries() const
Definition: RootTree.h:137
edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun
void advanceToNextLumiOrRun()
Definition: IndexIntoFile.h:775
edm::poolNames::metaDataTreeName
std::string const & metaDataTreeName()
Definition: BranchType.cc:152
edm::ProcessHistoryRegistry::collection_type
ProcessHistoryMap collection_type
Definition: ProcessHistoryRegistry.h:21
edm::EventAuxiliary::processHistoryID
ProcessHistoryID const & processHistoryID() const
Definition: EventAuxiliary.h:61
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
edm::InputType::Primary
edm::ParentageID
Hash< ParentageType > ParentageID
Definition: ParentageID.h:8
Exception
Definition: hltDiff.cc:246
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:343
edm::RootFile::whyNotFastClonable
int whyNotFastClonable() const
Definition: RootFile.h:225
edm::IndexIntoFile::reduceProcessHistoryIDs
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
Definition: IndexIntoFile.cc:308
edm::InputType::SecondarySource
edm::poolNames::thinnedAssociationsHelperBranchName
std::string const & thinnedAssociationsHelperBranchName()
Definition: BranchType.cc:179
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:158
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
edm::RootFile::newBranchToOldBranch_
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:350
edm::poolNames::eventHistoryTreeName
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:212
drop
const int drop
Definition: GenParticlePruner.cc:48
DTskim_cfg.processingMode
processingMode
Definition: DTskim_cfg.py:82
edm::IndexIntoFile::kEnd
Definition: IndexIntoFile.h:238
edm::RootFile::indexIntoFileBegin_
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:324
edm::roottree::getEntry
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:496
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::EventAuxiliary::isRealData
bool isRealData() const
Definition: EventAuxiliary.h:74
edm::IndexIntoFile::setRunOrLumiEntries
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
Definition: IndexIntoFile.h:1007
edm::FileBlock::MaxEventsTooSmall
Definition: FileBlock.h:39
edm::poolNames::fileIdentifierBranchName
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:185
edm::moduleName
std::string moduleName(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
edm::RootFile::branchListIndexesUnchanged_
bool branchListIndexesUnchanged_
Definition: RootFile.h:336
parents
TPRegexp parents
Definition: eve_filter.cc:21
ntuplemaker.time
time
Definition: ntuplemaker.py:310
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:489
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:144
CommonMethods.cp
def cp(fromDir, toDir, listOfFiles, overwrite=False, smallList=False)
Definition: CommonMethods.py:192
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:340
edm::errors::FileReadError
Definition: EDMException.h:50
edm::RootTree::nextWithCache
bool nextWithCache()
Definition: RootTree.cc:194
edm::EventAuxiliary::setProcessHistoryID
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: EventAuxiliary.h:62
edm::poolNames::processConfigurationBranchName
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:173
edm::RootFile::eventProductProvenanceRetriever
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
Definition: RootFile.h:306
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
edm::FileBlock::MaxLumisTooSmall
Definition: FileBlock.h:40
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::InputSource::RunsLumisAndEvents
Definition: InputSource.h:80
edm::RootFile::branchIDLists_
std::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:344
edm::IndexIntoFile::setProcessHistoryIDs
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
Definition: IndexIntoFile.h:1012
edm::RootFile::branchIDListHelper
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:253
edm::poolNames::moduleDescriptionMapBranchName
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:164
edm::RootTree::next
bool next()
Definition: RootTree.h:127
edm::RootFile::duplicateChecker_
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:356
edm::FileBlock::DuplicateEventsRemoved
Definition: FileBlock.h:42
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:1310
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:197
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:38
edm::RootFile::processConfiguration_
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:315
edm::RootFile::fillThisEventAuxiliary
void fillThisEventAuxiliary()
Definition: RootFile.cc:1227
edm::RootFile::file_
const std::string file_
Definition: RootFile.h:313