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 (unsigned int iStreamIndex)
 
std::unique_ptr
< MakeProvenanceReader
makeProvenanceReaderMaker (InputType inputType)
 
std::string const & newBranchToOldBranch (std::string const &newBranch) const
 
void overrideRunNumber (RunID &id)
 
void overrideRunNumber (LuminosityBlockID &id)
 
void overrideRunNumber (EventID &id, bool isRealData)
 
void readEntryDescriptionTree (EntryDescriptionMap &entryDescriptionMap, InputType inputType)
 
void readEventHistoryTree ()
 
void readParentageTree (InputType inputType)
 
void setIfFastClonable (int remainingEvents, int remainingLumis)
 
bool skipThisEntry ()
 
RootTreePtrArraytreePointers ()
 
void validateFile (InputType inputType, bool usingGoToEvent)
 

Private Attributes

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_
 
std::vector< boost::shared_ptr
< ProductProvenanceRetriever > > 
eventProductProvenanceRetrievers_
 
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 138 of file RootFile.cc.

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

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

Definition at line 493 of file RootFile.cc.

493  {
494  }
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 1130 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().

1130  {
1131  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1132  eventHistoryTree_ = nullptr;
1133  for(auto& treePointer : treePointers_) {
1134  treePointer->close();
1135  treePointer = nullptr;
1136  }
1137  filePtr_->Close();
1138  filePtr_.reset();
1139  }
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 724 of file RootFile.cc.

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

724  {
726  }
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 633 of file RootFile.cc.

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

633  {
634  return std::unique_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
635  eventTree_.tree(),
637  lumiTree_.tree(),
639  runTree_.tree(),
640  runTree_.metaTree(),
643  file_,
645  modifiedIDs(),
646  branchChildren_));
647  }
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
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 1664 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().

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

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

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

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

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

Definition at line 1227 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1227  {
1228  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1229  if(fileFormatVersion().newAuxiliary()) {
1230  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1231  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1232  } else {
1233  LuminosityBlockAux lumiAux;
1234  LuminosityBlockAux *pLumiAux = &lumiAux;
1235  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1236  conversion(lumiAux, *lumiAuxiliary);
1237  }
1238  if(provenanceAdaptor_) {
1239  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1240  }
1241  if(daqProvenanceHelper_) {
1242  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1243  }
1244  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1245  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1246  }
1247  return lumiAuxiliary;
1248  }
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 1251 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1251  {
1252  boost::shared_ptr<RunAuxiliary> runAuxiliary(new RunAuxiliary);
1253  if(fileFormatVersion().newAuxiliary()) {
1254  RunAuxiliary *pRunAux = runAuxiliary.get();
1255  runTree_.fillAux<RunAuxiliary>(pRunAux);
1256  } else {
1257  RunAux runAux;
1258  RunAux *pRunAux = &runAux;
1259  runTree_.fillAux<RunAux>(pRunAux);
1260  conversion(runAux, *runAuxiliary);
1261  }
1262  if(provenanceAdaptor_) {
1263  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1264  }
1265  if(daqProvenanceHelper_) {
1266  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1267  }
1268  return runAuxiliary;
1269  }
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 1142 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().

1142  {
1144  // Already read.
1145  return;
1146  }
1148  EventAuxiliary *pEvAux = &eventAux_;
1149  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1150  } else {
1151  // for backward compatibility.
1152  EventAux eventAux;
1153  EventAux *pEvAux = &eventAux;
1154  eventTree_.fillAux<EventAux>(pEvAux);
1155  conversion(eventAux, eventAux_);
1156  }
1158  }
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 729 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().

729  {
730  // First, account for consecutive skipped entries.
731  while(skipThisEntry()) {
734  }
737  }
738  else {
740  }
741  }
742  // OK, we have an entry that is not skipped.
744  if(entryType == IndexIntoFile::kEnd) {
745  return IndexIntoFile::kEnd;
746  }
747  if(entryType == IndexIntoFile::kRun) {
749  return IndexIntoFile::kRun;
750  } else if(processingMode_ == InputSource::Runs) {
752  return getNextItemType(run, lumi, event);
753  }
754  if(entryType == IndexIntoFile::kLumi) {
757  return IndexIntoFile::kLumi;
760  return getNextItemType(run, lumi, event);
761  }
762  if(isDuplicateEvent()) {
764  return getNextItemType(run, lumi, event);
765  }
769  event = eventAux_.event();
770  return IndexIntoFile::kEvent;
771  }
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:1161
bool skipThisEntry()
Definition: RootFile.cc:669
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:729
bool isDuplicateEvent()
Definition: RootFile.cc:713
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 1340 of file RootFile.cc.

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

1340  {
1341 
1343 
1344  if(duplicateChecker_) {
1345  duplicateChecker_->disable();
1346  }
1347 
1350 
1351  IndexIntoFile::IndexIntoFileItr iter =
1353 
1354  if(iter == indexIntoFile_.end(sortOrder)) {
1355  return false;
1356  }
1358  return true;
1359  }
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 659 of file RootFile.cc.

References indexIntoFileIter_.

659  {
660  return indexIntoFileIter_;
661  }
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 1648 of file RootFile.cc.

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

Referenced by RootFile().

1650  {
1651  if(duplicateChecker_) {
1652  if(eventTree_.next()) {
1654  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1656  indexesIntoFiles,
1657  currentIndexIntoFile);
1658  }
1660  }
1661  }
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:1142
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
bool edm::RootFile::isDuplicateEvent ( )
private

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

713  {
715  if(duplicateChecker_.get() == nullptr) {
716  return false;
717  }
719  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
721  }
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:1161
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 ( unsigned int  iStreamIndex)
private

Definition at line 1745 of file RootFile.cc.

References daqProvenanceHelper_, eventProductProvenanceRetrievers_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1745  {
1746  if(eventProductProvenanceRetrievers_.size()<=iStreamID) {
1747  eventProductProvenanceRetrievers_.resize(iStreamID+1);
1748  }
1749  if(!eventProductProvenanceRetrievers_[iStreamID]) {
1750  eventProductProvenanceRetrievers_[iStreamID].reset(new ProductProvenanceRetriever(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1751  }
1752  eventProductProvenanceRetrievers_[iStreamID]->reset();
1753  return eventProductProvenanceRetrievers_[iStreamID];
1754  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:216
RootTree eventTree_
Definition: RootFile.h:198
std::vector< boost::shared_ptr< ProductProvenanceRetriever > > eventProductProvenanceRetrievers_
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 1728 of file RootFile.cc.

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

Referenced by RootFile().

1728  {
1730  readParentageTree(inputType);
1731  return std::unique_ptr<MakeProvenanceReader>(new MakeReducedProvenanceReader(parentageIDLookup_));
1732  } else if(fileFormatVersion_.splitProductIDs()) {
1733  readParentageTree(inputType);
1734  return std::unique_ptr<MakeProvenanceReader>(new MakeFullProvenanceReader);
1735  } else if(fileFormatVersion_.perEventProductIDs()) {
1736  std::unique_ptr<EntryDescriptionMap> entryDescriptionMap(new EntryDescriptionMap);
1737  readEntryDescriptionTree(*entryDescriptionMap, inputType);
1738  return std::unique_ptr<MakeProvenanceReader>(new MakeOldProvenanceReader(std::move(entryDescriptionMap)));
1739  } else {
1740  return std::unique_ptr<MakeProvenanceReader>(new MakeDummyProvenanceReader);
1741  }
1742  }
void readEntryDescriptionTree(EntryDescriptionMap &entryDescriptionMap, InputType inputType)
Definition: RootFile.cc:497
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:181
void readParentageTree(InputType inputType)
Definition: RootFile.cc:543
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 650 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

650  {
651  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
652  if(it != newBranchToOldBranch_.end()) {
653  return it->second;
654  }
655  return newBranch;
656  }
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 1604 of file RootFile.cc.

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

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

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

Definition at line 1612 of file RootFile.cc.

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

1612  {
1613  if(forcedRunOffset_ != 0) {
1614  id = LuminosityBlockID(id.run() + forcedRunOffset_, id.luminosityBlock());
1615  }
1616  if(RunID(id.run()) < RunID::firstValidRun()) id = LuminosityBlockID(RunID::firstValidRun().run(), id.luminosityBlock());
1617  }
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 1620 of file RootFile.cc.

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

1620  {
1621  if(forcedRunOffset_ != 0) {
1622  if(isRealData) {
1623  throw Exception(errors::Configuration, "RootFile::RootFile()")
1624  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1625  }
1626  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1627  }
1628  if(RunID(id.run()) < RunID::firstValidRun()) {
1630  }
1631  }
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 1397 of file RootFile.cc.

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

Referenced by readEvent().

1397  {
1398  if(!eventTree_.current()) {
1399  return false;
1400  }
1402  if(!fileFormatVersion().lumiInEventID()) {
1403  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1404  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1406  }
1407  fillEventHistory();
1409 
1410  // We're not done ... so prepare the EventPrincipal
1411  eventTree_.insertEntryForIndex(principal.transitionIndex());
1412  principal.fillEventPrincipal(eventAux(),
1414  std::move(eventSelectionIDs_),
1415  std::move(branchListIndexes_),
1416  *(makeProductProvenanceRetriever(principal.streamID().value())),
1418 
1419  // report event read from file
1420  filePtr_->eventReadFromFile();
1421  return true;
1422  }
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:98
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:116
void fillEventHistory()
Definition: RootFile.cc:1171
boost::shared_ptr< ProductProvenanceRetriever > makeProductProvenanceRetriever(unsigned int iStreamIndex)
Definition: RootFile.cc:1745
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1604
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:179
EventAuxiliary eventAux_
Definition: RootFile.h:197
void fillThisEventAuxiliary()
Definition: RootFile.cc:1142
ProcessHistoryRegistry * processHistoryRegistry_
Definition: RootFile.h:178
void edm::RootFile::readEntryDescriptionTree ( EntryDescriptionMap entryDescriptionMap,
InputType  inputType 
)
private

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

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

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

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

Referenced by RootFile().

1635  {
1636  // Read in the event history tree, if we have one...
1637  if(fileFormatVersion().eventHistoryTree()) {
1638  history_.reset(new History);
1639  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1640  if(!eventHistoryTree_) {
1642  << "Failed to find the event history tree.\n";
1643  }
1644  }
1645  }
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 1549 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().

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

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

1511  {
1514  // Begin code for backward compatibility before the existence of lumi trees.
1515  if(!lumiTree_.isValid()) {
1517  assert(eventEntry != IndexIntoFile::invalidEntry);
1518  assert(eventTree_.current(eventEntry));
1519  fillEventAuxiliary(eventEntry);
1520 
1522  overrideRunNumber(lumi);
1523  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1524  }
1525  // End code for backward compatibility before the existence of lumi trees.
1527  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1528  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1529  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1530  overrideRunNumber(lumiAuxiliary->id());
1531  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1532  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1534  if(eventEntry != IndexIntoFile::invalidEntry) {
1535  assert(eventTree_.current(eventEntry));
1536  fillEventAuxiliary(eventEntry);
1537 
1538  lumiAuxiliary->setBeginTime(eventAux().time());
1539  }
1540  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1541  }
1542  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1543  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1544  }
1545  return lumiAuxiliary;
1546  }
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:1161
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:1227
bool isValid() const
Definition: RootTree.cc:104
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1604
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:179
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
void edm::RootFile::readParentageTree ( InputType  inputType)
private

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

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

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

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

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

Definition at line 1116 of file RootFile.cc.

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

1116  {
1117  // Report file opened.
1118  std::string const label = "source";
1119  std::string moduleName = "PoolSource";
1120  filePtr_->inputFileOpened(
1121  logicalFile_,
1122  inputType,
1123  moduleName,
1124  label,
1125  fid_.fid(),
1127  }
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 1425 of file RootFile.cc.

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

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

Definition at line 1567 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

Definition at line 1575 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

1591  {
1594  }
1597  if(run != indexIntoFileIter_.run()) return false;
1598  if(lumi != indexIntoFileIter_.lumi()) return false;
1600  return true;
1601  }
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:1161
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1583 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

579  {
580  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
581  //we must avoid copying the old branch which stored the per product per event provenance
583  return;
584  }
585  if(!fileFormatVersion().splitProductIDs()) {
587  return;
588  }
591  return;
592  }
593  // Find entry for first event in file
594  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
595  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
596  ++it;
597  }
598  if(it == indexIntoFileEnd_) {
600  return;
601  }
602 
603  // From here on, record all reasons we can't fast clone.
607  }
608  if(skipAnyEvents_) {
610  }
611  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
613  }
614  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
616  }
617  // We no longer fast copy the EventAuxiliary branch, so there
618  // is no longer any need to disable fast copying because the run
619  // number is being modified. Also, this check did not work anyway
620  // because this function is called before forcedRunOffset_ is set.
621 
622  // if(forcedRunOffset_ != 0) {
623  // whyNotFastClonable_ += FileBlock::RunNumberModified;
624  // }
625  if(duplicateChecker_ &&
626  !duplicateChecker_->checkDisabled() &&
627  !duplicateChecker_->noDuplicatesInFile()) {
629  }
630  }
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 664 of file RootFile.cc.

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

664  {
666  }
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 1272 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().

1272  {
1273  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1274 
1275  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1276  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1279 
1280  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1281  runOfSkippedEvent,
1282  lumiOfSkippedEvent,
1283  skippedEventEntry);
1284 
1285  // At the end of the file and there were no more events to skip
1286  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1287 
1288  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1289  fillEventAuxiliary(skippedEventEntry);
1290  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1291  continue;
1292  }
1293  }
1294  if(duplicateChecker_ &&
1295  !duplicateChecker_->checkDisabled() &&
1296  !duplicateChecker_->noDuplicatesInFile()) {
1297 
1298  fillEventAuxiliary(skippedEventEntry);
1299  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1300  runOfSkippedEvent,
1301  lumiOfSkippedEvent,
1302  eventAux_.id().event(),
1303  file_)) {
1304  continue;
1305  }
1306  }
1307  --offset;
1308  }
1309 
1310  while(offset < 0) {
1311 
1312  if(duplicateChecker_) {
1313  duplicateChecker_->disable();
1314  }
1315 
1316  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1320 
1321  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1322  runOfEvent,
1323  lumiOfEvent,
1324  eventEntry);
1325 
1326  if(eventEntry == IndexIntoFile::invalidEntry) break;
1327 
1328  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1329  fillEventAuxiliary(eventEntry);
1330  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1331  continue;
1332  }
1333  }
1334  ++offset;
1335  }
1337  }
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:1161
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 669 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().

669  {
671  return false;
672  }
673  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
674 
675  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
677  return true;
678  }
679 
680  // The Lumi is not skipped. If this is an event, see if the event is skipped.
685  eventAux_.id().event())) {
686  return true;
687  }
688  }
689 
690  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
692  eventSkipperByID_->skippingLumis()) {
693  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
694 
695  // There are no lumis in this run, not even ones we will skip
696  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
697  return true;
698  }
699  // If we get here there are lumis in the run, check to see if we are skipping all of them
700  do {
701  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
702  return false;
703  }
704  }
705  while(iterLumi.skipLumiInRun());
706  return true;
707  }
708  }
709  return false;
710  }
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:1161
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 1069 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().

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

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

781  {
782  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
783  int phIndex;
786  IndexIntoFile::EntryNumber_t eventEntry;
787  itr.skipEventBackward(phIndex,
788  run,
789  lumi,
790  eventEntry);
791  itr.skipEventBackward(phIndex,
792  run,
793  lumi,
794  eventEntry);
795  return eventEntry == IndexIntoFile::invalidEntry;
796  }
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 774 of file RootFile.cc.

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

774  {
775  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
776  itr.advanceToEvent();
777  return itr.getEntryType() == IndexIntoFile::kEnd;
778  }
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(), 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().

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