CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::RootFile Class Reference

#include <RootFile.h>

Public Types

typedef std::array< RootTree
*, NumBranchTypes
RootTreePtrArray
 

Public Member Functions

boost::shared_ptr
< BranchIDListHelper const > 
branchIDListHelper () const
 
BranchIDLists const & branchIDLists ()
 
bool branchListIndexesUnchanged () const
 
void close ()
 
bool containsItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
 
std::unique_ptr< FileBlockcreateFileBlock () const
 
EventAuxiliary const & eventAux () const
 
EventID const & eventID () const
 
RootTree const & eventTree () const
 
std::string const & file () const
 
FileFormatVersion fileFormatVersion () const
 
IndexIntoFile::EntryType getNextItemType (RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
 
bool goToEvent (EventID const &eventID)
 
std::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter () const
 
boost::shared_ptr< IndexIntoFileindexIntoFileSharedPtr () const
 
RootTree const & lumiTree () const
 
bool modifiedIDs () const
 
bool nextEventEntry ()
 
RootFileoperator= (RootFile const &)=delete
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 
bool readCurrentEvent (EventPrincipal &cache)
 
void readEvent (EventPrincipal &cache)
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
void readRun_ (RunPrincipal &runPrincipal)
 
boost::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()
 
void reportOpened (std::string const &inputType)
 
void rewind ()
 
 RootFile (std::string const &fileName, ProcessConfiguration const &processConfiguration, std::string const &logicalFileName, boost::shared_ptr< InputFile > filePtr, boost::shared_ptr< EventSkipperByID > eventSkipperByID, bool skipAnyEvents, int remainingEvents, int remainingLumis, unsigned int nStreams, unsigned int treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunNumber_t const &forcedRunNumber, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType inputType, boost::shared_ptr< BranchIDListHelper > branchIDListHelper, boost::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, ProcessHistoryRegistry &processHistoryRegistry, std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching)
 
 RootFile (RootFile const &)=delete
 
RootTree const & runTree () const
 
void setAtEventEntry (IndexIntoFile::EntryNumber_t entry)
 
bool setEntryAtEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtNextEventInLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtRun (RunNumber_t run)
 
void setPosition (IndexIntoFile::IndexIntoFileItr const &position)
 
void setToLastEntry ()
 
bool skipEvents (int &offset)
 
bool wasFirstEventJustRead () const
 
bool wasLastEventJustRead () const
 
int whyNotFastClonable () const
 
 ~RootFile ()
 

Private Member Functions

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

Private Attributes

boost::shared_ptr< BranchChildrenbranchChildren_
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
boost::shared_ptr
< BranchIDLists const > 
branchIDLists_
 
BranchListIndexes branchListIndexes_
 
bool branchListIndexesUnchanged_
 
std::unique_ptr
< DaqProvenanceHelper
daqProvenanceHelper_
 
boost::shared_ptr
< DuplicateChecker
duplicateChecker_
 
EventAuxiliary eventAux_
 
TTree * eventHistoryTree_
 
std::vector
< EventProcessHistoryID
eventProcessHistoryIDs_
 
std::vector
< EventProcessHistoryID >
::const_iterator 
eventProcessHistoryIter_
 
boost::shared_ptr
< ProductProvenanceRetriever
eventProductProvenanceRetriever_
 
EventSelectionIDVector eventSelectionIDs_
 
boost::shared_ptr
< EventSkipperByID
eventSkipperByID_
 
RootTree eventTree_
 
FileID fid_
 
std::string const file_
 
FileFormatVersion fileFormatVersion_
 
boost::shared_ptr< InputFilefilePtr_
 
int forcedRunOffset_
 
std::array< bool, NumBranchTypeshasNewlyDroppedBranch_
 
std::unique_ptr< Historyhistory_
 
IndexIntoFileindexIntoFile_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
 
boost::shared_ptr< IndexIntoFileindexIntoFileSharedPtr_
 
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
 
std::string const logicalFile_
 
RootTree lumiTree_
 
std::map< std::string,
std::string > 
newBranchToOldBranch_
 
bool noEventSort_
 
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
 
std::vector< ParentageIDparentageIDLookup_
 
ProcessConfiguration const & processConfiguration_
 
ProcessHistoryRegistryprocessHistoryRegistry_
 
InputSource::ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry_
 
std::unique_ptr
< ProvenanceAdaptor
provenanceAdaptor_
 
std::unique_ptr
< MakeProvenanceReader
provenanceReaderMaker_
 
RootTree runTree_
 
boost::shared_ptr< RunAuxiliarysavedRunAuxiliary_
 
bool skipAnyEvents_
 
RootTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 55 of file RootFile.h.

Member Typedef Documentation

Definition at line 57 of file RootFile.h.

Constructor & Destructor Documentation

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

Definition at line 136 of file RootFile.cc.

References edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), branchIDListHelper_, branchIDLists_, branchListIndexesUnchanged_, edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), edm::BranchTypeToAuxiliaryBranchName(), edm::BranchDescription::className(), edm::ProductRegistry::copyProduct(), daqProvenanceHelper_, edm::roottree::defaultNonEventCacheSize, edm::IndexIntoFile::doneFileInitialization(), dropOnInput(), edm::IndexIntoFile::end(), edm::errors::EventCorruption, edm::poolNames::eventHistoryBranchName(), eventProcessHistoryIDs_, eventProcessHistoryIter_, eventSkipperByID_, edm::FileBlock::EventsOrLumisSelectedByID, eventTree_, edm::hlt::Exception, fid_, file(), fileFormatVersion(), fileFormatVersion_, edm::poolNames::fileFormatVersionBranchName(), edm::poolNames::fileIdentifierBranchName(), filePtr_, edm::errors::FileReadError, edm::IndexIntoFile::firstAppearanceOrder, forcedRunOffset_, edm::BranchDescription::friendlyClassName(), edm::friendlyname::friendlyName(), edm::roottree::getEntry(), hasNewlyDroppedBranch_, i, edm::poolNames::idToParameterSetBlobsBranchName(), indexIntoFile_, indexIntoFileBegin_, edm::poolNames::indexIntoFileBranchName(), indexIntoFileEnd_, indexIntoFileIter_, edm::InEvent, edm::BranchDescription::init(), initializeDuplicateChecker(), edm::InLumi, edm::InRun, edm::pset::Registry::insertMapped(), edm::pset::Registry::instance(), lumiTree_, makeProvenanceReaderMaker(), edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::Primary, edm::poolNames::processConfigurationBranchName(), edm::poolNames::processHistoryBranchName(), edm::poolNames::processHistoryMapBranchName(), parseEventContent::prod, edm::poolNames::productDependenciesBranchName(), edm::poolNames::productDescriptionBranchName(), edm::ProductRegistry::productList(), edm::ProductRegistry::productListUpdator(), productRegistry(), productRegistry_, provenanceAdaptor_, provenanceReaderMaker_, readEventHistoryTree(), edm::ProcessHistoryRegistry::registerProcessHistory(), fetchall_from_DQM_v2::release, edm::RootTree::resetTraining(), runTree_, edm::SecondarySource, edm::ParameterSet::setID(), setIfFastClonable(), edm::setRefCoreStreamer(), edm::source(), AlCaHLTBitMon_QueryRunRegistry::string, edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), validateFile(), and whyNotFastClonable_.

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

Definition at line 491 of file RootFile.cc.

491  {
492  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 100 of file RootFile.h.

References branchIDListHelper_.

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

Definition at line 101 of file RootFile.h.

References branchIDLists_.

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

Definition at line 113 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

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

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

Definition at line 723 of file RootFile.cc.

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

723  {
725  }
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:184
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 631 of file RootFile.cc.

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

631  {
632  return std::unique_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
633  eventTree_.tree(),
635  lumiTree_.tree(),
637  runTree_.tree(),
638  runTree_.metaTree(),
641  file_,
643  modifiedIDs(),
645  branchIDLists_));
646  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:110
bool branchListIndexesUnchanged() const
Definition: RootFile.h:113
RootTree lumiTree_
Definition: RootFile.h:199
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:204
TTree const * metaTree() const
Definition: RootTree.h:139
TTree const * tree() const
Definition: RootTree.h:137
bool modifiedIDs() const
Definition: RootFile.h:114
int whyNotFastClonable() const
Definition: RootFile.h:111
RootTree eventTree_
Definition: RootFile.h:198
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:112
RootTree runTree_
Definition: RootFile.h:200
std::string const file_
Definition: RootFile.h:175
void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType  inputType 
)
private

Definition at line 1663 of file RootFile.cc.

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

Referenced by RootFile().

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

Definition at line 106 of file RootFile.h.

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

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

Definition at line 107 of file RootFile.h.

References eventTree_.

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

Definition at line 98 of file RootFile.h.

References file_.

Referenced by RootFile().

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

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

1160  {
1161  if(!eventTree_.current(entry)) {
1162  return false;
1163  }
1164  eventTree_.setEntryNumber(entry);
1166  return true;
1167  }
bool current() const
Definition: RootTree.h:87
RootTree eventTree_
Definition: RootFile.h:198
void fillThisEventAuxiliary()
Definition: RootFile.cc:1141
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
void edm::RootFile::fillEventHistory ( )
private

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

1170  {
1171  // We could consider doing delayed reading, but because we have to
1172  // store this History object in a different tree than the event
1173  // data tree, this is too hard to do in this first version.
1174 
1175  if(fileFormatVersion().eventHistoryBranch()) {
1176  // Lumi block number was not in EventID for the relevant releases.
1177  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1178  if(eventProcessHistoryIter_->eventID() != id) {
1179  EventProcessHistoryID target(id, ProcessHistoryID());
1181  assert(eventProcessHistoryIter_->eventID() == id);
1182  }
1185  } else if(fileFormatVersion().eventHistoryTree()) {
1186  // for backward compatibility.
1187  History* pHistory = history_.get();
1188  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1189  if(!eventHistoryBranch) {
1191  << "Failed to find history branch in event history tree.\n";
1192  }
1193  eventHistoryBranch->SetAddress(&pHistory);
1195  eventAux_.setProcessHistoryID(history_->processHistoryID());
1196  eventSelectionIDs_.swap(history_->eventSelectionIDs());
1197  branchListIndexes_.swap(history_->branchListIndexes());
1198  } else if(fileFormatVersion().noMetaDataTrees()) {
1199  // Current format
1201  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1202  assert(eventSelectionIDBranch != nullptr);
1203  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1205  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1206  assert(branchListIndexesBranch != nullptr);
1207  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1208  }
1209  if(provenanceAdaptor_) {
1210  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1211  for(auto& esID : eventSelectionIDs_) {
1212  esID = provenanceAdaptor_->convertID(esID);
1213  }
1214  }
1215  if(daqProvenanceHelper_) {
1217  }
1219  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1220  provenanceAdaptor_->branchListIndexes(branchListIndexes_);
1221  }
1222  branchIDListHelper_->fixBranchListIndexes(branchListIndexes_);
1223  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:460
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:215
std::unique_ptr< History > history_
Definition: RootFile.h:212
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:110
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:190
TTree const * tree() const
Definition: RootTree.h:137
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: RootFile.h:205
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:232
EventAuxiliary const & eventAux() const
Definition: RootFile.h:102
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:210
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:198
BranchListIndexes branchListIndexes_
Definition: RootFile.h:211
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
Hash< ProcessHistoryType > ProcessHistoryID
EntryNumber const & entryNumber() const
Definition: RootTree.h:91
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:115
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:219
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
EventAuxiliary eventAux_
Definition: RootFile.h:197
TTree * eventHistoryTree_
Definition: RootFile.h:209
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:189
void edm::RootFile::fillIndexIntoFile ( )
private

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

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

Definition at line 1226 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

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

Definition at line 1250 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

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

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

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

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

728  {
729  // First, account for consecutive skipped entries.
730  while(skipThisEntry()) {
733  }
736  }
737  else {
739  }
740  }
741  // OK, we have an entry that is not skipped.
743  if(entryType == IndexIntoFile::kEnd) {
744  return IndexIntoFile::kEnd;
745  }
746  if(entryType == IndexIntoFile::kRun) {
748  return IndexIntoFile::kRun;
749  } else if(processingMode_ == InputSource::Runs) {
751  return getNextItemType(run, lumi, event);
752  }
753  if(entryType == IndexIntoFile::kLumi) {
756  return IndexIntoFile::kLumi;
759  return getNextItemType(run, lumi, event);
760  }
761  if(isDuplicateEvent()) {
763  return getNextItemType(run, lumi, event);
764  }
768  event = eventAux_.event();
769  return IndexIntoFile::kEvent;
770  }
tuple lumi
Definition: fjr2json.py:35
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:206
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1160
bool skipThisEntry()
Definition: RootFile.cc:668
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:728
bool isDuplicateEvent()
Definition: RootFile.cc:712
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:197
EventNumber_t event() const
bool edm::RootFile::goToEvent ( EventID const &  eventID)

Definition at line 1339 of file RootFile.cc.

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

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

Definition at line 112 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 658 of file RootFile.cc.

References indexIntoFileIter_.

658  {
659  return indexIntoFileIter_;
660  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 140 of file RootFile.h.

References indexIntoFileSharedPtr_.

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

Definition at line 1647 of file RootFile.cc.

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

Referenced by RootFile().

1649  {
1650  if(duplicateChecker_) {
1651  if(eventTree_.next()) {
1653  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1655  indexesIntoFiles,
1656  currentIndexIntoFile);
1657  }
1659  }
1660  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:214
bool next()
Definition: RootTree.h:85
EventAuxiliary const & eventAux() const
Definition: RootFile.h:102
RootTree eventTree_
Definition: RootFile.h:198
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:184
static EntryNumber_t const invalidEntry
void fillThisEventAuxiliary()
Definition: RootFile.cc:1141
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::isDuplicateEvent ( )
private

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

712  {
714  if(duplicateChecker_.get() == nullptr) {
715  return false;
716  }
718  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
720  }
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1160
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:214
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:197
std::string const file_
Definition: RootFile.h:175
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 108 of file RootFile.h.

References lumiTree_.

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

Definition at line 1744 of file RootFile.cc.

References daqProvenanceHelper_, eventProductProvenanceRetriever_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1744  {
1746  eventProductProvenanceRetriever_.reset(new ProductProvenanceRetriever(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1747  }
1750  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:216
RootTree eventTree_
Definition: RootFile.h:198
boost::shared_ptr< ProductProvenanceRetriever > eventProductProvenanceRetriever_
Definition: RootFile.h:217
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:219
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( InputType  inputType)
private

Definition at line 1727 of file RootFile.cc.

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

Referenced by RootFile().

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

Definition at line 114 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

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

Definition at line 649 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

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

Definition at line 138 of file RootFile.h.

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

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

Definition at line 1603 of file RootFile.cc.

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

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

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

Definition at line 1611 of file RootFile.cc.

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

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

Definition at line 1619 of file RootFile.cc.

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

1619  {
1620  if(forcedRunOffset_ != 0) {
1621  if(isRealData) {
1622  throw Exception(errors::Configuration, "RootFile::RootFile()")
1623  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1624  }
1625  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1626  }
1627  if(RunID(id.run()) < RunID::firstValidRun()) {
1629  }
1630  }
static LuminosityBlockID firstValidLuminosityBlock()
static RunID firstValidRun()
Definition: RunID.h:81
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
int forcedRunOffset_
Definition: RootFile.h:207
boost::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 99 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

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

Definition at line 1396 of file RootFile.cc.

References branchListIndexes_, edm::RootTree::current(), eventAux(), eventAux_, eventSelectionIDs_, eventTree_, fileFormatVersion(), filePtr_, fillEventHistory(), edm::EventPrincipal::fillEventPrincipal(), fillThisEventAuxiliary(), edm::EventAuxiliary::id(), edm::RootTree::insertEntryForIndex(), edm::EventAuxiliary::isRealData(), makeProductProvenanceRetriever(), edm::EventAuxiliary::oldLuminosityBlock(), overrideRunNumber(), processHistoryRegistry_, edm::EventAuxiliary::resetObsoleteInfo(), edm::RootTree::rootDelayedReader(), and edm::EDProductGetter::transitionIndex().

Referenced by readEvent().

1396  {
1397  if(!eventTree_.current()) {
1398  return false;
1399  }
1401  if(!fileFormatVersion().lumiInEventID()) {
1402  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1403  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1405  }
1406  fillEventHistory();
1408 
1409  // We're not done ... so prepare the EventPrincipal
1410  eventTree_.insertEntryForIndex(principal.transitionIndex());
1411  principal.fillEventPrincipal(eventAux(),
1413  std::move(eventSelectionIDs_),
1414  std::move(branchListIndexes_),
1417 
1418  // report event read from file
1419  filePtr_->eventReadFromFile();
1420  return true;
1421  }
bool isRealData() const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:110
bool current() const
Definition: RootTree.h:87
void insertEntryForIndex(unsigned int index)
Definition: RootTree.cc:97
EventAuxiliary const & eventAux() const
Definition: RootFile.h:102
EventSelectionIDVector eventSelectionIDs_
Definition: RootFile.h:210
RootTree eventTree_
Definition: RootFile.h:198
BranchListIndexes branchListIndexes_
Definition: RootFile.h:211
LuminosityBlockNumber_t oldLuminosityBlock() const
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:115
boost::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever()
Definition: RootFile.cc:1744
void fillEventHistory()
Definition: RootFile.cc:1170
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1603
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:179
EventAuxiliary eventAux_
Definition: RootFile.h:197
void fillThisEventAuxiliary()
Definition: RootFile.cc:1141
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:178
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

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

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

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

1373  {
1376  // read the event auxiliary if not alrady read.
1378 
1379  // read the event
1381 
1382  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1383  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1384 
1385  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1386  // The IndexIntoFile should guarantee that it never fails.
1388  ProcessHistoryID const& reducedPHID = processHistoryRegistry_->reducedProcessHistoryID(idToCheck);
1390 
1392  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:110
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
LuminosityBlockNumber_t lumi() const
bool readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1396
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1160
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:187
EventAuxiliary const & eventAux() const
Definition: RootFile.h:102
ProcessHistoryID const & reducedProcessHistoryID(ProcessHistoryID const &fullID) const
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:184
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:219
bool useReducedProcessHistoryID() const
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:178
int forcedRunOffset_
Definition: RootFile.h:207
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1634 of file RootFile.cc.

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

Referenced by RootFile().

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

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

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

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

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

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

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

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

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

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

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

Definition at line 1115 of file RootFile.cc.

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

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

Definition at line 126 of file RootFile.h.

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

126  {
128  eventTree_.rewind();
129  lumiTree_.rewind();
130  runTree_.rewind();
131  }
RootTree lumiTree_
Definition: RootFile.h:199
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
RootTree eventTree_
Definition: RootFile.h:198
RootTree runTree_
Definition: RootFile.h:200
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:186
void rewind()
Definition: RootTree.h:89
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 109 of file RootFile.h.

References runTree_.

Referenced by validateFile().

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

Definition at line 1424 of file RootFile.cc.

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

1424  {
1425  eventTree_.setEntryNumber(entry);
1426  }
RootTree eventTree_
Definition: RootFile.h:198
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:189
bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

Definition at line 1566 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

Definition at line 116 of file RootFile.h.

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

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

Definition at line 1574 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

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

Definition at line 1582 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

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

Definition at line 663 of file RootFile.cc.

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

663  {
665  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
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 132 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

132  {
134  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:187
bool edm::RootFile::skipEvents ( int &  offset)

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

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

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

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

Definition at line 149 of file RootFile.h.

References treePointers_.

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

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

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

Definition at line 780 of file RootFile.cc.

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

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

Definition at line 773 of file RootFile.cc.

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

773  {
774  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
775  itr.advanceToEvent();
776  return itr.getEntryType() == IndexIntoFile::kEnd;
777  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:188
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 111 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

111 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:194

Member Data Documentation

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

Definition at line 213 of file RootFile.h.

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

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

Definition at line 205 of file RootFile.h.

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

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

Definition at line 204 of file RootFile.h.

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

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 211 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 196 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

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

Definition at line 209 of file RootFile.h.

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

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

Definition at line 189 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 190 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 217 of file RootFile.h.

Referenced by makeProductProvenanceRetriever().

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 210 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

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

Definition at line 180 of file RootFile.h.

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

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

Definition at line 182 of file RootFile.h.

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

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

Definition at line 175 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 181 of file RootFile.h.

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

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

Definition at line 207 of file RootFile.h.

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

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

Definition at line 195 of file RootFile.h.

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

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

Definition at line 212 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

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

Definition at line 186 of file RootFile.h.

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

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

Definition at line 183 of file RootFile.h.

Referenced by indexIntoFileSharedPtr().

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

Definition at line 202 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 193 of file RootFile.h.

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

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

Definition at line 185 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 218 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 177 of file RootFile.h.

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

Definition at line 206 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

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

Definition at line 203 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 215 of file RootFile.h.

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

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

Definition at line 216 of file RootFile.h.

Referenced by makeProductProvenanceRetriever(), and RootFile().

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

Definition at line 191 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 192 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 201 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 194 of file RootFile.h.

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