CMS 3D CMS Logo

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

#include <RootFile.h>

Public Types

typedef std::array< RootTree
*, NumBranchTypes
RootTreePtrArray
 

Public Member Functions

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

Private Member Functions

void dropOnInput (ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType inputType)
 
bool fillEventAuxiliary (IndexIntoFile::EntryNumber_t entry)
 
void fillEventHistory ()
 
void fillIndexIntoFile ()
 
boost::shared_ptr
< LuminosityBlockAuxiliary
fillLumiAuxiliary ()
 
boost::shared_ptr< RunAuxiliaryfillRunAuxiliary ()
 
void fillThisEventAuxiliary ()
 
void initializeDuplicateChecker (std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
 
bool isDuplicateEvent ()
 
boost::shared_ptr
< ProductProvenanceRetriever
makeProductProvenanceRetriever (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  bypassVersionCheck,
bool  labelRawDataLikeMC,
bool  usingGoToEvent,
bool  enablePrefetching 
)

Definition at line 138 of file RootFile.cc.

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

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

Definition at line 496 of file RootFile.cc.

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

Member Function Documentation

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

Definition at line 101 of file RootFile.h.

References branchIDListHelper_.

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

Definition at line 102 of file RootFile.h.

References branchIDLists_.

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

Definition at line 114 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

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

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

Definition at line 727 of file RootFile.cc.

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

727  {
729  }
tuple lumi
Definition: fjr2json.py:35
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
bool containsItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 636 of file RootFile.cc.

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

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

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

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

Definition at line 107 of file RootFile.h.

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

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

Definition at line 108 of file RootFile.h.

References eventTree_.

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

Definition at line 99 of file RootFile.h.

References file_.

Referenced by RootFile().

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

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

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

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

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

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

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

Definition at line 1230 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

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

Definition at line 1254 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

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

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

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

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

732  {
733  // First, account for consecutive skipped entries.
734  while(skipThisEntry()) {
737  }
740  }
741  else {
743  }
744  }
745  // OK, we have an entry that is not skipped.
747  if(entryType == IndexIntoFile::kEnd) {
748  return IndexIntoFile::kEnd;
749  }
750  if(entryType == IndexIntoFile::kRun) {
752  return IndexIntoFile::kRun;
753  } else if(processingMode_ == InputSource::Runs) {
755  return getNextItemType(run, lumi, event);
756  }
757  if(entryType == IndexIntoFile::kLumi) {
760  return IndexIntoFile::kLumi;
763  return getNextItemType(run, lumi, event);
764  }
765  if(isDuplicateEvent()) {
767  return getNextItemType(run, lumi, event);
768  }
772  event = eventAux_.event();
773  return IndexIntoFile::kEvent;
774  }
tuple lumi
Definition: fjr2json.py:35
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:207
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1164
bool skipThisEntry()
Definition: RootFile.cc:672
IndexIntoFile::EntryType getNextItemType(RunNumber_t &run, LuminosityBlockNumber_t &lumi, EventNumber_t &event)
Definition: RootFile.cc:732
bool isDuplicateEvent()
Definition: RootFile.cc:716
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
EventAuxiliary eventAux_
Definition: RootFile.h:198
EventNumber_t event() const
bool edm::RootFile::goToEvent ( EventID const &  eventID)

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

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

Definition at line 113 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 662 of file RootFile.cc.

References indexIntoFileIter_.

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

Definition at line 141 of file RootFile.h.

References indexIntoFileSharedPtr_.

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

Definition at line 1651 of file RootFile.cc.

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

Referenced by RootFile().

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

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

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

Definition at line 109 of file RootFile.h.

References lumiTree_.

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

Definition at line 1748 of file RootFile.cc.

References daqProvenanceHelper_, eventProductProvenanceRetrievers_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

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

Definition at line 1731 of file RootFile.cc.

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

Referenced by RootFile().

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

Definition at line 115 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

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

Definition at line 653 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

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

Definition at line 139 of file RootFile.h.

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

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

Definition at line 1607 of file RootFile.cc.

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

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

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

Definition at line 1615 of file RootFile.cc.

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

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

Definition at line 1623 of file RootFile.cc.

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

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

Definition at line 100 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

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

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

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

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

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

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

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

Definition at line 1638 of file RootFile.cc.

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

Referenced by RootFile().

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

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

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

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

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

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

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

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

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

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

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

Definition at line 1119 of file RootFile.cc.

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

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

Definition at line 127 of file RootFile.h.

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

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

Definition at line 110 of file RootFile.h.

References runTree_.

Referenced by validateFile().

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

Definition at line 1428 of file RootFile.cc.

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

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

Definition at line 1570 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1570  {
1572  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1574  return true;
1575  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:188
RootTree eventTree_
Definition: RootFile.h:199
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:185
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:190
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 117 of file RootFile.h.

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

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

Definition at line 1578 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

1594  {
1597  }
1600  if(run != indexIntoFileIter_.run()) return false;
1601  if(lumi != indexIntoFileIter_.lumi()) return false;
1603  return true;
1604  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:189
LuminosityBlockNumber_t lumi() const
bool fillEventAuxiliary(IndexIntoFile::EntryNumber_t entry)
Definition: RootFile.cc:1164
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1586 of file RootFile.cc.

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

Referenced by setEntryAtItem().

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

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

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

Definition at line 667 of file RootFile.cc.

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

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

Definition at line 133 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

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

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

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

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

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

Definition at line 150 of file RootFile.h.

References treePointers_.

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

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

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

Definition at line 784 of file RootFile.cc.

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

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

Definition at line 777 of file RootFile.cc.

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

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

Definition at line 112 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

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

Member Data Documentation

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

Definition at line 214 of file RootFile.h.

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

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

Definition at line 206 of file RootFile.h.

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

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

Definition at line 205 of file RootFile.h.

Referenced by branchIDLists(), and RootFile().

BranchListIndexes edm::RootFile::branchListIndexes_
private

Definition at line 212 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 197 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

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

Definition at line 210 of file RootFile.h.

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

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

Definition at line 190 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

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

Definition at line 191 of file RootFile.h.

Referenced by fillEventHistory(), and RootFile().

std::vector<boost::shared_ptr<ProductProvenanceRetriever> > edm::RootFile::eventProductProvenanceRetrievers_
mutableprivate

Definition at line 218 of file RootFile.h.

Referenced by makeProductProvenanceRetriever().

EventSelectionIDVector edm::RootFile::eventSelectionIDs_
private

Definition at line 211 of file RootFile.h.

Referenced by fillEventHistory(), and readCurrentEvent().

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

Definition at line 181 of file RootFile.h.

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

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

Definition at line 183 of file RootFile.h.

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

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

Definition at line 176 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 182 of file RootFile.h.

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

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

Definition at line 208 of file RootFile.h.

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

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

Definition at line 196 of file RootFile.h.

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

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

Definition at line 213 of file RootFile.h.

Referenced by fillEventHistory(), and readEventHistoryTree().

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

Definition at line 187 of file RootFile.h.

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

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

Definition at line 184 of file RootFile.h.

Referenced by indexIntoFileSharedPtr().

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

Definition at line 203 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

Definition at line 177 of file RootFile.h.

Referenced by reportOpened().

RootTree edm::RootFile::lumiTree_
private
std::map<std::string, std::string> edm::RootFile::newBranchToOldBranch_
private

Definition at line 209 of file RootFile.h.

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 194 of file RootFile.h.

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

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

Definition at line 186 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 219 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 178 of file RootFile.h.

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

Definition at line 207 of file RootFile.h.

Referenced by getNextItemType(), and setIfFastClonable().

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

Definition at line 204 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 216 of file RootFile.h.

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

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

Definition at line 217 of file RootFile.h.

Referenced by makeProductProvenanceRetriever(), and RootFile().

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

Definition at line 192 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 193 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 202 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 195 of file RootFile.h.

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