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 const > branchIDListHelper () const
 
std::shared_ptr< BranchIDListHelper > & branchIDListHelper ()
 
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 const > indexIntoFileSharedPtr () const
 
std::shared_ptr< IndexIntoFile > & indexIntoFileSharedPtr ()
 
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 (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)
 
 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)
 
 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)
 
 RootFile (RootFile const &)=delete
 
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 const > branchChildren () const
 
std::shared_ptr< BranchChildren > & branchChildren ()
 
void dropOnInput (ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
 
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever (size_t index) const
 
std::shared_ptr< ProductProvenanceRetriever > & eventProductProvenanceRetriever (size_t index)
 
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 const > savedRunAuxiliary () const
 
std::shared_ptr< RunAuxiliary > & savedRunAuxiliary ()
 
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_
 
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_
 
std::string const 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_
 
std::string const 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

Definition at line 65 of file RootFile.h.

Constructor & Destructor Documentation

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 
)

Definition at line 139 of file RootFile.cc.

References edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), branchIDListHelper_, branchIDLists_, branchListIndexesUnchanged_, edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), edm::BranchTypeToAuxiliaryBranchName(), edm::BranchDescription::className(), 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_, ghostTrackVertexReco_cff::finder, edm::IndexIntoFile::firstAppearanceOrder, edm::BranchDescription::friendlyClassName(), 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, edm::BranchDescription::init(), initializeDuplicateChecker(), edm::InLumi, edm::InRun, edm::pset::Registry::insertMapped(), edm::pset::Registry::instance(), lumiTree_, makeProvenanceReaderMaker(), edm::poolNames::mergeableRunProductMetadataBranchName(), edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::Primary, edm::poolNames::processConfigurationBranchName(), edm::poolNames::processHistoryBranchName(), edm::poolNames::processHistoryMapBranchName(), parseEventContent::prod, edm::poolNames::productDependenciesBranchName(), edm::poolNames::productDescriptionBranchName(), edm::ProductRegistry::productList(), edm::ProductRegistry::productListUpdator(), productRegistry(), productRegistry_, provenanceAdaptor_, provenanceReaderMaker_, muonDTDigis_cfi::pset, readEventHistoryTree(), edm::ProcessHistoryRegistry::registerProcessHistory(), edm::RootTree::resetTraining(), edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, runTree_, edm::SecondaryFile, edm::SecondarySource, setIfFastClonable(), edm::setIsMergeable(), edm::source(), storedMergeableRunProductMetadata_, AlCaHLTBitMon_QueryRunRegistry::string, lumiQTWidget::t, edm::poolNames::thinnedAssociationsHelperBranchName(), edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), validateFile(), and whyNotFastClonable_.

168  : file_(fileName),
169  logicalFile_(logicalFileName),
170  processConfiguration_(processConfiguration),
171  processHistoryRegistry_(&processHistoryRegistry),
172  filePtr_(filePtr),
173  eventSkipperByID_(eventSkipperByID),
175  fid_(),
176  indexIntoFileSharedPtr_(new IndexIntoFile),
178  orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
183  storedMergeableRunProductMetadata_((inputType == InputType::Primary) ? new StoredMergeableRunProductMetadata
184  : nullptr),
188  skipAnyEvents_(skipAnyEvents),
193  eventAux_(),
194  eventTree_(filePtr,
195  InEvent,
196  nStreams,
197  treeMaxVirtualSize,
198  treeCacheSize,
200  enablePrefetching,
201  inputType),
202  lumiTree_(filePtr,
203  InLumi,
204  1,
205  treeMaxVirtualSize,
208  enablePrefetching,
209  inputType),
210  runTree_(filePtr,
211  InRun,
212  1,
213  treeMaxVirtualSize,
216  enablePrefetching,
217  inputType),
218  treePointers_(),
221  branchIDLists_(),
224  thinnedAssociationsHelper_(thinnedAssociationsHelper),
225  processingMode_(processingMode),
226  runHelper_(runHelper),
228  eventHistoryTree_(nullptr),
231  history_(),
232  branchChildren_(new BranchChildren),
233  duplicateChecker_(duplicateChecker),
239  edProductClass_(TypeWithDict::byName("edm::WrapperBase").getClass()),
240  inputType_(inputType) {
241  hasNewlyDroppedBranch_.fill(false);
242 
246 
247  // Read the metadata tree.
248  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
249  std::unique_ptr<TTree> metaDataTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::metaDataTreeName().c_str())));
250  if (nullptr == metaDataTree.get()) {
252  << "Could not find tree " << poolNames::metaDataTreeName() << " in the input file.\n";
253  }
254 
255  // To keep things simple, we just read in every possible branch that exists.
256  // We don't pay attention to which branches exist in which file format versions
257 
258  FileFormatVersion* fftPtr = &fileFormatVersion_;
259  if (metaDataTree->FindBranch(poolNames::fileFormatVersionBranchName().c_str()) != nullptr) {
260  TBranch* fft = metaDataTree->GetBranch(poolNames::fileFormatVersionBranchName().c_str());
261  fft->SetAddress(&fftPtr);
262  roottree::getEntry(fft, 0);
263  metaDataTree->SetBranchAddress(poolNames::fileFormatVersionBranchName().c_str(), &fftPtr);
264  }
265 
266  FileID* fidPtr = &fid_;
267  if (metaDataTree->FindBranch(poolNames::fileIdentifierBranchName().c_str()) != nullptr) {
268  metaDataTree->SetBranchAddress(poolNames::fileIdentifierBranchName().c_str(), &fidPtr);
269  }
270 
271  IndexIntoFile* iifPtr = &indexIntoFile_;
272  if (metaDataTree->FindBranch(poolNames::indexIntoFileBranchName().c_str()) != nullptr) {
273  metaDataTree->SetBranchAddress(poolNames::indexIntoFileBranchName().c_str(), &iifPtr);
274  }
275 
276  StoredMergeableRunProductMetadata* smrc = nullptr;
277  if (inputType == InputType::Primary) {
279  if (metaDataTree->FindBranch(poolNames::mergeableRunProductMetadataBranchName().c_str()) != nullptr) {
280  metaDataTree->SetBranchAddress(poolNames::mergeableRunProductMetadataBranchName().c_str(), &smrc);
281  }
282  }
283 
284  // Need to read to a temporary registry so we can do a translation of the BranchKeys.
285  // This preserves backward compatibility against friendly class name algorithm changes.
286  ProductRegistry inputProdDescReg;
287  ProductRegistry* ppReg = &inputProdDescReg;
288  metaDataTree->SetBranchAddress(poolNames::productDescriptionBranchName().c_str(), (&ppReg));
289 
290  typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
291  PsetMap psetMap;
292  PsetMap* psetMapPtr = &psetMap;
293  if (metaDataTree->FindBranch(poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
294  //backward compatibility
295  assert(!fileFormatVersion().parameterSetsTree());
296  metaDataTree->SetBranchAddress(poolNames::parameterSetMapBranchName().c_str(), &psetMapPtr);
297  } else {
298  assert(fileFormatVersion().parameterSetsTree());
299  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
300  std::unique_ptr<TTree> psetTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parameterSetsTreeName().c_str())));
301  if (nullptr == psetTree.get()) {
303  << "Could not find tree " << poolNames::parameterSetsTreeName() << " in the input file.\n";
304  }
305 
306  typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
307  IdToBlobs idToBlob;
308  IdToBlobs* pIdToBlob = &idToBlob;
309  psetTree->SetBranchAddress(poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
310 
311  std::unique_ptr<TTreeCache> psetTreeCache =
313  psetTreeCache->SetEnablePrefetching(false);
314  filePtr_->SetCacheRead(psetTreeCache.get());
315  for (Long64_t i = 0; i != psetTree->GetEntries(); ++i) {
316  psetTree->GetEntry(i);
317  psetMap.insert(idToBlob);
318  }
319  filePtr_->SetCacheRead(nullptr);
320  }
321 
322  // backward compatibility
324  ProcessHistoryRegistry::collection_type* pHistMapPtr = &pHistMap;
325  if (metaDataTree->FindBranch(poolNames::processHistoryMapBranchName().c_str()) != nullptr) {
326  metaDataTree->SetBranchAddress(poolNames::processHistoryMapBranchName().c_str(), &pHistMapPtr);
327  }
328 
330  ProcessHistoryRegistry::vector_type* pHistVectorPtr = &pHistVector;
331  if (metaDataTree->FindBranch(poolNames::processHistoryBranchName().c_str()) != nullptr) {
332  metaDataTree->SetBranchAddress(poolNames::processHistoryBranchName().c_str(), &pHistVectorPtr);
333  }
334 
335  // backward compatibility
336  ProcessConfigurationVector processConfigurations;
337  ProcessConfigurationVector* procConfigVectorPtr = &processConfigurations;
338  if (metaDataTree->FindBranch(poolNames::processConfigurationBranchName().c_str()) != nullptr) {
339  metaDataTree->SetBranchAddress(poolNames::processConfigurationBranchName().c_str(), &procConfigVectorPtr);
340  }
341 
342  auto branchIDListsAPtr = std::make_unique<BranchIDLists>();
343  BranchIDLists* branchIDListsPtr = branchIDListsAPtr.get();
344  if (metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) != nullptr) {
345  metaDataTree->SetBranchAddress(poolNames::branchIDListBranchName().c_str(), &branchIDListsPtr);
346  }
347 
348  if (inputType != InputType::SecondarySource) {
350  std::make_unique<ThinnedAssociationsHelper>(); // propagate_const<T> has no reset() function
351  ThinnedAssociationsHelper* thinnedAssociationsHelperPtr = fileThinnedAssociationsHelper_.get();
352  if (metaDataTree->FindBranch(poolNames::thinnedAssociationsHelperBranchName().c_str()) != nullptr) {
353  metaDataTree->SetBranchAddress(poolNames::thinnedAssociationsHelperBranchName().c_str(),
354  &thinnedAssociationsHelperPtr);
355  }
356  }
357 
358  BranchChildren* branchChildrenBuffer = branchChildren_.get();
359  if (metaDataTree->FindBranch(poolNames::productDependenciesBranchName().c_str()) != nullptr) {
360  metaDataTree->SetBranchAddress(poolNames::productDependenciesBranchName().c_str(), &branchChildrenBuffer);
361  }
362 
363  // backward compatibility
364  std::vector<EventProcessHistoryID>* eventHistoryIDsPtr = &eventProcessHistoryIDs_;
365  if (metaDataTree->FindBranch(poolNames::eventHistoryBranchName().c_str()) != nullptr) {
366  metaDataTree->SetBranchAddress(poolNames::eventHistoryBranchName().c_str(), &eventHistoryIDsPtr);
367  }
368 
369  if (metaDataTree->FindBranch(poolNames::moduleDescriptionMapBranchName().c_str()) != nullptr) {
370  if (metaDataTree->GetBranch(poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
371  metaDataTree->SetBranchStatus((poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), false);
372  } else {
373  metaDataTree->SetBranchStatus(poolNames::moduleDescriptionMapBranchName().c_str(), false);
374  }
375  }
376 
377  // Here we read the metadata tree
378  roottree::getEntry(metaDataTree.get(), 0);
379 
381 
382  // Here we read the event history tree, if we have one.
384 
386  if (!fileFormatVersion().triggerPathsTracked()) {
387  ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion().parameterSetsByReference());
388  } else {
389  // Merge into the parameter set registry.
390  pset::Registry& psetRegistry = *pset::Registry::instance();
391  for (auto const& psetEntry : psetMap) {
392  ParameterSet pset(psetEntry.second.pset());
393  pset.setID(psetEntry.first);
394  // For thread safety, don't update global registries when a secondary source opens a file.
395  if (inputType != InputType::SecondarySource) {
396  psetRegistry.insertMapped(pset);
397  }
398  }
399  }
400  if (!fileFormatVersion().splitProductIDs()) {
401  // Old provenance format input file. Create a provenance adaptor.
402  // propagate_const<T> has no reset() function
403  provenanceAdaptor_ = std::make_unique<ProvenanceAdaptor>(
404  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, true);
405  // Fill in the branchIDLists branch from the provenance adaptor
406  branchIDLists_ = provenanceAdaptor_->branchIDLists();
407  } else {
408  if (!fileFormatVersion().triggerPathsTracked()) {
409  // New provenance format, but change in ParameterSet Format. Create a provenance adaptor.
410  // propagate_const<T> has no reset() function
411  provenanceAdaptor_ = std::make_unique<ProvenanceAdaptor>(
412  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, false);
413  }
414  // New provenance format input file. The branchIDLists branch was read directly from the input file.
415  if (metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) == nullptr) {
416  throw Exception(errors::EventCorruption) << "Failed to find branchIDLists branch in metaData tree.\n";
417  }
418  branchIDLists_.reset(branchIDListsAPtr.release());
419  }
420 
422  if (metaDataTree->FindBranch(poolNames::thinnedAssociationsHelperBranchName().c_str()) == nullptr) {
424  << "Failed to find thinnedAssociationsHelper branch in metaData tree.\n";
425  }
426  }
427 
428  if (!bypassVersionCheck) {
429  checkReleaseVersion(pHistVector, file());
430  }
431 
432  if (labelRawDataLikeMC) {
433  std::string const rawData("FEDRawDataCollection");
434  std::string const source("source");
435  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
436  BranchKey finder(rawData, source, "", "");
437  ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
438  if (it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source) {
439  // We found raw data with a module label of source.
440  // We need to change the module label and process name.
441  // Create helper.
442  it->second.init();
443  // propagate_const<T> has no reset() function
444  daqProvenanceHelper_ = std::make_unique<DaqProvenanceHelper>(it->second.unwrappedTypeID());
445  // Create the new branch description
446  BranchDescription const& newBD = daqProvenanceHelper_->branchDescription();
447  // Save info from the old and new branch descriptions
448  daqProvenanceHelper_->saveInfo(it->second, newBD);
449  // Map the new branch name to the old branch name.
450  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), it->second.branchName()));
451  // Remove the old branch description from the product Registry.
452  pList.erase(it);
453  // Check that there was only one.
454  it = pList.lower_bound(finder);
455  assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source));
456  // Insert the new branch description into the product registry.
457  inputProdDescReg.copyProduct(newBD);
458  // Fix up other per file metadata.
459  daqProvenanceHelper_->fixMetaData(processConfigurations, pHistVector);
460  daqProvenanceHelper_->fixMetaData(*branchIDLists_);
461  daqProvenanceHelper_->fixMetaData(*branchChildren_);
462  }
463  }
464 
465  for (auto const& history : pHistVector) {
466  processHistoryRegistry.registerProcessHistory(history);
467  }
468 
470 
471  // Update the branch id info. This has to be done before validateFile since
472  // depending on the file format, the branchIDListHelper_ may have its fixBranchListIndexes call made
473  if (inputType == InputType::Primary) {
474  branchListIndexesUnchanged_ = branchIDListHelper_->updateFromInput(*branchIDLists_);
475  }
476 
477  validateFile(inputType, usingGoToEvent);
478 
479  // Here, we make the class that will make the ProvenanceReader
480  // It reads whatever trees it needs.
481  // propagate_const<T> has no reset() function
482  provenanceReaderMaker_ = std::unique_ptr<MakeProvenanceReader>(makeProvenanceReaderMaker(inputType).release());
483 
484  // Merge into the hashed registries.
485  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
487  }
488 
489  initializeDuplicateChecker(indexesIntoFiles, currentIndexIntoFile);
491  indexIntoFile_.begin(noEventSort ? IndexIntoFile::firstAppearanceOrder : IndexIntoFile::numericalOrder);
493  indexIntoFile_.end(noEventSort ? IndexIntoFile::firstAppearanceOrder : IndexIntoFile::numericalOrder);
495  eventProcessHistoryIter_ = eventProcessHistoryIDs_.begin();
496 
497  // Set product presence information in the product registry.
498  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
499  for (auto& product : pList) {
500  BranchDescription& prod = product.second;
501  prod.init();
502  treePointers_[prod.branchType()]->setPresence(prod, newBranchToOldBranch(prod.branchName()));
503  }
504 
505  auto newReg = std::make_unique<ProductRegistry>();
506 
507  // Do the translation from the old registry to the new one
508  {
509  ProductRegistry::ProductList const& prodList = inputProdDescReg.productList();
510  for (auto const& product : prodList) {
511  BranchDescription const& prod = product.second;
512  std::string newFriendlyName = friendlyname::friendlyName(prod.className());
513  if (newFriendlyName == prod.friendlyClassName()) {
514  newReg->copyProduct(prod);
515  } else {
516  if (fileFormatVersion().splitProductIDs()) {
518  << "Cannot change friendly class name algorithm without more development work\n"
519  << "to update BranchIDLists and ThinnedAssociationsHelper. Contact the framework group.\n";
520  }
521  BranchDescription newBD(prod);
522  newBD.updateFriendlyClassName();
523  newReg->copyProduct(newBD);
524  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), prod.branchName()));
525  }
526  }
527  dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
528  if (inputType == InputType::SecondaryFile) {
529  thinnedAssociationsHelper->updateFromSecondaryInput(*fileThinnedAssociationsHelper_,
530  *associationsFromSecondary);
531  } else if (inputType == InputType::Primary) {
532  thinnedAssociationsHelper->updateFromPrimaryInput(*fileThinnedAssociationsHelper_);
533  }
534 
535  if (inputType == InputType::Primary) {
536  for (auto& product : newReg->productListUpdator()) {
537  setIsMergeable(product.second);
538  }
539  }
540 
541  // freeze the product registry
542  newReg->setFrozen(inputType != InputType::Primary);
543  productRegistry_.reset(newReg.release());
544  }
545 
546  // Set up information from the product registry.
547  ProductRegistry::ProductList const& prodList = productRegistry()->productList();
548 
549  {
550  std::array<size_t, NumBranchTypes> nBranches;
551  nBranches.fill(0);
552  for (auto const& product : prodList) {
553  ++nBranches[product.second.branchType()];
554  }
555 
556  int i = 0;
557  for (auto t : treePointers_) {
558  t->numberOfBranchesToAdd(nBranches[i]);
559  ++i;
560  }
561  }
562  for (auto const& product : prodList) {
563  BranchDescription const& prod = product.second;
564  treePointers_[prod.branchType()]->addBranch(prod, newBranchToOldBranch(prod.branchName()));
565  }
566 
567  // Determine if this file is fast clonable.
568  setIfFastClonable(remainingEvents, remainingLumis);
569 
570  // We are done with our initial reading of EventAuxiliary.
572 
573  // Tell the event tree to begin training at the next read.
575 
576  // Train the run and lumi trees.
577  runTree_.trainCache("*");
578  lumiTree_.trainCache("*");
579  }
void dropOnInput(ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
Definition: RootFile.cc:1687
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:261
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:340
std::vector< ProcessConfiguration > ProcessConfigurationVector
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:116
unsigned int const defaultNonEventLearningEntries
Definition: RootTree.h:49
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
std::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:338
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:248
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
static std::string const source("source")
int whyNotFastClonable_
Definition: RootFile.h:328
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:313
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: RootFile.h:341
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:344
std::map< BranchKey, BranchDescription > ProductList
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:316
RootTree lumiTree_
Definition: RootFile.h:333
InputType inputType_
Definition: RootFile.h:357
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:325
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:219
IndexIntoFileItr begin(SortOrder sortOrder) const
void initializeDuplicateChecker(std::vector< std::shared_ptr< IndexIntoFile >> const &indexesIntoFiles, std::vector< std::shared_ptr< IndexIntoFile >>::size_type currentIndexIntoFile)
Definition: RootFile.cc:1663
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:342
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
void trainCache(char const *branchNames)
Definition: RootTree.cc:460
std::shared_ptr< ProductRegistry const > productRegistry() const
Definition: RootFile.h:210
edm::propagate_const< TClass * > edProductClass_
Definition: RootFile.h:356
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:314
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:257
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:353
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:324
FileID fid_
Definition: RootFile.h:315
std::string const logicalFile_
Definition: RootFile.h:309
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:194
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
Definition: RootFile.h:322
bool noEventSort_
Definition: RootFile.h:327
std::string friendlyName(std::string const &iFullName)
std::string const & mergeableRunProductMetadataBranchName()
Definition: BranchType.cc:239
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:336
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:234
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:244
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:346
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:351
bool skipAnyEvents_
Definition: RootFile.h:326
RootTree eventTree_
Definition: RootFile.h:332
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
BranchListIndexes branchListIndexes_
Definition: RootFile.h:347
std::string const & metaDataTreeName()
Definition: BranchType.cc:169
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:184
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:348
std::string const & processHistoryBranchName()
Definition: BranchType.cc:199
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
RootTree runTree_
Definition: RootFile.h:334
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
Definition: RootFile.h:352
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:329
static constexpr EntryNumber_t invalidEntry
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:310
std::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:337
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:664
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:349
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
std::string const & file() const
Definition: RootFile.h:209
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:174
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:204
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:319
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
bool branchListIndexesUnchanged_
Definition: RootFile.h:330
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:345
unsigned int const defaultNonEventCacheSize
Definition: RootTree.h:47
RootTreePtrArray treePointers_
Definition: RootFile.h:335
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:318
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:179
std::string const & thinnedAssociationsHelperBranchName()
Definition: BranchType.cc:214
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
Definition: RootFile.cc:1814
std::string const & branchIDListBranchName()
Definition: BranchType.cc:209
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:354
EventAuxiliary eventAux_
Definition: RootFile.h:331
void resetTraining()
Definition: RootTree.h:192
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:339
void validateFile(InputType inputType, bool usingGoToEvent)
Definition: RootFile.cc:1134
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:724
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:515
unsigned int const defaultLearningEntries
Definition: RootTree.h:48
bool hasThinnedAssociations() const
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:224
void setIsMergeable(BranchDescription &)
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:189
std::string const file_
Definition: RootFile.h:308
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:323
static Registry * instance()
Definition: Registry.cc:12
void readEventHistoryTree()
Definition: RootFile.cc:1652
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 
)
inline

Definition at line 96 of file RootFile.h.

117  : RootFile(fileName,
118  processConfiguration,
119  logicalFileName,
120  filePtr,
121  nullptr,
122  false,
123  -1,
124  -1,
125  nStreams,
126  0U,
127  treeMaxVirtualSize,
128  processingMode,
129  runHelper,
130  false,
131  productSelectorRules,
132  inputType,
134  thinnedAssociationsHelper,
135  associationsFromSecondary,
136  nullptr,
137  dropDescendantsOfDroppedProducts,
138  processHistoryRegistry,
139  indexesIntoFiles,
140  currentIndexIntoFile,
141  orderedProcessHistoryIDs,
142  bypassVersionCheck,
143  labelRawDataLikeMC,
144  false,
145  enablePrefetching) {}
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:248
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)
Definition: RootFile.cc:139
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 
)
inline

Definition at line 147 of file RootFile.h.

References utilities::cache(), and AlCaHLTBitMon_QueryRunRegistry::string.

163  : RootFile(fileName,
164  processConfiguration,
165  logicalFileName,
166  filePtr,
167  nullptr,
168  false,
169  -1,
170  -1,
171  nStreams,
172  treeCacheSize,
173  treeMaxVirtualSize,
175  runHelper,
176  false,
177  productSelectorRules,
178  inputType,
179  nullptr,
180  nullptr,
181  nullptr,
182  nullptr,
183  false,
184  processHistoryRegistry,
185  indexesIntoFiles,
186  currentIndexIntoFile,
187  orderedProcessHistoryIDs,
188  bypassVersionCheck,
189  false,
190  false,
191  enablePrefetching) {}
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)
Definition: RootFile.cc:139
edm::RootFile::~RootFile ( )

Definition at line 581 of file RootFile.cc.

581 {}
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 298 of file RootFile.h.

References edm::get_underlying_safe().

Referenced by createFileBlock().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:349
std::shared_ptr<BranchChildren>& edm::RootFile::branchChildren ( )
inlineprivate

Definition at line 299 of file RootFile.h.

References edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:349
std::shared_ptr<BranchIDListHelper const> edm::RootFile::branchIDListHelper ( ) const
inline

Definition at line 248 of file RootFile.h.

References edm::get_underlying_safe().

248  {
250  }
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:339
std::shared_ptr<BranchIDListHelper>& edm::RootFile::branchIDListHelper ( )
inline

Definition at line 251 of file RootFile.h.

References edm::get_underlying_safe().

std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:339
bool edm::RootFile::branchListIndexesUnchanged ( ) const
inline

Definition at line 222 of file RootFile.h.

Referenced by createFileBlock().

222 { return branchListIndexesUnchanged_; }
bool branchListIndexesUnchanged_
Definition: RootFile.h:330
void edm::RootFile::close ( void  )

Definition at line 1188 of file RootFile.cc.

References eventHistoryTree_, filePtr_, and treePointers_.

Referenced by lumiQTWidget.ApplicationWindow::fileQuit(), esMonitoring.AsyncLineReaderMixin::handle_close(), esMonitoring.FDJsonServer::handle_close(), Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog::keyPressEvent().

1188  {
1189  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1190  eventHistoryTree_ = nullptr;
1191  for (auto& treePointer : treePointers_) {
1192  treePointer->close();
1193  treePointer = nullptr;
1194  }
1195  filePtr_->Close();
1196  filePtr_ = nullptr; // propagate_const<T> has no reset() function
1197  }
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:345
RootTreePtrArray treePointers_
Definition: RootFile.h:335
bool edm::RootFile::containsItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
) const

Definition at line 794 of file RootFile.cc.

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

794  {
796  }
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: event.py:1
std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 708 of file RootFile.cc.

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

708  {
709  return std::make_unique<FileBlock>(fileFormatVersion(),
710  eventTree_.tree(),
712  lumiTree_.tree(),
714  runTree_.tree(),
715  runTree_.metaTree(),
718  file_,
720  modifiedIDs(),
721  branchChildren());
722  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
bool branchListIndexesUnchanged() const
Definition: RootFile.h:222
RootTree lumiTree_
Definition: RootFile.h:333
TTree const * metaTree() const
Definition: RootTree.h:182
TTree const * tree() const
Definition: RootTree.h:180
bool modifiedIDs() const
Definition: RootFile.h:223
int whyNotFastClonable() const
Definition: RootFile.h:220
RootTree eventTree_
Definition: RootFile.h:332
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:221
RootTree runTree_
Definition: RootFile.h:334
std::shared_ptr< BranchChildren const > branchChildren() const
Definition: RootFile.h:298
std::string const file_
Definition: RootFile.h:308
void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType 
)
private

Definition at line 1687 of file RootFile.cc.

References edm::ProductRegistry::allBranchDescriptions(), TrackValidation_cff::association, edm::BranchDescription::branchID(), edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), SimDataFormats::CaloAnalysis::cp, drop, edm::BranchDescription::dropped(), edProductClass_, file_, fileThinnedAssociationsHelper_, edm::TypeWithDict::getClass(), edm::getWrapperBasePtr(), hasNewlyDroppedBranch_, edm::InEvent, edm::ProductSelector::initialize(), markBranchToBeDropped(), newBranchToOldBranch(), PFRecoTauDiscriminationByIsolation_cfi::offset, edm::BranchDescription::originalBranchID(), AlCaHLTBitMon_ParallelJobs::p, edm::BranchDescription::present(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::SecondaryFile, edm::SecondarySource, edm::ProductSelector::selected(), groupFilesInBlocks::temp, treePointers_, edm::BranchDescription::unwrappedType(), and edm::BranchDescription::wrappedType().

Referenced by RootFile().

1690  {
1691  // This is the selector for drop on input.
1692  ProductSelector productSelector;
1693  productSelector.initialize(rules, reg.allBranchDescriptions());
1694 
1695  std::vector<BranchDescription const*> associationDescriptions;
1696 
1697  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1698  // Do drop on input. On the first pass, just fill in a set of branches to be dropped.
1699  std::set<BranchID> branchesToDrop;
1700  std::map<BranchID, BranchID> droppedToKeptAlias;
1701  for (auto const& product : prodList) {
1702  BranchDescription const& prod = product.second;
1703  if (prod.branchID() != prod.originalBranchID() && prod.present()) {
1704  droppedToKeptAlias[prod.originalBranchID()] = prod.branchID();
1705  }
1706  }
1707  for (auto const& product : prodList) {
1708  BranchDescription const& prod = product.second;
1709  // Special handling for ThinnedAssociations
1710  if (prod.unwrappedType() == typeid(ThinnedAssociation) && prod.present()) {
1711  if (inputType != InputType::SecondarySource) {
1712  associationDescriptions.push_back(&prod);
1713  } else {
1714  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1715  }
1716  } else if (!productSelector.selected(prod)) {
1717  markBranchToBeDropped(dropDescendants, prod, branchesToDrop, droppedToKeptAlias);
1718  }
1719  }
1720 
1721  if (inputType != InputType::SecondarySource) {
1722  // Decide whether to keep the thinned associations and corresponding
1723  // entries in the helper. For secondary source they are all dropped,
1724  // but in other cases we look for thinned collections the associations
1725  // redirect a Ref or Ptr to when dereferencing them.
1726 
1727  // Need a list of kept products in order to determine which thinned associations
1728  // are kept.
1729  std::set<BranchID> keptProductsInEvent;
1730  for (auto const& product : prodList) {
1731  BranchDescription const& prod = product.second;
1732  if (branchesToDrop.find(prod.branchID()) == branchesToDrop.end() && prod.present() &&
1733  prod.branchType() == InEvent) {
1734  keptProductsInEvent.insert(prod.branchID());
1735  }
1736  }
1737 
1738  // Decide which ThinnedAssociations to keep and store the decision in keepAssociation
1739  std::map<BranchID, bool> keepAssociation;
1740  fileThinnedAssociationsHelper_->selectAssociationProducts(
1741  associationDescriptions, keptProductsInEvent, keepAssociation);
1742 
1743  for (auto association : associationDescriptions) {
1744  if (!keepAssociation[association->branchID()]) {
1745  markBranchToBeDropped(dropDescendants, *association, branchesToDrop, droppedToKeptAlias);
1746  }
1747  }
1748 
1749  // Also delete the dropped associations from the ThinnedAssociationsHelper
1750  auto temp = std::make_unique<ThinnedAssociationsHelper>();
1751  for (auto const& associationBranches : fileThinnedAssociationsHelper_->data()) {
1752  auto iter = keepAssociation.find(associationBranches.association());
1753  if (iter != keepAssociation.end() && iter->second) {
1754  temp->addAssociation(associationBranches);
1755  }
1756  }
1757  // propagate_const<T> has no reset() function
1758  fileThinnedAssociationsHelper_ = std::unique_ptr<ThinnedAssociationsHelper>(temp.release());
1759  }
1760 
1761  // On this pass, actually drop the branches.
1762  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1763  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1764  BranchDescription const& prod = it->second;
1765  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1766  if (drop) {
1767  if (!prod.dropped()) {
1768  if (productSelector.selected(prod) && prod.unwrappedType() != typeid(ThinnedAssociation)) {
1769  LogWarning("RootFile") << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1770  << "of file '" << file_ << "' because it is dependent on a branch\n"
1771  << "that was explicitly dropped.\n";
1772  }
1773  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1774  hasNewlyDroppedBranch_[prod.branchType()] = true;
1775  }
1776  ProductRegistry::ProductList::iterator icopy = it;
1777  ++it;
1778  prodList.erase(icopy);
1779  } else {
1780  ++it;
1781  }
1782  }
1783 
1784  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
1785  if (inputType == InputType::SecondaryFile) {
1786  TString tString;
1787  for (ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1788  BranchDescription const& prod = it->second;
1789  if (prod.branchType() != InEvent) {
1790  TClass* cp = prod.wrappedType().getClass();
1791  void* p = cp->New();
1792  int offset = cp->GetBaseClassOffset(edProductClass_);
1793  std::unique_ptr<WrapperBase> edp = getWrapperBasePtr(p, offset);
1794  if (edp->isMergeable()) {
1795  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1796  ProductRegistry::ProductList::iterator icopy = it;
1797  ++it;
1798  prodList.erase(icopy);
1799  } else {
1800  ++it;
1801  }
1802  } else
1803  ++it;
1804  }
1805  }
1806  }
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:340
std::map< BranchKey, BranchDescription > ProductList
edm::propagate_const< TClass * > edProductClass_
Definition: RootFile.h:356
const int drop
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:329
RootTreePtrArray treePointers_
Definition: RootFile.h:335
std::unique_ptr< WrapperBase > getWrapperBasePtr(void *p, int offset)
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:724
void markBranchToBeDropped(bool dropDescendants, BranchDescription const &branch, std::set< BranchID > &branchesToDrop, std::map< BranchID, BranchID > const &droppedToKeptAlias) const
Definition: RootFile.cc:1676
std::string const file_
Definition: RootFile.h:308
EventAuxiliary const& edm::RootFile::eventAux ( ) const
inline
EventID const& edm::RootFile::eventID ( ) const
inline

Definition at line 215 of file RootFile.h.

215 { return eventAux().id(); }
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
EventID const & id() const
std::shared_ptr<ProductProvenanceRetriever const> edm::RootFile::eventProductProvenanceRetriever ( size_t  index) const
inlineprivate

Definition at line 301 of file RootFile.h.

References edm::get_underlying_safe().

Referenced by makeProductProvenanceRetriever().

301  {
303  }
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:353
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<ProductProvenanceRetriever>& edm::RootFile::eventProductProvenanceRetriever ( size_t  index)
inlineprivate

Definition at line 304 of file RootFile.h.

References edm::get_underlying_safe().

304  {
306  }
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:353
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
RootTree const& edm::RootFile::eventTree ( ) const
inline

Definition at line 216 of file RootFile.h.

216 { return eventTree_; }
RootTree eventTree_
Definition: RootFile.h:332
std::string const& edm::RootFile::file ( ) const
inline

Definition at line 209 of file RootFile.h.

Referenced by RootFile().

209 { return file_; }
std::string const file_
Definition: RootFile.h:308
FileFormatVersion edm::RootFile::fileFormatVersion ( ) const
inline
bool edm::RootFile::fillEventAuxiliary ( IndexIntoFile::EntryNumber_t  entry)
private

Definition at line 1217 of file RootFile.cc.

References edm::RootTree::current(), eventTree_, fillThisEventAuxiliary(), and edm::RootTree::setEntryNumber().

Referenced by getNextItemType(), isDuplicateEvent(), readEvent(), readLuminosityBlockAuxiliary_(), readRunAuxiliary_(), setEntryAtNextEventInLumi(), skipEvents(), and skipThisEntry().

1217  {
1218  if (!eventTree_.current(entry)) {
1219  return false;
1220  }
1223  return true;
1224  }
bool current() const
Definition: RootTree.h:128
RootTree eventTree_
Definition: RootFile.h:332
void fillThisEventAuxiliary()
Definition: RootFile.cc:1199
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
void edm::RootFile::fillEventHistory ( )
private

Definition at line 1226 of file RootFile.cc.

References branchIDListHelper_, branchListIndexes_, edm::poolNames::branchListIndexesBranchName(), daqProvenanceHelper_, edm::RootTree::entryNumber(), 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(), edmPickEvents::target, and edm::RootTree::tree().

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

1226  {
1227  // We could consider doing delayed reading, but because we have to
1228  // store this History object in a different tree than the event
1229  // data tree, this is too hard to do in this first version.
1230 
1231  if (fileFormatVersion().eventHistoryBranch()) {
1232  // Lumi block number was not in EventID for the relevant releases.
1233  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1234  if (eventProcessHistoryIter_->eventID() != id) {
1235  EventProcessHistoryID target(id, ProcessHistoryID());
1237  assert(eventProcessHistoryIter_->eventID() == id);
1238  }
1241  } else if (fileFormatVersion().eventHistoryTree()) {
1242  // for backward compatibility.
1243  History* pHistory = history_.get();
1244  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1245  if (!eventHistoryBranch) {
1246  throw Exception(errors::EventCorruption) << "Failed to find history branch in event history tree.\n";
1247  }
1248  eventHistoryBranch->SetAddress(&pHistory);
1250  eventAux_.setProcessHistoryID(history_->processHistoryID());
1251  eventSelectionIDs_.swap(history_->eventSelectionIDs());
1252  branchListIndexes_.swap(history_->branchListIndexes());
1253  } else if (fileFormatVersion().noMetaDataTrees()) {
1254  // Current format
1256  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1257  assert(eventSelectionIDBranch != nullptr);
1258  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1260  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1261  assert(branchListIndexesBranch != nullptr);
1262  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1263  }
1264  if (provenanceAdaptor_) {
1265  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1266  for (auto& esID : eventSelectionIDs_) {
1267  esID = provenanceAdaptor_->convertID(esID);
1268  }
1269  }
1270  if (daqProvenanceHelper_) {
1272  }
1274  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1275  provenanceAdaptor_->branchListIndexes(branchListIndexes_);
1276  }
1277  if (branchIDListHelper_) {
1278  branchIDListHelper_->fixBranchListIndexes(branchListIndexes_);
1279  }
1280  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
Definition: Algorithms.h:69
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:249
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:324
TTree const * tree() const
Definition: RootTree.h:180
std::vector< BranchListIndex > BranchListIndexes
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:244
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:346
bool eventHistoryTree() const
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:351
RootTree eventTree_
Definition: RootFile.h:332
BranchListIndexes branchListIndexes_
Definition: RootFile.h:347
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Hash< ProcessHistoryType > ProcessHistoryID
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:348
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:158
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:345
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:253
EventAuxiliary eventAux_
Definition: RootFile.h:331
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:339
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:323
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 910 of file RootFile.cc.

References edm::RootTree::entries(), edm::RootTree::entryNumber(), event(), eventAux(), eventAux_, eventTree_, fileFormatVersion(), fillEventHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), fillThisEventAuxiliary(), edm::find_in_all(), indexIntoFile_, edm::IndexIntoFile::invalidEntry, edm::RootTree::isValid(), lastEventEntryNumberRead_, summaryLumi::lcount, edm::EventAuxiliary::luminosityBlock(), heppy_report::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().

910  {
911  // This function is for backward compatibility.
912  // If reading a current format file, indexIntoFile_ is read from the input
913  // file and should always be there. Note that the algorithm below will work
914  // sometimes but often fail with the new format introduced in release 3_8_0.
915  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
916  // probably a separate function should be written to deal with the task.
917  // This is possible just not implemented yet.
918  assert(!fileFormatVersion().hasIndexIntoFile());
919 
920  typedef std::list<LumiItem> LumiList;
921  LumiList lumis; // (declare 1)
922 
923  typedef std::set<LuminosityBlockID> RunLumiSet;
924  RunLumiSet runLumiSet; // (declare 2)
925 
926  typedef std::list<RunItem> RunList;
927  RunList runs; // (declare 5)
928 
929  typedef std::set<RunNumber_t> RunSet;
930  RunSet runSet; // (declare 4)
931 
932  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
933  RunItemSet runItemSet; // (declare 3)
934 
935  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
936  PHIDMap phidMap;
937 
938  RunNumber_t prevRun = 0;
939  LuminosityBlockNumber_t prevLumi = 0;
940  ProcessHistoryID prevPhid;
941  bool iFirst = true;
942 
943  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
945 
946  // First, loop through the event tree.
947  while (eventTree_.next()) {
948  bool newRun = false;
949  bool newLumi = false;
952 
953  // Save the event numbers as we loop through the event auxiliary to avoid
954  // having to read through the event auxiliary again later. These event numbers
955  // are not actually used in this function, but could be needed elsewhere.
957 
958  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(eventAux().processHistoryID());
959 
960  if (iFirst || prevPhid != reducedPHID || prevRun != eventAux().run()) {
961  iFirst = false;
962  newRun = newLumi = true;
963  } else if (prevLumi != eventAux().luminosityBlock()) {
964  newLumi = true;
965  }
966  prevPhid = reducedPHID;
967  prevRun = eventAux().run();
968  prevLumi = eventAux().luminosityBlock();
969  if (newLumi) {
970  lumis.emplace_back(
971  reducedPHID, eventAux().run(), eventAux().luminosityBlock(), eventTree_.entryNumber()); // (insert 1)
972  runLumiSet.insert(LuminosityBlockID(eventAux().run(), eventAux().luminosityBlock())); // (insert 2)
973  } else {
974  LumiItem& currentLumi = lumis.back();
975  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
976  ++currentLumi.lastEventEntry_;
977  }
978  if (newRun) {
979  // Insert run in list if it is not already there.
980  RunItem item(reducedPHID, eventAux().run());
981  if (runItemSet.insert(item).second) { // (check 3, insert 3)
982  runs.push_back(std::move(item)); // (insert 5)
983  runSet.insert(eventAux().run()); // (insert 4)
984  phidMap.insert(std::make_pair(eventAux().run(), reducedPHID));
985  }
986  }
987  }
988  // now clean up.
990  eventAux_ = EventAuxiliary();
992 
993  // Loop over run entries and fill information.
994 
995  typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
996  RunMap runMap; // (declare 11)
997 
998  typedef std::vector<RunItem> RunVector;
999  RunVector emptyRuns; // (declare 12)
1000 
1001  if (runTree_.isValid()) {
1002  while (runTree_.next()) {
1003  // Note: adjacent duplicates will be skipped without an explicit check.
1004 
1005  std::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
1006  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(runAux->processHistoryID());
1007 
1008  if (runSet.insert(runAux->run()).second) { // (check 4, insert 4)
1009  // This run was not associated with any events.
1010  emptyRuns.emplace_back(reducedPHID, runAux->run()); // (insert 12)
1011  }
1012  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
1013  phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1014  }
1015  // now clean up.
1017  }
1018 
1019  // Insert the ordered empty runs into the run list.
1020  RunItemSortByRun runItemSortByRun;
1021  stable_sort_all(emptyRuns, runItemSortByRun);
1022 
1023  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1024  for (auto const& emptyRun : emptyRuns) {
1025  for (; itRuns != endRuns; ++itRuns) {
1026  if (runItemSortByRun(emptyRun, *itRuns)) {
1027  break;
1028  }
1029  }
1030  runs.insert(itRuns, emptyRun);
1031  }
1032 
1033  // Loop over luminosity block entries and fill information.
1034 
1035  typedef std::vector<LumiItem> LumiVector;
1036  LumiVector emptyLumis; // (declare 7)
1037 
1038  typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1039  RunLumiMap runLumiMap; // (declare 6)
1040 
1041  if (lumiTree_.isValid()) {
1042  while (lumiTree_.next()) {
1043  // Note: adjacent duplicates will be skipped without an explicit check.
1044  std::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
1045  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
1046  if (runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
1047  // This lumi was not associated with any events.
1048  // Use the process history ID from the corresponding run. In cases of practical
1049  // importance, this should be the correct process history ID, but it is possible
1050  // to construct files where this is not the correct process history ID ...
1051  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1052  assert(iPhidMap != phidMap.end());
1053  emptyLumis.emplace_back(
1054  iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), IndexIntoFile::invalidEntry); // (insert 7)
1055  }
1056  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
1057  }
1058  // now clean up.
1060  }
1061 
1062  // Insert the ordered empty lumis into the lumi list.
1063  LumiItemSortByRunLumi lumiItemSortByRunLumi;
1064  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
1065 
1066  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1067  for (auto const& emptyLumi : emptyLumis) {
1068  for (; itLumis != endLumis; ++itLumis) {
1069  if (lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1070  break;
1071  }
1072  }
1073  lumis.insert(itLumis, emptyLumi);
1074  }
1075 
1076  // Create a map of RunItems that gives the order of first appearance in the list.
1077  // Also fill in the vector of process history IDs
1078  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1079  RunCountMap runCountMap; // Declare (17)
1080  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
1081  assert(phids.empty());
1082  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
1083  assert(entries.empty());
1084  int rcount = 0;
1085  for (auto& run : runs) {
1086  RunCountMap::const_iterator countMapItem = runCountMap.find(run);
1087  if (countMapItem == runCountMap.end()) {
1088  countMapItem = runCountMap.insert(std::make_pair(run, rcount)).first; // Insert (17)
1089  assert(countMapItem != runCountMap.end());
1090  ++rcount;
1091  }
1092  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, run.phid_);
1093  if (phidItem == phids.end()) {
1094  phids.push_back(run.phid_);
1095  phidItem = phids.end() - 1;
1096  }
1097  entries.emplace_back(countMapItem->second, // use (17)
1099  runMap[run.run_], // use (11)
1100  phidItem - phids.begin(),
1101  run.run_,
1102  0U,
1105  }
1106 
1107  // Create a map of LumiItems that gives the order of first appearance in the list.
1108  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1109  LumiCountMap lumiCountMap; // Declare (19)
1110  int lcount = 0;
1111  for (auto& lumi : lumis) {
1112  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(lumi.phid_, lumi.run_));
1113  assert(runCountMapItem != runCountMap.end());
1114  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(lumi);
1115  if (countMapItem == lumiCountMap.end()) {
1116  countMapItem = lumiCountMap.insert(std::make_pair(lumi, lcount)).first; // Insert (17)
1117  assert(countMapItem != lumiCountMap.end());
1118  ++lcount;
1119  }
1120  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, lumi.phid_);
1121  assert(phidItem != phids.end());
1122  entries.emplace_back(runCountMapItem->second,
1123  countMapItem->second,
1124  runLumiMap[LuminosityBlockID(lumi.run_, lumi.lumi_)],
1125  phidItem - phids.begin(),
1126  lumi.run_,
1127  lumi.lumi_,
1128  lumi.firstEventEntry_,
1129  lumi.lastEventEntry_);
1130  }
1131  stable_sort_all(entries);
1132  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1282
RootTree lumiTree_
Definition: RootFile.h:333
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
EntryNumber const & entries() const
Definition: RootTree.h:135
RunNumber_t run() const
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
Definition: Algorithms.h:103
unsigned int LuminosityBlockNumber_t
LuminosityBlockNumber_t luminosityBlock() const
U second(std::pair< T, U > const &p)
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool next()
Definition: RootTree.h:125
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:336
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1305
RootTree eventTree_
Definition: RootFile.h:332
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
RootTree runTree_
Definition: RootFile.h:334
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
std::vector< EventNumber_t > & unsortedEventNumbers() const
static constexpr EntryNumber_t invalidEntry
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:26
void fillEventHistory()
Definition: RootFile.cc:1226
bool isValid() const
Definition: RootTree.cc:109
unsigned int RunNumber_t
EventAuxiliary eventAux_
Definition: RootFile.h:331
void fillThisEventAuxiliary()
Definition: RootFile.cc:1199
def move(src, dest)
Definition: eostools.py:511
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::fillLumiAuxiliary ( )
private

Definition at line 1282 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1282  {
1283  auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1284  if (fileFormatVersion().newAuxiliary()) {
1285  LuminosityBlockAuxiliary* pLumiAux = lumiAuxiliary.get();
1286  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1287  } else {
1288  LuminosityBlockAux lumiAux;
1289  LuminosityBlockAux* pLumiAux = &lumiAux;
1290  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1291  conversion(lumiAux, *lumiAuxiliary);
1292  }
1293  if (provenanceAdaptor_) {
1294  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1295  }
1296  if (daqProvenanceHelper_) {
1297  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1298  }
1299  if (lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1300  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1301  }
1302  return lumiAuxiliary;
1303  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
RootTree lumiTree_
Definition: RootFile.h:333
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
unsigned int LuminosityBlockNumber_t
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:351
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
unsigned int RunNumber_t
void fillAux(T *&pAux)
Definition: RootTree.h:142
std::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1305 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1305  {
1306  auto runAuxiliary = std::make_shared<RunAuxiliary>();
1307  if (fileFormatVersion().newAuxiliary()) {
1308  RunAuxiliary* pRunAux = runAuxiliary.get();
1309  runTree_.fillAux<RunAuxiliary>(pRunAux);
1310  } else {
1311  RunAux runAux;
1312  RunAux* pRunAux = &runAux;
1313  runTree_.fillAux<RunAux>(pRunAux);
1314  conversion(runAux, *runAuxiliary);
1315  }
1316  if (provenanceAdaptor_) {
1317  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1318  }
1319  if (daqProvenanceHelper_) {
1320  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1321  }
1322  return runAuxiliary;
1323  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:351
RootTree runTree_
Definition: RootFile.h:334
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
void fillAux(T *&pAux)
Definition: RootTree.h:142
void edm::RootFile::fillThisEventAuxiliary ( )
private

Definition at line 1199 of file RootFile.cc.

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

1199  {
1201  // Already read.
1202  return;
1203  }
1204  if (fileFormatVersion().newAuxiliary()) {
1205  EventAuxiliary* pEvAux = &eventAux_;
1206  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1207  } else {
1208  // for backward compatibility.
1209  EventAux eventAux;
1210  EventAux* pEvAux = &eventAux;
1211  eventTree_.fillAux<EventAux>(pEvAux);
1212  conversion(eventAux, eventAux_);
1213  }
1215  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:336
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
RootTree eventTree_
Definition: RootFile.h:332
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:331
void fillAux(T *&pAux)
Definition: RootTree.h:142
IndexIntoFile::EntryType edm::RootFile::getNextItemType ( RunNumber_t run,
LuminosityBlockNumber_t lumi,
EventNumber_t event 
)

Definition at line 798 of file RootFile.cc.

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(), processingMode_, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, edm::InputSource::Runs, edm::InputSource::RunsAndLumis, and skipThisEntry().

800  {
801  // First, account for consecutive skipped entries.
802  while (skipThisEntry()) {
807  } else {
809  }
810  }
811  // OK, we have an entry that is not skipped.
813  if (entryType == IndexIntoFile::kEnd) {
814  return IndexIntoFile::kEnd;
815  }
816  if (entryType == IndexIntoFile::kRun) {
818  runHelper_->checkForNewRun(run);
819  return IndexIntoFile::kRun;
820  } else if (processingMode_ == InputSource::Runs) {
822  return getNextItemType(run, lumi, event);
823  }
824  if (entryType == IndexIntoFile::kLumi) {
827  return IndexIntoFile::kLumi;
830  return getNextItemType(run, lumi, event);
831  }
832  if (isDuplicateEvent()) {
834  return getNextItemType(run, lumi, event);
835  }
839  event = eventAux_.event();
840  return IndexIntoFile::kEvent;
841  }
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:342
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
bool skipThisEntry()
Definition: RootFile.cc:743
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:798
bool isDuplicateEvent()
Definition: RootFile.cc:781
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
EventAuxiliary eventAux_
Definition: RootFile.h:331
EventNumber_t event() const
Definition: event.py:1
bool edm::RootFile::goToEvent ( EventID const &  eventID)

Definition at line 1381 of file RootFile.cc.

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

1381  {
1383 
1384  if (duplicateChecker_) {
1385  duplicateChecker_->disable();
1386  }
1387 
1389  if (noEventSort_)
1391 
1392  IndexIntoFile::IndexIntoFileItr iter =
1394 
1395  if (iter == indexIntoFile_.end(sortOrder)) {
1396  return false;
1397  }
1398  indexIntoFileIter_ = iter;
1399  return true;
1400  }
RunNumber_t run() const
Definition: EventID.h:39
EventID const & eventID() const
Definition: RootFile.h:215
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
bool noEventSort_
Definition: RootFile.h:327
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 221 of file RootFile.h.

Referenced by createFileBlock().

221 { return hasNewlyDroppedBranch_; }
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:329
IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileIter ( ) const

Definition at line 732 of file RootFile.cc.

References indexIntoFileIter_.

732 { return indexIntoFileIter_; }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
std::shared_ptr<IndexIntoFile const> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 252 of file RootFile.h.

References edm::get_underlying_safe().

252  {
254  }
edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:316
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<IndexIntoFile>& edm::RootFile::indexIntoFileSharedPtr ( )
inline

Definition at line 255 of file RootFile.h.

References edm::get_underlying_safe(), and position.

edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:316
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
void edm::RootFile::initAssociationsFromSecondary ( std::vector< BranchID > const &  associationsFromSecondary)

Definition at line 738 of file RootFile.cc.

References fileThinnedAssociationsHelper_, and thinnedAssociationsHelper_.

738  {
739  thinnedAssociationsHelper_->initAssociationsFromSecondary(associationsFromSecondary,
741  }
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:340
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: RootFile.h:341
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 1663 of file RootFile.cc.

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

Referenced by RootFile().

1665  {
1666  if (duplicateChecker_ && !duplicateChecker_->checkDisabled()) {
1667  if (eventTree_.next()) {
1669  duplicateChecker_->inputFileOpened(
1670  eventAux().isRealData(), indexIntoFile_, indexesIntoFiles, currentIndexIntoFile);
1671  }
1673  }
1674  }
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
bool next()
Definition: RootTree.h:125
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
RootTree eventTree_
Definition: RootFile.h:332
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
static constexpr EntryNumber_t invalidEntry
void fillThisEventAuxiliary()
Definition: RootFile.cc:1199
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
bool edm::RootFile::isDuplicateEvent ( )
private

Definition at line 781 of file RootFile.cc.

References duplicateChecker_, edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::EventID::event(), eventAux_, file_, fillEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), edm::EventAuxiliary::id(), indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), and edm::IndexIntoFile::IndexIntoFileItr::run().

Referenced by getNextItemType().

781  {
783  if (duplicateChecker_.get() == nullptr) {
784  return false;
785  }
787  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
790  eventAux_.id().event(),
791  file_);
792  }
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:331
std::string const file_
Definition: RootFile.h:308
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 217 of file RootFile.h.

217 { return lumiTree_; }
RootTree lumiTree_
Definition: RootFile.h:333
std::shared_ptr< ProductProvenanceRetriever > edm::RootFile::makeProductProvenanceRetriever ( unsigned int  iStreamIndex)
private

Definition at line 1830 of file RootFile.cc.

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

Referenced by readCurrentEvent().

1830  {
1831  if (eventProductProvenanceRetrievers_.size() <= iStreamID) {
1832  eventProductProvenanceRetrievers_.resize(iStreamID + 1);
1833  }
1834  if (!eventProductProvenanceRetrievers_[iStreamID]) {
1835  // propagate_const<T> has no reset() function
1836  eventProductProvenanceRetrievers_[iStreamID] = std::make_shared<ProductProvenanceRetriever>(
1838  }
1839  eventProductProvenanceRetrievers_[iStreamID]->reset();
1840  return eventProductProvenanceRetriever(iStreamID);
1841  }
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
Definition: RootFile.h:301
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:353
RootTree eventTree_
Definition: RootFile.h:332
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
Definition: RootFile.h:352
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 1814 of file RootFile.cc.

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

Referenced by RootFile().

1814  {
1816  readParentageTree(inputType);
1817  return std::make_unique<MakeReducedProvenanceReader>(parentageIDLookup_);
1818  } else if (fileFormatVersion_.splitProductIDs()) {
1819  readParentageTree(inputType);
1820  return std::make_unique<MakeFullProvenanceReader>();
1821  } else if (fileFormatVersion_.perEventProductIDs()) {
1822  auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1823  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1824  return std::make_unique<MakeOldProvenanceReader>(std::move(entryDescriptionMap));
1825  } else {
1826  return std::make_unique<MakeDummyProvenanceReader>();
1827  }
1828  }
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:583
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:314
void readParentageTree(InputType inputType)
Definition: RootFile.cc:629
bool storedProductProvenanceUsed() const
bool perEventProductIDs() const
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:354
def move(src, dest)
Definition: eostools.py:511
void edm::RootFile::markBranchToBeDropped ( bool  dropDescendants,
BranchDescription const &  branch,
std::set< BranchID > &  branchesToDrop,
std::map< BranchID, BranchID > const &  droppedToKeptAlias 
) const
private

Definition at line 1676 of file RootFile.cc.

References branchChildren_, and edm::BranchDescription::branchID().

Referenced by dropOnInput().

1679  {
1680  if (dropDescendants) {
1681  branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1682  } else {
1683  branchesToDrop.insert(branch.branchID());
1684  }
1685  }
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:349
bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 223 of file RootFile.h.

Referenced by createFileBlock().

223 { return daqProvenanceHelper_.get() != nullptr; }
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
std::string const & edm::RootFile::newBranchToOldBranch ( std::string const &  newBranch) const
private

Definition at line 724 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

724  {
725  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
726  if (it != newBranchToOldBranch_.end()) {
727  return it->second;
728  }
729  return newBranch;
730  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:344
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 246 of file RootFile.h.

246 { return eventTree_.nextWithCache(); }
RootTree eventTree_
Definition: RootFile.h:332
bool nextWithCache()
Definition: RootTree.cc:193
RootFile& edm::RootFile::operator= ( RootFile const &  )
delete
std::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 210 of file RootFile.h.

Referenced by RootFile().

210 { return productRegistry_; }
std::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:337
bool edm::RootFile::readCurrentEvent ( EventPrincipal cache)

Definition at line 1438 of file RootFile.cc.

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

1438  {
1439  if (!eventTree_.current()) {
1440  return false;
1441  }
1443  if (!fileFormatVersion().lumiInEventID()) {
1444  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1445  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1447  }
1448  fillEventHistory();
1449  runHelper_->overrideRunNumber(eventAux_.id(), eventAux().isRealData());
1450 
1451  // We're not done ... so prepare the EventPrincipal
1452  eventTree_.insertEntryForIndex(principal.transitionIndex());
1453  principal.fillEventPrincipal(eventAux(),
1457  *(makeProductProvenanceRetriever(principal.streamID().value())),
1459 
1460  // report event read from file
1461  filePtr_->eventReadFromFile();
1462  return true;
1463  }
bool isRealData() const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
bool current() const
Definition: RootTree.h:128
def principal(options)
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:104
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:122
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:346
RootTree eventTree_
Definition: RootFile.h:332
BranchListIndexes branchListIndexes_
Definition: RootFile.h:347
LuminosityBlockNumber_t oldLuminosityBlock() const
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
void fillEventHistory()
Definition: RootFile.cc:1226
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:1830
EventID const & id() const
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
EventAuxiliary eventAux_
Definition: RootFile.h:331
void fillThisEventAuxiliary()
Definition: RootFile.cc:1199
def move(src, dest)
Definition: eostools.py:511
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

Definition at line 583 of file RootFile.cc.

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::Parentage::id(), edm::ParentageRegistry::insertMapped(), edm::ParentageRegistry::instance(), edm::numEntries(), parents, edm::EventEntryDescription::parents(), edm::Parentage::parentsForUpdate(), PhysicsTools::registry, edm::SecondarySource, and edm::Parentage::setParents().

Referenced by makeProvenanceReaderMaker().

583  {
584  // Called only for old format files.
585  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
586  std::unique_ptr<TTree> entryDescriptionTree(
587  dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
588  if (nullptr == entryDescriptionTree.get()) {
590  << "Could not find tree " << poolNames::entryDescriptionTreeName() << " in the input file.\n";
591  }
592 
593  EntryDescriptionID idBuffer;
594  EntryDescriptionID* pidBuffer = &idBuffer;
595  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
596 
597  EventEntryDescription entryDescriptionBuffer;
598  EventEntryDescription* pEntryDescriptionBuffer = &entryDescriptionBuffer;
599  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
600 
601  // Fill in the parentage registry.
602  ParentageRegistry& registry = *ParentageRegistry::instance();
603 
604  for (Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
605  roottree::getEntry(entryDescriptionTree.get(), i);
606  if (idBuffer != entryDescriptionBuffer.id()) {
607  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
608  }
609  entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.id(), entryDescriptionBuffer));
610  Parentage parents;
611  parents.setParents(entryDescriptionBuffer.parents());
612  if (daqProvenanceHelper_) {
613  ParentageID const oldID = parents.id();
614  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
615  ParentageID newID = parents.id();
616  if (newID != oldID) {
617  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
618  }
619  }
620  // For thread safety, don't update global registries when a secondary source opens a file.
621  if (inputType != InputType::SecondarySource) {
622  registry.insertMapped(parents);
623  }
624  }
625  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
626  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
627  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
TPRegexp parents
Definition: eve_filter.cc:21
std::string const & entryDescriptionBranchName()
Definition: BranchType.cc:155
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
Hash< EntryDescriptionType > EntryDescriptionID
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:147
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:151
static Interceptor::Registry registry("Interceptor")
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
void edm::RootFile::readEvent ( EventPrincipal cache)

Definition at line 1414 of file RootFile.cc.

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

1414  {
1417  // read the event auxiliary if not alrady read.
1419 
1420  // read the event
1422 
1423  runHelper_->checkRunConsistency(eventAux().run(), indexIntoFileIter_.run());
1424  runHelper_->checkLumiConsistency(eventAux().luminosityBlock(), indexIntoFileIter_.lumi());
1425 
1426  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1427  // The IndexIntoFile should guarantee that it never fails.
1429  ? *daqProvenanceHelper_->oldProcessHistoryID()
1430  : eventAux().processHistoryID());
1431  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1433 
1435  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t lumi() const
bool readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1438
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
def principal(options)
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
bool useReducedProcessHistoryID() const
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1652 of file RootFile.cc.

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

Referenced by RootFile().

1652  {
1653  // Read in the event history tree, if we have one...
1654  if (fileFormatVersion().eventHistoryTree()) {
1655  history_ = std::make_unique<History>(); // propagate_const<T> has no reset() function
1656  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1657  if (!eventHistoryTree_) {
1658  throw Exception(errors::EventCorruption) << "Failed to find the event history tree.\n";
1659  }
1660  }
1661  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:348
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:345
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:274
void edm::RootFile::readFakeRun_ ( RunPrincipal runPrincipal)
std::shared_ptr<RunAuxiliary> edm::RootFile::readFakeRunAuxiliary_ ( )
void edm::RootFile::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)

Definition at line 1595 of file RootFile.cc.

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

1595  {
1598  // Begin code for backward compatibility before the existence of lumi trees.
1599  if (!lumiTree_.isValid()) {
1601  return;
1602  }
1603  // End code for backward compatibility before the existence of lumi trees.
1605  // NOTE: we use 0 for the index since do not do delayed reads for LuminosityBlockPrincipals
1607  lumiPrincipal.fillLuminosityBlockPrincipal(*processHistoryRegistry_, lumiTree_.resetAndGetRootDelayedReader());
1608  // Read in all the products now.
1609  lumiPrincipal.readAllFromSourceAndMergeImmediately();
1611  }
RootTree lumiTree_
Definition: RootFile.h:333
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:104
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:122
bool isValid() const
Definition: RootTree.cc:109
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1557 of file RootFile.cc.

References 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(), edm::LuminosityBlockID::luminosityBlock(), lumiTree_, edm::LuminosityBlockID::run(), edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, savedRunAuxiliary_, edm::RootTree::setEntryNumber(), edm::EventAuxiliary::time(), and ntuplemaker::time.

1557  {
1560  // Begin code for backward compatibility before the existence of lumi trees.
1561  if (!lumiTree_.isValid()) {
1563  assert(eventEntry != IndexIntoFile::invalidEntry);
1564  assert(eventTree_.current(eventEntry));
1565  fillEventAuxiliary(eventEntry);
1566 
1567  LuminosityBlockID lumi = LuminosityBlockID(indexIntoFileIter_.run(), indexIntoFileIter_.lumi());
1568  runHelper_->overrideRunNumber(lumi);
1569  return std::make_shared<LuminosityBlockAuxiliary>(
1570  lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp());
1571  }
1572  // End code for backward compatibility before the existence of lumi trees.
1574  std::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1575  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1576  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1577  runHelper_->overrideRunNumber(lumiAuxiliary->id());
1578  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1579  if (lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1581  if (eventEntry != IndexIntoFile::invalidEntry) {
1582  assert(eventTree_.current(eventEntry));
1583  fillEventAuxiliary(eventEntry);
1584 
1585  lumiAuxiliary->setBeginTime(eventAux().time());
1586  }
1587  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1588  }
1589  if (!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1590  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1591  }
1592  return lumiAuxiliary;
1593  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1282
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
RootTree lumiTree_
Definition: RootFile.h:333
Timestamp const & time() const
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:325
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
bool current() const
Definition: RootTree.h:128
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
RootTree eventTree_
Definition: RootFile.h:332
static constexpr EntryNumber_t invalidEntry
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
bool isValid() const
Definition: RootTree.cc:109
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
void edm::RootFile::readParentageTree ( InputType  inputType)
private

Definition at line 629 of file RootFile.cc.

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

Referenced by makeProvenanceReaderMaker().

629  {
630  // New format file
631  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
632  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
633  if (nullptr == parentageTree.get()) {
635  << "Could not find tree " << poolNames::parentageTreeName() << " in the input file.\n";
636  }
637 
638  Parentage parents;
639  Parentage* pParentageBuffer = &parents;
640  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
641 
642  ParentageRegistry& registry = *ParentageRegistry::instance();
643 
644  parentageIDLookup_.reserve(parentageTree->GetEntries());
645  for (Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
646  roottree::getEntry(parentageTree.get(), i);
647  if (daqProvenanceHelper_) {
648  ParentageID const oldID = parents.id();
649  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
650  ParentageID newID = parents.id();
651  if (newID != oldID) {
652  daqProvenanceHelper_->setOldParentageIDToNew(oldID, newID);
653  }
654  }
655  // For thread safety, don't update global registries when a secondary source opens a file.
656  if (inputType != InputType::SecondarySource) {
657  registry.insertMapped(parents);
658  }
659  parentageIDLookup_.push_back(parents.id());
660  }
661  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
662  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:495
TPRegexp parents
Definition: eve_filter.cc:21
std::string const & parentageTreeName()
Definition: BranchType.cc:160
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
std::string const & parentageBranchName()
Definition: BranchType.cc:164
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:354
static Interceptor::Registry registry("Interceptor")
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
void edm::RootFile::readRun_ ( RunPrincipal runPrincipal)

Definition at line 1530 of file RootFile.cc.

References 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_.

1530  {
1531  MergeableRunProductMetadata* mergeableRunProductMetadata = nullptr;
1532  if (inputType_ == InputType::Primary) {
1533  mergeableRunProductMetadata = runPrincipal.mergeableRunProductMetadata();
1534  RootTree::EntryNumber const& entryNumber = runTree_.entryNumber();
1535  assert(entryNumber >= 0);
1536  mergeableRunProductMetadata->readRun(
1537  entryNumber, *storedMergeableRunProductMetadata_, IndexIntoFileItrHolder(indexIntoFileIter_));
1538  }
1539 
1540  if (!runHelper_->fakeNewRun()) {
1544  }
1545  // Begin code for backward compatibility before the existence of run trees.
1546  if (!runTree_.isValid()) {
1547  return;
1548  }
1549  // End code for backward compatibility before the existence of run trees.
1550  // NOTE: we use 0 for the index since do not do delayed reads for RunPrincipals
1552  runPrincipal.fillRunPrincipal(*processHistoryRegistry_, runTree_.resetAndGetRootDelayedReader());
1553  // Read in all the products now.
1554  runPrincipal.readAllFromSourceAndMergeImmediately(mergeableRunProductMetadata);
1555  }
InputType inputType_
Definition: RootFile.h:357
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
Definition: RootFile.h:322
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:104
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:122
RootTree runTree_
Definition: RootFile.h:334
EntryNumber const & entryNumber() const
Definition: RootTree.h:133
bool isValid() const
Definition: RootTree.cc:109
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
roottree::EntryNumber EntryNumber
Definition: RootTree.h:104
std::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

Definition at line 1467 of file RootFile.cc.

References 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::RunID::run(), edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, runTree_, savedRunAuxiliary(), savedRunAuxiliary_, edm::RootTree::setEntryNumber(), edm::EventAuxiliary::time(), and ntuplemaker::time.

1467  {
1468  if (runHelper_->fakeNewRun()) {
1469  runHelper_->overrideRunNumber(savedRunAuxiliary_->id());
1470  return savedRunAuxiliary();
1471  }
1474 
1475  // Begin code for backward compatibility before the existence of run trees.
1476  if (!runTree_.isValid()) {
1477  // prior to the support of run trees.
1478  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1480  assert(eventEntry != IndexIntoFile::invalidEntry);
1481  assert(eventTree_.current(eventEntry));
1482  fillEventAuxiliary(eventEntry);
1483 
1484  RunID run = RunID(indexIntoFileIter_.run());
1485  runHelper_->overrideRunNumber(run);
1486  savedRunAuxiliary_ = std::make_shared<RunAuxiliary>(run.run(), eventAux().time(), Timestamp::invalidTimestamp());
1487  return savedRunAuxiliary();
1488  }
1489  // End code for backward compatibility before the existence of run trees.
1491  std::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1492  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1493  runHelper_->overrideRunNumber(runAuxiliary->id());
1494  filePtr_->reportInputRunNumber(runAuxiliary->run());
1495  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1496  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1497  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1498  }
1499 
1500  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1501  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1502  // we attempt to read the first event in the run to get appropriate info.
1503  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1506  // If we have a valid event, use its information.
1507  if (eventEntry != IndexIntoFile::invalidEntry) {
1508  assert(eventTree_.current(eventEntry));
1509  fillEventAuxiliary(eventEntry);
1510 
1511  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1512  if (runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1513  runAuxiliary->setBeginTime(eventAux().time());
1514  }
1515 
1516  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1517  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1518  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1519  // and event ProcessHistory's always be the same if no file merging occurs).
1520  if (!fileFormatVersion().processHistorySameWithinRun()) {
1521  fillEventHistory();
1522  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1523  }
1524  }
1525  }
1526  savedRunAuxiliary_ = runAuxiliary;
1527  return runAuxiliary;
1528  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
Timestamp const & time() const
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:325
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
bool current() const
Definition: RootTree.h:128
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
EventAuxiliary const & eventAux() const
Definition: RootFile.h:211
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1305
RootTree eventTree_
Definition: RootFile.h:332
RootTree runTree_
Definition: RootFile.h:334
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
Definition: RootFile.h:295
static constexpr EntryNumber_t invalidEntry
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
bool processHistorySameWithinRun() const
void fillEventHistory()
Definition: RootFile.cc:1226
bool isValid() const
Definition: RootTree.cc:109
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:343
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1181 of file RootFile.cc.

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

1181  {
1182  // Report file opened.
1183  std::string const label = "source";
1184  std::string moduleName = "PoolSource";
1185  filePtr_->inputFileOpened(logicalFile_, inputType, moduleName, label, fid_.fid(), eventTree_.branchNames());
1186  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:138
char const * label
FileID fid_
Definition: RootFile.h:315
std::string const logicalFile_
Definition: RootFile.h:309
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:332
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:312
void edm::RootFile::rewind ( )
inline

Definition at line 235 of file RootFile.h.

235  {
237  eventTree_.rewind();
238  lumiTree_.rewind();
239  runTree_.rewind();
240  }
RootTree lumiTree_
Definition: RootFile.h:333
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
RootTree eventTree_
Definition: RootFile.h:332
RootTree runTree_
Definition: RootFile.h:334
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:319
void rewind()
Definition: RootTree.h:130
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 218 of file RootFile.h.

Referenced by validateFile().

218 { return runTree_; }
RootTree runTree_
Definition: RootFile.h:334
std::shared_ptr<RunAuxiliary const> edm::RootFile::savedRunAuxiliary ( ) const
inlineprivate

Definition at line 295 of file RootFile.h.

References edm::get_underlying_safe().

Referenced by readRunAuxiliary_().

edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:325
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
std::shared_ptr<RunAuxiliary>& edm::RootFile::savedRunAuxiliary ( )
inlineprivate

Definition at line 296 of file RootFile.h.

References edm::get_underlying_safe().

edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:325
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
void edm::RootFile::setAtEventEntry ( IndexIntoFile::EntryNumber_t  entry)

Definition at line 1465 of file RootFile.cc.

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

RootTree eventTree_
Definition: RootFile.h:332
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

Definition at line 1613 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventTree_, edm::IndexIntoFile::findEventPosition(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, and edm::RootTree::setEntryNumber().

1613  {
1616  return false;
1618  return true;
1619  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
RootTree eventTree_
Definition: RootFile.h:332
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: event.py:1
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 225 of file RootFile.h.

References mps_splice::entry, and writedatasetfile::run.

225  {
227  }
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1629
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1621
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: RootFile.cc:1613
Definition: event.py:1
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1621 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::IndexIntoFile::findLumiPosition(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, lumiTree_, and edm::RootTree::setEntryNumber().

1621  {
1624  return false;
1626  return true;
1627  }
RootTree lumiTree_
Definition: RootFile.h:333
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1637 of file RootFile.cc.

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

1637  {
1640  }
1643  return false;
1644  if (run != indexIntoFileIter_.run())
1645  return false;
1646  if (lumi != indexIntoFileIter_.lumi())
1647  return false;
1649  return true;
1650  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1629 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::IndexIntoFile::findRunPosition(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, runTree_, and edm::RootTree::setEntryNumber().

1629  {
1632  return false;
1634  return true;
1635  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
RootTree runTree_
Definition: RootFile.h:334
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:201
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

Definition at line 664 of file RootFile.cc.

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

664  {
665  if (fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
666  //we must avoid copying the old branch which stored the per product per event provenance
668  return;
669  }
670  if (!fileFormatVersion().splitProductIDs()) {
672  return;
673  }
676  return;
677  }
678  // Find entry for first event in file
679  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
680  while (it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
681  ++it;
682  }
683  if (it == indexIntoFileEnd_) {
685  return;
686  }
687 
688  // From here on, record all reasons we can't fast clone.
689  IndexIntoFile::SortOrder sortOrder =
693  }
694  if (skipAnyEvents_) {
696  }
697  if (remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
699  }
700  if (remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
702  }
703  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
705  }
706  }
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
int whyNotFastClonable_
Definition: RootFile.h:328
RootTree lumiTree_
Definition: RootFile.h:333
EntryNumber const & entries() const
Definition: RootTree.h:135
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:342
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
bool noEventSort_
Definition: RootFile.h:327
bool skipAnyEvents_
Definition: RootFile.h:326
RootTree eventTree_
Definition: RootFile.h:332
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:319
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 734 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::copyPosition(), and indexIntoFileIter_.

734  {
736  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
static int position[264][3]
Definition: ReadPGInfo.cc:509
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 1808 of file RootFile.cc.

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

1810  {
1811  eventTree_.setSignals(preEventReadSource, postEventReadSource);
1812  }
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
Definition: RootTree.cc:488
RootTree eventTree_
Definition: RootFile.h:332
void edm::RootFile::setToLastEntry ( )
inline

Definition at line 241 of file RootFile.h.

IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
bool edm::RootFile::skipEntries ( unsigned int &  offset)
inline
bool edm::RootFile::skipEvents ( int &  offset)

Definition at line 1325 of file RootFile.cc.

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, PFRecoTauDiscriminationByIsolation_cfi::offset, edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward(), and edm::IndexIntoFile::IndexIntoFileItr::skipEventForward().

1325  {
1326  while (offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1327  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1328  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1331 
1333  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, skippedEventEntry);
1334 
1335  // At the end of the file and there were no more events to skip
1336  if (skippedEventEntry == IndexIntoFile::invalidEntry)
1337  break;
1338 
1339  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1340  fillEventAuxiliary(skippedEventEntry);
1341  if (eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1342  continue;
1343  }
1344  }
1345  if (duplicateChecker_ && !duplicateChecker_->checkDisabled() && !duplicateChecker_->noDuplicatesInFile()) {
1346  fillEventAuxiliary(skippedEventEntry);
1347  if (duplicateChecker_->isDuplicateAndCheckActive(
1348  phIndexOfSkippedEvent, runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event(), file_)) {
1349  continue;
1350  }
1351  }
1352  --offset;
1353  }
1354 
1355  while (offset < 0) {
1356  if (duplicateChecker_) {
1357  duplicateChecker_->disable();
1358  }
1359 
1360  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1364 
1365  indexIntoFileIter_.skipEventBackward(phIndexOfEvent, runOfEvent, lumiOfEvent, eventEntry);
1366 
1367  if (eventEntry == IndexIntoFile::invalidEntry)
1368  break;
1369 
1370  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1371  fillEventAuxiliary(eventEntry);
1372  if (eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1373  continue;
1374  }
1375  }
1376  ++offset;
1377  }
1379  }
EventNumber_t event() const
Definition: EventID.h:41
static constexpr int invalidIndex
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:313
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
unsigned int LuminosityBlockNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
static constexpr RunNumber_t invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
static constexpr EntryNumber_t invalidEntry
static constexpr LuminosityBlockNumber_t invalidLumi
EventID const & id() const
unsigned int RunNumber_t
EventAuxiliary eventAux_
Definition: RootFile.h:331
std::string const file_
Definition: RootFile.h:308
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
bool edm::RootFile::skipThisEntry ( )
private

Definition at line 743 of file RootFile.cc.

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

743  {
745  return false;
746  }
747  if (eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
748  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
750  return true;
751  }
752 
753  // The Lumi is not skipped. If this is an event, see if the event is skipped.
757  return true;
758  }
759  }
760 
761  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
763  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
764 
765  // There are no lumis in this run, not even ones we will skip
766  if (iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
767  return true;
768  }
769  // If we get here there are lumis in the run, check to see if we are skipping all of them
770  do {
771  if (!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
772  return false;
773  }
774  } while (iterLumi.skipLumiInRun());
775  return true;
776  }
777  }
778  return false;
779  }
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:313
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1217
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:320
static constexpr LuminosityBlockNumber_t invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:331
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 267 of file RootFile.h.

References MicroEventContent_cff::branch, cmsCodeRulesChecker::rules, and AlCaHLTBitMon_QueryRunRegistry::string.

267 { return treePointers_; }
RootTreePtrArray treePointers_
Definition: RootFile.h:335
void edm::RootFile::validateFile ( InputType  inputType,
bool  usingGoToEvent 
)
private

Definition at line 1134 of file RootFile.cc.

References edm::createGlobalIdentifier(), daqProvenanceHelper_, duplicateChecker_, edm::IndexIntoFile::empty(), edm::RootTree::entries(), edm::errors::EventCorruption, eventTree_, Exception, fid_, fileFormatVersion(), 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(), and edm::FileFormatVersion::useReducedProcessHistoryID().

Referenced by RootFile().

1134  {
1135  if (!fid_.isValid()) {
1136  fid_ = FileID(createGlobalIdentifier());
1137  }
1138  if (!eventTree_.isValid()) {
1139  throw Exception(errors::EventCorruption) << "'Events' tree is corrupted or not present\n"
1140  << "in the input file.\n";
1141  }
1142 
1143  if (fileFormatVersion().hasIndexIntoFile()) {
1144  if (runTree().entries() > 0) {
1145  assert(!indexIntoFile_.empty());
1146  }
1148  if (daqProvenanceHelper_) {
1149  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1150  for (auto& phid : phidVec) {
1151  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1152  }
1153  }
1155  }
1156  } else {
1157  assert(indexIntoFile_.empty());
1159  }
1160 
1164  std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(eventTree_)));
1165  // We fill the event numbers explicitly if we need to find events in closed files,
1166  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1167  bool needEventNumbers = false;
1168  bool needIndexesForDuplicateChecker =
1169  duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1170  if (inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1171  needEventNumbers = true;
1172  }
1173  bool needEventEntries = false;
1174  if (inputType != InputType::Primary || !noEventSort_) {
1175  // We need event entries for sorting or for secondary files or sources.
1176  needEventEntries = true;
1177  }
1178  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1179  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
void setEventFinder(std::shared_ptr< EventFinder > ptr) const
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:350
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:219
bool empty() const
True if no runs, lumis, or events are in the file.
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:311
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:355
EntryNumber const & entries() const
Definition: RootTree.h:135
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
FileID fid_
Definition: RootFile.h:315
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool noEventSort_
Definition: RootFile.h:327
RootTree const & runTree() const
Definition: RootFile.h:218
RootTree eventTree_
Definition: RootFile.h:332
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:317
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:109
void fillIndexIntoFile()
Definition: RootFile.cc:910
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:318
void setNumberOfEvents(EntryNumber_t nevents) const
bool useReducedProcessHistoryID() const
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 849 of file RootFile.cc.

References a, b, mps_splice::entry, indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, csvLumiCalc::lumi, writedatasetfile::run, and edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward().

849  {
850  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
851  int phIndex;
854  IndexIntoFile::EntryNumber_t eventEntry;
855  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
856  itr.skipEventBackward(phIndex, run, lumi, eventEntry);
857  return eventEntry == IndexIntoFile::invalidEntry;
858  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
unsigned int LuminosityBlockNumber_t
long long EntryNumber_t
static constexpr EntryNumber_t invalidEntry
unsigned int RunNumber_t
bool edm::RootFile::wasLastEventJustRead ( ) const

Definition at line 843 of file RootFile.cc.

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

843  {
844  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
845  itr.advanceToEvent();
846  return itr.getEntryType() == IndexIntoFile::kEnd;
847  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:321
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 220 of file RootFile.h.

Referenced by createFileBlock().

220 { return whyNotFastClonable_; }
int whyNotFastClonable_
Definition: RootFile.h:328

Member Data Documentation

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

Definition at line 349 of file RootFile.h.

Referenced by markBranchToBeDropped(), and RootFile().

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

Definition at line 339 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 338 of file RootFile.h.

Referenced by RootFile().

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 347 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 330 of file RootFile.h.

Referenced by RootFile().

edm::propagate_const<std::unique_ptr<DaqProvenanceHelper> > edm::RootFile::daqProvenanceHelper_
private
edm::propagate_const<std::shared_ptr<DuplicateChecker> > edm::RootFile::duplicateChecker_
private
edm::propagate_const<TClass*> edm::RootFile::edProductClass_
private

Definition at line 356 of file RootFile.h.

Referenced by dropOnInput().

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

Definition at line 345 of file RootFile.h.

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

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

Definition at line 323 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 324 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 353 of file RootFile.h.

Referenced by makeProductProvenanceRetriever().

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 346 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

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

Definition at line 313 of file RootFile.h.

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

RootTree edm::RootFile::eventTree_
private
FileID edm::RootFile::fid_
private

Definition at line 315 of file RootFile.h.

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

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

Definition at line 308 of file RootFile.h.

Referenced by createFileBlock(), dropOnInput(), isDuplicateEvent(), and skipEvents().

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 314 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and RootFile().

edm::propagate_const<std::shared_ptr<InputFile> > edm::RootFile::filePtr_
private
edm::propagate_const<std::unique_ptr<ThinnedAssociationsHelper> > edm::RootFile::fileThinnedAssociationsHelper_
private

Definition at line 340 of file RootFile.h.

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

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

Definition at line 329 of file RootFile.h.

Referenced by dropOnInput(), and RootFile().

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

Definition at line 348 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

IndexIntoFile& edm::RootFile::indexIntoFile_
private
IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileBegin_
private

Definition at line 319 of file RootFile.h.

Referenced by RootFile(), and setIfFastClonable().

IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileEnd_
private
IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileIter_
private
edm::propagate_const<std::shared_ptr<IndexIntoFile> > edm::RootFile::indexIntoFileSharedPtr_
private

Definition at line 316 of file RootFile.h.

InputType edm::RootFile::inputType_
private

Definition at line 357 of file RootFile.h.

Referenced by readRun_().

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

Definition at line 336 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

Definition at line 309 of file RootFile.h.

Referenced by reportOpened().

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

Definition at line 344 of file RootFile.h.

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 327 of file RootFile.h.

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

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

Definition at line 318 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 354 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 310 of file RootFile.h.

edm::propagate_const<ProcessHistoryRegistry*> edm::RootFile::processHistoryRegistry_
private
InputSource::ProcessingMode edm::RootFile::processingMode_
private

Definition at line 342 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

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

Definition at line 337 of file RootFile.h.

Referenced by RootFile().

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

Definition at line 351 of file RootFile.h.

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

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

Definition at line 352 of file RootFile.h.

Referenced by makeProductProvenanceRetriever(), and RootFile().

edm::propagate_const<RunHelperBase*> edm::RootFile::runHelper_
private
RootTree edm::RootFile::runTree_
private
edm::propagate_const<std::shared_ptr<RunAuxiliary> > edm::RootFile::savedRunAuxiliary_
private

Definition at line 325 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 326 of file RootFile.h.

Referenced by setIfFastClonable().

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

Definition at line 322 of file RootFile.h.

Referenced by readRun_(), and RootFile().

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

Definition at line 341 of file RootFile.h.

Referenced by initAssociationsFromSecondary().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 335 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 328 of file RootFile.h.

Referenced by RootFile(), and setIfFastClonable().