CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
*, NumBranchTypes
RootTreePtrArray
 

Public Member Functions

boost::shared_ptr
< BranchIDListHelper const > 
branchIDListHelper () const
 
BranchIDLists const & branchIDLists ()
 
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
 
boost::shared_ptr< IndexIntoFileindexIntoFileSharedPtr () const
 
RootTree const & lumiTree () const
 
bool modifiedIDs () const
 
bool nextEventEntry ()
 
RootFileoperator= (RootFile const &)=delete
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 
bool readCurrentEvent (EventPrincipal &cache)
 
void readEvent (EventPrincipal &cache)
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
void readRun_ (RunPrincipal &runPrincipal)
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()
 
void reportOpened (std::string const &inputType)
 
void rewind ()
 
 RootFile (std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, boost::shared_ptr< InputFile > filePtr, boost::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunNumber_t const &forcedRunNumber, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, boost::shared_ptr< BranchIDListHelper > branchIDListHelper, boost::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent, 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 setToLastEntry ()
 
bool skipEvents (int &offset)
 
bool wasFirstEventJustRead () const
 
bool wasLastEventJustRead () const
 
int whyNotFastClonable () const
 
 ~RootFile ()
 

Private Member Functions

void dropOnInput (ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
 
bool fillEventAuxiliary (IndexIntoFile::EntryNumber_t entry)
 
void fillEventHistory ()
 
void fillIndexIntoFile ()
 
boost::shared_ptr
< LuminosityBlockAuxiliary
fillLumiAuxiliary ()
 
boost::shared_ptr< RunAuxiliaryfillRunAuxiliary ()
 
void fillThisEventAuxiliary ()
 
void initializeDuplicateChecker (std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
 
bool isDuplicateEvent ()
 
boost::shared_ptr
< ProductProvenanceRetriever
makeProductProvenanceRetriever ()
 
std::unique_ptr
< MakeProvenanceReader
makeProvenanceReaderMaker (InputType inputType)
 
std::string const & newBranchToOldBranch (std::string const &newBranch) const
 
void overrideRunNumber (RunID &id)
 
void overrideRunNumber (LuminosityBlockID &id)
 
void overrideRunNumber (EventID &id, bool isRealData)
 
void readEntryDescriptionTree (EntryDescriptionMap &entryDescriptionMap, InputType inputType)
 
void readEventHistoryTree ()
 
void readParentageTree (InputType inputType)
 
void setIfFastClonable (int remainingEvents, int remainingLumis)
 
bool skipThisEntry ()
 
RootTreePtrArraytreePointers ()
 
void validateFile (InputType inputType, bool usingGoToEvent)
 

Private Attributes

boost::shared_ptr< BranchChildrenbranchChildren_
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
boost::shared_ptr
< BranchIDLists const > 
branchIDLists_
 
BranchListIndexes branchListIndexes_
 
bool branchListIndexesUnchanged_
 
std::unique_ptr
< DaqProvenanceHelper
daqProvenanceHelper_
 
boost::shared_ptr
< DuplicateChecker
duplicateChecker_
 
EventAuxiliary eventAux_
 
TTree * eventHistoryTree_
 
std::vector
< EventProcessHistoryID
eventProcessHistoryIDs_
 
std::vector
< EventProcessHistoryID >
::const_iterator 
eventProcessHistoryIter_
 
boost::shared_ptr
< ProductProvenanceRetriever
eventProductProvenanceRetriever_
 
EventSelectionIDVector eventSelectionIDs_
 
boost::shared_ptr
< EventSkipperByID
eventSkipperByID_
 
RootTree eventTree_
 
FileID fid_
 
std::string const file_
 
FileFormatVersion fileFormatVersion_
 
boost::shared_ptr< InputFilefilePtr_
 
int forcedRunOffset_
 
std::array< bool, NumBranchTypeshasNewlyDroppedBranch_
 
std::unique_ptr< Historyhistory_
 
IndexIntoFileindexIntoFile_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
 
boost::shared_ptr< IndexIntoFileindexIntoFileSharedPtr_
 
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_
 
ProcessHistoryRegistryprocessHistoryRegistry_
 
InputSource::ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry_
 
std::unique_ptr
< ProvenanceAdaptor
provenanceAdaptor_
 
std::unique_ptr
< MakeProvenanceReader
provenanceReaderMaker_
 
RootTree runTree_
 
boost::shared_ptr< RunAuxiliarysavedRunAuxiliary_
 
bool skipAnyEvents_
 
RootTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 55 of file RootFile.h.

Member Typedef Documentation

Definition at line 57 of file RootFile.h.

Constructor & Destructor Documentation

edm::RootFile::RootFile ( std::string const &  fileName,
ProcessConfiguration const &  processConfiguration,
std::string const &  logicalFileName,
boost::shared_ptr< InputFile filePtr,
boost::shared_ptr< EventSkipperByID eventSkipperByID,
bool  skipAnyEvents,
int  remainingEvents,
int  remainingLumis,
unsigned int  nStreams,
unsigned int  treeCacheSize,
int  treeMaxVirtualSize,
InputSource::ProcessingMode  processingMode,
RunNumber_t const &  forcedRunNumber,
bool  noEventSort,
ProductSelectorRules const &  productSelectorRules,
InputType  inputType,
boost::shared_ptr< BranchIDListHelper branchIDListHelper,
boost::shared_ptr< DuplicateChecker duplicateChecker,
bool  dropDescendantsOfDroppedProducts,
ProcessHistoryRegistry processHistoryRegistry,
std::vector< boost::shared_ptr< IndexIntoFile > > const &  indexesIntoFiles,
std::vector< boost::shared_ptr< IndexIntoFile > >::size_type  currentIndexIntoFile,
std::vector< ProcessHistoryID > &  orderedProcessHistoryIDs,
bool  bypassVersionCheck,
bool  labelRawDataLikeMC,
bool  usingGoToEvent,
bool  enablePrefetching 
)

Definition at line 136 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_, edm::hlt::Exception, fid_, file(), fileFormatVersion(), fileFormatVersion_, edm::poolNames::fileFormatVersionBranchName(), edm::poolNames::fileIdentifierBranchName(), filePtr_, edm::errors::FileReadError, edm::IndexIntoFile::firstAppearanceOrder, forcedRunOffset_, edm::BranchDescription::friendlyClassName(), edm::friendlyname::friendlyName(), edm::roottree::getEntry(), hasNewlyDroppedBranch_, 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::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_, readEventHistoryTree(), edm::ProcessHistoryRegistry::registerProcessHistory(), fetchall_from_DQM_v2::release, edm::RootTree::resetTraining(), runTree_, edm::SecondarySource, edm::ParameterSet::setID(), setIfFastClonable(), edm::setRefCoreStreamer(), edm::source(), AlCaHLTBitMon_QueryRunRegistry::string, edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), validateFile(), and whyNotFastClonable_.

162  :
163  file_(fileName),
164  logicalFile_(logicalFileName),
166  processHistoryRegistry_(&processHistoryRegistry),
167  filePtr_(filePtr),
168  eventSkipperByID_(eventSkipperByID),
170  fid_(),
171  indexIntoFileSharedPtr_(new IndexIntoFile),
173  orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
180  skipAnyEvents_(skipAnyEvents),
185  eventAux_(),
186  eventTree_(filePtr_, InEvent, nStreams, treeMaxVirtualSize, treeCacheSize, roottree::defaultLearningEntries, enablePrefetching, inputType),
187  lumiTree_(filePtr_, InLumi, 1, treeMaxVirtualSize, roottree::defaultNonEventCacheSize, roottree::defaultNonEventLearningEntries, enablePrefetching, inputType),
188  runTree_(filePtr_, InRun, 1, treeMaxVirtualSize, roottree::defaultNonEventCacheSize, roottree::defaultNonEventLearningEntries, enablePrefetching, inputType),
189  treePointers_(),
192  branchIDLists_(),
195  forcedRunOffset_(0),
197  eventHistoryTree_(nullptr),
200  history_(),
201  branchChildren_(new BranchChildren),
202  duplicateChecker_(duplicateChecker),
208 
209  hasNewlyDroppedBranch_.fill(false);
210 
214 
215  // Read the metadata tree.
216  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
217  std::unique_ptr<TTree> metaDataTree(dynamic_cast<TTree *>(filePtr_->Get(poolNames::metaDataTreeName().c_str())));
218  if(nullptr == metaDataTree.get()) {
219  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::metaDataTreeName()
220  << " in the input file.\n";
221  }
222 
223  // To keep things simple, we just read in every possible branch that exists.
224  // We don't pay attention to which branches exist in which file format versions
225 
226  FileFormatVersion *fftPtr = &fileFormatVersion_;
227  if(metaDataTree->FindBranch(poolNames::fileFormatVersionBranchName().c_str()) != nullptr) {
228  TBranch *fft = metaDataTree->GetBranch(poolNames::fileFormatVersionBranchName().c_str());
229  fft->SetAddress(&fftPtr);
230  roottree::getEntry(fft, 0);
231  metaDataTree->SetBranchAddress(poolNames::fileFormatVersionBranchName().c_str(), &fftPtr);
232  }
233 
234  FileID *fidPtr = &fid_;
235  if(metaDataTree->FindBranch(poolNames::fileIdentifierBranchName().c_str()) != nullptr) {
236  metaDataTree->SetBranchAddress(poolNames::fileIdentifierBranchName().c_str(), &fidPtr);
237  }
238 
239  IndexIntoFile *iifPtr = &indexIntoFile_;
240  if(metaDataTree->FindBranch(poolNames::indexIntoFileBranchName().c_str()) != nullptr) {
241  metaDataTree->SetBranchAddress(poolNames::indexIntoFileBranchName().c_str(), &iifPtr);
242  }
243 
244  // Need to read to a temporary registry so we can do a translation of the BranchKeys.
245  // This preserves backward compatibility against friendly class name algorithm changes.
246  ProductRegistry inputProdDescReg;
247  ProductRegistry *ppReg = &inputProdDescReg;
248  metaDataTree->SetBranchAddress(poolNames::productDescriptionBranchName().c_str(), (&ppReg));
249 
250  typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
251  PsetMap psetMap;
252  PsetMap *psetMapPtr = &psetMap;
253  if(metaDataTree->FindBranch(poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
254  //backward compatibility
255  assert(!fileFormatVersion().parameterSetsTree());
256  metaDataTree->SetBranchAddress(poolNames::parameterSetMapBranchName().c_str(), &psetMapPtr);
257  } else {
258  assert(fileFormatVersion().parameterSetsTree());
259  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
260  std::unique_ptr<TTree> psetTree(dynamic_cast<TTree *>(filePtr_->Get(poolNames::parameterSetsTreeName().c_str())));
261  if(nullptr == psetTree.get()) {
262  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parameterSetsTreeName()
263  << " in the input file.\n";
264  }
265 
266  typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
267  IdToBlobs idToBlob;
268  IdToBlobs* pIdToBlob = &idToBlob;
269  psetTree->SetBranchAddress(poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
270 
271  std::unique_ptr<TTreeCache> psetTreeCache = roottree::trainCache(psetTree.get(), *filePtr_, roottree::defaultNonEventCacheSize, "*");
272  psetTreeCache->SetEnablePrefetching(false);
273  filePtr_->SetCacheRead(psetTreeCache.get());
274  for(Long64_t i = 0; i != psetTree->GetEntries(); ++i) {
275  psetTree->GetEntry(i);
276  psetMap.insert(idToBlob);
277  }
278  filePtr_->SetCacheRead(0);
279  }
280 
281  // backward compatibility
283  ProcessHistoryRegistry::collection_type *pHistMapPtr = &pHistMap;
284  if(metaDataTree->FindBranch(poolNames::processHistoryMapBranchName().c_str()) != nullptr) {
285  metaDataTree->SetBranchAddress(poolNames::processHistoryMapBranchName().c_str(), &pHistMapPtr);
286  }
287 
289  ProcessHistoryRegistry::vector_type *pHistVectorPtr = &pHistVector;
290  if(metaDataTree->FindBranch(poolNames::processHistoryBranchName().c_str()) != nullptr) {
291  metaDataTree->SetBranchAddress(poolNames::processHistoryBranchName().c_str(), &pHistVectorPtr);
292  }
293 
294  // backward compatibility
295  ProcessConfigurationVector processConfigurations;
296  ProcessConfigurationVector* procConfigVectorPtr = &processConfigurations;
297  if(metaDataTree->FindBranch(poolNames::processConfigurationBranchName().c_str()) != nullptr) {
298  metaDataTree->SetBranchAddress(poolNames::processConfigurationBranchName().c_str(), &procConfigVectorPtr);
299  }
300 
301  std::unique_ptr<BranchIDLists> branchIDListsAPtr(new BranchIDLists);
302  BranchIDLists* branchIDListsPtr = branchIDListsAPtr.get();
303  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) != nullptr) {
304  metaDataTree->SetBranchAddress(poolNames::branchIDListBranchName().c_str(), &branchIDListsPtr);
305  }
306 
307  BranchChildren* branchChildrenBuffer = branchChildren_.get();
308  if(metaDataTree->FindBranch(poolNames::productDependenciesBranchName().c_str()) != nullptr) {
309  metaDataTree->SetBranchAddress(poolNames::productDependenciesBranchName().c_str(), &branchChildrenBuffer);
310  }
311 
312  // backward compatibility
313  std::vector<EventProcessHistoryID> *eventHistoryIDsPtr = &eventProcessHistoryIDs_;
314  if(metaDataTree->FindBranch(poolNames::eventHistoryBranchName().c_str()) != nullptr) {
315  metaDataTree->SetBranchAddress(poolNames::eventHistoryBranchName().c_str(), &eventHistoryIDsPtr);
316  }
317 
318  if(metaDataTree->FindBranch(poolNames::moduleDescriptionMapBranchName().c_str()) != nullptr) {
319  if(metaDataTree->GetBranch(poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
320  metaDataTree->SetBranchStatus((poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), 0);
321  } else {
322  metaDataTree->SetBranchStatus(poolNames::moduleDescriptionMapBranchName().c_str(), 0);
323  }
324  }
325 
326  // Here we read the metadata tree
327  roottree::getEntry(metaDataTree.get(), 0);
328 
330 
331  // Here we read the event history tree, if we have one.
333 
335  if(!fileFormatVersion().triggerPathsTracked()) {
336  ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion().parameterSetsByReference());
337  } else {
338  // Merge into the parameter set registry.
339  pset::Registry& psetRegistry = *pset::Registry::instance();
340  for(auto const& psetEntry : psetMap) {
341  ParameterSet pset(psetEntry.second.pset());
342  pset.setID(psetEntry.first);
343  // For thread safety, don't update global registries when a secondary source opens a file.
344  if(inputType != InputType::SecondarySource) {
345  psetRegistry.insertMapped(pset);
346  }
347  }
348  }
349  if(!fileFormatVersion().splitProductIDs()) {
350  // Old provenance format input file. Create a provenance adaptor.
351  provenanceAdaptor_.reset(new ProvenanceAdaptor(
352  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, true));
353  // Fill in the branchIDLists branch from the provenance adaptor
354  branchIDLists_ = provenanceAdaptor_->branchIDLists();
355  } else {
356  if(!fileFormatVersion().triggerPathsTracked()) {
357  // New provenance format, but change in ParameterSet Format. Create a provenance adaptor.
358  provenanceAdaptor_.reset(new ProvenanceAdaptor(
359  inputProdDescReg, pHistMap, pHistVector, processConfigurations, psetIdConverter, false));
360  }
361  // New provenance format input file. The branchIDLists branch was read directly from the input file.
362  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) == nullptr) {
364  << "Failed to find branchIDLists branch in metaData tree.\n";
365  }
366  branchIDLists_.reset(branchIDListsAPtr.release());
367  }
368 
369  if(!bypassVersionCheck) {
370  checkReleaseVersion(pHistVector, file());
371  }
372 
373  if(labelRawDataLikeMC) {
374  std::string const rawData("FEDRawDataCollection");
375  std::string const source("source");
376  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
377  BranchKey finder(rawData, source, "", "");
378  ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
379  if(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source) {
380  // We found raw data with a module label of source.
381  // We need to change the module label and process name.
382  // Create helper.
383  it->second.init();
384  daqProvenanceHelper_.reset(new DaqProvenanceHelper(it->second.unwrappedTypeID()));
385  // Create the new branch description
386  BranchDescription const& newBD = daqProvenanceHelper_->constBranchDescription_;
387  // Save info from the old and new branch descriptions
388  daqProvenanceHelper_->saveInfo(it->second, newBD);
389  // Map the new branch name to the old branch name.
390  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), it->second.branchName()));
391  // Remove the old branch description from the product Registry.
392  pList.erase(it);
393  // Check that there was only one.
394  it = pList.lower_bound(finder);
395  assert(!(it != pList.end() && it->first.friendlyClassName() == rawData && it->first.moduleLabel() == source));
396  // Insert the new branch description into the product registry.
397  inputProdDescReg.copyProduct(newBD);
398  // Fix up other per file metadata.
399  daqProvenanceHelper_->fixMetaData(processConfigurations, pHistVector);
400  daqProvenanceHelper_->fixMetaData(*branchIDLists_);
401  daqProvenanceHelper_->fixMetaData(*branchChildren_);
402  }
403  }
404 
405  for(auto const& history : pHistVector) {
406  processHistoryRegistry.registerProcessHistory(history);
407  }
408 
410 
411  // Update the branch id info. This has to be done before validateFile since
412  // depending on the file format, the branchIDListHelper_ may have its fixBranchListIndexes call made
413  if(inputType == InputType::Primary || inputType == InputType::SecondarySource) {
415  }
416 
417  validateFile(inputType, usingGoToEvent);
418 
419  // Here, we make the class that will make the ProvenanceReader
420  // It reads whatever trees it needs.
422 
423  // Merge into the hashed registries.
424  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
426  }
427 
428  initializeDuplicateChecker(indexesIntoFiles, currentIndexIntoFile);
431  forcedRunOffset_ = forcedRunOffset(forcedRunNumber, indexIntoFileBegin_, indexIntoFileEnd_);
432  eventProcessHistoryIter_ = eventProcessHistoryIDs_.begin();
433 
434  // Set product presence information in the product registry.
435  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
436  for(auto& product : pList) {
437  BranchDescription& prod = product.second;
438  prod.init();
439  treePointers_[prod.branchType()]->setPresence(prod, newBranchToOldBranch(prod.branchName()));
440  }
441 
442  std::unique_ptr<ProductRegistry> newReg(new ProductRegistry);
443 
444  // Do the translation from the old registry to the new one
445  {
446  ProductRegistry::ProductList const& prodList = inputProdDescReg.productList();
447  for(auto const& product : prodList) {
448  BranchDescription const& prod = product.second;
449  std::string newFriendlyName = friendlyname::friendlyName(prod.className());
450  if(newFriendlyName == prod.friendlyClassName()) {
451  newReg->copyProduct(prod);
452  } else {
453  if(fileFormatVersion().splitProductIDs()) {
455  << "Cannot change friendly class name algorithm without more development work\n"
456  << "to update BranchIDLists. Contact the framework group.\n";
457  }
458  BranchDescription newBD(prod);
459  newBD.updateFriendlyClassName();
460  newReg->copyProduct(newBD);
461  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), prod.branchName()));
462  }
463  }
464  dropOnInput(*newReg, productSelectorRules, dropDescendants, inputType);
465  // freeze the product registry
466  newReg->setFrozen(inputType != InputType::Primary);
467  productRegistry_.reset(newReg.release());
468  }
469 
470  // Set up information from the product registry.
471  ProductRegistry::ProductList const& prodList = productRegistry()->productList();
472  for(auto const& product : prodList) {
473  BranchDescription const& prod = product.second;
474  treePointers_[prod.branchType()]->addBranch(product.first, prod,
475  newBranchToOldBranch(prod.branchName()));
476  }
477 
478  // Determine if this file is fast clonable.
479  setIfFastClonable(remainingEvents, remainingLumis);
480 
481  setRefCoreStreamer(true); // backward compatibility
482 
483  // We are done with our initial reading of EventAuxiliary.
485 
486  // Tell the event tree to begin training at the next read.
488 
489  // Train the run and lumi trees.
490  runTree_.trainCache("*");
491  lumiTree_.trainCache("*");
492  }
void dropOnInput(ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
Definition: RootFile.cc:1666
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:460
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:249
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:216
std::vector< ProcessConfiguration > ProcessConfigurationVector
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:214
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:114
unsigned int const defaultNonEventLearningEntries
Definition: RootTree.h:40
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:192
std::unique_ptr< History > history_
Definition: RootFile.h:213
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
boost::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
Definition: RootFile.h:101
std::vector< BranchIDList > BranchIDLists
Definition: BranchIDList.h:19
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
static std::string const source("source")
int whyNotFastClonable_
Definition: RootFile.h:195
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:209
std::map< BranchKey, BranchDescription > ProductList
RootTree lumiTree_
Definition: RootFile.h:200
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:217
void setRefCoreStreamer(bool resetAll=false)
processConfiguration
Definition: Schedule.cc:362
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:212
IndexIntoFileItr begin(SortOrder sortOrder) const
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:205
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:207
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
void trainCache(char const *branchNames)
Definition: RootTree.cc:429
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:182
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:245
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:191
FileID fid_
Definition: RootFile.h:183
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
std::string const logicalFile_
Definition: RootFile.h:177
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:192
bool noEventSort_
Definition: RootFile.h:194
std::string friendlyName(std::string const &iFullName)
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: RootFile.h:206
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:203
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:227
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:232
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:211
bool skipAnyEvents_
Definition: RootFile.h:193
RootTree eventTree_
Definition: RootFile.h:199
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
BranchListIndexes branchListIndexes_
Definition: RootFile.h:212
std::string const & metaDataTreeName()
Definition: BranchType.cc:167
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:182
std::string const & processHistoryBranchName()
Definition: BranchType.cc:197
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
boost::shared_ptr< ProductProvenanceRetriever > eventProductProvenanceRetriever_
Definition: RootFile.h:218
RootTree runTree_
Definition: RootFile.h:201
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:196
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:184
static EntryNumber_t const invalidEntry
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:178
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:580
std::string const & file() const
Definition: RootFile.h:99
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:172
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:202
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:187
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
bool branchListIndexesUnchanged_
Definition: RootFile.h:197
unsigned int const defaultNonEventCacheSize
Definition: RootTree.h:38
RootTreePtrArray treePointers_
Definition: RootFile.h:202
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:204
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:186
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:177
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker(InputType inputType)
Definition: RootFile.cc:1730
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
void initializeDuplicateChecker(std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
Definition: RootFile.cc:1650
std::string const & branchIDListBranchName()
Definition: BranchType.cc:207
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:219
EventAuxiliary eventAux_
Definition: RootFile.h:198
void resetTraining()
Definition: RootTree.h:149
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void validateFile(InputType inputType, bool usingGoToEvent)
Definition: RootFile.cc:1071
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:652
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:484
unsigned int const defaultLearningEntries
Definition: RootTree.h:39
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:181
TTree * eventHistoryTree_
Definition: RootFile.h:210
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:217
boost::shared_ptr< ProductRegistry const > productRegistry() const
Definition: RootFile.h:100
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:187
std::string const file_
Definition: RootFile.h:176
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:190
static Registry * instance()
Definition: Registry.cc:14
void readEventHistoryTree()
Definition: RootFile.cc:1637
int forcedRunOffset_
Definition: RootFile.h:208
edm::RootFile::~RootFile ( )

Definition at line 494 of file RootFile.cc.

494  {
495  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 101 of file RootFile.h.

References branchIDListHelper_.

101 {return branchIDListHelper_;}
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: RootFile.h:206
BranchIDLists const& edm::RootFile::branchIDLists ( )
inline

Definition at line 102 of file RootFile.h.

References branchIDLists_.

102 {return *branchIDLists_;}
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:205
bool edm::RootFile::branchListIndexesUnchanged ( ) const
inline

Definition at line 114 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

Definition at line 1132 of file RootFile.cc.

References eventHistoryTree_, filePtr_, and treePointers_.

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

1132  {
1133  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1134  eventHistoryTree_ = nullptr;
1135  for(auto& treePointer : treePointers_) {
1136  treePointer->close();
1137  treePointer = nullptr;
1138  }
1139  filePtr_->Close();
1140  filePtr_.reset();
1141  }
RootTreePtrArray treePointers_
Definition: RootFile.h:202
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
TTree * eventHistoryTree_
Definition: RootFile.h:210
bool edm::RootFile::containsItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
) const

Definition at line 726 of file RootFile.cc.

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

726  {
728  }
tuple lumi
Definition: fjr2json.py:35
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
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 634 of file RootFile.cc.

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

634  {
635  return std::unique_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
636  eventTree_.tree(),
638  lumiTree_.tree(),
640  runTree_.tree(),
641  runTree_.metaTree(),
644  file_,
646  modifiedIDs(),
648  branchIDLists_));
649  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:214
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
bool branchListIndexesUnchanged() const
Definition: RootFile.h:114
RootTree lumiTree_
Definition: RootFile.h:200
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:205
TTree const * metaTree() const
Definition: RootTree.h:139
TTree const * tree() const
Definition: RootTree.h:137
bool modifiedIDs() const
Definition: RootFile.h:115
int whyNotFastClonable() const
Definition: RootFile.h:112
RootTree eventTree_
Definition: RootFile.h:199
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:113
RootTree runTree_
Definition: RootFile.h:201
std::string const file_
Definition: RootFile.h:176
void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType 
)
private

Definition at line 1666 of file RootFile.cc.

References edm::ProductRegistry::allBranchDescriptions(), branchChildren_, edm::BranchDescription::branchID(), edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), CommonMethods::cp(), drop, file_, edm::BranchDescription::getInterface(), hasNewlyDroppedBranch_, edm::InEvent, edm::ProductSelector::initialize(), newBranchToOldBranch(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::SecondaryFile, edm::ProductSelector::selected(), treePointers_, and edm::BranchDescription::wrappedName().

Referenced by RootFile().

1666  {
1667  // This is the selector for drop on input.
1668  ProductSelector productSelector;
1669  productSelector.initialize(rules, reg.allBranchDescriptions());
1670 
1671  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1672  // Do drop on input. On the first pass, just fill in a set of branches to be dropped.
1673  std::set<BranchID> branchesToDrop;
1674  for(auto const& product : prodList) {
1675  BranchDescription const& prod = product.second;
1676  if(!productSelector.selected(prod)) {
1677  if(dropDescendants) {
1678  branchChildren_->appendToDescendants(prod.branchID(), branchesToDrop);
1679  } else {
1680  branchesToDrop.insert(prod.branchID());
1681  }
1682  }
1683  }
1684 
1685  // On this pass, actually drop the branches.
1686  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1687  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1688  BranchDescription const& prod = it->second;
1689  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1690  if(drop) {
1691  if(productSelector.selected(prod)) {
1692  LogWarning("RootFile")
1693  << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1694  << "of file '" << file_ << "' because it is dependent on a branch\n"
1695  << "that was explicitly dropped.\n";
1696  }
1697  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1698  hasNewlyDroppedBranch_[prod.branchType()] = true;
1699  ProductRegistry::ProductList::iterator icopy = it;
1700  ++it;
1701  prodList.erase(icopy);
1702  } else {
1703  ++it;
1704  }
1705  }
1706 
1707  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
1708  if(inputType == InputType::SecondaryFile) {
1709  TString tString;
1710  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1711  BranchDescription const& prod = it->second;
1712  if(prod.branchType() != InEvent) {
1713  TClass *cp = gROOT->GetClass(prod.wrappedName().c_str());
1714  WrapperOwningHolder edp(cp->New(), prod.getInterface());
1715  if(edp.isMergeable()) {
1716  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1717  ProductRegistry::ProductList::iterator icopy = it;
1718  ++it;
1719  prodList.erase(icopy);
1720  } else {
1721  ++it;
1722  }
1723  }
1724  else ++it;
1725  }
1726  }
1727  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:214
std::map< BranchKey, BranchDescription > ProductList
const int drop
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:196
RootTreePtrArray treePointers_
Definition: RootFile.h:202
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:652
std::string const file_
Definition: RootFile.h:176
EventAuxiliary const& edm::RootFile::eventAux ( ) const
inline
EventID const& edm::RootFile::eventID ( ) const
inline

Definition at line 107 of file RootFile.h.

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

107 {return eventAux().id();}
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
EventID const & id() const
RootTree const& edm::RootFile::eventTree ( ) const
inline

Definition at line 108 of file RootFile.h.

References eventTree_.

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

Definition at line 99 of file RootFile.h.

References file_.

Referenced by RootFile().

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

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

1163  {
1164  if(!eventTree_.current(entry)) {
1165  return false;
1166  }
1167  eventTree_.setEntryNumber(entry);
1169  return true;
1170  }
bool current() const
Definition: RootTree.h:87
RootTree eventTree_
Definition: RootFile.h:199
void fillThisEventAuxiliary()
Definition: RootFile.cc:1144
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
void edm::RootFile::fillEventHistory ( )
private

Definition at line 1173 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_, edm::hlt::Exception, fileFormatVersion(), edm::RootTree::fillBranchEntry(), edm::roottree::getEntry(), history_, edm::lower_bound_all(), edm::FileFormatVersion::noMetaDataTrees(), edm::EventAuxiliary::processHistoryID(), provenanceAdaptor_, DTTTrigCorrFirst::run, edm::EventAuxiliary::setProcessHistoryID(), edm::FileFormatVersion::splitProductIDs(), filterCSVwithJSON::target, and edm::RootTree::tree().

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

1173  {
1174  // We could consider doing delayed reading, but because we have to
1175  // store this History object in a different tree than the event
1176  // data tree, this is too hard to do in this first version.
1177 
1178  if(fileFormatVersion().eventHistoryBranch()) {
1179  // Lumi block number was not in EventID for the relevant releases.
1180  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1181  if(eventProcessHistoryIter_->eventID() != id) {
1182  EventProcessHistoryID target(id, ProcessHistoryID());
1184  assert(eventProcessHistoryIter_->eventID() == id);
1185  }
1188  } else if(fileFormatVersion().eventHistoryTree()) {
1189  // for backward compatibility.
1190  History* pHistory = history_.get();
1191  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1192  if(!eventHistoryBranch) {
1194  << "Failed to find history branch in event history tree.\n";
1195  }
1196  eventHistoryBranch->SetAddress(&pHistory);
1198  eventAux_.setProcessHistoryID(history_->processHistoryID());
1199  eventSelectionIDs_.swap(history_->eventSelectionIDs());
1200  branchListIndexes_.swap(history_->branchListIndexes());
1201  } else if(fileFormatVersion().noMetaDataTrees()) {
1202  // Current format
1204  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1205  assert(eventSelectionIDBranch != nullptr);
1206  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1208  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1209  assert(branchListIndexesBranch != nullptr);
1210  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1211  }
1212  if(provenanceAdaptor_) {
1213  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1214  for(auto& esID : eventSelectionIDs_) {
1215  esID = provenanceAdaptor_->convertID(esID);
1216  }
1217  }
1218  if(daqProvenanceHelper_) {
1220  }
1222  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1223  provenanceAdaptor_->branchListIndexes(branchListIndexes_);
1224  }
1225  branchIDListHelper_->fixBranchListIndexes(branchListIndexes_);
1226  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:460
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:216
std::unique_ptr< History > history_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
Definition: Algorithms.h:91
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:237
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:191
TTree const * tree() const
Definition: RootTree.h:137
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: RootFile.h:206
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:232
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:211
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:199
BranchListIndexes branchListIndexes_
Definition: RootFile.h:212
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
EntryNumber const & entryNumber() const
Definition: RootTree.h:91
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:115
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
EventAuxiliary eventAux_
Definition: RootFile.h:198
TTree * eventHistoryTree_
Definition: RootFile.h:210
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:190
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 845 of file RootFile.cc.

References edm::RootTree::entries(), python.tagInventory::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, fjr2json::lumi, edm::EventAuxiliary::luminosityBlock(), edmLumisInFiles::lumis, lumiTree_, edm::RootTree::next(), processHistoryRegistry_, edm::ProcessHistoryRegistry::reducedProcessHistoryID(), DTTTrigCorrFirst::run, edm::EventAuxiliary::run(), gather_cfg::runs, runTree_, edm::second(), edm::RootTree::setEntryNumber(), edm::IndexIntoFile::setProcessHistoryIDs(), edm::IndexIntoFile::setRunOrLumiEntries(), edm::stable_sort_all(), and edm::IndexIntoFile::unsortedEventNumbers().

Referenced by validateFile().

845  {
846  // This function is for backward compatibility.
847  // If reading a current format file, indexIntoFile_ is read from the input
848  // file and should always be there. Note that the algorithm below will work
849  // sometimes but often fail with the new format introduced in release 3_8_0.
850  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
851  // probably a separate function should be written to deal with the task.
852  // This is possible just not implemented yet.
853  assert(!fileFormatVersion().hasIndexIntoFile());
854 
855  typedef std::list<LumiItem> LumiList;
856  LumiList lumis; // (declare 1)
857 
858  typedef std::set<LuminosityBlockID> RunLumiSet;
859  RunLumiSet runLumiSet; // (declare 2)
860 
861  typedef std::list<RunItem> RunList;
862  RunList runs; // (declare 5)
863 
864  typedef std::set<RunNumber_t> RunSet;
865  RunSet runSet; // (declare 4)
866 
867  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
868  RunItemSet runItemSet; // (declare 3)
869 
870  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
871  PHIDMap phidMap;
872 
873  RunNumber_t prevRun = 0;
874  LuminosityBlockNumber_t prevLumi = 0;
875  ProcessHistoryID prevPhid;
876  bool iFirst = true;
877 
878  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
880 
881  // First, loop through the event tree.
882  while(eventTree_.next()) {
883  bool newRun = false;
884  bool newLumi = false;
887 
888  // Save the event numbers as we loop through the event auxiliary to avoid
889  // having to read through the event auxiliary again later. These event numbers
890  // are not actually used in this function, but could be needed elsewhere.
892 
893  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(eventAux().processHistoryID());
894 
895  if(iFirst || prevPhid != reducedPHID || prevRun != eventAux().run()) {
896  iFirst = false;
897  newRun = newLumi = true;
898  } else if(prevLumi != eventAux().luminosityBlock()) {
899  newLumi = true;
900  }
901  prevPhid = reducedPHID;
902  prevRun = eventAux().run();
903  prevLumi = eventAux().luminosityBlock();
904  if(newLumi) {
905  lumis.emplace_back(reducedPHID,
906  eventAux().run(), eventAux().luminosityBlock(), eventTree_.entryNumber()); // (insert 1)
907  runLumiSet.insert(LuminosityBlockID(eventAux().run(), eventAux().luminosityBlock())); // (insert 2)
908  } else {
909  LumiItem& currentLumi = lumis.back();
910  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
911  ++currentLumi.lastEventEntry_;
912  }
913  if(newRun) {
914  // Insert run in list if it is not already there.
915  RunItem item(reducedPHID, eventAux().run());
916  if(runItemSet.insert(item).second) { // (check 3, insert 3)
917  runs.push_back(std::move(item)); // (insert 5)
918  runSet.insert(eventAux().run()); // (insert 4)
919  phidMap.insert(std::make_pair(eventAux().run(), reducedPHID));
920  }
921  }
922  }
923  // now clean up.
925  eventAux_ = EventAuxiliary();
927 
928  // Loop over run entries and fill information.
929 
930  typedef std::map<RunNumber_t, IndexIntoFile::EntryNumber_t> RunMap;
931  RunMap runMap; // (declare 11)
932 
933  typedef std::vector<RunItem> RunVector;
934  RunVector emptyRuns; // (declare 12)
935 
936  if(runTree_.isValid()) {
937  while(runTree_.next()) {
938  // Note: adjacent duplicates will be skipped without an explicit check.
939 
940  boost::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
941  ProcessHistoryID reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(runAux->processHistoryID());
942 
943  if(runSet.insert(runAux->run()).second) { // (check 4, insert 4)
944  // This run was not associated with any events.
945  emptyRuns.emplace_back(reducedPHID, runAux->run()); // (insert 12)
946  }
947  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
948  phidMap.insert(std::make_pair(runAux->run(), reducedPHID));
949  }
950  // now clean up.
952  }
953 
954  // Insert the ordered empty runs into the run list.
955  RunItemSortByRun runItemSortByRun;
956  stable_sort_all(emptyRuns, runItemSortByRun);
957 
958  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
959  for(auto const& emptyRun : emptyRuns) {
960  for(; itRuns != endRuns; ++itRuns) {
961  if(runItemSortByRun(emptyRun, *itRuns)) {
962  break;
963  }
964  }
965  runs.insert(itRuns, emptyRun);
966  }
967 
968  // Loop over luminosity block entries and fill information.
969 
970  typedef std::vector<LumiItem> LumiVector;
971  LumiVector emptyLumis; // (declare 7)
972 
973  typedef std::map<LuminosityBlockID, IndexIntoFile::EntryNumber_t> RunLumiMap;
974  RunLumiMap runLumiMap; // (declare 6)
975 
976  if(lumiTree_.isValid()) {
977  while(lumiTree_.next()) {
978  // Note: adjacent duplicates will be skipped without an explicit check.
979  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
980  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
981  if(runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
982  // This lumi was not associated with any events.
983  // Use the process history ID from the corresponding run. In cases of practical
984  // importance, this should be the correct process history ID, but it is possible
985  // to construct files where this is not the correct process history ID ...
986  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
987  assert(iPhidMap != phidMap.end());
988  emptyLumis.emplace_back(iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), IndexIntoFile::invalidEntry); // (insert 7)
989  }
990  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
991  }
992  // now clean up.
994  }
995 
996  // Insert the ordered empty lumis into the lumi list.
997  LumiItemSortByRunLumi lumiItemSortByRunLumi;
998  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
999 
1000  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
1001  for(auto const& emptyLumi : emptyLumis) {
1002  for(; itLumis != endLumis; ++itLumis) {
1003  if(lumiItemSortByRunLumi(emptyLumi, *itLumis)) {
1004  break;
1005  }
1006  }
1007  lumis.insert(itLumis, emptyLumi);
1008  }
1009 
1010  // Create a map of RunItems that gives the order of first appearance in the list.
1011  // Also fill in the vector of process history IDs
1012  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
1013  RunCountMap runCountMap; // Declare (17)
1014  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
1015  assert(phids.empty());
1016  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
1017  assert(entries.empty());
1018  int rcount = 0;
1019  for(auto& run : runs) {
1020  RunCountMap::const_iterator countMapItem = runCountMap.find(run);
1021  if(countMapItem == runCountMap.end()) {
1022  countMapItem = runCountMap.insert(std::make_pair(run, rcount)).first; // Insert (17)
1023  assert(countMapItem != runCountMap.end());
1024  ++rcount;
1025  }
1026  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, run.phid_);
1027  if(phidItem == phids.end()) {
1028  phids.push_back(run.phid_);
1029  phidItem = phids.end() - 1;
1030  }
1031  entries.emplace_back(
1032  countMapItem->second, // use (17)
1034  runMap[run.run_], // use (11)
1035  phidItem - phids.begin(),
1036  run.run_,
1037  0U,
1040  }
1041 
1042  // Create a map of LumiItems that gives the order of first appearance in the list.
1043  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
1044  LumiCountMap lumiCountMap; // Declare (19)
1045  int lcount = 0;
1046  for(auto& lumi : lumis) {
1047  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(lumi.phid_, lumi.run_));
1048  assert(runCountMapItem != runCountMap.end());
1049  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(lumi);
1050  if(countMapItem == lumiCountMap.end()) {
1051  countMapItem = lumiCountMap.insert(std::make_pair(lumi, lcount)).first; // Insert (17)
1052  assert(countMapItem != lumiCountMap.end());
1053  ++lcount;
1054  }
1055  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, lumi.phid_);
1056  assert(phidItem != phids.end());
1057  entries.emplace_back(
1058  runCountMapItem->second,
1059  countMapItem->second,
1060  runLumiMap[LuminosityBlockID(lumi.run_, lumi.lumi_)],
1061  phidItem - phids.begin(),
1062  lumi.run_,
1063  lumi.lumi_,
1064  lumi.firstEventEntry_,
1065  lumi.lastEventEntry_);
1066  }
1067  stable_sort_all(entries);
1068  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:200
EntryNumber const & entries() const
Definition: RootTree.h:93
RunNumber_t run() const
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1253
void stable_sort_all(RandomAccessSequence &s)
wrappers for std::stable_sort
Definition: Algorithms.h:135
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
LuminosityBlockNumber_t luminosityBlock() const
tuple runs
Definition: gather_cfg.py:87
U second(std::pair< T, U > const &p)
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool next()
Definition: RootTree.h:85
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:203
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
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:185
RootTree runTree_
Definition: RootFile.h:201
EntryNumber const & entryNumber() const
Definition: RootTree.h:91
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
std::vector< EventNumber_t > & unsortedEventNumbers() const
static EntryNumber_t const invalidEntry
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:32
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1229
void fillEventHistory()
Definition: RootFile.cc:1173
bool isValid() const
Definition: RootTree.cc:103
unsigned int RunNumber_t
Definition: EventRange.h:32
EventAuxiliary eventAux_
Definition: RootFile.h:198
void fillThisEventAuxiliary()
Definition: RootFile.cc:1144
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::fillLumiAuxiliary ( )
private

Definition at line 1229 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1229  {
1230  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1231  if(fileFormatVersion().newAuxiliary()) {
1232  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1233  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1234  } else {
1235  LuminosityBlockAux lumiAux;
1236  LuminosityBlockAux *pLumiAux = &lumiAux;
1237  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1238  conversion(lumiAux, *lumiAuxiliary);
1239  }
1240  if(provenanceAdaptor_) {
1241  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1242  }
1243  if(daqProvenanceHelper_) {
1244  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1245  }
1246  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1247  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1248  }
1249  return lumiAuxiliary;
1250  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:216
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
RootTree lumiTree_
Definition: RootFile.h:200
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
unsigned int RunNumber_t
Definition: EventRange.h:32
void fillAux(T *&pAux)
Definition: RootTree.h:99
boost::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1253 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1253  {
1254  boost::shared_ptr<RunAuxiliary> runAuxiliary(new RunAuxiliary);
1255  if(fileFormatVersion().newAuxiliary()) {
1256  RunAuxiliary *pRunAux = runAuxiliary.get();
1257  runTree_.fillAux<RunAuxiliary>(pRunAux);
1258  } else {
1259  RunAux runAux;
1260  RunAux *pRunAux = &runAux;
1261  runTree_.fillAux<RunAux>(pRunAux);
1262  conversion(runAux, *runAuxiliary);
1263  }
1264  if(provenanceAdaptor_) {
1265  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1266  }
1267  if(daqProvenanceHelper_) {
1268  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1269  }
1270  return runAuxiliary;
1271  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:216
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
RootTree runTree_
Definition: RootFile.h:201
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
void fillAux(T *&pAux)
Definition: RootTree.h:99
void edm::RootFile::fillThisEventAuxiliary ( )
private

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

1144  {
1146  // Already read.
1147  return;
1148  }
1150  EventAuxiliary *pEvAux = &eventAux_;
1151  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1152  } else {
1153  // for backward compatibility.
1154  EventAux eventAux;
1155  EventAux *pEvAux = &eventAux;
1156  eventTree_.fillAux<EventAux>(pEvAux);
1157  conversion(eventAux, eventAux_);
1158  }
1160  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:203
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
EntryNumber const & entryNumber() const
Definition: RootTree.h:91
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:198
void fillAux(T *&pAux)
Definition: RootTree.h:99
IndexIntoFile::EntryType edm::RootFile::getNextItemType ( RunNumber_t run,
LuminosityBlockNumber_t lumi,
EventNumber_t event 
)

Definition at line 731 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(), edm::InputSource::Runs, edm::InputSource::RunsAndLumis, and skipThisEntry().

731  {
732  // First, account for consecutive skipped entries.
733  while(skipThisEntry()) {
736  }
739  }
740  else {
742  }
743  }
744  // OK, we have an entry that is not skipped.
746  if(entryType == IndexIntoFile::kEnd) {
747  return IndexIntoFile::kEnd;
748  }
749  if(entryType == IndexIntoFile::kRun) {
751  return IndexIntoFile::kRun;
752  } else if(processingMode_ == InputSource::Runs) {
754  return getNextItemType(run, lumi, event);
755  }
756  if(entryType == IndexIntoFile::kLumi) {
759  return IndexIntoFile::kLumi;
762  return getNextItemType(run, lumi, event);
763  }
764  if(isDuplicateEvent()) {
766  return getNextItemType(run, lumi, event);
767  }
771  event = eventAux_.event();
772  return IndexIntoFile::kEvent;
773  }
tuple lumi
Definition: fjr2json.py:35
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:207
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
bool skipThisEntry()
Definition: RootFile.cc:671
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:731
bool isDuplicateEvent()
Definition: RootFile.cc:715
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
EventAuxiliary eventAux_
Definition: RootFile.h:198
EventNumber_t event() const
bool edm::RootFile::goToEvent ( EventID const &  eventID)

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

1342  {
1343 
1345 
1346  if(duplicateChecker_) {
1347  duplicateChecker_->disable();
1348  }
1349 
1352 
1353  IndexIntoFile::IndexIntoFileItr iter =
1355 
1356  if(iter == indexIntoFile_.end(sortOrder)) {
1357  return false;
1358  }
1359  indexIntoFileIter_ = iter;
1360  return true;
1361  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & eventID() const
Definition: RootFile.h:107
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
bool noEventSort_
Definition: RootFile.h:194
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 113 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 661 of file RootFile.cc.

References indexIntoFileIter_.

661  {
662  return indexIntoFileIter_;
663  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 141 of file RootFile.h.

References indexIntoFileSharedPtr_.

141  {
143  }
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:184
void edm::RootFile::initializeDuplicateChecker ( std::vector< boost::shared_ptr< IndexIntoFile > > const &  indexesIntoFiles,
std::vector< boost::shared_ptr< IndexIntoFile > >::size_type  currentIndexIntoFile 
)
private

Definition at line 1650 of file RootFile.cc.

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

Referenced by RootFile().

1652  {
1653  if(duplicateChecker_) {
1654  if(eventTree_.next()) {
1656  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1658  indexesIntoFiles,
1659  currentIndexIntoFile);
1660  }
1662  }
1663  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
bool next()
Definition: RootTree.h:85
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
static EntryNumber_t const invalidEntry
void fillThisEventAuxiliary()
Definition: RootFile.cc:1144
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::isDuplicateEvent ( )
private

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

715  {
717  if(duplicateChecker_.get() == nullptr) {
718  return false;
719  }
721  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
723  }
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:198
std::string const file_
Definition: RootFile.h:176
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 109 of file RootFile.h.

References lumiTree_.

109 {return lumiTree_;}
RootTree lumiTree_
Definition: RootFile.h:200
boost::shared_ptr< ProductProvenanceRetriever > edm::RootFile::makeProductProvenanceRetriever ( )
private

Definition at line 1747 of file RootFile.cc.

References daqProvenanceHelper_, eventProductProvenanceRetriever_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1747  {
1749  eventProductProvenanceRetriever_.reset(new ProductProvenanceRetriever(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1750  }
1753  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:217
RootTree eventTree_
Definition: RootFile.h:199
boost::shared_ptr< ProductProvenanceRetriever > eventProductProvenanceRetriever_
Definition: RootFile.h:218
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 1730 of file RootFile.cc.

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

Referenced by RootFile().

1730  {
1732  readParentageTree(inputType);
1733  return std::unique_ptr<MakeProvenanceReader>(new MakeReducedProvenanceReader(parentageIDLookup_));
1734  } else if(fileFormatVersion_.splitProductIDs()) {
1735  readParentageTree(inputType);
1736  return std::unique_ptr<MakeProvenanceReader>(new MakeFullProvenanceReader);
1737  } else if(fileFormatVersion_.perEventProductIDs()) {
1738  std::unique_ptr<EntryDescriptionMap> entryDescriptionMap(new EntryDescriptionMap);
1739  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1740  return std::unique_ptr<MakeProvenanceReader>(new MakeOldProvenanceReader(std::move(entryDescriptionMap)));
1741  } else {
1742  return std::unique_ptr<MakeProvenanceReader>(new MakeDummyProvenanceReader);
1743  }
1744  }
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:498
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:182
void readParentageTree(InputType inputType)
Definition: RootFile.cc:544
bool storedProductProvenanceUsed() const
std::map< EntryDescriptionID, EventEntryDescription > EntryDescriptionMap
Definition: RootFile.h:47
bool perEventProductIDs() const
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:219
bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 115 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

115 {return daqProvenanceHelper_.get() != 0;}
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
std::string const & edm::RootFile::newBranchToOldBranch ( std::string const &  newBranch) const
private

Definition at line 652 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

652  {
653  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
654  if(it != newBranchToOldBranch_.end()) {
655  return it->second;
656  }
657  return newBranch;
658  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:209
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 139 of file RootFile.h.

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

139 {return eventTree_.next();}
bool next()
Definition: RootTree.h:85
RootTree eventTree_
Definition: RootFile.h:199
RootFile& edm::RootFile::operator= ( RootFile const &  )
delete
void edm::RootFile::overrideRunNumber ( RunID id)
private

Definition at line 1606 of file RootFile.cc.

References edm::RunID::firstValidRun(), forcedRunOffset_, and DTTTrigCorrFirst::run.

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

1606  {
1607  if(forcedRunOffset_ != 0) {
1608  id = RunID(id.run() + forcedRunOffset_);
1609  }
1610  if(id < RunID::firstValidRun()) id = RunID::firstValidRun();
1611  }
static RunID firstValidRun()
Definition: RunID.h:81
int forcedRunOffset_
Definition: RootFile.h:208
void edm::RootFile::overrideRunNumber ( LuminosityBlockID id)
private

Definition at line 1614 of file RootFile.cc.

References edm::RunID::firstValidRun(), forcedRunOffset_, and DTTTrigCorrFirst::run.

1614  {
1615  if(forcedRunOffset_ != 0) {
1616  id = LuminosityBlockID(id.run() + forcedRunOffset_, id.luminosityBlock());
1617  }
1618  if(RunID(id.run()) < RunID::firstValidRun()) id = LuminosityBlockID(RunID::firstValidRun().run(), id.luminosityBlock());
1619  }
static RunID firstValidRun()
Definition: RunID.h:81
int forcedRunOffset_
Definition: RootFile.h:208
void edm::RootFile::overrideRunNumber ( EventID id,
bool  isRealData 
)
private

Definition at line 1622 of file RootFile.cc.

References edm::errors::Configuration, event(), edm::hlt::Exception, edm::LuminosityBlockID::firstValidLuminosityBlock(), edm::RunID::firstValidRun(), forcedRunOffset_, and DTTTrigCorrFirst::run.

1622  {
1623  if(forcedRunOffset_ != 0) {
1624  if(isRealData) {
1625  throw Exception(errors::Configuration, "RootFile::RootFile()")
1626  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1627  }
1628  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1629  }
1630  if(RunID(id.run()) < RunID::firstValidRun()) {
1632  }
1633  }
static LuminosityBlockID firstValidLuminosityBlock()
static RunID firstValidRun()
Definition: RunID.h:81
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
int forcedRunOffset_
Definition: RootFile.h:208
boost::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 100 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

100 {return productRegistry_;}
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:204
bool edm::RootFile::readCurrentEvent ( EventPrincipal cache)

Definition at line 1399 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(), edm::EventAuxiliary::oldLuminosityBlock(), overrideRunNumber(), processHistoryRegistry_, edm::EventAuxiliary::resetObsoleteInfo(), edm::RootTree::rootDelayedReader(), and edm::EDProductGetter::transitionIndex().

Referenced by readEvent().

1399  {
1400  if(!eventTree_.current()) {
1401  return false;
1402  }
1404  if(!fileFormatVersion().lumiInEventID()) {
1405  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1406  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1408  }
1409  fillEventHistory();
1411 
1412  // We're not done ... so prepare the EventPrincipal
1413  eventTree_.insertEntryForIndex(principal.transitionIndex());
1414  principal.fillEventPrincipal(eventAux(),
1416  std::move(eventSelectionIDs_),
1417  std::move(branchListIndexes_),
1420 
1421  // report event read from file
1422  filePtr_->eventReadFromFile();
1423  return true;
1424  }
bool isRealData() const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
bool current() const
Definition: RootTree.h:87
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:97
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:211
RootTree eventTree_
Definition: RootFile.h:199
BranchListIndexes branchListIndexes_
Definition: RootFile.h:212
LuminosityBlockNumber_t oldLuminosityBlock() const
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:115
boost::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever()
Definition: RootFile.cc:1747
void fillEventHistory()
Definition: RootFile.cc:1173
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1606
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
EventAuxiliary eventAux_
Definition: RootFile.h:198
void fillThisEventAuxiliary()
Definition: RootFile.cc:1144
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

Definition at line 498 of file RootFile.cc.

References daqProvenanceHelper_, edm::poolNames::entryDescriptionBranchName(), edm::poolNames::entryDescriptionIDBranchName(), edm::poolNames::entryDescriptionTreeName(), edm::errors::EventCorruption, edm::hlt::Exception, filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), i, edm::Parentage::id(), edm::EventEntryDescription::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().

498  {
499  // Called only for old format files.
500  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
501  std::unique_ptr<TTree> entryDescriptionTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
502  if(nullptr == entryDescriptionTree.get()) {
503  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
504  << " in the input file.\n";
505  }
506 
507  EntryDescriptionID idBuffer;
508  EntryDescriptionID* pidBuffer = &idBuffer;
509  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
510 
511  EventEntryDescription entryDescriptionBuffer;
512  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
513  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
514 
515  // Fill in the parentage registry.
516  ParentageRegistry& registry = *ParentageRegistry::instance();
517 
518  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
519  roottree::getEntry(entryDescriptionTree.get(), i);
520  if(idBuffer != entryDescriptionBuffer.id()) {
521  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
522  }
523  entryDescriptionMap.insert(std::make_pair(entryDescriptionBuffer.id(),entryDescriptionBuffer));
524  Parentage parents;
525  parents.setParents(entryDescriptionBuffer.parents());
527  ParentageID const oldID = parents.id();
528  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
529  ParentageID newID = parents.id();
530  if(newID != oldID) {
531  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
532  }
533  }
534  // For thread safety, don't update global registries when a secondary source opens a file.
535  if(inputType != InputType::SecondarySource) {
536  registry.insertMapped(parents);
537  }
538  }
539  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
540  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
541  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:460
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
std::string const & entryDescriptionBranchName()
Definition: BranchType.cc:153
Hash< EntryDescriptionType > EntryDescriptionID
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:145
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:149
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
static Interceptor::Registry registry("Interceptor")
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
void edm::RootFile::readEvent ( EventPrincipal cache)

Definition at line 1376 of file RootFile.cc.

References daqProvenanceHelper_, edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), fileFormatVersion(), fillEventAuxiliary(), forcedRunOffset_, 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(), edm::ProcessHistoryRegistry::reducedProcessHistoryID(), DTTTrigCorrFirst::run, edm::IndexIntoFile::IndexIntoFileItr::run(), and edm::FileFormatVersion::useReducedProcessHistoryID().

1376  {
1379  // read the event auxiliary if not alrady read.
1381 
1382  // read the event
1384 
1385  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1386  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1387 
1388  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1389  // The IndexIntoFile should guarantee that it never fails.
1391  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1393 
1395  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1399
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
bool useReducedProcessHistoryID() const
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
int forcedRunOffset_
Definition: RootFile.h:208
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1637 of file RootFile.cc.

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

Referenced by RootFile().

1637  {
1638  // Read in the event history tree, if we have one...
1639  if(fileFormatVersion().eventHistoryTree()) {
1640  history_.reset(new History);
1641  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1642  if(!eventHistoryTree_) {
1644  << "Failed to find the event history tree.\n";
1645  }
1646  }
1647  }
std::unique_ptr< History > history_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:262
TTree * eventHistoryTree_
Definition: RootFile.h:210
void edm::RootFile::readLuminosityBlock_ ( LuminosityBlockPrincipal lumiPrincipal)

Definition at line 1551 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::LuminosityBlockPrincipal::readImmediate(), edm::RootTree::rootDelayedReader(), edm::RootTree::setEntryNumber(), and edm::EDProductGetter::transitionIndex().

1551  {
1554  // Begin code for backward compatibility before the existence of lumi trees.
1555  if(!lumiTree_.isValid()) {
1557  return;
1558  }
1559  // End code for backward compatibility before the existence of lumi trees.
1561  lumiTree_.insertEntryForIndex(lumiPrincipal.transitionIndex());
1562  lumiPrincipal.fillLuminosityBlockPrincipal(*processHistoryRegistry_, lumiTree_.rootDelayedReader());
1563  // Read in all the products now.
1564  lumiPrincipal.readImmediate();
1566  }
RootTree lumiTree_
Definition: RootFile.h:200
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:97
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:115
bool isValid() const
Definition: RootTree.cc:103
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1513 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, fjr2json::lumi, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::LuminosityBlockID::luminosityBlock(), lumiTree_, overrideRunNumber(), edm::LuminosityBlockID::run(), edm::IndexIntoFile::IndexIntoFileItr::run(), savedRunAuxiliary_, edm::RootTree::setEntryNumber(), cond::rpcobgas::time, and edm::EventAuxiliary::time().

1513  {
1516  // Begin code for backward compatibility before the existence of lumi trees.
1517  if(!lumiTree_.isValid()) {
1519  assert(eventEntry != IndexIntoFile::invalidEntry);
1520  assert(eventTree_.current(eventEntry));
1521  fillEventAuxiliary(eventEntry);
1522 
1524  overrideRunNumber(lumi);
1525  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1526  }
1527  // End code for backward compatibility before the existence of lumi trees.
1529  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1530  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1531  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1532  overrideRunNumber(lumiAuxiliary->id());
1533  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1534  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1536  if(eventEntry != IndexIntoFile::invalidEntry) {
1537  assert(eventTree_.current(eventEntry));
1538  fillEventAuxiliary(eventEntry);
1539 
1540  lumiAuxiliary->setBeginTime(eventAux().time());
1541  }
1542  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1543  }
1544  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1545  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1546  }
1547  return lumiAuxiliary;
1548  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:192
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:200
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
bool current() const
Definition: RootTree.h:87
LuminosityBlockNumber_t lumi() const
long long EntryNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
static EntryNumber_t const invalidEntry
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1229
bool isValid() const
Definition: RootTree.cc:103
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1606
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
void edm::RootFile::readParentageTree ( InputType  inputType)
private

Definition at line 544 of file RootFile.cc.

References daqProvenanceHelper_, edm::hlt::Exception, filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), 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().

544  {
545  // New format file
546  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
547  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
548  if(nullptr == parentageTree.get()) {
549  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
550  << " in the input file.\n";
551  }
552 
553  Parentage parents;
554  Parentage *pParentageBuffer = &parents;
555  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
556 
557  ParentageRegistry& registry = *ParentageRegistry::instance();
558 
559  parentageIDLookup_.reserve(parentageTree->GetEntries());
560  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
561  roottree::getEntry(parentageTree.get(), i);
563  ParentageID const oldID = parents.id();
564  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
565  ParentageID newID = parents.id();
566  if(newID != oldID) {
567  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
568  }
569  }
570  // For thread safety, don't update global registries when a secondary source opens a file.
571  if(inputType != InputType::SecondarySource) {
572  registry.insertMapped(parents);
573  }
574  parentageIDLookup_.push_back(parents.id());
575  }
576  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
577  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:460
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
std::string const & parentageTreeName()
Definition: BranchType.cc:158
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
std::string const & parentageBranchName()
Definition: BranchType.cc:162
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:219
static Interceptor::Registry registry("Interceptor")
static ParentageRegistry * instance()
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
void edm::RootFile::readRun_ ( RunPrincipal runPrincipal)

Definition at line 1496 of file RootFile.cc.

References edm::RunPrincipal::fillRunPrincipal(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::RootTree::insertEntryForIndex(), edm::RootTree::isValid(), edm::IndexIntoFile::kRun, processHistoryRegistry_, edm::RunPrincipal::readImmediate(), edm::RootTree::rootDelayedReader(), runTree_, and edm::EDProductGetter::transitionIndex().

1496  {
1499  // Begin code for backward compatibility before the existence of run trees.
1500  if(!runTree_.isValid()) {
1502  return;
1503  }
1504  // End code for backward compatibility before the existence of run trees.
1505  runTree_.insertEntryForIndex(runPrincipal.transitionIndex());
1506  runPrincipal.fillRunPrincipal(*processHistoryRegistry_, runTree_.rootDelayedReader());
1507  // Read in all the products now.
1508  runPrincipal.readImmediate();
1510  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:97
RootTree runTree_
Definition: RootFile.h:201
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:115
bool isValid() const
Definition: RootTree.cc:103
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
boost::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

Definition at line 1432 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, overrideRunNumber(), edm::FileFormatVersion::processHistorySameWithinRun(), edm::RunID::run(), DTTTrigCorrFirst::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runTree_, savedRunAuxiliary_, edm::RootTree::setEntryNumber(), cond::rpcobgas::time, and edm::EventAuxiliary::time().

1432  {
1435 
1436  // Begin code for backward compatibility before the existence of run trees.
1437  if(!runTree_.isValid()) {
1438 
1439  // prior to the support of run trees.
1440  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1442  assert(eventEntry != IndexIntoFile::invalidEntry);
1443  assert(eventTree_.current(eventEntry));
1444  fillEventAuxiliary(eventEntry);
1445 
1447  overrideRunNumber(run);
1448  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(run.run(), eventAux().time(), Timestamp::invalidTimestamp()));
1449  }
1450  // End code for backward compatibility before the existence of run trees.
1452  boost::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1453  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1454  overrideRunNumber(runAuxiliary->id());
1455  filePtr_->reportInputRunNumber(runAuxiliary->run());
1456  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1457  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1458  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1459  }
1460 
1461  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1462  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1463  // we attempt to read the first event in the run to get appropriate info.
1464  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1466 
1468  // If we have a valid event, use its information.
1469  if(eventEntry != IndexIntoFile::invalidEntry) {
1470  assert(eventTree_.current(eventEntry));
1471  fillEventAuxiliary(eventEntry);
1472 
1473  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1474  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1475  runAuxiliary->setBeginTime(eventAux().time());
1476  }
1477 
1478  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1479  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1480  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1481  // and event ProcessHistory's always be the same if no file merging occurs).
1482  if(!fileFormatVersion().processHistorySameWithinRun()) {
1483  fillEventHistory();
1484  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1485  savedRunAuxiliary_ = runAuxiliary;
1486  }
1487  } else {
1488  // No valid event, just use what is there, because it is the best we can do.
1489  savedRunAuxiliary_ = runAuxiliary;
1490  }
1491  }
1492  return runAuxiliary;
1493  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:192
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
static Timestamp invalidTimestamp()
Definition: Timestamp.h:101
EntryNumber_t firstEventEntryThisRun() const
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
bool current() const
Definition: RootTree.h:87
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1253
long long EntryNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
RootTree runTree_
Definition: RootFile.h:201
static EntryNumber_t const invalidEntry
bool processHistorySameWithinRun() const
void fillEventHistory()
Definition: RootFile.cc:1173
bool isValid() const
Definition: RootTree.cc:103
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1606
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1118 of file RootFile.cc.

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

1118  {
1119  // Report file opened.
1120  std::string const label = "source";
1121  std::string moduleName = "PoolSource";
1122  filePtr_->inputFileOpened(
1123  logicalFile_,
1124  inputType,
1125  moduleName,
1126  label,
1127  fid_.fid(),
1129  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:96
FileID fid_
Definition: RootFile.h:183
std::string const logicalFile_
Definition: RootFile.h:177
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:199
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
void edm::RootFile::rewind ( )
inline

Definition at line 127 of file RootFile.h.

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

127  {
129  eventTree_.rewind();
130  lumiTree_.rewind();
131  runTree_.rewind();
132  }
RootTree lumiTree_
Definition: RootFile.h:200
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
RootTree eventTree_
Definition: RootFile.h:199
RootTree runTree_
Definition: RootFile.h:201
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:187
void rewind()
Definition: RootTree.h:89
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 110 of file RootFile.h.

References runTree_.

Referenced by validateFile().

110 {return runTree_;}
RootTree runTree_
Definition: RootFile.h:201
void edm::RootFile::setAtEventEntry ( IndexIntoFile::EntryNumber_t  entry)

Definition at line 1427 of file RootFile.cc.

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

1427  {
1428  eventTree_.setEntryNumber(entry);
1429  }
RootTree eventTree_
Definition: RootFile.h:199
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

Definition at line 1569 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1569  {
1571  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1573  return true;
1574  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
RootTree eventTree_
Definition: RootFile.h:199
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
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 117 of file RootFile.h.

References setEntryAtEvent(), setEntryAtLumi(), and setEntryAtRun().

117  {
118  return event ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
119  }
tuple lumi
Definition: fjr2json.py:35
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1585
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1577
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
bool setEntryAtEvent(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
Definition: RootFile.cc:1569
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1577 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1577  {
1579  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1581  return true;
1582  }
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:200
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

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

1593  {
1596  }
1599  if(run != indexIntoFileIter_.run()) return false;
1600  if(lumi != indexIntoFileIter_.lumi()) return false;
1602  return true;
1603  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1585 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1585  {
1587  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1589  return true;
1590  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
RootTree runTree_
Definition: RootFile.h:201
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

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

580  {
581  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
582  //we must avoid copying the old branch which stored the per product per event provenance
584  return;
585  }
586  if(!fileFormatVersion().splitProductIDs()) {
588  return;
589  }
592  return;
593  }
594  // Find entry for first event in file
595  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
596  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
597  ++it;
598  }
599  if(it == indexIntoFileEnd_) {
601  return;
602  }
603 
604  // From here on, record all reasons we can't fast clone.
608  }
609  if(skipAnyEvents_) {
611  }
612  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
614  }
615  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
617  }
618  // We no longer fast copy the EventAuxiliary branch, so there
619  // is no longer any need to disable fast copying because the run
620  // number is being modified. Also, this check did not work anyway
621  // because this function is called before forcedRunOffset_ is set.
622 
623  // if(forcedRunOffset_ != 0) {
624  // whyNotFastClonable_ += FileBlock::RunNumberModified;
625  // }
626  if(duplicateChecker_ &&
627  !duplicateChecker_->checkDisabled() &&
628  !duplicateChecker_->noDuplicatesInFile()) {
630  }
631  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
int whyNotFastClonable_
Definition: RootFile.h:195
RootTree lumiTree_
Definition: RootFile.h:200
EntryNumber const & entries() const
Definition: RootTree.h:93
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:207
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
bool noEventSort_
Definition: RootFile.h:194
bool skipAnyEvents_
Definition: RootFile.h:193
RootTree eventTree_
Definition: RootFile.h:199
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:187
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 666 of file RootFile.cc.

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

666  {
668  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
void copyPosition(IndexIntoFileItr const &position)
Copy the position without modifying the pointer to the IndexIntoFile or size.
void edm::RootFile::setToLastEntry ( )
inline

Definition at line 133 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

133  {
135  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
bool edm::RootFile::skipEvents ( int &  offset)

Definition at line 1274 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, evf::evtn::offset(), edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward(), and edm::IndexIntoFile::IndexIntoFileItr::skipEventForward().

1274  {
1275  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1276 
1277  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1278  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1281 
1282  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1283  runOfSkippedEvent,
1284  lumiOfSkippedEvent,
1285  skippedEventEntry);
1286 
1287  // At the end of the file and there were no more events to skip
1288  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1289 
1290  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1291  fillEventAuxiliary(skippedEventEntry);
1292  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1293  continue;
1294  }
1295  }
1296  if(duplicateChecker_ &&
1297  !duplicateChecker_->checkDisabled() &&
1298  !duplicateChecker_->noDuplicatesInFile()) {
1299 
1300  fillEventAuxiliary(skippedEventEntry);
1301  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1302  runOfSkippedEvent,
1303  lumiOfSkippedEvent,
1304  eventAux_.id().event(),
1305  file_)) {
1306  continue;
1307  }
1308  }
1309  --offset;
1310  }
1311 
1312  while(offset < 0) {
1313 
1314  if(duplicateChecker_) {
1315  duplicateChecker_->disable();
1316  }
1317 
1318  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1322 
1323  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1324  runOfEvent,
1325  lumiOfEvent,
1326  eventEntry);
1327 
1328  if(eventEntry == IndexIntoFile::invalidEntry) break;
1329 
1330  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1331  fillEventAuxiliary(eventEntry);
1332  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1333  continue;
1334  }
1335  }
1336  ++offset;
1337  }
1339  }
EventNumber_t event() const
Definition: EventID.h:44
static int const invalidIndex
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
static RunNumber_t const invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
unsigned int offset(bool)
static EntryNumber_t const invalidEntry
static LuminosityBlockNumber_t const invalidLumi
EventID const & id() const
unsigned int RunNumber_t
Definition: EventRange.h:32
EventAuxiliary eventAux_
Definition: RootFile.h:198
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:181
std::string const file_
Definition: RootFile.h:176
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
bool edm::RootFile::skipThisEntry ( )
private

Definition at line 671 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(), and edm::IndexIntoFile::IndexIntoFileItr::skipLumiInRun().

Referenced by getNextItemType().

671  {
673  return false;
674  }
675  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
676 
677  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
679  return true;
680  }
681 
682  // The Lumi is not skipped. If this is an event, see if the event is skipped.
687  eventAux_.id().event())) {
688  return true;
689  }
690  }
691 
692  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
694  eventSkipperByID_->skippingLumis()) {
695  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
696 
697  // There are no lumis in this run, not even ones we will skip
698  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
699  return true;
700  }
701  // If we get here there are lumis in the run, check to see if we are skipping all of them
702  do {
703  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
704  return false;
705  }
706  }
707  while(iterLumi.skipLumiInRun());
708  return true;
709  }
710  }
711  return false;
712  }
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1163
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
static LuminosityBlockNumber_t const invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:198
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:181
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 150 of file RootFile.h.

References treePointers_.

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

Definition at line 1071 of file RootFile.cc.

References edm::createGlobalIdentifier(), daqProvenanceHelper_, duplicateChecker_, edm::IndexIntoFile::empty(), edm::RootTree::entries(), python.tagInventory::entries, edm::errors::EventCorruption, eventTree_, edm::hlt::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().

1071  {
1072  if(!fid_.isValid()) {
1073  fid_ = FileID(createGlobalIdentifier());
1074  }
1075  if(!eventTree_.isValid()) {
1077  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
1078  }
1079 
1080  if(fileFormatVersion().hasIndexIntoFile()) {
1081  if(runTree().entries() > 0) {
1082  assert(!indexIntoFile_.empty());
1083  }
1085  if(daqProvenanceHelper_) {
1086  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1087  for(auto& phid : phidVec) {
1088  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1089  }
1090  }
1092  }
1093  }
1094  else {
1095  assert(indexIntoFile_.empty());
1097  }
1098 
1101  indexIntoFile_.setEventFinder(boost::shared_ptr<IndexIntoFile::EventFinder>(new RootFileEventFinder(eventTree_)));
1102  // We fill the event numbers explicitly if we need to find events in closed files,
1103  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1104  bool needEventNumbers = false;
1105  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1106  if(inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1107  needEventNumbers = true;
1108  }
1109  bool needEventEntries = false;
1110  if(inputType != InputType::Primary || !noEventSort_) {
1111  // We need event entries for sorting or for secondary files or sources.
1112  needEventEntries = true;
1113  }
1114  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1115  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
bool empty() const
True if no runs, lumis, or events are in the file.
EntryNumber const & entries() const
Definition: RootTree.h:93
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
FileID fid_
Definition: RootFile.h:183
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool noEventSort_
Definition: RootFile.h:194
RootTree const & runTree() const
Definition: RootFile.h:110
RootTree eventTree_
Definition: RootFile.h:199
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:103
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
void setEventFinder(boost::shared_ptr< EventFinder > ptr) const
void fillIndexIntoFile()
Definition: RootFile.cc:845
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:186
void setNumberOfEvents(EntryNumber_t nevents) const
bool useReducedProcessHistoryID() const
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 783 of file RootFile.cc.

References indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, fjr2json::lumi, DTTTrigCorrFirst::run, and edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward().

783  {
784  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
785  int phIndex;
788  IndexIntoFile::EntryNumber_t eventEntry;
789  itr.skipEventBackward(phIndex,
790  run,
791  lumi,
792  eventEntry);
793  itr.skipEventBackward(phIndex,
794  run,
795  lumi,
796  eventEntry);
797  return eventEntry == IndexIntoFile::invalidEntry;
798  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
static EntryNumber_t const invalidEntry
unsigned int RunNumber_t
Definition: EventRange.h:32
bool edm::RootFile::wasLastEventJustRead ( ) const

Definition at line 776 of file RootFile.cc.

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

776  {
777  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
778  itr.advanceToEvent();
779  return itr.getEntryType() == IndexIntoFile::kEnd;
780  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 112 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

112 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:195

Member Data Documentation

boost::shared_ptr<BranchChildren> edm::RootFile::branchChildren_
private

Definition at line 214 of file RootFile.h.

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

boost::shared_ptr<BranchIDListHelper> edm::RootFile::branchIDListHelper_
private

Definition at line 206 of file RootFile.h.

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

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

Definition at line 205 of file RootFile.h.

Referenced by branchIDLists(), createFileBlock(), and RootFile().

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 212 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 197 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

std::unique_ptr<DaqProvenanceHelper> edm::RootFile::daqProvenanceHelper_
private
boost::shared_ptr<DuplicateChecker> edm::RootFile::duplicateChecker_
private
EventAuxiliary edm::RootFile::eventAux_
private
TTree* edm::RootFile::eventHistoryTree_
private

Definition at line 210 of file RootFile.h.

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

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

Definition at line 190 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 191 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

boost::shared_ptr<ProductProvenanceRetriever> edm::RootFile::eventProductProvenanceRetriever_
mutableprivate

Definition at line 218 of file RootFile.h.

Referenced by makeProductProvenanceRetriever().

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 211 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

boost::shared_ptr<EventSkipperByID> edm::RootFile::eventSkipperByID_
private

Definition at line 181 of file RootFile.h.

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

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

Definition at line 183 of file RootFile.h.

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

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

Definition at line 176 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 182 of file RootFile.h.

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

boost::shared_ptr<InputFile> edm::RootFile::filePtr_
private
int edm::RootFile::forcedRunOffset_
private

Definition at line 208 of file RootFile.h.

Referenced by overrideRunNumber(), readEvent(), and RootFile().

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

Definition at line 196 of file RootFile.h.

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

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

Definition at line 213 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

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

Definition at line 187 of file RootFile.h.

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

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

Definition at line 184 of file RootFile.h.

Referenced by indexIntoFileSharedPtr().

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

Definition at line 203 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 194 of file RootFile.h.

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

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

Definition at line 186 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 219 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 178 of file RootFile.h.

ProcessHistoryRegistry* edm::RootFile::processHistoryRegistry_
private
InputSource::ProcessingMode edm::RootFile::processingMode_
private

Definition at line 207 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

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

Definition at line 204 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 216 of file RootFile.h.

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

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

Definition at line 217 of file RootFile.h.

Referenced by makeProductProvenanceRetriever(), and RootFile().

RootTree edm::RootFile::runTree_
private
boost::shared_ptr<RunAuxiliary> edm::RootFile::savedRunAuxiliary_
private

Definition at line 192 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 193 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 202 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 195 of file RootFile.h.

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