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 ()
 
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 getNextEntryTypeWanted ()
 
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
 
EventPrincipalreadCurrentEvent (EventPrincipal &cache)
 
EventPrincipalreadEvent (EventPrincipal &cache)
 
boost::shared_ptr
< LuminosityBlockPrincipal
readLumi (boost::shared_ptr< LuminosityBlockPrincipal > lumiPrincipal)
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
boost::shared_ptr< RunPrincipalreadRun_ (boost::shared_ptr< 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 treeCacheSize, int treeMaxVirtualSize, InputSource::ProcessingMode processingMode, RunNumber_t const &forcedRunNumber, bool noEventSort, ProductSelectorRules const &productSelectorRules, InputType::InputType inputType, boost::shared_ptr< BranchIDListHelper > branchIDListHelper, boost::shared_ptr< DuplicateChecker > duplicateChecker, bool dropDescendantsOfDroppedProducts, std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile, std::vector< ProcessHistoryID > &orderedProcessHistoryIDs, bool labelRawDataLikeMC, bool usingGoToEvent, bool enablePrefetching)
 
 RootFile (RootFile const &)=delete
 
RootTree const & runTree () const
 
void setAtEventEntry (IndexIntoFile::EntryNumber_t entry)
 
bool setEntryAtEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtNextEventInLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtRun (RunNumber_t run)
 
void setPosition (IndexIntoFile::IndexIntoFileItr const &position)
 
void setToLastEntry ()
 
bool skipEvents (int &offset)
 
bool wasFirstEventJustRead () const
 
bool wasLastEventJustRead () const
 
int whyNotFastClonable () const
 
 ~RootFile ()
 

Private Member Functions

void checkReleaseVersion ()
 
void dropOnInput (ProductRegistry &reg, ProductSelectorRules const &rules, bool dropDescendants, InputType::InputType inputType)
 
void fillEventAuxiliary ()
 
void fillHistory ()
 
void fillIndexIntoFile ()
 
boost::shared_ptr
< LuminosityBlockAuxiliary
fillLumiAuxiliary ()
 
boost::shared_ptr< RunAuxiliaryfillRunAuxiliary ()
 
void fillThisEventAuxiliary ()
 
IndexIntoFile::EntryType getEntryTypeWithSkipping ()
 
void initializeDuplicateChecker (std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
 
bool isDuplicateEvent ()
 
boost::shared_ptr< BranchMappermakeBranchMapper ()
 
std::unique_ptr
< MakeProvenanceReader
makeProvenanceReaderMaker () const
 
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 ()
 
void readEventHistoryTree ()
 
void readParentageTree ()
 
void setIfFastClonable (int remainingEvents, int remainingLumis)
 
bool skipThisEntry ()
 
RootTreePtrArraytreePointers ()
 
void validateFile (InputType::InputType inputType, bool usingGoToEvent)
 

Private Attributes

boost::shared_ptr< BranchChildrenbranchChildren_
 
boost::shared_ptr
< BranchIDListHelper
branchIDListHelper_
 
boost::shared_ptr
< BranchIDLists const > 
branchIDLists_
 
boost::shared_ptr
< BranchListIndexes
branchListIndexes_
 
bool branchListIndexesUnchanged_
 
std::unique_ptr
< DaqProvenanceHelper
daqProvenanceHelper_
 
boost::shared_ptr
< DuplicateChecker
duplicateChecker_
 
EventAuxiliary eventAux_
 
boost::shared_ptr< BranchMappereventBranchMapper_
 
TTree * eventHistoryTree_
 
std::vector
< EventProcessHistoryID
eventProcessHistoryIDs_
 
std::vector
< EventProcessHistoryID >
::const_iterator 
eventProcessHistoryIter_
 
boost::shared_ptr
< 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_
 
ProcessConfigurationVector processConfigurations_
 
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 51 of file RootFile.h.

Member Typedef Documentation

Definition at line 53 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  treeCacheSize,
int  treeMaxVirtualSize,
InputSource::ProcessingMode  processingMode,
RunNumber_t const &  forcedRunNumber,
bool  noEventSort,
ProductSelectorRules const &  productSelectorRules,
InputType::InputType  inputType,
boost::shared_ptr< BranchIDListHelper branchIDListHelper,
boost::shared_ptr< DuplicateChecker duplicateChecker,
bool  dropDescendantsOfDroppedProducts,
std::vector< boost::shared_ptr< IndexIntoFile > > const &  indexesIntoFiles,
std::vector< boost::shared_ptr< IndexIntoFile > >::size_type  currentIndexIntoFile,
std::vector< ProcessHistoryID > &  orderedProcessHistoryIDs,
bool  labelRawDataLikeMC,
bool  usingGoToEvent,
bool  enablePrefetching 
)

Definition at line 121 of file RootFile.cc.

References edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), branchIDListHelper_, branchIDLists_, branchListIndexesUnchanged_, edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), edm::BranchTypeToAuxiliaryBranchName(), checkReleaseVersion(), 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_, fileFormatVersion(), fileFormatVersion_, edm::poolNames::fileFormatVersionBranchName(), edm::poolNames::fileIdentifierBranchName(), filePtr_, edm::errors::FileReadError, edm::fillProductRegistryTransients(), 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::detail::ThreadSafeRegistry< KEY, T, E >::insertCollection(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), lumiTree_, makeProvenanceReaderMaker(), edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::InputType::Primary, edm::poolNames::processConfigurationBranchName(), processConfigurations_, 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(), readParentageTree(), fetchall_from_DQM_v2::release, edm::RootTree::resetTraining(), runTree_, edm::ParameterSet::setID(), setIfFastClonable(), edm::setRefCoreStreamer(), LaserTracksInput_cfi::source, AlCaHLTBitMon_QueryRunRegistry::string, edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), validateFile(), and whyNotFastClonable_.

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

Definition at line 472 of file RootFile.cc.

472  {
473  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 94 of file RootFile.h.

References branchIDListHelper_.

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

Definition at line 95 of file RootFile.h.

References branchIDLists_.

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

Definition at line 107 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

bool branchListIndexesUnchanged_
Definition: RootFile.h:191
void edm::RootFile::checkReleaseVersion ( )
private

Definition at line 1632 of file RootFile.cc.

References edm::hlt::Exception, file(), edm::errors::FormatIncompatibility, edm::getReleaseVersion(), edm::releaseversion::isEarlierRelease(), processConfigurations_, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by RootFile().

1632  {
1633  std::string releaseVersion = getReleaseVersion();
1634  releaseversion::DecomposedReleaseVersion currentRelease(releaseVersion);
1635  for(auto const& pc : processConfigurations_) {
1636  if(releaseversion::isEarlierRelease(currentRelease, pc.releaseVersion())) {
1638  << "The release you are using, " << getReleaseVersion() << " , predates\n"
1639  << "a release (" << pc.releaseVersion() << ") used in writing the input file, " << file() <<".\n"
1640  << "Forward compatibility cannot be supported.\n";
1641  }
1642  }
1643  }
ProcessConfigurationVector processConfigurations_
Definition: RootFile.h:173
bool isEarlierRelease(std::string const &a, std::string const &b)
std::string getReleaseVersion()
std::string const & file() const
Definition: RootFile.h:92
void edm::RootFile::close ( void  )

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

1104  {
1105  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1106  eventHistoryTree_ = nullptr;
1107  for(auto& treePointer : treePointers_) {
1108  treePointer->close();
1109  treePointer = nullptr;
1110  }
1111  filePtr_->Close();
1112  filePtr_.reset();
1113  }
RootTreePtrArray treePointers_
Definition: RootFile.h:196
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
TTree * eventHistoryTree_
Definition: RootFile.h:204
std::unique_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 614 of file RootFile.cc.

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

614  {
615  return std::unique_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
616  eventTree_.tree(),
618  lumiTree_.tree(),
620  runTree_.tree(),
621  runTree_.metaTree(),
624  file_,
626  modifiedIDs(),
628  branchIDLists_));
629  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:208
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
bool branchListIndexesUnchanged() const
Definition: RootFile.h:107
RootTree lumiTree_
Definition: RootFile.h:194
boost::shared_ptr< BranchIDLists const > branchIDLists_
Definition: RootFile.h:199
TTree const * metaTree() const
Definition: RootTree.h:115
TTree const * tree() const
Definition: RootTree.h:113
bool modifiedIDs() const
Definition: RootFile.h:108
int whyNotFastClonable() const
Definition: RootFile.h:105
RootTree eventTree_
Definition: RootFile.h:193
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:106
RootTree runTree_
Definition: RootFile.h:195
std::string const file_
Definition: RootFile.h:170
void edm::RootFile::dropOnInput ( ProductRegistry reg,
ProductSelectorRules const &  rules,
bool  dropDescendants,
InputType::InputType  inputType 
)
private

Definition at line 1662 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::InputType::SecondaryFile, edm::ProductSelector::selected(), treePointers_, and edm::BranchDescription::wrappedName().

Referenced by RootFile().

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

Definition at line 100 of file RootFile.h.

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

Referenced by readCurrentEvent().

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

Definition at line 101 of file RootFile.h.

References eventTree_.

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

Definition at line 92 of file RootFile.h.

References file_.

Referenced by checkReleaseVersion().

92 {return file_;}
std::string const file_
Definition: RootFile.h:170
FileFormatVersion edm::RootFile::fileFormatVersion ( ) const
inline
void edm::RootFile::fillEventAuxiliary ( )
private

Definition at line 1135 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventTree_, fillThisEventAuxiliary(), indexIntoFileIter_, and edm::RootTree::setEntryNumber().

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

1135  {
1138  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
RootTree eventTree_
Definition: RootFile.h:193
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
void edm::RootFile::fillHistory ( )
private

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

1141  {
1142  // We could consider doing delayed reading, but because we have to
1143  // store this History object in a different tree than the event
1144  // data tree, this is too hard to do in this first version.
1145 
1146  if(fileFormatVersion().eventHistoryBranch()) {
1147  // Lumi block number was not in EventID for the relevant releases.
1148  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1149  if(eventProcessHistoryIter_->eventID() != id) {
1150  EventProcessHistoryID target(id, ProcessHistoryID());
1152  assert(eventProcessHistoryIter_->eventID() == id);
1153  }
1156  } else if(fileFormatVersion().eventHistoryTree()) {
1157  // for backward compatibility.
1158  History* pHistory = history_.get();
1159  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1160  if(!eventHistoryBranch) {
1162  << "Failed to find history branch in event history tree.\n";
1163  }
1164  eventHistoryBranch->SetAddress(&pHistory);
1166  eventAux_.setProcessHistoryID(history_->processHistoryID());
1167  eventSelectionIDs_.reset(&history_->eventSelectionIDs(), do_nothing_deleter());
1168  branchListIndexes_.reset(&history_->branchListIndexes(), do_nothing_deleter());
1169  } else if(fileFormatVersion().noMetaDataTrees()) {
1170  // Current format
1172  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1173  assert(eventSelectionIDBranch != nullptr);
1174  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1175  BranchListIndexes* pBLI = branchListIndexes_.get();
1176  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1177  assert(branchListIndexesBranch != nullptr);
1178  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1179  }
1180  if(provenanceAdaptor_) {
1181  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1182  for(auto& esID : *eventSelectionIDs_) {
1183  esID = provenanceAdaptor_->convertID(esID);
1184  }
1185  }
1186  if(daqProvenanceHelper_) {
1188  }
1190  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1191  provenanceAdaptor_->branchListIndexes(*branchListIndexes_);
1192  }
1193  branchIDListHelper_->fixBranchListIndexes(*branchListIndexes_);
1194  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:446
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:210
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:206
std::unique_ptr< History > history_
Definition: RootFile.h:207
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
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:185
TTree const * tree() const
Definition: RootTree.h:113
std::vector< BranchListIndex > BranchListIndexes
boost::shared_ptr< BranchIDListHelper > branchIDListHelper_
Definition: RootFile.h:200
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:232
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:193
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
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
Definition: RootFile.h:205
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:108
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
EventAuxiliary eventAux_
Definition: RootFile.h:192
TTree * eventHistoryTree_
Definition: RootFile.h:204
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:184
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 817 of file RootFile.cc.

References edm::RootTree::entries(), python.tagInventory::entries, edm::RootTree::entryNumber(), event(), eventAux(), eventAux_, eventTree_, edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), fileFormatVersion(), fillHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), fillThisEventAuxiliary(), edm::find_in_all(), indexIntoFile_, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::RootTree::isValid(), lastEventEntryNumberRead_, summaryLumi::lcount, fjr2json::lumi, edm::EventAuxiliary::luminosityBlock(), edmLumisInFiles::lumis, lumiTree_, edm::RootTree::next(), 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().

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

Definition at line 1197 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1197  {
1198  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1199  if(fileFormatVersion().newAuxiliary()) {
1200  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1201  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1202  } else {
1203  LuminosityBlockAux lumiAux;
1204  LuminosityBlockAux *pLumiAux = &lumiAux;
1205  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1206  conversion(lumiAux, *lumiAuxiliary);
1207  }
1208  if(provenanceAdaptor_) {
1209  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1210  }
1211  if(daqProvenanceHelper_) {
1212  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1213  }
1214  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1215  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1216  }
1217  return lumiAuxiliary;
1218  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:210
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
RootTree lumiTree_
Definition: RootFile.h:194
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:214
unsigned int RunNumber_t
Definition: EventRange.h:32
void fillAux(T *&pAux)
Definition: RootTree.h:92
boost::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1221 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1221  {
1222  boost::shared_ptr<RunAuxiliary> runAuxiliary(new RunAuxiliary);
1223  if(fileFormatVersion().newAuxiliary()) {
1224  RunAuxiliary *pRunAux = runAuxiliary.get();
1225  runTree_.fillAux<RunAuxiliary>(pRunAux);
1226  } else {
1227  RunAux runAux;
1228  RunAux *pRunAux = &runAux;
1229  runTree_.fillAux<RunAux>(pRunAux);
1230  conversion(runAux, *runAuxiliary);
1231  }
1232  if(provenanceAdaptor_) {
1233  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1234  }
1235  if(daqProvenanceHelper_) {
1236  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1237  }
1238  return runAuxiliary;
1239  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:210
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
RootTree runTree_
Definition: RootFile.h:195
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
void fillAux(T *&pAux)
Definition: RootTree.h:92
void edm::RootFile::fillThisEventAuxiliary ( )
private

Definition at line 1116 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(), readCurrentEvent(), readLuminosityBlockAuxiliary_(), readRunAuxiliary_(), and skipEvents().

1116  {
1118  // Already read.
1119  return;
1120  }
1122  EventAuxiliary *pEvAux = &eventAux_;
1123  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1124  } else {
1125  // for backward compatibility.
1126  EventAux eventAux;
1127  EventAux *pEvAux = &eventAux;
1128  eventTree_.fillAux<EventAux>(pEvAux);
1129  conversion(eventAux, eventAux_);
1130  }
1132  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:197
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:192
void fillAux(T *&pAux)
Definition: RootTree.h:92
IndexIntoFile::EntryType edm::RootFile::getEntryTypeWithSkipping ( )
private
IndexIntoFile::EntryType edm::RootFile::getNextEntryTypeWanted ( )

Definition at line 722 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::advanceToNextLumiOrRun(), edm::IndexIntoFile::IndexIntoFileItr::advanceToNextRun(), getEntryTypeWithSkipping(), indexIntoFileIter_, isDuplicateEvent(), edm::IndexIntoFile::kEnd, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::kLumi, edm::IndexIntoFile::kRun, processingMode_, edm::InputSource::Runs, and edm::InputSource::RunsAndLumis.

722  {
724  if(entryType == IndexIntoFile::kEnd) {
725  return IndexIntoFile::kEnd;
726  }
727  if(entryType == IndexIntoFile::kRun) {
728  return IndexIntoFile::kRun;
729  } else if(processingMode_ == InputSource::Runs) {
731  return getNextEntryTypeWanted();
732  }
733  if(entryType == IndexIntoFile::kLumi) {
734  return IndexIntoFile::kLumi;
737  return getNextEntryTypeWanted();
738  }
739  if(isDuplicateEvent()) {
741  return getNextEntryTypeWanted();
742  }
743  return IndexIntoFile::kEvent;
744  }
IndexIntoFile::EntryType getEntryTypeWithSkipping()
Definition: RootFile.cc:695
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:201
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::EntryType getNextEntryTypeWanted()
Definition: RootFile.cc:722
bool isDuplicateEvent()
Definition: RootFile.cc:711
bool edm::RootFile::goToEvent ( EventID const &  eventID)

Definition at line 1313 of file RootFile.cc.

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

1313  {
1314 
1316 
1317  if(duplicateChecker_) {
1318  duplicateChecker_->disable();
1319  }
1320 
1323 
1324  IndexIntoFile::IndexIntoFileItr iter =
1326 
1327  if(iter == indexIntoFile_.end(sortOrder)) {
1328  return false;
1329  }
1330  indexIntoFileIter_ = iter;
1331  return true;
1332  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & eventID() const
Definition: RootFile.h:100
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
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:209
bool noEventSort_
Definition: RootFile.h:188
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 106 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 641 of file RootFile.cc.

References indexIntoFileIter_.

641  {
642  return indexIntoFileIter_;
643  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 133 of file RootFile.h.

References indexIntoFileSharedPtr_.

133  {
135  }
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:178
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 1646 of file RootFile.cc.

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

Referenced by RootFile().

1648  {
1649  if(duplicateChecker_) {
1650  if(eventTree_.next()) {
1652  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1654  indexesIntoFiles,
1655  currentIndexIntoFile);
1656  }
1658  }
1659  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:209
bool next()
Definition: RootTree.h:81
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::isDuplicateEvent ( )
private

Definition at line 711 of file RootFile.cc.

References duplicateChecker_, 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 getNextEntryTypeWanted().

711  {
713  if(duplicateChecker_.get() == nullptr) {
714  return false;
715  }
717  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
719  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1135
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
LuminosityBlockNumber_t lumi() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:209
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:192
std::string const file_
Definition: RootFile.h:170
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 102 of file RootFile.h.

References lumiTree_.

102 {return lumiTree_;}
RootTree lumiTree_
Definition: RootFile.h:194
boost::shared_ptr< BranchMapper > edm::RootFile::makeBranchMapper ( )
private

Definition at line 1739 of file RootFile.cc.

References daqProvenanceHelper_, eventBranchMapper_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1739  {
1740  if(!eventBranchMapper_) {
1741  eventBranchMapper_.reset(new BranchMapper(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1742  }
1743  eventBranchMapper_->reset();
1744  return eventBranchMapper_;
1745  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:211
boost::shared_ptr< BranchMapper > eventBranchMapper_
Definition: RootFile.h:212
RootTree eventTree_
Definition: RootFile.h:193
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( ) const
private

Definition at line 1726 of file RootFile.cc.

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

Referenced by RootFile().

1726  {
1728  return std::unique_ptr<MakeProvenanceReader>(new MakeReducedProvenanceReader(parentageIDLookup_));
1729  } else if(fileFormatVersion_.splitProductIDs()) {
1730  return std::unique_ptr<MakeProvenanceReader>(new MakeFullProvenanceReader);
1731  } else if(fileFormatVersion_.perEventProductIDs()) {
1732  return std::unique_ptr<MakeProvenanceReader>(new MakeOldProvenanceReader);
1733  } else {
1734  return std::unique_ptr<MakeProvenanceReader>(new MakeDummyProvenanceReader);
1735  }
1736  }
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:176
bool storedProductProvenanceUsed() const
bool perEventProductIDs() const
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:213
bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 108 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

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

Definition at line 632 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

632  {
633  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
634  if(it != newBranchToOldBranch_.end()) {
635  return it->second;
636  }
637  return newBranch;
638  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:203
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 131 of file RootFile.h.

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

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

Definition at line 1588 of file RootFile.cc.

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

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

1588  {
1589  if(forcedRunOffset_ != 0) {
1590  id = RunID(id.run() + forcedRunOffset_);
1591  }
1592  if(id < RunID::firstValidRun()) id = RunID::firstValidRun();
1593  }
static RunID firstValidRun()
Definition: RunID.h:82
int forcedRunOffset_
Definition: RootFile.h:202
void edm::RootFile::overrideRunNumber ( LuminosityBlockID id)
private

Definition at line 1596 of file RootFile.cc.

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

1596  {
1597  if(forcedRunOffset_ != 0) {
1598  id = LuminosityBlockID(id.run() + forcedRunOffset_, id.luminosityBlock());
1599  }
1600  if(RunID(id.run()) < RunID::firstValidRun()) id = LuminosityBlockID(RunID::firstValidRun().run(), id.luminosityBlock());
1601  }
static RunID firstValidRun()
Definition: RunID.h:82
int forcedRunOffset_
Definition: RootFile.h:202
void edm::RootFile::overrideRunNumber ( EventID id,
bool  isRealData 
)
private

Definition at line 1604 of file RootFile.cc.

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

1604  {
1605  if(forcedRunOffset_ != 0) {
1606  if(isRealData) {
1607  throw Exception(errors::Configuration, "RootFile::RootFile()")
1608  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1609  }
1610  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1611  }
1612  if(RunID(id.run()) < RunID::firstValidRun()) {
1614  }
1615  }
static LuminosityBlockID firstValidLuminosityBlock()
static RunID firstValidRun()
Definition: RunID.h:82
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:202
boost::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 93 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

93 {return productRegistry_;}
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:198
EventPrincipal * edm::RootFile::readCurrentEvent ( EventPrincipal cache)

Definition at line 1371 of file RootFile.cc.

References branchListIndexes_, edm::RootTree::current(), event(), eventAux(), eventAux_, eventID(), eventSelectionIDs_, eventTree_, fileFormatVersion(), filePtr_, edm::EventPrincipal::fillEventPrincipal(), fillHistory(), fillThisEventAuxiliary(), edm::EventAuxiliary::id(), edm::EventAuxiliary::isRealData(), makeBranchMapper(), edm::EventAuxiliary::oldLuminosityBlock(), overrideRunNumber(), edm::EventAuxiliary::resetObsoleteInfo(), edm::RootTree::rootDelayedReader(), and DTTTrigCorrFirst::run.

Referenced by readEvent().

1371  {
1372  if(!eventTree_.current()) {
1373  return nullptr;
1374  }
1376  if(!fileFormatVersion().lumiInEventID()) {
1377  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1378  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1380  }
1381  fillHistory();
1383 
1384  // We're not done ... so prepare the EventPrincipal
1385  cache.fillEventPrincipal(eventAux(),
1388  makeBranchMapper(),
1390 
1391  // report event read from file
1392  filePtr_->eventReadFromFile(eventID().run(), eventID().event());
1393  return &cache;
1394  }
EventID const & eventID() const
Definition: RootFile.h:100
bool isRealData() const
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:206
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
void fillHistory()
Definition: RootFile.cc:1141
LuminosityBlockNumber_t oldLuminosityBlock() 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
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
Definition: RootFile.h:205
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:99
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1588
boost::shared_ptr< BranchMapper > makeBranchMapper()
Definition: RootFile.cc:1739
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
EventAuxiliary eventAux_
Definition: RootFile.h:192
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
bool current()
Definition: RootTree.h:83
void edm::RootFile::readEntryDescriptionTree ( )
private

Definition at line 476 of file RootFile.cc.

References daqProvenanceHelper_, edm::poolNames::entryDescriptionBranchName(), edm::poolNames::entryDescriptionIDBranchName(), edm::poolNames::entryDescriptionTreeName(), edm::errors::EventCorruption, edm::hlt::Exception, fileFormatVersion(), filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), i, edm::Parentage::id(), edm::EventEntryDescription::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::numEntries(), parents, edm::Parentage::parents(), edm::EventEntryDescription::parents(), and PhysicsTools::registry.

Referenced by readParentageTree().

476  {
477  // Called only for old format files.
478  if(!fileFormatVersion().perEventProductIDs()) return;
479  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
480  std::unique_ptr<TTree> entryDescriptionTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
481  if(nullptr == entryDescriptionTree.get()) {
482  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
483  << " in the input file.\n";
484  }
485 
486  EntryDescriptionID idBuffer;
487  EntryDescriptionID* pidBuffer = &idBuffer;
488  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
489 
491 
492  EventEntryDescription entryDescriptionBuffer;
493  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
494  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
495 
496  // Fill in the parentage registry.
498 
499  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
500  roottree::getEntry(entryDescriptionTree.get(), i);
501  if(idBuffer != entryDescriptionBuffer.id()) {
502  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
503  }
504  oldregistry.insertMapped(entryDescriptionBuffer);
505  Parentage parents;
506  parents.parents() = entryDescriptionBuffer.parents();
508  ParentageID const oldID = parents.id();
509  daqProvenanceHelper_->fixMetaData(parents.parents());
510  ParentageID newID = parents.id();
511  if(newID != oldID) {
512  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
513  }
514  }
515  registry.insertMapped(parents);
516  }
517  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), nullptr);
518  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), nullptr);
519  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:446
int i
Definition: DBlmapReader.cc:9
edm::detail::ThreadSafeRegistry< edm::EntryDescriptionID, edm::EventEntryDescription > EntryDescriptionRegistry
TPRegexp parents
Definition: eve_filter.cc:24
std::string const & entryDescriptionBranchName()
Definition: BranchType.cc:153
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
static ThreadSafeRegistry * instance()
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
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:214
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:149
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
static Interceptor::Registry registry("Interceptor")
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
EventPrincipal * edm::RootFile::readEvent ( EventPrincipal cache)

Definition at line 1348 of file RootFile.cc.

References daqProvenanceHelper_, edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), eventTree_, edm::detail::ThreadSafeRegistry< KEY, T, E >::extra(), fileFormatVersion(), forcedRunOffset_, edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::EventAuxiliary::processHistoryID(), edm::IndexIntoFile::processHistoryID(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), readCurrentEvent(), DTTTrigCorrFirst::run, edm::IndexIntoFile::IndexIntoFileItr::run(), edm::RootTree::setEntryNumber(), and edm::FileFormatVersion::useReducedProcessHistoryID().

1348  {
1351  // Set the entry in the tree, and read the event at that entry.
1353  EventPrincipal* ep = readCurrentEvent(cache);
1354 
1355  assert(ep != nullptr);
1356  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1357  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1358 
1359  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1360  // The IndexIntoFile should guarantee that it never fails.
1362  ProcessHistoryID const& reducedPHID = ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(idToCheck);
1364 
1366  return ep;
1367  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
static ThreadSafeRegistry * instance()
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
bool useReducedProcessHistoryID() const
EventPrincipal * readCurrentEvent(EventPrincipal &cache)
Definition: RootFile.cc:1371
int forcedRunOffset_
Definition: RootFile.h:202
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1619 of file RootFile.cc.

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

Referenced by RootFile().

1619  {
1620  // Read in the event history tree, if we have one...
1621  if(fileFormatVersion().eventHistoryTree()) {
1622  history_.reset(new History);
1623  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1624  if(!eventHistoryTree_) {
1626  << "Failed to find the event history tree.\n";
1627  }
1628  }
1629  }
std::unique_ptr< History > history_
Definition: RootFile.h:207
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:262
TTree * eventHistoryTree_
Definition: RootFile.h:204
boost::shared_ptr< LuminosityBlockPrincipal > edm::RootFile::readLumi ( boost::shared_ptr< LuminosityBlockPrincipal lumiPrincipal)

Definition at line 1533 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::RootTree::isValid(), edm::IndexIntoFile::kLumi, lumiTree_, edm::RootTree::rootDelayedReader(), and edm::RootTree::setEntryNumber().

1533  {
1536  // Begin code for backward compatibility before the existence of lumi trees.
1537  if(!lumiTree_.isValid()) {
1539  return lumiPrincipal;
1540  }
1541  // End code for backward compatibility before the existence of lumi trees.
1543  lumiPrincipal->fillLuminosityBlockPrincipal(lumiTree_.rootDelayedReader());
1544  // Read in all the products now.
1545  lumiPrincipal->readImmediate();
1547  return lumiPrincipal;
1548  }
RootTree lumiTree_
Definition: RootFile.h:194
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:99
bool isValid() const
Definition: RootTree.cc:87
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1489 of file RootFile.cc.

References edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::RootTree::entryNumber(), eventAux(), eventTree_, fileFormatVersion(), filePtr_, fillLumiAuxiliary(), fillThisEventAuxiliary(), 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().

1489  {
1492  // Begin code for backward compatibility before the existence of lumi trees.
1493  if(!lumiTree_.isValid()) {
1495  assert(eventEntry != IndexIntoFile::invalidEntry);
1497  eventTree_.setEntryNumber(eventEntry);
1498  assert(eventTree_.current());
1500  eventTree_.setEntryNumber(savedEntry);
1501 
1503  overrideRunNumber(lumi);
1504  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1505  }
1506  // End code for backward compatibility before the existence of lumi trees.
1508  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1509  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1510  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1511  overrideRunNumber(lumiAuxiliary->id());
1512  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1513  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1515  if(eventEntry != IndexIntoFile::invalidEntry) {
1517  eventTree_.setEntryNumber(eventEntry);
1518  assert(eventTree_.current());
1520  eventTree_.setEntryNumber(savedEntry);
1521 
1522  lumiAuxiliary->setBeginTime(eventAux().time());
1523  }
1524  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1525  }
1526  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1527  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1528  }
1529  return lumiAuxiliary;
1530  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:186
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:194
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
LuminosityBlockNumber_t lumi() const
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
static EntryNumber_t const invalidEntry
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1197
bool isValid() const
Definition: RootTree.cc:87
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1588
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
roottree::EntryNumber EntryNumber
Definition: RootTree.h:60
bool current()
Definition: RootTree.h:83
void edm::RootFile::readParentageTree ( )
private

Definition at line 522 of file RootFile.cc.

References daqProvenanceHelper_, edm::hlt::Exception, fileFormatVersion(), filePtr_, edm::errors::FileReadError, edm::roottree::getEntry(), i, edm::Parentage::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::numEntries(), edm::poolNames::parentageBranchName(), parentageIDLookup_, edm::poolNames::parentageTreeName(), parents, edm::Parentage::parents(), readEntryDescriptionTree(), and PhysicsTools::registry.

Referenced by RootFile().

522  {
523  if(!fileFormatVersion().splitProductIDs()) {
524  // Old format file.
526  return;
527  }
528  // New format file
529  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
530  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
531  if(nullptr == parentageTree.get()) {
532  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
533  << " in the input file.\n";
534  }
535 
536  Parentage parents;
537  Parentage *pParentageBuffer = &parents;
538  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
539 
541 
542  parentageIDLookup_.reserve(parentageTree->GetEntries());
543  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
544  roottree::getEntry(parentageTree.get(), i);
546  ParentageID const oldID = parents.id();
547  daqProvenanceHelper_->fixMetaData(parents.parents());
548  ParentageID newID = parents.id();
549  if(newID != oldID) {
550  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
551  }
552  }
553  registry.insertMapped(parents);
554  parentageIDLookup_.push_back(parents.id());
555  }
556  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), nullptr);
557  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:446
int i
Definition: DBlmapReader.cc:9
TPRegexp parents
Definition: eve_filter.cc:24
std::string const & parentageTreeName()
Definition: BranchType.cc:158
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
static ThreadSafeRegistry * instance()
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
void readEntryDescriptionTree()
Definition: RootFile.cc:476
std::string const & parentageBranchName()
Definition: BranchType.cc:162
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:213
static Interceptor::Registry registry("Interceptor")
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
boost::shared_ptr< RunPrincipal > edm::RootFile::readRun_ ( boost::shared_ptr< RunPrincipal runPrincipal)

Definition at line 1472 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::RootTree::isValid(), edm::IndexIntoFile::kRun, edm::RootTree::rootDelayedReader(), and runTree_.

1472  {
1475  // Begin code for backward compatibility before the existence of run trees.
1476  if(!runTree_.isValid()) {
1478  return runPrincipal;
1479  }
1480  // End code for backward compatibility before the existence of run trees.
1481  runPrincipal->fillRunPrincipal(runTree_.rootDelayedReader());
1482  // Read in all the products now.
1483  runPrincipal->readImmediate();
1485  return runPrincipal;
1486  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
RootTree runTree_
Definition: RootFile.h:195
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:99
bool isValid() const
Definition: RootTree.cc:87
boost::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

Definition at line 1402 of file RootFile.cc.

References edm::RootTree::current(), edm::IndexIntoFile::IndexIntoFileItr::entry(), edm::RootTree::entryNumber(), eventAux(), eventTree_, fileFormatVersion(), filePtr_, fillHistory(), fillRunAuxiliary(), fillThisEventAuxiliary(), 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().

1402  {
1405 
1406  // Begin code for backward compatibility before the existence of run trees.
1407  if(!runTree_.isValid()) {
1408 
1409  // prior to the support of run trees.
1410  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1412  assert(eventEntry != IndexIntoFile::invalidEntry);
1414  eventTree_.setEntryNumber(eventEntry);
1415  assert(eventTree_.current());
1417  eventTree_.setEntryNumber(savedEntry);
1418 
1420  overrideRunNumber(run);
1421  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(run.run(), eventAux().time(), Timestamp::invalidTimestamp()));
1422  }
1423  // End code for backward compatibility before the existence of run trees.
1425  boost::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1426  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1427  overrideRunNumber(runAuxiliary->id());
1428  filePtr_->reportInputRunNumber(runAuxiliary->run());
1429  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1430  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1431  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1432  }
1433 
1434  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1435  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1436  // we attempt to read the first event in the run to get appropriate info.
1437  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1439 
1441  // If we have a valid event, use its information.
1442  if(eventEntry != IndexIntoFile::invalidEntry) {
1444  eventTree_.setEntryNumber(eventEntry);
1445  assert(eventTree_.current());
1447 
1448  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1449  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1450  runAuxiliary->setBeginTime(eventAux().time());
1451  }
1452 
1453  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1454  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1455  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1456  // and event ProcessHistory's always be the same if no file merging occurs).
1457  if(!fileFormatVersion().processHistorySameWithinRun()) {
1458  fillHistory();
1459  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1460  savedRunAuxiliary_ = runAuxiliary;
1461  }
1462  eventTree_.setEntryNumber(savedEntry);
1463  } else {
1464  // No valid event, just use what is there, because it is the best we can do.
1465  savedRunAuxiliary_ = runAuxiliary;
1466  }
1467  }
1468  return runAuxiliary;
1469  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:186
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
EntryNumber_t firstEventEntryThisRun() const
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1221
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:193
void fillHistory()
Definition: RootFile.cc:1141
RootTree runTree_
Definition: RootFile.h:195
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
static EntryNumber_t const invalidEntry
bool processHistorySameWithinRun() const
bool isValid() const
Definition: RootTree.cc:87
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1588
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
roottree::EntryNumber EntryNumber
Definition: RootTree.h:60
bool current()
Definition: RootTree.h:83
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1090 of file RootFile.cc.

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

1090  {
1091  // Report file opened.
1092  std::string const label = "source";
1093  std::string moduleName = "PoolSource";
1094  filePtr_->inputFileOpened(
1095  logicalFile_,
1096  inputType,
1097  moduleName,
1098  label,
1099  fid_.fid(),
1101  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:89
FileID fid_
Definition: RootFile.h:177
std::string const logicalFile_
Definition: RootFile.h:171
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:193
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:174
void edm::RootFile::rewind ( )
inline

Definition at line 119 of file RootFile.h.

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

119  {
121  eventTree_.rewind();
122  lumiTree_.rewind();
123  runTree_.rewind();
124  }
RootTree lumiTree_
Definition: RootFile.h:194
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
RootTree eventTree_
Definition: RootFile.h:193
RootTree runTree_
Definition: RootFile.h:195
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:181
void rewind()
Definition: RootTree.h:84
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 103 of file RootFile.h.

References runTree_.

Referenced by validateFile().

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

Definition at line 1397 of file RootFile.cc.

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

1397  {
1399  }
std::pair< std::string, MonitorElement * > entry
Definition: ME_MAP.h:8
RootTree eventTree_
Definition: RootFile.h:193
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::setEntryAtEvent ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)

Definition at line 1551 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1551  {
1553  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1555  return true;
1556  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
RootTree eventTree_
Definition: RootFile.h:193
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:179
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 110 of file RootFile.h.

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

110  {
111  return event ? setEntryAtEvent(run, lumi, event) : (lumi ? setEntryAtLumi(run, lumi) : setEntryAtRun(run));
112  }
tuple lumi
Definition: fjr2json.py:35
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1567
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1559
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:1551
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1559 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1559  {
1561  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1563  return true;
1564  }
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:194
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1575 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::advanceToEvent(), edm::IndexIntoFile::IndexIntoFileItr::entry(), eventTree_, edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::IndexIntoFile::IndexIntoFileItr::run(), and edm::RootTree::setEntryNumber().

1575  {
1578  }
1581  if(run != indexIntoFileIter_.run()) return false;
1582  if(lumi != indexIntoFileIter_.lumi()) return false;
1584  return true;
1585  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
LuminosityBlockNumber_t lumi() const
RootTree eventTree_
Definition: RootFile.h:193
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1567 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1567  {
1569  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1571  return true;
1572  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
RootTree runTree_
Definition: RootFile.h:195
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

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

560  {
561  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
562  //we must avoid copying the old branch which stored the per product per event provenance
564  return;
565  }
566  if(!fileFormatVersion().splitProductIDs()) {
568  return;
569  }
572  return;
573  }
574  // Find entry for first event in file
575  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
576  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
577  ++it;
578  }
579  if(it == indexIntoFileEnd_) {
581  return;
582  }
583 
584  // From here on, record all reasons we can't fast clone.
588  }
589  if(skipAnyEvents_) {
591  }
592  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
594  }
595  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
597  }
598  // We no longer fast copy the EventAuxiliary branch, so there
599  // is no longer any need to disable fast copying because the run
600  // number is being modified. Also, this check did not work anyway
601  // because this function is called before forcedRunOffset_ is set.
602 
603  // if(forcedRunOffset_ != 0) {
604  // whyNotFastClonable_ += FileBlock::RunNumberModified;
605  // }
606  if(duplicateChecker_ &&
607  !duplicateChecker_->checkDisabled() &&
608  !duplicateChecker_->noDuplicatesInFile()) {
610  }
611  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
int whyNotFastClonable_
Definition: RootFile.h:189
RootTree lumiTree_
Definition: RootFile.h:194
EntryNumber const & entries() const
Definition: RootTree.h:87
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:201
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:209
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
bool noEventSort_
Definition: RootFile.h:188
bool skipAnyEvents_
Definition: RootFile.h:187
RootTree eventTree_
Definition: RootFile.h:193
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:181
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 646 of file RootFile.cc.

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

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

Definition at line 125 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

125  {
127  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
bool edm::RootFile::skipEvents ( int &  offset)

Definition at line 1242 of file RootFile.cc.

References duplicateChecker_, edm::EventID::event(), eventAux_, eventSkipperByID_, eventTree_, file_, fillEventAuxiliary(), fillThisEventAuxiliary(), edm::EventAuxiliary::id(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::invalidEntry, edm::IndexIntoFile::invalidIndex, edm::IndexIntoFile::invalidLumi, edm::IndexIntoFile::invalidRun, evf::evtn::offset(), edm::RootTree::setEntryNumber(), edm::IndexIntoFile::IndexIntoFileItr::skipEventBackward(), and edm::IndexIntoFile::IndexIntoFileItr::skipEventForward().

1242  {
1243  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1244 
1245  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1246  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1249 
1250  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1251  runOfSkippedEvent,
1252  lumiOfSkippedEvent,
1253  skippedEventEntry);
1254 
1255  // At the end of the file and there were no more events to skip
1256  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1257 
1258  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1259  eventTree_.setEntryNumber(skippedEventEntry);
1261  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1262  continue;
1263  }
1264  }
1265  if(duplicateChecker_ &&
1266  !duplicateChecker_->checkDisabled() &&
1267  !duplicateChecker_->noDuplicatesInFile()) {
1268 
1269  eventTree_.setEntryNumber(skippedEventEntry);
1271  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1272  runOfSkippedEvent,
1273  lumiOfSkippedEvent,
1274  eventAux_.id().event(),
1275  file_)) {
1276  continue;
1277  }
1278  }
1279  --offset;
1280  }
1281 
1282  while(offset < 0) {
1283 
1284  if(duplicateChecker_) {
1285  duplicateChecker_->disable();
1286  }
1287 
1288  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1291  EntryNumber_t eventEntry = IndexIntoFile::invalidEntry;
1292 
1293  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1294  runOfEvent,
1295  lumiOfEvent,
1296  eventEntry);
1297 
1298  if(eventEntry == IndexIntoFile::invalidEntry) break;
1299 
1300  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1301  eventTree_.setEntryNumber(eventEntry);
1303  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1304  continue;
1305  }
1306  }
1307  ++offset;
1308  }
1310  }
EventNumber_t event() const
Definition: EventID.h:44
static int const invalidIndex
void fillEventAuxiliary()
Definition: RootFile.cc:1135
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:209
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
static RunNumber_t const invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RootTree eventTree_
Definition: RootFile.h:193
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:192
void fillThisEventAuxiliary()
Definition: RootFile.cc:1116
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:175
std::string const file_
Definition: RootFile.h:170
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:175
bool edm::RootFile::skipThisEntry ( )
private

Definition at line 651 of file RootFile.cc.

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

651  {
653  return false;
654  }
655  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
656 
657  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
659  return true;
660  }
661 
662  // The Lumi is not skipped. If this is an event, see if the event is skipped.
667  eventAux_.id().event())) {
668  return true;
669  }
670  }
671 
672  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
674  eventSkipperByID_->skippingLumis()) {
675  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
676 
677  // There are no lumis in this run, not even ones we will skip
678  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
679  return true;
680  }
681  // If we get here there are lumis in the run, check to see if we are skipping all of them
682  do {
683  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
684  return false;
685  }
686  }
687  while(iterLumi.skipLumiInRun());
688  return true;
689  }
690  }
691  return false;
692  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1135
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:182
static LuminosityBlockNumber_t const invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:192
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:175
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 143 of file RootFile.h.

References treePointers_.

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

Definition at line 1043 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::InputType::Primary, edm::IndexIntoFile::reduceProcessHistoryIDs(), runTree(), edm::IndexIntoFile::setEventFinder(), edm::IndexIntoFile::setNumberOfEvents(), edm::IndexIntoFile::setProcessHistoryIDs(), and edm::FileFormatVersion::useReducedProcessHistoryID().

Referenced by RootFile().

1043  {
1044  if(!fid_.isValid()) {
1045  fid_ = FileID(createGlobalIdentifier());
1046  }
1047  if(!eventTree_.isValid()) {
1049  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
1050  }
1051 
1052  if(fileFormatVersion().hasIndexIntoFile()) {
1053  if(runTree().entries() > 0) {
1054  assert(!indexIntoFile_.empty());
1055  }
1057  if(daqProvenanceHelper_) {
1058  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1059  for(auto& phid : phidVec) {
1060  phid = daqProvenanceHelper_->mapProcessHistoryID(phid);
1061  }
1062  }
1064  }
1065  }
1066  else {
1067  assert(indexIntoFile_.empty());
1069  }
1070 
1073  indexIntoFile_.setEventFinder(boost::shared_ptr<IndexIntoFile::EventFinder>(new RootFileEventFinder(eventTree_)));
1074  // We fill the event numbers explicitly if we need to find events in closed files,
1075  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1076  bool needEventNumbers = false;
1077  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1078  if(inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1079  needEventNumbers = true;
1080  }
1081  bool needEventEntries = false;
1082  if(inputType != InputType::Primary || !noEventSort_) {
1083  // We need event entries for sorting or for secondary files or sources.
1084  needEventEntries = true;
1085  }
1086  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1087  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
bool empty() const
True if no runs, lumis, or events are in the file.
EntryNumber const & entries() const
Definition: RootTree.h:87
void reduceProcessHistoryIDs()
FileID fid_
Definition: RootFile.h:177
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:209
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool noEventSort_
Definition: RootFile.h:188
RootTree const & runTree() const
Definition: RootFile.h:103
RootTree eventTree_
Definition: RootFile.h:193
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:179
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:87
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:214
void setEventFinder(boost::shared_ptr< EventFinder > ptr) const
void fillIndexIntoFile()
Definition: RootFile.cc:817
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:180
void setNumberOfEvents(EntryNumber_t nevents) const
bool useReducedProcessHistoryID() const
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 754 of file RootFile.cc.

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

754  {
755  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
756  int phIndex;
759  IndexIntoFile::EntryNumber_t eventEntry;
760  itr.skipEventBackward(phIndex,
761  run,
762  lumi,
763  eventEntry);
764  itr.skipEventBackward(phIndex,
765  run,
766  lumi,
767  eventEntry);
768  return eventEntry == IndexIntoFile::invalidEntry;
769  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
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 747 of file RootFile.cc.

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

747  {
748  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
749  itr.advanceToEvent();
750  return itr.getEntryType() == IndexIntoFile::kEnd;
751  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:183
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 105 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

105 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:189

Member Data Documentation

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

Definition at line 208 of file RootFile.h.

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

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

Definition at line 200 of file RootFile.h.

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

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

Definition at line 199 of file RootFile.h.

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

boost::shared_ptr<BranchListIndexes> edm::RootFile::branchListIndexes_
private

Definition at line 206 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 191 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
boost::shared_ptr<BranchMapper> edm::RootFile::eventBranchMapper_
mutableprivate

Definition at line 212 of file RootFile.h.

Referenced by makeBranchMapper().

TTree* edm::RootFile::eventHistoryTree_
private

Definition at line 204 of file RootFile.h.

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

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

Definition at line 184 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 185 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

boost::shared_ptr<EventSelectionIDVector> edm::RootFile::eventSelectionIDs_
private

Definition at line 205 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

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

Definition at line 175 of file RootFile.h.

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

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

Definition at line 177 of file RootFile.h.

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

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

Definition at line 170 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

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

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

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

Definition at line 190 of file RootFile.h.

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

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

Definition at line 207 of file RootFile.h.

Referenced by fillHistory(), and readEventHistoryTree().

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

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

Referenced by indexIntoFileSharedPtr().

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

Definition at line 197 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 188 of file RootFile.h.

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

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

Definition at line 180 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 213 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 172 of file RootFile.h.

ProcessConfigurationVector edm::RootFile::processConfigurations_
private

Definition at line 173 of file RootFile.h.

Referenced by checkReleaseVersion(), and RootFile().

InputSource::ProcessingMode edm::RootFile::processingMode_
private

Definition at line 201 of file RootFile.h.

Referenced by getNextEntryTypeWanted(), and setIfFastClonable().

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

Definition at line 198 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 210 of file RootFile.h.

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

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

Definition at line 211 of file RootFile.h.

Referenced by makeBranchMapper(), and RootFile().

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

Definition at line 186 of file RootFile.h.

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 187 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 196 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 189 of file RootFile.h.

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