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

Member Typedef Documentation

Definition at line 64 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 132 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_.

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

115  : RootFile(
116  fileName, processConfiguration, logicalFileName, filePtr,
117  nullptr, false, -1, -1, nStreams, 0U, treeMaxVirtualSize,
118  processingMode, runHelper,
119  false, productSelectorRules, inputType, branchIDListHelper,
120  thinnedAssociationsHelper, associationsFromSecondary,
121  nullptr, dropDescendantsOfDroppedProducts, processHistoryRegistry,
122  indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
123  bypassVersionCheck, labelRawDataLikeMC,
124  false, enablePrefetching) {}
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:208
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:132
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 126 of file RootFile.h.

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

141  : RootFile(
142  fileName, processConfiguration, logicalFileName, filePtr,
143  nullptr, false, -1, -1, nStreams, treeCacheSize, treeMaxVirtualSize,
145  false, productSelectorRules, inputType, nullptr, nullptr,
146  nullptr, nullptr, false, processHistoryRegistry,
147  indexesIntoFiles, currentIndexIntoFile, orderedProcessHistoryIDs,
148  bypassVersionCheck, false,
149  false, 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:132
edm::RootFile::~RootFile ( )

Definition at line 549 of file RootFile.cc.

549  {
550  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 248 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:295
std::shared_ptr<BranchChildren>& edm::RootFile::branchChildren ( )
inlineprivate

Definition at line 249 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:295
std::shared_ptr<BranchIDListHelper const> edm::RootFile::branchIDListHelper ( ) const
inline

Definition at line 208 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:285
std::shared_ptr<BranchIDListHelper>& edm::RootFile::branchIDListHelper ( )
inline

Definition at line 209 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:285
bool edm::RootFile::branchListIndexesUnchanged ( ) const
inline

Definition at line 180 of file RootFile.h.

Referenced by createFileBlock().

bool branchListIndexesUnchanged_
Definition: RootFile.h:276
void edm::RootFile::close ( void  )

Definition at line 1184 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().

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

Definition at line 777 of file RootFile.cc.

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

777  {
779  }
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
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 681 of file RootFile.cc.

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

681  {
682  return std::make_unique<FileBlock>(fileFormatVersion(),
683  eventTree_.tree(),
685  lumiTree_.tree(),
687  runTree_.tree(),
688  runTree_.metaTree(),
691  file_,
693  modifiedIDs(),
694  branchChildren());
695  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
bool branchListIndexesUnchanged() const
Definition: RootFile.h:180
RootTree lumiTree_
Definition: RootFile.h:279
TTree const * metaTree() const
Definition: RootTree.h:180
TTree const * tree() const
Definition: RootTree.h:178
bool modifiedIDs() const
Definition: RootFile.h:181
int whyNotFastClonable() const
Definition: RootFile.h:178
RootTree eventTree_
Definition: RootFile.h:278
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:179
RootTree runTree_
Definition: RootFile.h:280
std::shared_ptr< BranchChildren const > branchChildren() const
Definition: RootFile.h:248
std::string const file_
Definition: RootFile.h:254
void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType 
)
private

Definition at line 1715 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().

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

Definition at line 173 of file RootFile.h.

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

Definition at line 251 of file RootFile.h.

References edm::get_underlying_safe().

Referenced by makeProductProvenanceRetriever().

std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:299
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 252 of file RootFile.h.

References edm::get_underlying_safe().

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

Definition at line 174 of file RootFile.h.

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

Definition at line 167 of file RootFile.h.

Referenced by RootFile().

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

Definition at line 1215 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().

1215  {
1216  if(!eventTree_.current(entry)) {
1217  return false;
1218  }
1221  return true;
1222  }
bool current() const
Definition: RootTree.h:126
RootTree eventTree_
Definition: RootFile.h:278
void fillThisEventAuxiliary()
Definition: RootFile.cc:1196
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
void edm::RootFile::fillEventHistory ( )
private

Definition at line 1225 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_, findQualityFiles::run, edm::EventAuxiliary::setProcessHistoryID(), edm::FileFormatVersion::splitProductIDs(), edmPickEvents::target, and edm::RootTree::tree().

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

1225  {
1226  // We could consider doing delayed reading, but because we have to
1227  // store this History object in a different tree than the event
1228  // data tree, this is too hard to do in this first version.
1229 
1230  if(fileFormatVersion().eventHistoryBranch()) {
1231  // Lumi block number was not in EventID for the relevant releases.
1232  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1233  if(eventProcessHistoryIter_->eventID() != id) {
1234  EventProcessHistoryID target(id, ProcessHistoryID());
1236  assert(eventProcessHistoryIter_->eventID() == id);
1237  }
1240  } else if(fileFormatVersion().eventHistoryTree()) {
1241  // for backward compatibility.
1242  History* pHistory = history_.get();
1243  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1244  if(!eventHistoryBranch) {
1246  << "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:510
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
Definition: Algorithms.h:91
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:301
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:249
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:270
TTree const * tree() const
Definition: RootTree.h:178
std::vector< BranchListIndex > BranchListIndexes
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:244
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:292
bool eventHistoryTree() const
edm::propagate_const< std::unique_ptr< ProvenanceAdaptor > > provenanceAdaptor_
Definition: RootFile.h:297
RootTree eventTree_
Definition: RootFile.h:278
BranchListIndexes branchListIndexes_
Definition: RootFile.h:293
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:294
EntryNumber const & entryNumber() const
Definition: RootTree.h:131
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:156
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:291
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:253
EventAuxiliary eventAux_
Definition: RootFile.h:277
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
Definition: RootFile.h:285
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:269
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 897 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_, edm::EventAuxiliary::run(), findQualityFiles::run, gather_cfg::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().

897  {
898  // This function is for backward compatibility.
899  // If reading a current format file, indexIntoFile_ is read from the input
900  // file and should always be there. Note that the algorithm below will work
901  // sometimes but often fail with the new format introduced in release 3_8_0.
902  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
903  // probably a separate function should be written to deal with the task.
904  // This is possible just not implemented yet.
905  assert(!fileFormatVersion().hasIndexIntoFile());
906 
907  typedef std::list<LumiItem> LumiList;
908  LumiList lumis; // (declare 1)
909 
910  typedef std::set<LuminosityBlockID> RunLumiSet;
911  RunLumiSet runLumiSet; // (declare 2)
912 
913  typedef std::list<RunItem> RunList;
914  RunList runs; // (declare 5)
915 
916  typedef std::set<RunNumber_t> RunSet;
917  RunSet runSet; // (declare 4)
918 
919  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
920  RunItemSet runItemSet; // (declare 3)
921 
922  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
923  PHIDMap phidMap;
924 
925  RunNumber_t prevRun = 0;
926  LuminosityBlockNumber_t prevLumi = 0;
927  ProcessHistoryID prevPhid;
928  bool iFirst = true;
929 
930  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
932 
933  // First, loop through the event tree.
934  while(eventTree_.next()) {
935  bool newRun = false;
936  bool newLumi = false;
939 
940  // Save the event numbers as we loop through the event auxiliary to avoid
941  // having to read through the event auxiliary again later. These event numbers
942  // are not actually used in this function, but could be needed elsewhere.
944 
945  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(eventAux().processHistoryID());
946 
947  if(iFirst || prevPhid != reducedPHID || prevRun != eventAux().run()) {
948  iFirst = false;
949  newRun = newLumi = true;
950  } else if(prevLumi != eventAux().luminosityBlock()) {
951  newLumi = true;
952  }
953  prevPhid = reducedPHID;
954  prevRun = eventAux().run();
955  prevLumi = eventAux().luminosityBlock();
956  if(newLumi) {
957  lumis.emplace_back(reducedPHID,
958  eventAux().run(), eventAux().luminosityBlock(), eventTree_.entryNumber()); // (insert 1)
959  runLumiSet.insert(LuminosityBlockID(eventAux().run(), eventAux().luminosityBlock())); // (insert 2)
960  } else {
961  LumiItem& currentLumi = lumis.back();
962  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
963  ++currentLumi.lastEventEntry_;
964  }
965  if(newRun) {
966  // Insert run in list if it is not already there.
967  RunItem item(reducedPHID, eventAux().run());
968  if(runItemSet.insert(item).second) { // (check 3, insert 3)
969  runs.push_back(std::move(item)); // (insert 5)
970  runSet.insert(eventAux().run()); // (insert 4)
971  phidMap.insert(std::make_pair(eventAux().run(), reducedPHID));
972  }
973  }
974  }
975  // now clean up.
977  eventAux_ = EventAuxiliary();
979 
980  // Loop over run entries and fill information.
981 
982  typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
983  RunMap runMap; // (declare 11)
984 
985  typedef std::vector<RunItem> RunVector;
986  RunVector emptyRuns; // (declare 12)
987 
988  if(runTree_.isValid()) {
989  while(runTree_.next()) {
990  // Note: adjacent duplicates will be skipped without an explicit check.
991 
992  std::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
993  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(runAux->processHistoryID());
994 
995  if(runSet.insert(runAux->run()).second) { // (check 4, insert 4)
996  // This run was not associated with any events.
997  emptyRuns.emplace_back(reducedPHID, runAux->run()); // (insert 12)
998  }
999  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
1000  phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
1001  }
1002  // now clean up.
1004  }
1005 
1006  // Insert the ordered empty runs into the run list.
1007  RunItemSortByRun runItemSortByRun;
1008  stable_sort_all(emptyRuns, runItemSortByRun);
1009 
1010  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
1011  for(auto const& emptyRun : emptyRuns) {
1012  for(; itRuns != endRuns; ++itRuns) {
1013  if(runItemSortByRun(emptyRun, *itRuns)) {
1014  break;
1015  }
1016  }
1017  runs.insert(itRuns, emptyRun);
1018  }
1019 
1020  // Loop over luminosity block entries and fill information.
1021 
1022  typedef std::vector<LumiItem> LumiVector;
1023  LumiVector emptyLumis; // (declare 7)
1024 
1025  typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
1026  RunLumiMap runLumiMap; // (declare 6)
1027 
1028  if(lumiTree_.isValid()) {
1029  while(lumiTree_.next()) {
1030  // Note: adjacent duplicates will be skipped without an explicit check.
1031  std::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
1032  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
1033  if(runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
1034  // This lumi was not associated with any events.
1035  // Use the process history ID from the corresponding run. In cases of practical
1036  // importance, this should be the correct process history ID, but it is possible
1037  // to construct files where this is not the correct process history ID ...
1038  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
1039  assert(iPhidMap != phidMap.end());
1040  emptyLumis.emplace_back(iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), IndexIntoFile::invalidEntry); // (insert 7)
1041  }
1042  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
1043  }
1044  // now clean up.
1046  }
1047 
1048  // Insert the ordered empty lumis into the lumi list.
1049  LumiItemSortByRunLumi lumiItemSortByRunLumi;
1050  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
1051 
1052  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1053  for(auto const& emptyLumi : emptyLumis) {
1054  for(; itLumis != endLumis; ++itLumis) {
1055  if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1056  break;
1057  }
1058  }
1059  lumis.insert(itLumis, emptyLumi);
1060  }
1061 
1062  // Create a map of RunItems that gives the order of first appearance in the list.
1063  // Also fill in the vector of process history IDs
1064  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1065  RunCountMap runCountMap; // Declare (17)
1066  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
1067  assert(phids.empty());
1068  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
1069  assert(entries.empty());
1070  int rcount = 0;
1071  for(auto& run : runs) {
1072  RunCountMap::const_iterator countMapItem = runCountMap.find(run);
1073  if(countMapItem == runCountMap.end()) {
1074  countMapItem = runCountMap.insert(std::make_pair(run, rcount)).first; // Insert (17)
1075  assert(countMapItem != runCountMap.end());
1076  ++rcount;
1077  }
1078  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, run.phid_);
1079  if(phidItem == phids.end()) {
1080  phids.push_back(run.phid_);
1081  phidItem = phids.end() - 1;
1082  }
1083  entries.emplace_back(
1084  countMapItem->second, // use (17)
1086  runMap[run.run_], // use (11)
1087  phidItem - phids.begin(),
1088  run.run_,
1089  0U,
1092  }
1093 
1094  // Create a map of LumiItems that gives the order of first appearance in the list.
1095  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1096  LumiCountMap lumiCountMap; // Declare (19)
1097  int lcount = 0;
1098  for(auto& lumi : lumis) {
1099  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(lumi.phid_, lumi.run_));
1100  assert(runCountMapItem != runCountMap.end());
1101  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(lumi);
1102  if(countMapItem == lumiCountMap.end()) {
1103  countMapItem = lumiCountMap.insert(std::make_pair(lumi, lcount)).first; // Insert (17)
1104  assert(countMapItem != lumiCountMap.end());
1105  ++lcount;
1106  }
1107  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, lumi.phid_);
1108  assert(phidItem != phids.end());
1109  entries.emplace_back(
1110  runCountMapItem->second,
1111  countMapItem->second,
1112  runLumiMap[LuminosityBlockID(lumi.run_, lumi.lumi_)],
1113  phidItem - phids.begin(),
1114  lumi.run_,
1115  lumi.lumi_,
1116  lumi.firstEventEntry_,
1117  lumi.lastEventEntry_);
1118  }
1119  stable_sort_all(entries);
1120  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1283
RootTree lumiTree_
Definition: RootFile.h:279
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
EntryNumber const & entries() const
Definition: RootTree.h:133
RunNumber_t run() const
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
Definition: Algorithms.h:135
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:123
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:282
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1307
RootTree eventTree_
Definition: RootFile.h:278
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:263
RootTree runTree_
Definition: RootFile.h:280
EntryNumber const & entryNumber() const
Definition: RootTree.h:131
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:32
void fillEventHistory()
Definition: RootFile.cc:1225
bool isValid() const
Definition: RootTree.cc:106
unsigned int RunNumber_t
EventAuxiliary eventAux_
Definition: RootFile.h:277
void fillThisEventAuxiliary()
Definition: RootFile.cc:1196
def move(src, dest)
Definition: eostools.py:511
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::fillLumiAuxiliary ( )
private

Definition at line 1283 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_().

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

Definition at line 1307 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

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

Definition at line 1196 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().

1196  {
1198  // Already read.
1199  return;
1200  }
1202  EventAuxiliary *pEvAux = &eventAux_;
1203  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1204  } else {
1205  // for backward compatibility.
1206  EventAux eventAux;
1207  EventAux *pEvAux = &eventAux;
1208  eventTree_.fillAux<EventAux>(pEvAux);
1209  conversion(eventAux, eventAux_);
1210  }
1212  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:282
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
RootTree eventTree_
Definition: RootFile.h:278
EntryNumber const & entryNumber() const
Definition: RootTree.h:131
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:277
void fillAux(T *&pAux)
Definition: RootTree.h:140
IndexIntoFile::EntryType edm::RootFile::getNextItemType ( RunNumber_t run,
LuminosityBlockNumber_t lumi,
EventNumber_t event 
)

Definition at line 782 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().

782  {
783  // First, account for consecutive skipped entries.
784  while(skipThisEntry()) {
787  }
790  }
791  else {
793  }
794  }
795  // OK, we have an entry that is not skipped.
797  if(entryType == IndexIntoFile::kEnd) {
798  return IndexIntoFile::kEnd;
799  }
800  if(entryType == IndexIntoFile::kRun) {
802  runHelper_->checkForNewRun(run);
803  return IndexIntoFile::kRun;
804  } else if(processingMode_ == InputSource::Runs) {
806  return getNextItemType(run, lumi, event);
807  }
808  if(entryType == IndexIntoFile::kLumi) {
811  return IndexIntoFile::kLumi;
814  return getNextItemType(run, lumi, event);
815  }
816  if(isDuplicateEvent()) {
818  return getNextItemType(run, lumi, event);
819  }
823  event = eventAux_.event();
824  return IndexIntoFile::kEvent;
825  }
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:288
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
bool skipThisEntry()
Definition: RootFile.cc:722
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:782
bool isDuplicateEvent()
Definition: RootFile.cc:766
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
EventAuxiliary eventAux_
Definition: RootFile.h:277
EventNumber_t event() const
Definition: event.py:1
bool edm::RootFile::goToEvent ( EventID const &  eventID)

Definition at line 1396 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().

1396  {
1397 
1399 
1400  if(duplicateChecker_) {
1401  duplicateChecker_->disable();
1402  }
1403 
1406 
1407  IndexIntoFile::IndexIntoFileItr iter =
1409 
1410  if(iter == indexIntoFile_.end(sortOrder)) {
1411  return false;
1412  }
1413  indexIntoFileIter_ = iter;
1414  return true;
1415  }
RunNumber_t run() const
Definition: EventID.h:39
EventID const & eventID() const
Definition: RootFile.h:173
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:296
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
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:273
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 179 of file RootFile.h.

Referenced by createFileBlock().

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

Definition at line 707 of file RootFile.cc.

References indexIntoFileIter_.

707  {
708  return indexIntoFileIter_;
709  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
std::shared_ptr<IndexIntoFile const> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 210 of file RootFile.h.

References edm::get_underlying_safe().

edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:262
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 211 of file RootFile.h.

References edm::get_underlying_safe(), and position.

edm::propagate_const< std::shared_ptr< IndexIntoFile > > indexIntoFileSharedPtr_
Definition: RootFile.h:262
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 717 of file RootFile.cc.

References fileThinnedAssociationsHelper_, and thinnedAssociationsHelper_.

717  {
718  thinnedAssociationsHelper_->initAssociationsFromSecondary(associationsFromSecondary, *fileThinnedAssociationsHelper_);
719  }
edm::propagate_const< std::unique_ptr< ThinnedAssociationsHelper > > fileThinnedAssociationsHelper_
Definition: RootFile.h:286
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
Definition: RootFile.h:287
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 1689 of file RootFile.cc.

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

Referenced by RootFile().

1691  {
1692  if(duplicateChecker_ && !duplicateChecker_->checkDisabled()) {
1693  if(eventTree_.next()) {
1695  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1697  indexesIntoFiles,
1698  currentIndexIntoFile);
1699  }
1701  }
1702  }
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:296
bool next()
Definition: RootTree.h:123
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
RootTree eventTree_
Definition: RootFile.h:278
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
static constexpr EntryNumber_t invalidEntry
void fillThisEventAuxiliary()
Definition: RootFile.cc:1196
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
bool edm::RootFile::isDuplicateEvent ( )
private

Definition at line 766 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().

766  {
768  if(duplicateChecker_.get() == nullptr) {
769  return false;
770  }
772  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
774  }
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:296
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:277
std::string const file_
Definition: RootFile.h:254
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 175 of file RootFile.h.

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

Definition at line 1863 of file RootFile.cc.

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

Referenced by readCurrentEvent().

1863  {
1864  if(eventProductProvenanceRetrievers_.size()<=iStreamID) {
1865  eventProductProvenanceRetrievers_.resize(iStreamID+1);
1866  }
1867  if(!eventProductProvenanceRetrievers_[iStreamID]) {
1868  // propagate_const<T> has no reset() function
1869  eventProductProvenanceRetrievers_[iStreamID] = std::make_shared<ProductProvenanceRetriever>(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get()));
1870  }
1871  eventProductProvenanceRetrievers_[iStreamID]->reset();
1872  return eventProductProvenanceRetriever(iStreamID);
1873  }
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:301
std::shared_ptr< ProductProvenanceRetriever const > eventProductProvenanceRetriever(size_t index) const
Definition: RootFile.h:251
std::vector< edm::propagate_const< std::shared_ptr< ProductProvenanceRetriever > > > eventProductProvenanceRetrievers_
Definition: RootFile.h:299
RootTree eventTree_
Definition: RootFile.h:278
edm::propagate_const< std::unique_ptr< MakeProvenanceReader > > provenanceReaderMaker_
Definition: RootFile.h:298
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 1846 of file RootFile.cc.

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

Referenced by RootFile().

1846  {
1848  readParentageTree(inputType);
1849  return std::make_unique<MakeReducedProvenanceReader>(parentageIDLookup_);
1850  } else if(fileFormatVersion_.splitProductIDs()) {
1851  readParentageTree(inputType);
1852  return std::make_unique<MakeFullProvenanceReader>();
1853  } else if(fileFormatVersion_.perEventProductIDs()) {
1854  auto entryDescriptionMap = std::make_unique<EntryDescriptionMap>();
1855  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1856  return std::make_unique<MakeOldProvenanceReader>(std::move(entryDescriptionMap));
1857  } else {
1858  return std::make_unique<MakeDummyProvenanceReader>();
1859  }
1860  }
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:553
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:260
void readParentageTree(InputType inputType)
Definition: RootFile.cc:599
bool storedProductProvenanceUsed() const
bool perEventProductIDs() const
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:300
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 1705 of file RootFile.cc.

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

Referenced by dropOnInput().

1706  {
1707  if(dropDescendants) {
1708  branchChildren_->appendToDescendants(branch, branchesToDrop, droppedToKeptAlias);
1709  } else {
1710  branchesToDrop.insert(branch.branchID());
1711  }
1712  }
edm::propagate_const< std::shared_ptr< BranchChildren > > branchChildren_
Definition: RootFile.h:295
bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 181 of file RootFile.h.

Referenced by createFileBlock().

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

Definition at line 698 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

698  {
699  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
700  if(it != newBranchToOldBranch_.end()) {
701  return it->second;
702  }
703  return newBranch;
704  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:290
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 206 of file RootFile.h.

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

Definition at line 168 of file RootFile.h.

Referenced by RootFile().

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

Definition at line 1453 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().

1453  {
1454  if(!eventTree_.current()) {
1455  return false;
1456  }
1458  if(!fileFormatVersion().lumiInEventID()) {
1459  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1460  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1462  }
1463  fillEventHistory();
1464  runHelper_->overrideRunNumber(eventAux_.id(), eventAux().isRealData());
1465 
1466  // We're not done ... so prepare the EventPrincipal
1467  eventTree_.insertEntryForIndex(principal.transitionIndex());
1468  principal.fillEventPrincipal(eventAux(),
1472  *(makeProductProvenanceRetriever(principal.streamID().value())),
1474 
1475  // report event read from file
1476  filePtr_->eventReadFromFile();
1477  return true;
1478  }
bool isRealData() const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
bool current() const
Definition: RootTree.h:126
def principal(options)
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:100
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:118
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:292
RootTree eventTree_
Definition: RootFile.h:278
BranchListIndexes branchListIndexes_
Definition: RootFile.h:293
LuminosityBlockNumber_t oldLuminosityBlock() const
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:258
void fillEventHistory()
Definition: RootFile.cc:1225
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:1863
EventID const & id() const
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
EventAuxiliary eventAux_
Definition: RootFile.h:277
void fillThisEventAuxiliary()
Definition: RootFile.cc:1196
def move(src, dest)
Definition: eostools.py:511
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

Definition at line 553 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().

553  {
554  // Called only for old format files.
555  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
556  std::unique_ptr<TTree> entryDescriptionTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
557  if(nullptr == entryDescriptionTree.get()) {
558  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
559  << " in the input file.\n";
560  }
561 
562  EntryDescriptionID idBuffer;
563  EntryDescriptionID* pidBuffer = &idBuffer;
564  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
565 
566  EventEntryDescription entryDescriptionBuffer;
567  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
568  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
569 
570  // Fill in the parentage registry.
571  ParentageRegistry& registry = *ParentageRegistry::instance();
572 
573  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
574  roottree::getEntry(entryDescriptionTree.get(), i);
575  if(idBuffer != entryDescriptionBuffer.id()) {
576  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
577  }
578  entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.id(),entryDescriptionBuffer));
579  Parentage parents;
580  parents.setParents(entryDescriptionBuffer.parents());
582  ParentageID const oldID = parents.id();
583  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
584  ParentageID newID = parents.id();
585  if(newID != oldID) {
586  daqProvenanceHelper_->setOldParentageIDToNew(oldID,newID);
587  }
588  }
589  // For thread safety, don't update global registries when a secondary source opens a file.
590  if(inputType != InputType::SecondarySource) {
591  registry.insertMapped(parents);
592  }
593  }
594  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
595  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
596  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:510
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:301
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:258
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 1430 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(), findQualityFiles::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runHelper_, and edm::FileFormatVersion::useReducedProcessHistoryID().

1430  {
1433  // read the event auxiliary if not alrady read.
1435 
1436  // read the event
1438 
1439  runHelper_->checkRunConsistency(eventAux().run(), indexIntoFileIter_.run());
1440  runHelper_->checkLumiConsistency(eventAux().luminosityBlock(), indexIntoFileIter_.lumi());
1441 
1442  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1443  // The IndexIntoFile should guarantee that it never fails.
1445  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1447 
1449  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:301
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
LuminosityBlockNumber_t lumi() const
bool readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1453
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
def principal(options)
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
bool useReducedProcessHistoryID() const
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1676 of file RootFile.cc.

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

Referenced by RootFile().

1676  {
1677  // Read in the event history tree, if we have one...
1678  if(fileFormatVersion().eventHistoryTree()) {
1679  history_ = std::make_unique<History>(); // propagate_const<T> has no reset() function
1680  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1681  if(!eventHistoryTree_) {
1683  << "Failed to find the event history tree.\n";
1684  }
1685  }
1686  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
edm::propagate_const< std::unique_ptr< History > > history_
Definition: RootFile.h:294
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:258
edm::propagate_const< TTree * > eventHistoryTree_
Definition: RootFile.h:291
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 1620 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().

1620  {
1623  // Begin code for backward compatibility before the existence of lumi trees.
1624  if(!lumiTree_.isValid()) {
1626  return;
1627  }
1628  // End code for backward compatibility before the existence of lumi trees.
1630  // NOTE: we use 0 for the index since do not do delayed reads for LuminosityBlockPrincipals
1632  lumiPrincipal.fillLuminosityBlockPrincipal(*processHistoryRegistry_, lumiTree_.resetAndGetRootDelayedReader());
1633  // Read in all the products now.
1634  lumiPrincipal.readAllFromSourceAndMergeImmediately();
1636  }
RootTree lumiTree_
Definition: RootFile.h:279
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:100
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:118
bool isValid() const
Definition: RootTree.cc:106
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1582 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.

1582  {
1585  // Begin code for backward compatibility before the existence of lumi trees.
1586  if(!lumiTree_.isValid()) {
1588  assert(eventEntry != IndexIntoFile::invalidEntry);
1589  assert(eventTree_.current(eventEntry));
1590  fillEventAuxiliary(eventEntry);
1591 
1592  LuminosityBlockID lumi = LuminosityBlockID(indexIntoFileIter_.run(), indexIntoFileIter_.lumi());
1593  runHelper_->overrideRunNumber(lumi);
1594  return std::make_shared<LuminosityBlockAuxiliary>(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp());
1595  }
1596  // End code for backward compatibility before the existence of lumi trees.
1598  std::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1599  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1600  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1601  runHelper_->overrideRunNumber(lumiAuxiliary->id());
1602  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1603  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1605  if(eventEntry != IndexIntoFile::invalidEntry) {
1606  assert(eventTree_.current(eventEntry));
1607  fillEventAuxiliary(eventEntry);
1608 
1609  lumiAuxiliary->setBeginTime(eventAux().time());
1610  }
1611  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1612  }
1613  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1614  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1615  }
1616  return lumiAuxiliary;
1617  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1283
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
RootTree lumiTree_
Definition: RootFile.h:279
Timestamp const & time() const
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:271
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
bool current() const
Definition: RootTree.h:126
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
RootTree eventTree_
Definition: RootFile.h:278
static constexpr EntryNumber_t invalidEntry
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:258
bool isValid() const
Definition: RootTree.cc:106
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
void edm::RootFile::readParentageTree ( InputType  inputType)
private

Definition at line 599 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().

599  {
600  // New format file
601  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
602  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
603  if(nullptr == parentageTree.get()) {
604  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
605  << " in the input file.\n";
606  }
607 
608  Parentage parents;
609  Parentage *pParentageBuffer = &parents;
610  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
611 
612  ParentageRegistry& registry = *ParentageRegistry::instance();
613 
614  parentageIDLookup_.reserve(parentageTree->GetEntries());
615  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
616  roottree::getEntry(parentageTree.get(), i);
618  ParentageID const oldID = parents.id();
619  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
620  ParentageID newID = parents.id();
621  if(newID != oldID) {
622  daqProvenanceHelper_->setOldParentageIDToNew(oldID,newID);
623  }
624  }
625  // For thread safety, don't update global registries when a secondary source opens a file.
626  if(inputType != InputType::SecondarySource) {
627  registry.insertMapped(parents);
628  }
629  parentageIDLookup_.push_back(parents.id());
630  }
631  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
632  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:510
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:301
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:258
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:300
static Interceptor::Registry registry("Interceptor")
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
void edm::RootFile::readRun_ ( RunPrincipal runPrincipal)

Definition at line 1552 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_.

1552  {
1553 
1554  MergeableRunProductMetadata* mergeableRunProductMetadata = nullptr;
1555  if (inputType_ == InputType::Primary) {
1556  mergeableRunProductMetadata = runPrincipal.mergeableRunProductMetadata();
1557  RootTree::EntryNumber const& entryNumber = runTree_.entryNumber();
1558  assert(entryNumber >= 0);
1559  mergeableRunProductMetadata->readRun(entryNumber, *storedMergeableRunProductMetadata_,
1560  IndexIntoFileItrHolder(indexIntoFileIter_));
1561  }
1562 
1563  if(!runHelper_->fakeNewRun()) {
1567  }
1568  // Begin code for backward compatibility before the existence of run trees.
1569  if(!runTree_.isValid()) {
1570  return;
1571  }
1572  // End code for backward compatibility before the existence of run trees.
1573  // NOTE: we use 0 for the index since do not do delayed reads for RunPrincipals
1575  runPrincipal.fillRunPrincipal(*processHistoryRegistry_, runTree_.resetAndGetRootDelayedReader());
1576  // Read in all the products now.
1577  runPrincipal.readAllFromSourceAndMergeImmediately(mergeableRunProductMetadata);
1578  }
InputType inputType_
Definition: RootFile.h:303
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
edm::propagate_const< std::unique_ptr< StoredMergeableRunProductMetadata > > storedMergeableRunProductMetadata_
Definition: RootFile.h:268
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:100
DelayedReader * resetAndGetRootDelayedReader() const
Definition: RootTree.cc:118
RootTree runTree_
Definition: RootFile.h:280
EntryNumber const & entryNumber() const
Definition: RootTree.h:131
bool isValid() const
Definition: RootTree.cc:106
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
roottree::EntryNumber EntryNumber
Definition: RootTree.h:100
std::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

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

1486  {
1487  if(runHelper_->fakeNewRun()) {
1488  runHelper_->overrideRunNumber(savedRunAuxiliary_->id());
1489  return savedRunAuxiliary();
1490  }
1493 
1494  // Begin code for backward compatibility before the existence of run trees.
1495  if(!runTree_.isValid()) {
1496 
1497  // prior to the support of run trees.
1498  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1500  assert(eventEntry != IndexIntoFile::invalidEntry);
1501  assert(eventTree_.current(eventEntry));
1502  fillEventAuxiliary(eventEntry);
1503 
1504  RunID run = RunID(indexIntoFileIter_.run());
1505  runHelper_->overrideRunNumber(run);
1506  savedRunAuxiliary_ = std::make_shared<RunAuxiliary>(run.run(), eventAux().time(), Timestamp::invalidTimestamp());
1507  return savedRunAuxiliary();
1508  }
1509  // End code for backward compatibility before the existence of run trees.
1511  std::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1512  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1513  runHelper_->overrideRunNumber(runAuxiliary->id());
1514  filePtr_->reportInputRunNumber(runAuxiliary->run());
1515  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1516  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1517  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1518  }
1519 
1520  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1521  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1522  // we attempt to read the first event in the run to get appropriate info.
1523  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1525 
1527  // If we have a valid event, use its information.
1528  if(eventEntry != IndexIntoFile::invalidEntry) {
1529  assert(eventTree_.current(eventEntry));
1530  fillEventAuxiliary(eventEntry);
1531 
1532  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1533  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1534  runAuxiliary->setBeginTime(eventAux().time());
1535  }
1536 
1537  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1538  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1539  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1540  // and event ProcessHistory's always be the same if no file merging occurs).
1541  if(!fileFormatVersion().processHistorySameWithinRun()) {
1542  fillEventHistory();
1543  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1544  }
1545  }
1546  }
1547  savedRunAuxiliary_ = runAuxiliary;
1548  return runAuxiliary;
1549  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
Timestamp const & time() const
edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:271
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
bool current() const
Definition: RootTree.h:126
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
EventAuxiliary const & eventAux() const
Definition: RootFile.h:169
std::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1307
RootTree eventTree_
Definition: RootFile.h:278
RootTree runTree_
Definition: RootFile.h:280
std::shared_ptr< RunAuxiliary const > savedRunAuxiliary() const
Definition: RootFile.h:245
static constexpr EntryNumber_t invalidEntry
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:258
bool processHistorySameWithinRun() const
void fillEventHistory()
Definition: RootFile.cc:1225
bool isValid() const
Definition: RootTree.cc:106
edm::propagate_const< RunHelperBase * > runHelper_
Definition: RootFile.h:289
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1170 of file RootFile.cc.

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

1170  {
1171  // Report file opened.
1172  std::string const label = "source";
1173  std::string moduleName = "PoolSource";
1174  filePtr_->inputFileOpened(
1175  logicalFile_,
1176  inputType,
1177  moduleName,
1178  label,
1179  fid_.fid(),
1181  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:136
char const * label
FileID fid_
Definition: RootFile.h:261
std::string const logicalFile_
Definition: RootFile.h:255
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:278
edm::propagate_const< std::shared_ptr< InputFile > > filePtr_
Definition: RootFile.h:258
void edm::RootFile::rewind ( )
inline

Definition at line 193 of file RootFile.h.

193  {
195  eventTree_.rewind();
196  lumiTree_.rewind();
197  runTree_.rewind();
198  }
RootTree lumiTree_
Definition: RootFile.h:279
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
RootTree eventTree_
Definition: RootFile.h:278
RootTree runTree_
Definition: RootFile.h:280
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:265
void rewind()
Definition: RootTree.h:128
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 176 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 245 of file RootFile.h.

References edm::get_underlying_safe().

Referenced by readRunAuxiliary_().

edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:271
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 246 of file RootFile.h.

References edm::get_underlying_safe().

edm::propagate_const< std::shared_ptr< RunAuxiliary > > savedRunAuxiliary_
Definition: RootFile.h:271
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 1481 of file RootFile.cc.

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

1481  {
1483  }
RootTree eventTree_
Definition: RootFile.h:278
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

Definition at line 1639 of file RootFile.cc.

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

1639  {
1641  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1643  return true;
1644  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
RootTree eventTree_
Definition: RootFile.h:278
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
Definition: event.py:1
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 183 of file RootFile.h.

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

183  {
185  }
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1655
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1647
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: RootFile.cc:1639
Definition: event.py:1
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1647 of file RootFile.cc.

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

1647  {
1649  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1651  return true;
1652  }
RootTree lumiTree_
Definition: RootFile.h:279
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1663 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().

1663  {
1666  }
1669  if(run != indexIntoFileIter_.run()) return false;
1670  if(lumi != indexIntoFileIter_.lumi()) return false;
1672  return true;
1673  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1655 of file RootFile.cc.

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

1655  {
1657  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1659  return true;
1660  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
RootTree runTree_
Definition: RootFile.h:280
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:205
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

Definition at line 635 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().

635  {
636  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
637  //we must avoid copying the old branch which stored the per product per event provenance
639  return;
640  }
641  if(!fileFormatVersion().splitProductIDs()) {
643  return;
644  }
647  return;
648  }
649  // Find entry for first event in file
650  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
651  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
652  ++it;
653  }
654  if(it == indexIntoFileEnd_) {
656  return;
657  }
658 
659  // From here on, record all reasons we can't fast clone.
663  }
664  if(skipAnyEvents_) {
666  }
667  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
669  }
670  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
672  }
673  if(duplicateChecker_ &&
674  !duplicateChecker_->checkDisabled() &&
675  !duplicateChecker_->noDuplicatesInFile()) {
677  }
678  }
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:296
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
int whyNotFastClonable_
Definition: RootFile.h:274
RootTree lumiTree_
Definition: RootFile.h:279
EntryNumber const & entries() const
Definition: RootTree.h:133
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:288
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
bool noEventSort_
Definition: RootFile.h:273
bool skipAnyEvents_
Definition: RootFile.h:272
RootTree eventTree_
Definition: RootFile.h:278
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:265
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 712 of file RootFile.cc.

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

712  {
714  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
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 1839 of file RootFile.cc.

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

1840  {
1841  eventTree_.setSignals(preEventReadSource,postEventReadSource);
1842  }
void setSignals(signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *preEventReadSource, signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const *postEventReadSource)
Definition: RootTree.cc:501
RootTree eventTree_
Definition: RootFile.h:278
void edm::RootFile::setToLastEntry ( )
inline

Definition at line 199 of file RootFile.h.

199  {
201  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
bool edm::RootFile::skipEntries ( unsigned int &  offset)
inline
bool edm::RootFile::skipEvents ( int &  offset)

Definition at line 1328 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().

1328  {
1329  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1330 
1331  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1332  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1335 
1336  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1337  runOfSkippedEvent,
1338  lumiOfSkippedEvent,
1339  skippedEventEntry);
1340 
1341  // At the end of the file and there were no more events to skip
1342  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1343 
1344  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1345  fillEventAuxiliary(skippedEventEntry);
1346  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1347  continue;
1348  }
1349  }
1350  if(duplicateChecker_ &&
1351  !duplicateChecker_->checkDisabled() &&
1352  !duplicateChecker_->noDuplicatesInFile()) {
1353 
1354  fillEventAuxiliary(skippedEventEntry);
1355  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1356  runOfSkippedEvent,
1357  lumiOfSkippedEvent,
1358  eventAux_.id().event(),
1359  file_)) {
1360  continue;
1361  }
1362  }
1363  --offset;
1364  }
1365 
1366  while(offset < 0) {
1367 
1368  if(duplicateChecker_) {
1369  duplicateChecker_->disable();
1370  }
1371 
1372  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1376 
1377  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1378  runOfEvent,
1379  lumiOfEvent,
1380  eventEntry);
1381 
1382  if(eventEntry == IndexIntoFile::invalidEntry) break;
1383 
1384  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1385  fillEventAuxiliary(eventEntry);
1386  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1387  continue;
1388  }
1389  }
1390  ++offset;
1391  }
1393  }
EventNumber_t event() const
Definition: EventID.h:41
static constexpr int invalidIndex
edm::propagate_const< std::shared_ptr< DuplicateChecker > > duplicateChecker_
Definition: RootFile.h:296
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:259
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
unsigned int LuminosityBlockNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
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:277
std::string const file_
Definition: RootFile.h:254
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
bool edm::RootFile::skipThisEntry ( )
private

Definition at line 722 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().

722  {
724  return false;
725  }
726  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
727 
728  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
730  return true;
731  }
732 
733  // The Lumi is not skipped. If this is an event, see if the event is skipped.
738  eventAux_.id().event())) {
739  return true;
740  }
741  }
742 
743  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
745  eventSkipperByID_->skippingLumis()) {
746  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
747 
748  // There are no lumis in this run, not even ones we will skip
749  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
750  return true;
751  }
752  // If we get here there are lumis in the run, check to see if we are skipping all of them
753  do {
754  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
755  return false;
756  }
757  }
758  while(iterLumi.skipLumiInRun());
759  return true;
760  }
761  }
762  return false;
763  }
EventNumber_t event() const
Definition: EventID.h:41
edm::propagate_const< std::shared_ptr< EventSkipperByID > > eventSkipperByID_
Definition: RootFile.h:259
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1215
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:266
static constexpr LuminosityBlockNumber_t invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:277
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 221 of file RootFile.h.

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

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

Definition at line 1123 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().

1123  {
1124  if(!fid_.isValid()) {
1125  fid_ = FileID(createGlobalIdentifier());
1126  }
1127  if(!eventTree_.isValid()) {
1129  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
1130  }
1131 
1132  if(fileFormatVersion().hasIndexIntoFile()) {
1133  if(runTree().entries() > 0) {
1134  assert(!indexIntoFile_.empty());
1135  }
1137  if(daqProvenanceHelper_) {
1138  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1139  for(auto& phid : phidVec) {
1140  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1141  }
1142  }
1144  }
1145  }
1146  else {
1147  assert(indexIntoFile_.empty());
1149  }
1150 
1153  indexIntoFile_.setEventFinder(std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(eventTree_)));
1154  // We fill the event numbers explicitly if we need to find events in closed files,
1155  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1156  bool needEventNumbers = false;
1157  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1158  if(inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1159  needEventNumbers = true;
1160  }
1161  bool needEventEntries = false;
1162  if(inputType != InputType::Primary || !noEventSort_) {
1163  // We need event entries for sorting or for secondary files or sources.
1164  needEventEntries = true;
1165  }
1166  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1167  }
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:296
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:177
bool empty() const
True if no runs, lumis, or events are in the file.
edm::propagate_const< ProcessHistoryRegistry * > processHistoryRegistry_
Definition: RootFile.h:257
edm::propagate_const< std::unique_ptr< DaqProvenanceHelper > > daqProvenanceHelper_
Definition: RootFile.h:301
EntryNumber const & entries() const
Definition: RootTree.h:133
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
FileID fid_
Definition: RootFile.h:261
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool noEventSort_
Definition: RootFile.h:273
RootTree const & runTree() const
Definition: RootFile.h:176
RootTree eventTree_
Definition: RootFile.h:278
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:263
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:106
void fillIndexIntoFile()
Definition: RootFile.cc:897
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:264
void setNumberOfEvents(EntryNumber_t nevents) const
bool useReducedProcessHistoryID() const
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 835 of file RootFile.cc.

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

835  {
836  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
837  int phIndex;
840  IndexIntoFile::EntryNumber_t eventEntry;
841  itr.skipEventBackward(phIndex,
842  run,
843  lumi,
844  eventEntry);
845  itr.skipEventBackward(phIndex,
846  run,
847  lumi,
848  eventEntry);
849  return eventEntry == IndexIntoFile::invalidEntry;
850  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
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 828 of file RootFile.cc.

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

828  {
829  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
830  itr.advanceToEvent();
831  return itr.getEntryType() == IndexIntoFile::kEnd;
832  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:267
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 178 of file RootFile.h.

Referenced by createFileBlock().

178 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:274

Member Data Documentation

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

Definition at line 295 of file RootFile.h.

Referenced by markBranchToBeDropped(), and RootFile().

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

Definition at line 285 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 284 of file RootFile.h.

Referenced by RootFile().

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 293 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

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

Referenced by dropOnInput().

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

Definition at line 291 of file RootFile.h.

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

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

Definition at line 269 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

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

Referenced by makeProductProvenanceRetriever().

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 292 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

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

Definition at line 259 of file RootFile.h.

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

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

Definition at line 261 of file RootFile.h.

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

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

Definition at line 254 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

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

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

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

Definition at line 275 of file RootFile.h.

Referenced by dropOnInput(), and RootFile().

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

Definition at line 294 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

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

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

InputType edm::RootFile::inputType_
private

Definition at line 303 of file RootFile.h.

Referenced by readRun_().

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

Definition at line 282 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 273 of file RootFile.h.

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

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

Definition at line 264 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 300 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 256 of file RootFile.h.

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

Definition at line 288 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

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

Definition at line 283 of file RootFile.h.

Referenced by RootFile().

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

Definition at line 297 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 298 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 271 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 272 of file RootFile.h.

Referenced by setIfFastClonable().

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

Definition at line 268 of file RootFile.h.

Referenced by readRun_(), and RootFile().

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

Definition at line 287 of file RootFile.h.

Referenced by initAssociationsFromSecondary().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 281 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 274 of file RootFile.h.

Referenced by RootFile(), and setIfFastClonable().