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

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

std::shared_ptr< BranchChildrenbranchChildren_
 
std::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
std::shared_ptr< BranchIDLists
const > 
branchIDLists_
 
BranchListIndexes branchListIndexes_
 
bool branchListIndexesUnchanged_
 
std::unique_ptr
< DaqProvenanceHelper
daqProvenanceHelper_
 
std::shared_ptr< DuplicateCheckerduplicateChecker_
 
TClass * edProductClass_
 
EventAuxiliary eventAux_
 
TTree * eventHistoryTree_
 
std::vector
< EventProcessHistoryID
eventProcessHistoryIDs_
 
std::vector
< EventProcessHistoryID >
::const_iterator 
eventProcessHistoryIter_
 
std::vector< std::shared_ptr
< ProductProvenanceRetriever > > 
eventProductProvenanceRetrievers_
 
EventSelectionIDVector eventSelectionIDs_
 
std::shared_ptr< EventSkipperByIDeventSkipperByID_
 
RootTree eventTree_
 
FileID fid_
 
std::string const file_
 
FileFormatVersion fileFormatVersion_
 
std::shared_ptr< InputFilefilePtr_
 
int forcedRunOffset_
 
std::array< bool, NumBranchTypeshasNewlyDroppedBranch_
 
std::unique_ptr< Historyhistory_
 
IndexIntoFileindexIntoFile_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
 
std::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_
 
std::shared_ptr
< ProductRegistry const > 
productRegistry_
 
std::unique_ptr
< ProvenanceAdaptor
provenanceAdaptor_
 
std::unique_ptr
< MakeProvenanceReader
provenanceReaderMaker_
 
RootTree runTree_
 
std::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,
std::shared_ptr< InputFile filePtr,
std::shared_ptr< EventSkipperByID eventSkipperByID,
bool  skipAnyEvents,
int  remainingEvents,
int  remainingLumis,
unsigned int  nStreams,
unsigned int  treeCacheSize,
int  treeMaxVirtualSize,
InputSource::ProcessingMode  processingMode,
RunNumber_t const &  forcedRunNumber,
bool  noEventSort,
ProductSelectorRules const &  productSelectorRules,
InputType  inputType,
std::shared_ptr< BranchIDListHelper branchIDListHelper,
std::shared_ptr< DuplicateChecker duplicateChecker,
bool  dropDescendantsOfDroppedProducts,
ProcessHistoryRegistry processHistoryRegistry,
std::vector< std::shared_ptr< IndexIntoFile > > const &  indexesIntoFiles,
std::vector< std::shared_ptr< IndexIntoFile > >::size_type  currentIndexIntoFile,
std::vector< ProcessHistoryID > &  orderedProcessHistoryIDs,
bool  bypassVersionCheck,
bool  labelRawDataLikeMC,
bool  usingGoToEvent,
bool  enablePrefetching 
)

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

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

Definition at line 497 of file RootFile.cc.

497  {
498  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 101 of file RootFile.h.

References branchIDListHelper_.

101 {return branchIDListHelper_;}
std::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_;}
std::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 1134 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().

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

Definition at line 728 of file RootFile.cc.

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

728  {
730  }
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 637 of file RootFile.cc.

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

637  {
638  return std::unique_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
639  eventTree_.tree(),
641  lumiTree_.tree(),
643  runTree_.tree(),
644  runTree_.metaTree(),
647  file_,
649  modifiedIDs(),
650  branchChildren_));
651  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
bool branchListIndexesUnchanged() const
Definition: RootFile.h:114
RootTree lumiTree_
Definition: RootFile.h:200
TTree const * metaTree() const
Definition: RootTree.h:141
TTree const * tree() const
Definition: RootTree.h:139
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::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:214
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 1668 of file RootFile.cc.

References edm::ProductRegistry::allBranchDescriptions(), branchChildren_, edm::BranchDescription::branchID(), edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), CommonMethods::cp(), drop, edProductClass_, file_, edm::getWrapperBasePtr(), hasNewlyDroppedBranch_, edm::InEvent, edm::ProductSelector::initialize(), newBranchToOldBranch(), evf::evtn::offset(), AlCaHLTBitMon_ParallelJobs::p, parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::SecondaryFile, edm::ProductSelector::selected(), treePointers_, and edm::BranchDescription::wrappedName().

Referenced by RootFile().

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

1165  {
1166  if(!eventTree_.current(entry)) {
1167  return false;
1168  }
1169  eventTree_.setEntryNumber(entry);
1171  return true;
1172  }
bool current() const
Definition: RootTree.h:89
RootTree eventTree_
Definition: RootFile.h:199
void fillThisEventAuxiliary()
Definition: RootFile.cc:1146
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
void edm::RootFile::fillEventHistory ( )
private

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

1175  {
1176  // We could consider doing delayed reading, but because we have to
1177  // store this History object in a different tree than the event
1178  // data tree, this is too hard to do in this first version.
1179 
1180  if(fileFormatVersion().eventHistoryBranch()) {
1181  // Lumi block number was not in EventID for the relevant releases.
1182  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1183  if(eventProcessHistoryIter_->eventID() != id) {
1184  EventProcessHistoryID target(id, ProcessHistoryID());
1186  assert(eventProcessHistoryIter_->eventID() == id);
1187  }
1190  } else if(fileFormatVersion().eventHistoryTree()) {
1191  // for backward compatibility.
1192  History* pHistory = history_.get();
1193  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1194  if(!eventHistoryBranch) {
1196  << "Failed to find history branch in event history tree.\n";
1197  }
1198  eventHistoryBranch->SetAddress(&pHistory);
1200  eventAux_.setProcessHistoryID(history_->processHistoryID());
1201  eventSelectionIDs_.swap(history_->eventSelectionIDs());
1202  branchListIndexes_.swap(history_->branchListIndexes());
1203  } else if(fileFormatVersion().noMetaDataTrees()) {
1204  // Current format
1206  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1207  assert(eventSelectionIDBranch != nullptr);
1208  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1210  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1211  assert(branchListIndexesBranch != nullptr);
1212  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1213  }
1214  if(provenanceAdaptor_) {
1215  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1216  for(auto& esID : eventSelectionIDs_) {
1217  esID = provenanceAdaptor_->convertID(esID);
1218  }
1219  }
1220  if(daqProvenanceHelper_) {
1222  }
1224  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1225  provenanceAdaptor_->branchListIndexes(branchListIndexes_);
1226  }
1227  branchIDListHelper_->fixBranchListIndexes(branchListIndexes_);
1228  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:461
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:139
std::vector< BranchListIndex > BranchListIndexes
std::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:93
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:117
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 847 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().

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

Definition at line 1231 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1231  {
1232  auto lumiAuxiliary = std::make_shared<LuminosityBlockAuxiliary>();
1234  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1235  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1236  } else {
1237  LuminosityBlockAux lumiAux;
1238  LuminosityBlockAux *pLumiAux = &lumiAux;
1239  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1240  conversion(lumiAux, *lumiAuxiliary);
1241  }
1242  if(provenanceAdaptor_) {
1243  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1244  }
1245  if(daqProvenanceHelper_) {
1246  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1247  }
1248  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1249  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1250  }
1251  return lumiAuxiliary;
1252  }
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
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:101
std::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1255 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1255  {
1256  auto runAuxiliary = std::make_shared<RunAuxiliary>();
1258  RunAuxiliary *pRunAux = runAuxiliary.get();
1259  runTree_.fillAux<RunAuxiliary>(pRunAux);
1260  } else {
1261  RunAux runAux;
1262  RunAux *pRunAux = &runAux;
1263  runTree_.fillAux<RunAux>(pRunAux);
1264  conversion(runAux, *runAuxiliary);
1265  }
1266  if(provenanceAdaptor_) {
1267  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1268  }
1269  if(daqProvenanceHelper_) {
1270  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1271  }
1272  return runAuxiliary;
1273  }
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:101
void edm::RootFile::fillThisEventAuxiliary ( )
private

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

1146  {
1148  // Already read.
1149  return;
1150  }
1152  EventAuxiliary *pEvAux = &eventAux_;
1153  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1154  } else {
1155  // for backward compatibility.
1156  EventAux eventAux;
1157  EventAux *pEvAux = &eventAux;
1158  eventTree_.fillAux<EventAux>(pEvAux);
1159  conversion(eventAux, eventAux_);
1160  }
1162  }
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:93
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:198
void fillAux(T *&pAux)
Definition: RootTree.h:101
IndexIntoFile::EntryType edm::RootFile::getNextItemType ( RunNumber_t run,
LuminosityBlockNumber_t lumi,
EventNumber_t event 
)

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

733  {
734  // First, account for consecutive skipped entries.
735  while(skipThisEntry()) {
738  }
741  }
742  else {
744  }
745  }
746  // OK, we have an entry that is not skipped.
748  if(entryType == IndexIntoFile::kEnd) {
749  return IndexIntoFile::kEnd;
750  }
751  if(entryType == IndexIntoFile::kRun) {
753  return IndexIntoFile::kRun;
754  } else if(processingMode_ == InputSource::Runs) {
756  return getNextItemType(run, lumi, event);
757  }
758  if(entryType == IndexIntoFile::kLumi) {
761  return IndexIntoFile::kLumi;
764  return getNextItemType(run, lumi, event);
765  }
766  if(isDuplicateEvent()) {
768  return getNextItemType(run, lumi, event);
769  }
773  event = eventAux_.event();
774  return IndexIntoFile::kEvent;
775  }
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:1165
bool skipThisEntry()
Definition: RootFile.cc:673
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:733
bool isDuplicateEvent()
Definition: RootFile.cc:717
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 1344 of file RootFile.cc.

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

1344  {
1345 
1347 
1348  if(duplicateChecker_) {
1349  duplicateChecker_->disable();
1350  }
1351 
1354 
1355  IndexIntoFile::IndexIntoFileItr iter =
1357 
1358  if(iter == indexIntoFile_.end(sortOrder)) {
1359  return false;
1360  }
1362  return true;
1363  }
RunNumber_t run() const
Definition: EventID.h:39
EventID const & eventID() const
Definition: RootFile.h:107
EventNumber_t event() const
Definition: EventID.h:41
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
IndexIntoFileItr findPosition(RunNumber_t run, LuminosityBlockNumber_t lumi=0U, EventNumber_t event=0U) const
bool noEventSort_
Definition: RootFile.h: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::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
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 663 of file RootFile.cc.

References indexIntoFileIter_.

663  {
664  return indexIntoFileIter_;
665  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
std::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 141 of file RootFile.h.

References indexIntoFileSharedPtr_.

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

Definition at line 1652 of file RootFile.cc.

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

Referenced by RootFile().

1654  {
1655  if(duplicateChecker_) {
1656  if(eventTree_.next()) {
1658  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1660  indexesIntoFiles,
1661  currentIndexIntoFile);
1662  }
1664  }
1665  }
bool next()
Definition: RootTree.h:87
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
std::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
void fillThisEventAuxiliary()
Definition: RootFile.cc:1146
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
bool edm::RootFile::isDuplicateEvent ( )
private

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

717  {
719  if(duplicateChecker_.get() == nullptr) {
720  return false;
721  }
723  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
725  }
EventNumber_t event() const
Definition: EventID.h:41
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1165
EventID const & id() const
std::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
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
std::shared_ptr< ProductProvenanceRetriever > edm::RootFile::makeProductProvenanceRetriever ( unsigned int  iStreamIndex)
private

Definition at line 1751 of file RootFile.cc.

References daqProvenanceHelper_, eventProductProvenanceRetrievers_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1751  {
1752  if(eventProductProvenanceRetrievers_.size()<=iStreamID) {
1753  eventProductProvenanceRetrievers_.resize(iStreamID+1);
1754  }
1755  if(!eventProductProvenanceRetrievers_[iStreamID]) {
1756  eventProductProvenanceRetrievers_[iStreamID].reset(new ProductProvenanceRetriever(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1757  }
1758  eventProductProvenanceRetrievers_[iStreamID]->reset();
1759  return eventProductProvenanceRetrievers_[iStreamID];
1760  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:217
std::vector< std::shared_ptr< ProductProvenanceRetriever > > eventProductProvenanceRetrievers_
Definition: RootFile.h:218
RootTree eventTree_
Definition: RootFile.h:199
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 1734 of file RootFile.cc.

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

Referenced by RootFile().

1734  {
1736  readParentageTree(inputType);
1737  return std::unique_ptr<MakeProvenanceReader>(new MakeReducedProvenanceReader(parentageIDLookup_));
1738  } else if(fileFormatVersion_.splitProductIDs()) {
1739  readParentageTree(inputType);
1740  return std::unique_ptr<MakeProvenanceReader>(new MakeFullProvenanceReader);
1741  } else if(fileFormatVersion_.perEventProductIDs()) {
1742  std::unique_ptr<EntryDescriptionMap> entryDescriptionMap(new EntryDescriptionMap);
1743  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1744  return std::unique_ptr<MakeProvenanceReader>(new MakeOldProvenanceReader(std::move(entryDescriptionMap)));
1745  } else {
1746  return std::unique_ptr<MakeProvenanceReader>(new MakeDummyProvenanceReader);
1747  }
1748  }
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:501
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:182
void readParentageTree(InputType inputType)
Definition: RootFile.cc:547
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 654 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

654  {
655  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
656  if(it != newBranchToOldBranch_.end()) {
657  return it->second;
658  }
659  return newBranch;
660  }
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:87
RootTree eventTree_
Definition: RootFile.h:199
RootFile& edm::RootFile::operator= ( RootFile const &  )
delete
void edm::RootFile::overrideRunNumber ( RunID id)
private

Definition at line 1608 of file RootFile.cc.

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

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

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

Definition at line 1616 of file RootFile.cc.

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

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

Definition at line 1624 of file RootFile.cc.

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

1624  {
1625  if(forcedRunOffset_ != 0) {
1626  if(isRealData) {
1627  throw Exception(errors::Configuration, "RootFile::RootFile()")
1628  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1629  }
1630  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1631  }
1632  if(RunID(id.run()) < RunID::firstValidRun()) {
1633  id = EventID(RunID::firstValidRun().run(), LuminosityBlockID::firstValidLuminosityBlock().luminosityBlock(), id.event());
1634  }
1635  }
static LuminosityBlockID firstValidLuminosityBlock()
static RunID firstValidRun()
Definition: RunID.h:77
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
std::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_;}
std::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:204
bool edm::RootFile::readCurrentEvent ( EventPrincipal cache)

Definition at line 1401 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(), edm::EventPrincipal::streamID(), edm::EDProductGetter::transitionIndex(), and edm::StreamID::value().

Referenced by readEvent().

1401  {
1402  if(!eventTree_.current()) {
1403  return false;
1404  }
1406  if(!fileFormatVersion().lumiInEventID()) {
1407  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1408  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1410  }
1411  fillEventHistory();
1413 
1414  // We're not done ... so prepare the EventPrincipal
1415  eventTree_.insertEntryForIndex(principal.transitionIndex());
1416  principal.fillEventPrincipal(eventAux(),
1418  std::move(eventSelectionIDs_),
1419  std::move(branchListIndexes_),
1420  *(makeProductProvenanceRetriever(principal.streamID().value())),
1422 
1423  // report event read from file
1424  filePtr_->eventReadFromFile();
1425  return true;
1426  }
bool isRealData() const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
bool current() const
Definition: RootTree.h:89
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:98
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
std::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:116
void fillEventHistory()
Definition: RootFile.cc:1175
std::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:1751
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1608
EventAuxiliary eventAux_
Definition: RootFile.h:198
void fillThisEventAuxiliary()
Definition: RootFile.cc:1146
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

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

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

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

1378  {
1381  // read the event auxiliary if not alrady read.
1383 
1384  // read the event
1386 
1387  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1388  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1389 
1390  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1391  // The IndexIntoFile should guarantee that it never fails.
1393  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1395 
1397  }
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:1401
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1165
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 1639 of file RootFile.cc.

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

Referenced by RootFile().

1639  {
1640  // Read in the event history tree, if we have one...
1641  if(fileFormatVersion().eventHistoryTree()) {
1642  history_.reset(new History);
1643  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1644  if(!eventHistoryTree_) {
1646  << "Failed to find the event history tree.\n";
1647  }
1648  }
1649  }
std::unique_ptr< History > history_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
std::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 1553 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().

1553  {
1556  // Begin code for backward compatibility before the existence of lumi trees.
1557  if(!lumiTree_.isValid()) {
1559  return;
1560  }
1561  // End code for backward compatibility before the existence of lumi trees.
1563  lumiTree_.insertEntryForIndex(lumiPrincipal.transitionIndex());
1564  lumiPrincipal.fillLuminosityBlockPrincipal(*processHistoryRegistry_, lumiTree_.rootDelayedReader());
1565  // Read in all the products now.
1566  lumiPrincipal.readImmediate();
1568  }
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:98
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:116
bool isValid() const
Definition: RootTree.cc:104
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:179
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
std::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

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

1515  {
1518  // Begin code for backward compatibility before the existence of lumi trees.
1519  if(!lumiTree_.isValid()) {
1521  assert(eventEntry != IndexIntoFile::invalidEntry);
1522  assert(eventTree_.current(eventEntry));
1523  fillEventAuxiliary(eventEntry);
1524 
1525  LuminosityBlockID lumi = LuminosityBlockID(indexIntoFileIter_.run(), indexIntoFileIter_.lumi());
1526  overrideRunNumber(lumi);
1527  return std::make_shared<LuminosityBlockAuxiliary>(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp());
1528  }
1529  // End code for backward compatibility before the existence of lumi trees.
1531  std::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1532  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1533  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1534  overrideRunNumber(lumiAuxiliary->id());
1535  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1536  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1538  if(eventEntry != IndexIntoFile::invalidEntry) {
1539  assert(eventTree_.current(eventEntry));
1540  fillEventAuxiliary(eventEntry);
1541 
1542  lumiAuxiliary->setBeginTime(eventAux().time());
1543  }
1544  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1545  }
1546  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1547  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1548  }
1549  return lumiAuxiliary;
1550  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:111
std::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1231
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:89
LuminosityBlockNumber_t lumi() const
long long EntryNumber_t
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1165
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
EventAuxiliary const & eventAux() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:199
std::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
static EntryNumber_t const invalidEntry
bool isValid() const
Definition: RootTree.cc:104
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1608
std::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:192
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
void edm::RootFile::readParentageTree ( InputType  inputType)
private

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

547  {
548  // New format file
549  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
550  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
551  if(nullptr == parentageTree.get()) {
552  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
553  << " in the input file.\n";
554  }
555 
556  Parentage parents;
557  Parentage *pParentageBuffer = &parents;
558  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
559 
560  ParentageRegistry& registry = *ParentageRegistry::instance();
561 
562  parentageIDLookup_.reserve(parentageTree->GetEntries());
563  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
564  roottree::getEntry(parentageTree.get(), i);
566  ParentageID const oldID = parents.id();
567  daqProvenanceHelper_->fixMetaData(parents.parentsForUpdate());
568  ParentageID newID = parents.id();
569  if(newID != oldID) {
570  daqProvenanceHelper_->setOldParentageIDToNew(oldID,newID);
571  }
572  }
573  // For thread safety, don't update global registries when a secondary source opens a file.
574  if(inputType != InputType::SecondarySource) {
575  registry.insertMapped(parents);
576  }
577  parentageIDLookup_.push_back(parents.id());
578  }
579  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
580  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:461
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::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:180
std::string const & parentageBranchName()
Definition: BranchType.cc:162
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
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 1498 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().

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

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

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

Definition at line 1120 of file RootFile.cc.

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

1120  {
1121  // Report file opened.
1122  std::string const label = "source";
1123  std::string moduleName = "PoolSource";
1124  filePtr_->inputFileOpened(
1125  logicalFile_,
1126  inputType,
1127  moduleName,
1128  label,
1129  fid_.fid(),
1131  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:98
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
std::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:91
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 1429 of file RootFile.cc.

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

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

Definition at line 1571 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1571  {
1573  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1575  return true;
1576  }
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:190
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:1587
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1579
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:1571
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1579 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1579  {
1581  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1583  return true;
1584  }
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:190
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

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

1595  {
1598  }
1601  if(run != indexIntoFileIter_.run()) return false;
1602  if(lumi != indexIntoFileIter_.lumi()) return false;
1604  return true;
1605  }
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:1165
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1587 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1587  {
1589  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1591  return true;
1592  }
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:190
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

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

583  {
584  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
585  //we must avoid copying the old branch which stored the per product per event provenance
587  return;
588  }
589  if(!fileFormatVersion().splitProductIDs()) {
591  return;
592  }
595  return;
596  }
597  // Find entry for first event in file
598  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
599  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
600  ++it;
601  }
602  if(it == indexIntoFileEnd_) {
604  return;
605  }
606 
607  // From here on, record all reasons we can't fast clone.
611  }
612  if(skipAnyEvents_) {
614  }
615  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
617  }
618  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
620  }
621  // We no longer fast copy the EventAuxiliary branch, so there
622  // is no longer any need to disable fast copying because the run
623  // number is being modified. Also, this check did not work anyway
624  // because this function is called before forcedRunOffset_ is set.
625 
626  // if(forcedRunOffset_ != 0) {
627  // whyNotFastClonable_ += FileBlock::RunNumberModified;
628  // }
629  if(duplicateChecker_ &&
630  !duplicateChecker_->checkDisabled() &&
631  !duplicateChecker_->noDuplicatesInFile()) {
633  }
634  }
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:95
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:207
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
std::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 668 of file RootFile.cc.

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

668  {
670  }
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 1276 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().

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

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

1073  {
1074  if(!fid_.isValid()) {
1075  fid_ = FileID(createGlobalIdentifier());
1076  }
1077  if(!eventTree_.isValid()) {
1079  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
1080  }
1081 
1082  if(fileFormatVersion().hasIndexIntoFile()) {
1083  if(runTree().entries() > 0) {
1084  assert(!indexIntoFile_.empty());
1085  }
1087  if(daqProvenanceHelper_) {
1088  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1089  for(auto& phid : phidVec) {
1090  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1091  }
1092  }
1094  }
1095  }
1096  else {
1097  assert(indexIntoFile_.empty());
1099  }
1100 
1103  indexIntoFile_.setEventFinder(std::shared_ptr<IndexIntoFile::EventFinder>(std::make_shared<RootFileEventFinder>(eventTree_)));
1104  // We fill the event numbers explicitly if we need to find events in closed files,
1105  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1106  bool needEventNumbers = false;
1107  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1108  if(inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1109  needEventNumbers = true;
1110  }
1111  bool needEventEntries = false;
1112  if(inputType != InputType::Primary || !noEventSort_) {
1113  // We need event entries for sorting or for secondary files or sources.
1114  needEventEntries = true;
1115  }
1116  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1117  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
void setEventFinder(std::shared_ptr< EventFinder > ptr) 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:95
void reduceProcessHistoryIDs(ProcessHistoryRegistry const &processHistoryRegistry)
FileID fid_
Definition: RootFile.h:183
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:104
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:220
void fillIndexIntoFile()
Definition: RootFile.cc:847
std::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:215
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 785 of file RootFile.cc.

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

785  {
786  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
787  int phIndex;
790  IndexIntoFile::EntryNumber_t eventEntry;
791  itr.skipEventBackward(phIndex,
792  run,
793  lumi,
794  eventEntry);
795  itr.skipEventBackward(phIndex,
796  run,
797  lumi,
798  eventEntry);
799  return eventEntry == IndexIntoFile::invalidEntry;
800  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
unsigned int LuminosityBlockNumber_t
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 778 of file RootFile.cc.

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

778  {
779  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
780  itr.advanceToEvent();
781  return itr.getEntryType() == IndexIntoFile::kEnd;
782  }
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

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

Definition at line 214 of file RootFile.h.

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

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

Definition at line 206 of file RootFile.h.

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

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

Definition at line 205 of file RootFile.h.

Referenced by branchIDLists(), 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
std::shared_ptr<DuplicateChecker> edm::RootFile::duplicateChecker_
private
TClass* edm::RootFile::edProductClass_
private

Definition at line 221 of file RootFile.h.

Referenced by dropOnInput().

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

std::vector<std::shared_ptr<ProductProvenanceRetriever> > edm::RootFile::eventProductProvenanceRetrievers_
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().

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

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

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