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

BranchIDListRegistry::collection_type
const & 
branchIDLists ()
 
bool branchListIndexesUnchanged () const
 
EventPrincipalclearAndReadCurrentEvent (EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
 
void close ()
 
boost::shared_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, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
 
EventPrincipalreadEvent (EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
 
boost::shared_ptr
< LuminosityBlockPrincipal
readLumi (boost::shared_ptr< LuminosityBlockPrincipal > lbCache)
 
boost::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
boost::shared_ptr< RunPrincipalreadRun_ (boost::shared_ptr< RunPrincipal > rpCache)
 
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, GroupSelectorRules const &groupSelectorRules, InputType::InputType inputType, 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 bypassVersionCheck, bool labelRawDataLikeMC, bool usingGoToEvent)
 
 RootFile (RootFile const &)=delete
 
RootTree const & runTree () const
 
EventPrincipalsecondaryEventPrincipal ()
 
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, GroupSelectorRules 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
< BranchIDListRegistry::collection_type
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_
 
std::unique_ptr< EventPrincipalsecondaryEventPrincipal_
 
bool skipAnyEvents_
 
RootTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 50 of file RootFile.h.

Member Typedef Documentation

Definition at line 52 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,
GroupSelectorRules const &  groupSelectorRules,
InputType::InputType  inputType,
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  bypassVersionCheck,
bool  labelRawDataLikeMC,
bool  usingGoToEvent 
)

Definition at line 122 of file RootFile.cc.

References edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), 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_, file_, 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_, secondaryEventPrincipal_, edm::InputType::SecondarySource, edm::ParameterSet::setID(), setIfFastClonable(), edm::setRefCoreStreamer(), LaserTracksInput_cfi::source, edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), edm::BranchIDListHelper::updateFromInput(), 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),
171  treePointers_(),
174  branchIDLists_(),
176  forcedRunOffset_(0),
181  history_(),
182  branchChildren_(new BranchChildren),
183  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(0 == 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()) != 0) {
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()) != 0) {
218  metaDataTree->SetBranchAddress(poolNames::fileIdentifierBranchName().c_str(), &fidPtr);
219  }
220 
221  IndexIntoFile *iifPtr = &indexIntoFile_;
222  if(metaDataTree->FindBranch(poolNames::indexIntoFileBranchName().c_str()) != 0) {
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()) != 0) {
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(0 == 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  filePtr_->SetCacheRead(psetTreeCache.get());
255  for(Long64_t i = 0; i != psetTree->GetEntries(); ++i) {
256  psetTree->GetEntry(i);
257  psetMap.insert(idToBlob);
258  }
259  filePtr_->SetCacheRead(0);
260  }
261 
262  // backward compatibility
264  ProcessHistoryRegistry::collection_type *pHistMapPtr = &pHistMap;
265  if(metaDataTree->FindBranch(poolNames::processHistoryMapBranchName().c_str()) != 0) {
266  metaDataTree->SetBranchAddress(poolNames::processHistoryMapBranchName().c_str(), &pHistMapPtr);
267  }
268 
270  ProcessHistoryRegistry::vector_type *pHistVectorPtr = &pHistVector;
271  if(metaDataTree->FindBranch(poolNames::processHistoryBranchName().c_str()) != 0) {
272  metaDataTree->SetBranchAddress(poolNames::processHistoryBranchName().c_str(), &pHistVectorPtr);
273  }
274 
275  ProcessConfigurationVector* procConfigVectorPtr = &processConfigurations_;
276  if(metaDataTree->FindBranch(poolNames::processConfigurationBranchName().c_str()) != 0) {
277  metaDataTree->SetBranchAddress(poolNames::processConfigurationBranchName().c_str(), &procConfigVectorPtr);
278  }
279 
280  std::unique_ptr<BranchIDListRegistry::collection_type> branchIDListsAPtr(new BranchIDListRegistry::collection_type);
281  BranchIDListRegistry::collection_type *branchIDListsPtr = branchIDListsAPtr.get();
282  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) != 0) {
283  metaDataTree->SetBranchAddress(poolNames::branchIDListBranchName().c_str(), &branchIDListsPtr);
284  }
285 
286  BranchChildren* branchChildrenBuffer = branchChildren_.get();
287  if(metaDataTree->FindBranch(poolNames::productDependenciesBranchName().c_str()) != 0) {
288  metaDataTree->SetBranchAddress(poolNames::productDependenciesBranchName().c_str(), &branchChildrenBuffer);
289  }
290 
291  // backward compatibility
292  std::vector<EventProcessHistoryID> *eventHistoryIDsPtr = &eventProcessHistoryIDs_;
293  if(metaDataTree->FindBranch(poolNames::eventHistoryBranchName().c_str()) != 0) {
294  metaDataTree->SetBranchAddress(poolNames::eventHistoryBranchName().c_str(), &eventHistoryIDsPtr);
295  }
296 
297  if(metaDataTree->FindBranch(poolNames::moduleDescriptionMapBranchName().c_str()) != 0) {
298  if(metaDataTree->GetBranch(poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
299  metaDataTree->SetBranchStatus((poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), 0);
300  } else {
301  metaDataTree->SetBranchStatus(poolNames::moduleDescriptionMapBranchName().c_str(), 0);
302  }
303  }
304 
305  // Here we read the metadata tree
306  roottree::getEntry(metaDataTree.get(), 0);
307 
308  if(!bypassVersionCheck) {
310  }
311 
313 
314  // Here we read the event history tree, if we have one.
316 
318  if(!fileFormatVersion().triggerPathsTracked()) {
319  ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion().parameterSetsByReference());
320  } else {
321  // Merge into the parameter set registry.
322  pset::Registry& psetRegistry = *pset::Registry::instance();
323  for(PsetMap::const_iterator i = psetMap.begin(), iEnd = psetMap.end(); i != iEnd; ++i) {
324  ParameterSet pset(i->second.pset());
325  pset.setID(i->first);
326  psetRegistry.insertMapped(pset);
327  }
328  }
329  if(!fileFormatVersion().splitProductIDs()) {
330  // Old provenance format input file. Create a provenance adaptor.
331  provenanceAdaptor_.reset(new ProvenanceAdaptor(
332  inputProdDescReg, pHistMap, pHistVector, processConfigurations_, psetIdConverter, true));
333  // Fill in the branchIDLists branch from the provenance adaptor
334  branchIDLists_ = provenanceAdaptor_->branchIDLists();
335  } else {
336  if(!fileFormatVersion().triggerPathsTracked()) {
337  // New provenance format, but change in ParameterSet Format. Create a provenance adaptor.
338  provenanceAdaptor_.reset(new ProvenanceAdaptor(
339  inputProdDescReg, pHistMap, pHistVector, processConfigurations_, psetIdConverter, false));
340  }
341  // New provenance format input file. The branchIDLists branch was read directly from the input file.
342  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) == 0) {
344  << "Failed to find branchIDLists branch in metaData tree.\n";
345  }
346  branchIDLists_.reset(branchIDListsAPtr.release());
347  }
348 
349  if(labelRawDataLikeMC) {
350  std::string const rawData("FEDRawDataCollection");
351  std::string const source("source");
352  ProductRegistry::ProductList& pList = inputProdDescReg.productListUpdator();
353  BranchKey finder(rawData, source, "", "");
354  ProductRegistry::ProductList::iterator it = pList.lower_bound(finder);
355  if(it != pList.end() && it->first.friendlyClassName_ == rawData && it->first.moduleLabel_ == source) {
356  // We found raw data with a module label of source.
357  // We need to change the module label and process name.
358  // Create helper.
359  it->second.init();
360  daqProvenanceHelper_.reset(new DaqProvenanceHelper(it->second.typeID()));
361  // Create the new branch description
362  BranchDescription const& newBD = daqProvenanceHelper_->constBranchDescription_.me();
363  // Save info from the old and new branch descriptions
364  daqProvenanceHelper_->saveInfo(it->second, newBD);
365  // Map the new branch name to the old branch name.
366  it->second.init();
367  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), it->second.branchName()));
368  // Remove the old branch description from the product Registry.
369  pList.erase(it);
370  // Check that there was only one.
371  it = pList.lower_bound(finder);
372  assert(!(it != pList.end() && it->first.friendlyClassName_ == rawData && it->first.moduleLabel_ == source));
373  // Insert the new branch description into the product registry.
374  inputProdDescReg.copyProduct(newBD);
375  // Fix up other per file metadata.
377  daqProvenanceHelper_->fixMetaData(pHistVector);
378  daqProvenanceHelper_->fixMetaData(*branchIDLists_);
379  daqProvenanceHelper_->fixMetaData(*branchChildren_);
380  }
381  }
382 
385 
387 
388  validateFile(inputType, usingGoToEvent);
389 
390  // Read the parentage tree. Old format files are handled internally in readParentageTree().
392 
393  // Merge into the hashed registries.
394  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
396  }
397 
398  initializeDuplicateChecker(indexesIntoFiles, currentIndexIntoFile);
401  forcedRunOffset_ = forcedRunOffset(forcedRunNumber, indexIntoFileBegin_, indexIntoFileEnd_);
403 
404  // Set product presence information in the product registry.
405  ProductRegistry::ProductList const& pList = inputProdDescReg.productList();
406  for(ProductRegistry::ProductList::const_iterator it = pList.begin(), itEnd = pList.end();
407  it != itEnd; ++it) {
408  BranchDescription const& prod = it->second;
409  prod.init();
410  treePointers_[prod.branchType()]->setPresence(prod, newBranchToOldBranch(prod.branchName()));
411  }
412 
414 
415  std::unique_ptr<ProductRegistry> newReg(new ProductRegistry);
416 
417  // Do the translation from the old registry to the new one
418  {
419  ProductRegistry::ProductList const& prodList = inputProdDescReg.productList();
420  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
421  it != itEnd; ++it) {
422  BranchDescription const& prod = it->second;
423  std::string newFriendlyName = friendlyname::friendlyName(prod.className());
424  if(newFriendlyName == prod.friendlyClassName()) {
425  newReg->copyProduct(prod);
426  } else {
427  if(fileFormatVersion().splitProductIDs()) {
429  << "Cannot change friendly class name algorithm without more development work\n"
430  << "to update BranchIDLists. Contact the framework group.\n";
431  }
432  BranchDescription newBD(prod);
433  newBD.updateFriendlyClassName();
434  newReg->copyProduct(newBD);
435  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), prod.branchName()));
436  }
437  }
438  dropOnInput(*newReg, groupSelectorRules, dropDescendants, inputType);
439  // freeze the product registry
440  newReg->setFrozen(inputType != InputType::Primary);
441  productRegistry_.reset(newReg.release());
442  }
443 
444  // Here, we make the class that will make the ProvenanceReader
446 
447  // Set up information from the product registry.
448  ProductRegistry::ProductList const& prodList = productRegistry()->productList();
449  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
450  it != itEnd; ++it) {
451  BranchDescription const& prod = it->second;
452  treePointers_[prod.branchType()]->addBranch(it->first, prod,
453  newBranchToOldBranch(prod.branchName()));
454  }
455 
456  // Event Principal cache for secondary input source
457  if(inputType == InputType::SecondarySource) {
458  secondaryEventPrincipal_.reset(new EventPrincipal(productRegistry(), processConfiguration));
459  }
460 
461  // Determine if this file is fast clonable.
462  setIfFastClonable(remainingEvents, remainingLumis);
463 
464  // Update the branch id info.
465  if(inputType == InputType::Primary) {
467  }
468 
469  setRefCoreStreamer(true); // backward compatibility
470 
471  // We are done with our initial reading of EventAuxiliary.
473 
474  // Tell the event tree to begin training at the next read.
476 
477  // Train the run and lumi trees.
478  runTree_.trainCache("*");
479  lumiTree_.trainCache("*");
480  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:273
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:249
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:213
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:211
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:209
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:114
unsigned int const defaultNonEventLearningEntries
Definition: RootTree.h:37
std::unique_ptr< EventPrincipal > secondaryEventPrincipal_
Definition: RootFile.h:215
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:190
std::unique_ptr< History > history_
Definition: RootFile.h:210
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
ProcessConfigurationVector processConfigurations_
Definition: RootFile.h:177
void readParentageTree()
Definition: RootFile.cc:532
int whyNotFastClonable_
Definition: RootFile.h:193
void checkReleaseVersion()
Definition: RootFile.cc:1652
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:206
std::map< BranchKey, BranchDescription > ProductList
static bool updateFromInput(BranchIDLists const &bidlists, std::string const &fileName)
RootTree lumiTree_
Definition: RootFile.h:198
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:214
void setRefCoreStreamer(bool resetAll=false)
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:212
static ThreadSafeRegistry * instance()
IndexIntoFileItr begin(SortOrder sortOrder) const
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:204
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
boost::shared_ptr< BranchMapper > eventBranchMapper_
Definition: RootFile.h:216
detail::ThreadSafeRegistry< ParameterSetID, ParameterSet, ProcessParameterSetIDCache > Registry
Definition: Registry.h:37
void trainCache(char const *branchNames)
Definition: RootTree.cc:253
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
std::vector< EventSelectionID > EventSelectionIDVector
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:180
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:245
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:189
FileID fid_
Definition: RootFile.h:181
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
std::string const logicalFile_
Definition: RootFile.h:175
std::map< key_type, value_type > collection_type
std::vector< BranchListIndex > BranchListIndexes
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:192
bool noEventSort_
Definition: RootFile.h:192
std::string friendlyName(std::string const &iFullName)
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:201
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:191
RootTree eventTree_
Definition: RootFile.h:197
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:208
std::string const & processHistoryBranchName()
Definition: BranchType.cc:197
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
RootTree runTree_
Definition: RootFile.h:199
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:194
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:182
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:176
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:570
std::unique_ptr< MakeProvenanceReader > makeProvenanceReaderMaker() const
Definition: RootFile.cc:1748
void dropOnInput(ProductRegistry &reg, GroupSelectorRules const &rules, bool dropDescendants, InputType::InputType inputType)
Definition: RootFile.cc:1683
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:172
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:202
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:185
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
bool branchListIndexesUnchanged_
Definition: RootFile.h:195
unsigned int const defaultNonEventCacheSize
Definition: RootTree.h:35
std::vector< value_type > vector_type
RootTreePtrArray treePointers_
Definition: RootFile.h:200
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:202
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:184
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:177
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
void initializeDuplicateChecker(std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
Definition: RootFile.cc:1667
std::string const & branchIDListBranchName()
Definition: BranchType.cc:207
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:217
EventAuxiliary eventAux_
Definition: RootFile.h:196
void resetTraining()
Definition: RootTree.h:120
boost::shared_ptr< BranchIDListRegistry::collection_type const > branchIDLists_
Definition: RootFile.h:203
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:641
std::unique_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:297
unsigned int const defaultLearningEntries
Definition: RootTree.h:36
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:179
TTree * eventHistoryTree_
Definition: RootFile.h:207
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:217
boost::shared_ptr< ProductRegistry const > productRegistry() const
Definition: RootFile.h:95
void validateFile(InputType::InputType inputType, bool usingGoToEvent)
Definition: RootFile.cc:1052
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:187
std::string const file_
Definition: RootFile.h:174
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:188
void readEventHistoryTree()
Definition: RootFile.cc:1639
int forcedRunOffset_
Definition: RootFile.h:205
edm::RootFile::~RootFile ( )

Definition at line 482 of file RootFile.cc.

482  {
483  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

BranchIDListRegistry::collection_type const& edm::RootFile::branchIDLists ( )
inline

Definition at line 96 of file RootFile.h.

References branchIDLists_.

96 {return *branchIDLists_;}
boost::shared_ptr< BranchIDListRegistry::collection_type const > branchIDLists_
Definition: RootFile.h:203
bool edm::RootFile::branchListIndexesUnchanged ( ) const
inline

Definition at line 108 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

Definition at line 1652 of file RootFile.cc.

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

Referenced by RootFile().

1652  {
1653  std::string releaseVersion = getReleaseVersion();
1654  releaseversion::DecomposedReleaseVersion currentRelease(releaseVersion);
1655  for(ProcessConfigurationVector::const_iterator it = processConfigurations_.begin(), itEnd = processConfigurations_.end();
1656  it != itEnd; ++it) {
1657  if(releaseversion::isEarlierRelease(currentRelease, it->releaseVersion())) {
1659  << "The release you are using, " << getReleaseVersion() << " , predates\n"
1660  << "a release (" << it->releaseVersion() << ") used in writing the input file, " << file() <<".\n"
1661  << "Forward compatibility cannot be supported.\n";
1662  }
1663  }
1664  }
ProcessConfigurationVector processConfigurations_
Definition: RootFile.h:177
bool isEarlierRelease(std::string const &a, std::string const &b)
std::string getReleaseVersion()
std::string const & file() const
Definition: RootFile.h:94
EventPrincipal * edm::RootFile::clearAndReadCurrentEvent ( EventPrincipal cache,
boost::shared_ptr< LuminosityBlockPrincipal lb = boost::shared_ptr<LuminosityBlockPrincipal>() 
)

Definition at line 1410 of file RootFile.cc.

References edm::EventPrincipal::clearEventPrincipal(), and readCurrentEvent().

1411  {
1412  cache.clearEventPrincipal();
1413  return readCurrentEvent(cache, lb);
1414  }
EventPrincipal * readCurrentEvent(EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
Definition: RootFile.cc:1382
void edm::RootFile::close ( void  )

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

1115  {
1116  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
1117  eventHistoryTree_ = 0;
1118  for(RootTreePtrArray::iterator it = treePointers_.begin(), itEnd = treePointers_.end(); it != itEnd; ++it) {
1119  (*it)->close();
1120  (*it) = 0;
1121  }
1122  filePtr_->Close();
1123  filePtr_.reset();
1124  }
RootTreePtrArray treePointers_
Definition: RootFile.h:200
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
TTree * eventHistoryTree_
Definition: RootFile.h:207
boost::shared_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 624 of file RootFile.cc.

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

624  {
625  return boost::shared_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
626  eventTree_.tree(),
628  lumiTree_.tree(),
630  runTree_.tree(),
631  runTree_.metaTree(),
634  file_,
636  modifiedIDs(),
637  branchChildren_));
638  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:211
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
bool branchListIndexesUnchanged() const
Definition: RootFile.h:108
RootTree lumiTree_
Definition: RootFile.h:198
TTree const * metaTree() const
Definition: RootTree.h:113
TTree const * tree() const
Definition: RootTree.h:111
bool modifiedIDs() const
Definition: RootFile.h:109
int whyNotFastClonable() const
Definition: RootFile.h:106
RootTree eventTree_
Definition: RootFile.h:197
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:107
RootTree runTree_
Definition: RootFile.h:199
std::string const file_
Definition: RootFile.h:174
void edm::RootFile::dropOnInput ( ProductRegistry reg,
GroupSelectorRules const &  rules,
bool  dropDescendants,
InputType::InputType  inputType 
)
private

Definition at line 1683 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::GroupSelector::initialize(), newBranchToOldBranch(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::InputType::SecondaryFile, edm::GroupSelector::selected(), treePointers_, and edm::BranchDescription::wrappedName().

Referenced by RootFile().

1683  {
1684  // This is the selector for drop on input.
1685  GroupSelector groupSelector;
1686  groupSelector.initialize(rules, reg.allBranchDescriptions());
1687 
1688  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1689  // Do drop on input. On the first pass, just fill in a set of branches to be dropped.
1690  std::set<BranchID> branchesToDrop;
1691  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
1692  it != itEnd; ++it) {
1693  BranchDescription const& prod = it->second;
1694  if(!groupSelector.selected(prod)) {
1695  if(dropDescendants) {
1696  branchChildren_->appendToDescendants(prod.branchID(), branchesToDrop);
1697  } else {
1698  branchesToDrop.insert(prod.branchID());
1699  }
1700  }
1701  }
1702 
1703  // On this pass, actually drop the branches.
1704  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1705  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1706  BranchDescription const& prod = it->second;
1707  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1708  if(drop) {
1709  if(groupSelector.selected(prod)) {
1710  LogWarning("RootFile")
1711  << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1712  << "of file '" << file_ << "' because it is dependent on a branch\n"
1713  << "that was explicitly dropped.\n";
1714  }
1715  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1716  hasNewlyDroppedBranch_[prod.branchType()] = true;
1717  ProductRegistry::ProductList::iterator icopy = it;
1718  ++it;
1719  prodList.erase(icopy);
1720  } else {
1721  ++it;
1722  }
1723  }
1724 
1725  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
1726  if(inputType == InputType::SecondaryFile) {
1727  TString tString;
1728  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1729  BranchDescription const& prod = it->second;
1730  if(prod.branchType() != InEvent) {
1731  TClass *cp = gROOT->GetClass(prod.wrappedName().c_str());
1732  WrapperOwningHolder edp(cp->New(), prod.getInterface());
1733  if(edp.isMergeable()) {
1734  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1735  ProductRegistry::ProductList::iterator icopy = it;
1736  ++it;
1737  prodList.erase(icopy);
1738  } else {
1739  ++it;
1740  }
1741  }
1742  else ++it;
1743  }
1744  }
1745  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:211
std::map< BranchKey, BranchDescription > ProductList
const int drop
std::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:194
RootTreePtrArray treePointers_
Definition: RootFile.h:200
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:641
std::string const file_
Definition: RootFile.h:174
EventAuxiliary const& edm::RootFile::eventAux ( ) const
inline
EventID const& edm::RootFile::eventID ( ) const
inline

Definition at line 101 of file RootFile.h.

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

Referenced by readCurrentEvent().

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

Definition at line 102 of file RootFile.h.

References eventTree_.

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

Definition at line 94 of file RootFile.h.

References file_.

Referenced by checkReleaseVersion().

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

Definition at line 1146 of file RootFile.cc.

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

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

1146  {
1149  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
RootTree eventTree_
Definition: RootFile.h:197
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
void edm::RootFile::fillHistory ( )
private

Definition at line 1152 of file RootFile.cc.

References branchListIndexes_, edm::poolNames::branchListIndexesBranchName(), daqProvenanceHelper_, alignCSCRings::e, 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::BranchIDListHelper::fixBranchListIndexes(), edm::roottree::getEntry(), history_, i, errorMatrix2Lands_multiChannel::id, 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_().

1152  {
1153  // We could consider doing delayed reading, but because we have to
1154  // store this History object in a different tree than the event
1155  // data tree, this is too hard to do in this first version.
1156 
1157  if(fileFormatVersion().eventHistoryBranch()) {
1158  // Lumi block number was not in EventID for the relevant releases.
1159  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1160  if(eventProcessHistoryIter_->eventID() != id) {
1161  EventProcessHistoryID target(id, ProcessHistoryID());
1163  assert(eventProcessHistoryIter_->eventID() == id);
1164  }
1167  } else if(fileFormatVersion().eventHistoryTree()) {
1168  // for backward compatibility.
1169  History* pHistory = history_.get();
1170  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1171  if(!eventHistoryBranch) {
1173  << "Failed to find history branch in event history tree.\n";
1174  }
1175  eventHistoryBranch->SetAddress(&pHistory);
1177  eventAux_.setProcessHistoryID(history_->processHistoryID());
1178  eventSelectionIDs_.reset(&history_->eventSelectionIDs(), do_nothing_deleter());
1179  branchListIndexes_.reset(&history_->branchListIndexes(), do_nothing_deleter());
1180  } else if(fileFormatVersion().noMetaDataTrees()) {
1181  // Current format
1183  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1184  assert(eventSelectionIDBranch != 0);
1185  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1186  BranchListIndexes* pBLI = branchListIndexes_.get();
1187  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1188  assert(branchListIndexesBranch != 0);
1189  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1190  }
1191  if(provenanceAdaptor_) {
1192  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1193  for(EventSelectionIDVector::iterator i = eventSelectionIDs_->begin(), e = eventSelectionIDs_->end(); i != e; ++i) {
1194  (*i) = provenanceAdaptor_->convertID(*i);
1195  }
1196  }
1197  if(daqProvenanceHelper_) {
1199  }
1201  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1202  provenanceAdaptor_->branchListIndexes(*branchListIndexes_);
1203  }
1205  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:273
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:213
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:209
std::unique_ptr< History > history_
Definition: RootFile.h:210
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
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
static void fixBranchListIndexes(BranchListIndexes &indexes)
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:189
TTree const * tree() const
Definition: RootTree.h:111
std::vector< BranchListIndex > BranchListIndexes
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:232
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:197
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:208
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:106
void setProcessHistoryID(ProcessHistoryID const &phid)
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
EventAuxiliary eventAux_
Definition: RootFile.h:196
TTree * eventHistoryTree_
Definition: RootFile.h:207
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:188
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 826 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(), i, indexIntoFile_, edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::RootTree::isValid(), lastEventEntryNumberRead_, summaryLumi::lcount, 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().

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

Definition at line 1208 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1208  {
1209  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1210  if(fileFormatVersion().newAuxiliary()) {
1211  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1212  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1213  } else {
1214  LuminosityBlockAux lumiAux;
1215  LuminosityBlockAux *pLumiAux = &lumiAux;
1216  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1217  conversion(lumiAux, *lumiAuxiliary);
1218  }
1219  if(provenanceAdaptor_) {
1220  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1221  }
1222  if(daqProvenanceHelper_) {
1223  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1224  }
1225  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1226  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1227  }
1228  return lumiAuxiliary;
1229  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
RootTree lumiTree_
Definition: RootFile.h:198
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:218
unsigned int RunNumber_t
Definition: EventRange.h:32
void fillAux(T *&pAux)
Definition: RootTree.h:90
boost::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1232 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1232  {
1233  boost::shared_ptr<RunAuxiliary> runAuxiliary(new RunAuxiliary);
1234  if(fileFormatVersion().newAuxiliary()) {
1235  RunAuxiliary *pRunAux = runAuxiliary.get();
1236  runTree_.fillAux<RunAuxiliary>(pRunAux);
1237  } else {
1238  RunAux runAux;
1239  RunAux *pRunAux = &runAux;
1240  runTree_.fillAux<RunAux>(pRunAux);
1241  conversion(runAux, *runAuxiliary);
1242  }
1243  if(provenanceAdaptor_) {
1244  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1245  }
1246  if(daqProvenanceHelper_) {
1247  runAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(runAuxiliary->processHistoryID()));
1248  }
1249  return runAuxiliary;
1250  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:213
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
RootTree runTree_
Definition: RootFile.h:199
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
void fillAux(T *&pAux)
Definition: RootTree.h:90
void edm::RootFile::fillThisEventAuxiliary ( )
private

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

1127  {
1129  // Already read.
1130  return;
1131  }
1133  EventAuxiliary *pEvAux = &eventAux_;
1134  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1135  } else {
1136  // for backward compatibility.
1137  EventAux eventAux;
1138  EventAux *pEvAux = &eventAux;
1139  eventTree_.fillAux<EventAux>(pEvAux);
1140  conversion(eventAux, eventAux_);
1141  }
1143  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:201
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:196
void fillAux(T *&pAux)
Definition: RootTree.h:90
IndexIntoFile::EntryType edm::RootFile::getEntryTypeWithSkipping ( )
private
IndexIntoFile::EntryType edm::RootFile::getNextEntryTypeWanted ( )

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

731  {
733  if(entryType == IndexIntoFile::kEnd) {
734  return IndexIntoFile::kEnd;
735  }
736  if(entryType == IndexIntoFile::kRun) {
737  return IndexIntoFile::kRun;
738  } else if(processingMode_ == InputSource::Runs) {
740  return getNextEntryTypeWanted();
741  }
742  if(entryType == IndexIntoFile::kLumi) {
743  return IndexIntoFile::kLumi;
746  return getNextEntryTypeWanted();
747  }
748  if(isDuplicateEvent()) {
750  return getNextEntryTypeWanted();
751  }
752  return IndexIntoFile::kEvent;
753  }
IndexIntoFile::EntryType getEntryTypeWithSkipping()
Definition: RootFile.cc:704
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:204
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::EntryType getNextEntryTypeWanted()
Definition: RootFile.cc:731
bool isDuplicateEvent()
Definition: RootFile.cc:720
bool edm::RootFile::goToEvent ( EventID const &  eventID)

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

1324  {
1325 
1327 
1328  if(duplicateChecker_) {
1329  duplicateChecker_->disable();
1330  }
1331 
1334 
1335  IndexIntoFile::IndexIntoFileItr iter =
1337 
1338  if(iter == indexIntoFile_.end(sortOrder)) {
1339  return false;
1340  }
1341  indexIntoFileIter_ = iter;
1342  return true;
1343  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & eventID() const
Definition: RootFile.h:101
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
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:212
bool noEventSort_
Definition: RootFile.h:192
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 107 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 650 of file RootFile.cc.

References indexIntoFileIter_.

650  {
651  return indexIntoFileIter_;
652  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 134 of file RootFile.h.

References indexIntoFileSharedPtr_.

134  {
136  }
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:182
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 1667 of file RootFile.cc.

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

Referenced by RootFile().

1669  {
1670  if(duplicateChecker_) {
1671  if(eventTree_.next()) {
1673  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1675  indexesIntoFiles,
1676  currentIndexIntoFile);
1677  }
1679  }
1680  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
bool next()
Definition: RootTree.h:79
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::isDuplicateEvent ( )
private

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

720  {
722  if(duplicateChecker_.get() == 0) {
723  return false;
724  }
726  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
728  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1146
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
LuminosityBlockNumber_t lumi() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:196
std::string const file_
Definition: RootFile.h:174
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 103 of file RootFile.h.

References lumiTree_.

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

Definition at line 1761 of file RootFile.cc.

References daqProvenanceHelper_, eventBranchMapper_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1761  {
1762  if(!eventBranchMapper_) {
1763  eventBranchMapper_.reset(new BranchMapper(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1764  }
1765  eventBranchMapper_->reset();
1766  return eventBranchMapper_;
1767  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:214
boost::shared_ptr< BranchMapper > eventBranchMapper_
Definition: RootFile.h:216
RootTree eventTree_
Definition: RootFile.h:197
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( ) const
private

Definition at line 1748 of file RootFile.cc.

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

Referenced by RootFile().

1748  {
1750  return std::unique_ptr<MakeProvenanceReader>(new MakeReducedProvenanceReader(parentageIDLookup_));
1751  } else if(fileFormatVersion_.splitProductIDs()) {
1752  return std::unique_ptr<MakeProvenanceReader>(new MakeFullProvenanceReader);
1753  } else if(fileFormatVersion_.perEventProductIDs()) {
1754  return std::unique_ptr<MakeProvenanceReader>(new MakeOldProvenanceReader);
1755  } else {
1756  return std::unique_ptr<MakeProvenanceReader>(new MakeDummyProvenanceReader);
1757  }
1758  }
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:180
bool storedProductProvenanceUsed() const
bool perEventProductIDs() const
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:217
bool edm::RootFile::modifiedIDs ( ) const
inline

Definition at line 109 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

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

Definition at line 641 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

641  {
642  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
643  if(it != newBranchToOldBranch_.end()) {
644  return it->second;
645  }
646  return newBranch;
647  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:206
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 132 of file RootFile.h.

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

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

Definition at line 1608 of file RootFile.cc.

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

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

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

Definition at line 1616 of file RootFile.cc.

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

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

Definition at line 1624 of file RootFile.cc.

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

1624  {
1625  if(forcedRunOffset_ != 0) {
1626  if(isRealData) {
1627  throw Exception(errors::Configuration, "RootFile::RootFile()")
1628  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1629  }
1630  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1631  }
1632  if(RunID(id.run()) < RunID::firstValidRun()) {
1634  }
1635  }
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:205
boost::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 95 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

95 {return productRegistry_;}
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:202
EventPrincipal * edm::RootFile::readCurrentEvent ( EventPrincipal cache,
boost::shared_ptr< LuminosityBlockPrincipal lb = boost::shared_ptr<LuminosityBlockPrincipal>() 
)

Definition at line 1382 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 clearAndReadCurrentEvent(), and readEvent().

1383  {
1384  if(!eventTree_.current()) {
1385  return 0;
1386  }
1388  if(!fileFormatVersion().lumiInEventID()) {
1389  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1390  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1392  }
1393  fillHistory();
1395 
1396  // We're not done ... so prepare the EventPrincipal
1397  cache.fillEventPrincipal(eventAux(),
1398  lb,
1401  makeBranchMapper(),
1403 
1404  // report event read from file
1405  filePtr_->eventReadFromFile(eventID().run(), eventID().event());
1406  return &cache;
1407  }
EventID const & eventID() const
Definition: RootFile.h:101
bool isRealData() const
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:209
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
void fillHistory()
Definition: RootFile.cc:1152
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:208
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:80
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1608
boost::shared_ptr< BranchMapper > makeBranchMapper()
Definition: RootFile.cc:1761
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
EventAuxiliary eventAux_
Definition: RootFile.h:196
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
bool current()
Definition: RootTree.h:81
void edm::RootFile::readEntryDescriptionTree ( )
private

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

486  {
487  // Called only for old format files.
488  if(!fileFormatVersion().perEventProductIDs()) return;
489  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
490  std::unique_ptr<TTree> entryDescriptionTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
491  if(0 == entryDescriptionTree.get()) {
492  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
493  << " in the input file.\n";
494  }
495 
496  EntryDescriptionID idBuffer;
497  EntryDescriptionID* pidBuffer = &idBuffer;
498  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
499 
501 
502  EventEntryDescription entryDescriptionBuffer;
503  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
504  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
505 
506  // Fill in the parentage registry.
508 
509  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
510  roottree::getEntry(entryDescriptionTree.get(), i);
511  if(idBuffer != entryDescriptionBuffer.id()) {
512  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
513  }
514  oldregistry.insertMapped(entryDescriptionBuffer);
515  Parentage parents;
516  parents.parents() = entryDescriptionBuffer.parents();
518  ParentageID const oldID = parents.id();
519  daqProvenanceHelper_->fixMetaData(parents.parents());
520  ParentageID newID = parents.id();
521  if(newID != oldID) {
522  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
523  }
524  }
525  registry.insertMapped(parents);
526  }
527  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), 0);
528  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), 0);
529  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:273
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:105
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
static ThreadSafeRegistry * instance()
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:218
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:149
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
static Interceptor::Registry registry("Interceptor")
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
EventPrincipal * edm::RootFile::readEvent ( EventPrincipal cache,
boost::shared_ptr< LuminosityBlockPrincipal lb = boost::shared_ptr<LuminosityBlockPrincipal>() 
)

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

1359  {
1362  // Set the entry in the tree, and read the event at that entry.
1364  EventPrincipal* ep = readCurrentEvent(cache, lb);
1365 
1366  assert(ep != 0);
1367  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1368  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1369 
1370  // If this next assert shows up in performance profiling or significantly affects memory, then these three lines should be deleted.
1371  // The IndexIntoFile should guarantee that it never fails.
1373  ProcessHistoryID const& reducedPHID = ProcessHistoryRegistry::instance()->extra().reduceProcessHistoryID(idToCheck);
1375 
1377  return ep;
1378  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
EventPrincipal * readCurrentEvent(EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
Definition: RootFile.cc:1382
static ThreadSafeRegistry * instance()
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
ProcessHistoryID const & processHistoryID(int i) const
ProcessHistoryID const & processHistoryID() const
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
bool useReducedProcessHistoryID() const
int forcedRunOffset_
Definition: RootFile.h:205
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1639 of file RootFile.cc.

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

Referenced by RootFile().

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

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

1553  {
1556  // Begin code for backward compatibility before the existence of lumi trees.
1557  if(!lumiTree_.isValid()) {
1559  return lbCache;
1560  }
1561  // End code for backward compatibility before the existence of lumi trees.
1563  lbCache->fillLuminosityBlockPrincipal(lumiTree_.rootDelayedReader());
1564  // Read in all the products now.
1565  lbCache->readImmediate();
1567  return lbCache;
1568  }
RootTree lumiTree_
Definition: RootFile.h:198
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:80
bool isValid() const
Definition: RootTree.cc:68
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

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

1509  {
1512  // Begin code for backward compatibility before the existence of lumi trees.
1513  if(!lumiTree_.isValid()) {
1515  assert(eventEntry != IndexIntoFile::invalidEntry);
1517  eventTree_.setEntryNumber(eventEntry);
1518  assert(eventTree_.current());
1520  eventTree_.setEntryNumber(savedEntry);
1521 
1523  overrideRunNumber(lumi);
1524  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1525  }
1526  // End code for backward compatibility before the existence of lumi trees.
1528  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1529  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1530  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1531  overrideRunNumber(lumiAuxiliary->id());
1532  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1533  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1535  if(eventEntry != IndexIntoFile::invalidEntry) {
1537  eventTree_.setEntryNumber(eventEntry);
1538  assert(eventTree_.current());
1540  eventTree_.setEntryNumber(savedEntry);
1541 
1542  lumiAuxiliary->setBeginTime(eventAux().time());
1543  }
1544  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1545  }
1546  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1547  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1548  }
1549  return lumiAuxiliary;
1550  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:190
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:198
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
LuminosityBlockNumber_t lumi() const
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
static EntryNumber_t const invalidEntry
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1208
bool isValid() const
Definition: RootTree.cc:68
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1608
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
roottree::EntryNumber EntryNumber
Definition: RootTree.h:59
bool current()
Definition: RootTree.h:81
void edm::RootFile::readParentageTree ( )
private

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

532  {
533  if(!fileFormatVersion().splitProductIDs()) {
534  // Old format file.
536  return;
537  }
538  // New format file
539  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
540  std::unique_ptr<TTree> parentageTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str())));
541  if(0 == parentageTree.get()) {
542  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
543  << " in the input file.\n";
544  }
545 
546  Parentage parents;
547  Parentage *pParentageBuffer = &parents;
548  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
549 
551 
552  parentageIDLookup_.reserve(parentageTree->GetEntries());
553  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
554  roottree::getEntry(parentageTree.get(), i);
556  ParentageID const oldID = parents.id();
557  daqProvenanceHelper_->fixMetaData(parents.parents());
558  ParentageID newID = parents.id();
559  if(newID != oldID) {
560  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
561  }
562  }
563  registry.insertMapped(parents);
564  parentageIDLookup_.push_back(parents.id());
565  }
566  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), 0);
567  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:273
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:105
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
static ThreadSafeRegistry * instance()
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
void readEntryDescriptionTree()
Definition: RootFile.cc:486
std::string const & parentageBranchName()
Definition: BranchType.cc:162
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
std::vector< ParentageID > parentageIDLookup_
Definition: RootFile.h:217
static Interceptor::Registry registry("Interceptor")
Hash< ParentageType > ParentageID
Definition: ParentageID.h:9
boost::shared_ptr< RunPrincipal > edm::RootFile::readRun_ ( boost::shared_ptr< RunPrincipal rpCache)

Definition at line 1492 of file RootFile.cc.

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

1492  {
1495  // Begin code for backward compatibility before the existence of run trees.
1496  if(!runTree_.isValid()) {
1498  return rpCache;
1499  }
1500  // End code for backward compatibility before the existence of run trees.
1501  rpCache->fillRunPrincipal(runTree_.rootDelayedReader());
1502  // Read in all the products now.
1503  rpCache->readImmediate();
1505  return rpCache;
1506  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
RootTree runTree_
Definition: RootFile.h:199
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:80
bool isValid() const
Definition: RootTree.cc:68
boost::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

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

1422  {
1425 
1426  // Begin code for backward compatibility before the existence of run trees.
1427  if(!runTree_.isValid()) {
1428 
1429  // prior to the support of run trees.
1430  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1432  assert(eventEntry != IndexIntoFile::invalidEntry);
1434  eventTree_.setEntryNumber(eventEntry);
1435  assert(eventTree_.current());
1437  eventTree_.setEntryNumber(savedEntry);
1438 
1440  overrideRunNumber(run);
1441  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(run.run(), eventAux().time(), Timestamp::invalidTimestamp()));
1442  }
1443  // End code for backward compatibility before the existence of run trees.
1445  boost::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1446  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1447  overrideRunNumber(runAuxiliary->id());
1448  filePtr_->reportInputRunNumber(runAuxiliary->run());
1449  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1450  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1451  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1452  }
1453 
1454  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1455  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1456  // we attempt to read the first event in the run to get appropriate info.
1457  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1459 
1461  // If we have a valid event, use its information.
1462  if(eventEntry != IndexIntoFile::invalidEntry) {
1464  eventTree_.setEntryNumber(eventEntry);
1465  assert(eventTree_.current());
1467 
1468  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1469  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1470  runAuxiliary->setBeginTime(eventAux().time());
1471  }
1472 
1473  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1474  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1475  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1476  // and event ProcessHistory's always be the same if no file merging occurs).
1477  if(!fileFormatVersion().processHistorySameWithinRun()) {
1478  fillHistory();
1479  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1480  savedRunAuxiliary_ = runAuxiliary;
1481  }
1482  eventTree_.setEntryNumber(savedEntry);
1483  } else {
1484  // No valid event, just use what is there, because it is the best we can do.
1485  savedRunAuxiliary_ = runAuxiliary;
1486  }
1487  }
1488  return runAuxiliary;
1489  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:190
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
EntryNumber_t firstEventEntryThisRun() const
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1232
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
EventAuxiliary const & eventAux() const
Definition: RootFile.h:97
RootTree eventTree_
Definition: RootFile.h:197
void fillHistory()
Definition: RootFile.cc:1152
RootTree runTree_
Definition: RootFile.h:199
EntryNumber const & entryNumber() const
Definition: RootTree.h:84
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
static EntryNumber_t const invalidEntry
bool processHistorySameWithinRun() const
bool isValid() const
Definition: RootTree.cc:68
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1608
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
roottree::EntryNumber EntryNumber
Definition: RootTree.h:59
bool current()
Definition: RootTree.h:81
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 1101 of file RootFile.cc.

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

1101  {
1102  // Report file opened.
1103  std::string const label = "source";
1104  std::string moduleName = "PoolSource";
1105  filePtr_->inputFileOpened(
1106  logicalFile_,
1107  inputType,
1108  moduleName,
1109  label,
1110  fid_.fid(),
1112  }
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:87
FileID fid_
Definition: RootFile.h:181
std::string const logicalFile_
Definition: RootFile.h:175
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:197
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:178
void edm::RootFile::rewind ( )
inline

Definition at line 120 of file RootFile.h.

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

120  {
122  eventTree_.rewind();
123  lumiTree_.rewind();
124  runTree_.rewind();
125  }
RootTree lumiTree_
Definition: RootFile.h:198
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
RootTree eventTree_
Definition: RootFile.h:197
RootTree runTree_
Definition: RootFile.h:199
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:185
void rewind()
Definition: RootTree.h:82
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 104 of file RootFile.h.

References runTree_.

Referenced by validateFile().

104 {return runTree_;}
RootTree runTree_
Definition: RootFile.h:199
EventPrincipal& edm::RootFile::secondaryEventPrincipal ( )
inline

Definition at line 141 of file RootFile.h.

References secondaryEventPrincipal_.

141  {
142  return *secondaryEventPrincipal_;
143  }
std::unique_ptr< EventPrincipal > secondaryEventPrincipal_
Definition: RootFile.h:215
void edm::RootFile::setAtEventEntry ( IndexIntoFile::EntryNumber_t  entry)

Definition at line 1417 of file RootFile.cc.

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

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

Definition at line 1571 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1571  {
1573  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1575  return true;
1576  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
RootTree eventTree_
Definition: RootFile.h:197
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:183
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 111 of file RootFile.h.

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

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

Definition at line 1579 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1579  {
1581  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1583  return true;
1584  }
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:198
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::setEntryAtNextEventInLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1595 of file RootFile.cc.

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

1595  {
1598  }
1601  if(run != indexIntoFileIter_.run()) return false;
1602  if(lumi != indexIntoFileIter_.lumi()) return false;
1604  return true;
1605  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
LuminosityBlockNumber_t lumi() const
RootTree eventTree_
Definition: RootFile.h:197
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1587 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1587  {
1589  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1591  return true;
1592  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
RootTree runTree_
Definition: RootFile.h:199
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

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

570  {
571  if(fileFormatVersion().noMetaDataTrees() and !fileFormatVersion().storedProductProvenanceUsed()) {
572  //we must avoid copying the old branch which stored the per product per event provenance
574  return;
575  }
576  if(!fileFormatVersion().splitProductIDs()) {
578  return;
579  }
582  return;
583  }
584  // Find entry for first event in file
585  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
586  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
587  ++it;
588  }
589  if(it == indexIntoFileEnd_) {
591  return;
592  }
593 
594  // From here on, record all reasons we can't fast clone.
598  }
599  if(skipAnyEvents_) {
601  }
602  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
604  }
605  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
607  }
608  // We no longer fast copy the EventAuxiliary branch, so there
609  // is no longer any need to disable fast copying because the run
610  // number is being modified. Also, this check did not work anyway
611  // because this function is called before forcedRunOffset_ is set.
612 
613  // if(forcedRunOffset_ != 0) {
614  // whyNotFastClonable_ += FileBlock::RunNumberModified;
615  // }
616  if(duplicateChecker_ &&
617  !duplicateChecker_->checkDisabled() &&
618  !duplicateChecker_->noDuplicatesInFile()) {
620  }
621  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
int whyNotFastClonable_
Definition: RootFile.h:193
RootTree lumiTree_
Definition: RootFile.h:198
EntryNumber const & entries() const
Definition: RootTree.h:85
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:204
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
bool noEventSort_
Definition: RootFile.h:192
bool skipAnyEvents_
Definition: RootFile.h:191
RootTree eventTree_
Definition: RootFile.h:197
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:185
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 655 of file RootFile.cc.

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

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

Definition at line 126 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

126  {
128  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
bool edm::RootFile::skipEvents ( int &  offset)

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

1253  {
1254  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1255 
1256  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1257  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1260 
1261  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1262  runOfSkippedEvent,
1263  lumiOfSkippedEvent,
1264  skippedEventEntry);
1265 
1266  // At the end of the file and there were no more events to skip
1267  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1268 
1269  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1270  eventTree_.setEntryNumber(skippedEventEntry);
1272  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1273  continue;
1274  }
1275  }
1276  if(duplicateChecker_ &&
1277  !duplicateChecker_->checkDisabled() &&
1278  !duplicateChecker_->noDuplicatesInFile()) {
1279 
1280  eventTree_.setEntryNumber(skippedEventEntry);
1282  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1283  runOfSkippedEvent,
1284  lumiOfSkippedEvent,
1285  eventAux_.id().event(),
1286  file_)) {
1287  continue;
1288  }
1289  }
1290  --offset;
1291  }
1292 
1293  while(offset < 0) {
1294 
1295  if(duplicateChecker_) {
1296  duplicateChecker_->disable();
1297  }
1298 
1299  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1302  EntryNumber_t eventEntry = IndexIntoFile::invalidEntry;
1303 
1304  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1305  runOfEvent,
1306  lumiOfEvent,
1307  eventEntry);
1308 
1309  if(eventEntry == IndexIntoFile::invalidEntry) break;
1310 
1311  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1312  eventTree_.setEntryNumber(eventEntry);
1314  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1315  continue;
1316  }
1317  }
1318  ++offset;
1319  }
1321  }
EventNumber_t event() const
Definition: EventID.h:44
static int const invalidIndex
void fillEventAuxiliary()
Definition: RootFile.cc:1146
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
static RunNumber_t const invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RootTree eventTree_
Definition: RootFile.h:197
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:196
void fillThisEventAuxiliary()
Definition: RootFile.cc:1127
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:179
std::string const file_
Definition: RootFile.h:174
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::skipThisEntry ( )
private

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

660  {
662  return false;
663  }
664  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
665 
666  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
668  return true;
669  }
670 
671  // The Lumi is not skipped. If this is an event, see if the event is skipped.
676  eventAux_.id().event())) {
677  return true;
678  }
679  }
680 
681  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
683  eventSkipperByID_->skippingLumis()) {
684  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
685 
686  // There are no lumis in this run, not even ones we will skip
687  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
688  return true;
689  }
690  // If we get here there are lumis in the run, check to see if we are skipping all of them
691  do {
692  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
693  return false;
694  }
695  }
696  while(iterLumi.skipLumiInRun());
697  return true;
698  }
699  }
700  return false;
701  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1146
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:186
static LuminosityBlockNumber_t const invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:196
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:179
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 147 of file RootFile.h.

References treePointers_.

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

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

1052  {
1053  if(!fid_.isValid()) {
1054  fid_ = FileID(createGlobalIdentifier());
1055  }
1056  if(!eventTree_.isValid()) {
1058  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
1059  }
1060 
1061  if(fileFormatVersion().hasIndexIntoFile()) {
1062  if(runTree().entries() > 0) {
1063  assert(!indexIntoFile_.empty());
1064  }
1066  if(daqProvenanceHelper_) {
1067  std::vector<ProcessHistoryID>& phidVec = indexIntoFile_.setProcessHistoryIDs();
1068  for(std::vector<ProcessHistoryID>::iterator it = phidVec.begin(), itEnd = phidVec.end();
1069  it != itEnd;
1070  ++it) {
1071  *it = daqProvenanceHelper_->mapProcessHistoryID(*it);
1072  }
1073  }
1075  }
1076  }
1077  else {
1078  assert(indexIntoFile_.empty());
1080  }
1081 
1084  indexIntoFile_.setEventFinder(boost::shared_ptr<IndexIntoFile::EventFinder>(new RootFileEventFinder(eventTree_)));
1085  // We fill the event numbers explicitly if we need to find events in closed files,
1086  // such as for secondary files (or secondary sources) or if duplicate checking across files.
1087  bool needEventNumbers = false;
1088  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
1089  if(inputType != InputType::Primary || needIndexesForDuplicateChecker || usingGoToEvent) {
1090  needEventNumbers = true;
1091  }
1092  bool needEventEntries = false;
1093  if(inputType != InputType::Primary || !noEventSort_) {
1094  // We need event entries for sorting or for secondary files or sources.
1095  needEventEntries = true;
1096  }
1097  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
1098  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:105
bool empty() const
True if no runs, lumis, or events are in the file.
EntryNumber const & entries() const
Definition: RootTree.h:85
void reduceProcessHistoryIDs()
FileID fid_
Definition: RootFile.h:181
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:212
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool noEventSort_
Definition: RootFile.h:192
RootTree const & runTree() const
Definition: RootFile.h:104
RootTree eventTree_
Definition: RootFile.h:197
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:183
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:68
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:218
void setEventFinder(boost::shared_ptr< EventFinder > ptr) const
void fillIndexIntoFile()
Definition: RootFile.cc:826
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:184
void setNumberOfEvents(EntryNumber_t nevents) const
bool useReducedProcessHistoryID() const
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 763 of file RootFile.cc.

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

763  {
764  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
765  int phIndex;
768  IndexIntoFile::EntryNumber_t eventEntry;
769  itr.skipEventBackward(phIndex,
770  run,
771  lumi,
772  eventEntry);
773  itr.skipEventBackward(phIndex,
774  run,
775  lumi,
776  eventEntry);
777  return eventEntry == IndexIntoFile::invalidEntry;
778  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
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 756 of file RootFile.cc.

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

756  {
757  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
758  itr.advanceToEvent();
759  return itr.getEntryType() == IndexIntoFile::kEnd;
760  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:187
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 106 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

106 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:193

Member Data Documentation

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

Definition at line 211 of file RootFile.h.

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

boost::shared_ptr<BranchIDListRegistry::collection_type const> edm::RootFile::branchIDLists_
private

Definition at line 203 of file RootFile.h.

Referenced by branchIDLists(), and RootFile().

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

Definition at line 209 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

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

Referenced by makeBranchMapper().

TTree* edm::RootFile::eventHistoryTree_
private

Definition at line 207 of file RootFile.h.

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

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

Definition at line 188 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 189 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 208 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

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

Definition at line 179 of file RootFile.h.

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

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

Definition at line 181 of file RootFile.h.

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

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

Definition at line 174 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

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

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

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

Definition at line 194 of file RootFile.h.

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

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

Definition at line 210 of file RootFile.h.

Referenced by fillHistory(), and readEventHistoryTree().

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

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

Referenced by indexIntoFileSharedPtr().

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

Definition at line 201 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 192 of file RootFile.h.

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

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

Definition at line 184 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 217 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 176 of file RootFile.h.

ProcessConfigurationVector edm::RootFile::processConfigurations_
private

Definition at line 177 of file RootFile.h.

Referenced by checkReleaseVersion(), and RootFile().

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

Definition at line 204 of file RootFile.h.

Referenced by getNextEntryTypeWanted(), and setIfFastClonable().

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

Definition at line 202 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 213 of file RootFile.h.

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

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

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

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

std::unique_ptr<EventPrincipal> edm::RootFile::secondaryEventPrincipal_
mutableprivate

Definition at line 215 of file RootFile.h.

Referenced by RootFile(), and secondaryEventPrincipal().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 191 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 200 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 193 of file RootFile.h.

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