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 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  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_.

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

Definition at line 479 of file RootFile.cc.

479  {
480  }
edm::RootFile::RootFile ( RootFile const &  )
delete

Member Function Documentation

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

Definition at line 95 of file RootFile.h.

References branchIDLists_.

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

Definition at line 107 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

Definition at line 1649 of file RootFile.cc.

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

Referenced by RootFile().

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

Definition at line 1407 of file RootFile.cc.

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

1408  {
1409  cache.clearEventPrincipal();
1410  return readCurrentEvent(cache, lb);
1411  }
EventPrincipal * readCurrentEvent(EventPrincipal &cache, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
Definition: RootFile.cc:1379
void edm::RootFile::close ( void  )

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

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

Definition at line 621 of file RootFile.cc.

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

621  {
622  return boost::shared_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
623  eventTree_.tree(),
625  lumiTree_.tree(),
627  runTree_.tree(),
628  runTree_.metaTree(),
631  file_,
633  modifiedIDs(),
634  branchChildren_));
635  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:210
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
bool branchListIndexesUnchanged() const
Definition: RootFile.h:107
RootTree lumiTree_
Definition: RootFile.h:197
TTree const * metaTree() const
Definition: RootTree.h:113
TTree const * tree() const
Definition: RootTree.h:111
bool modifiedIDs() const
Definition: RootFile.h:108
int whyNotFastClonable() const
Definition: RootFile.h:105
RootTree eventTree_
Definition: RootFile.h:196
std::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:106
RootTree runTree_
Definition: RootFile.h:198
std::string const file_
Definition: RootFile.h:173
void edm::RootFile::dropOnInput ( ProductRegistry reg,
GroupSelectorRules const &  rules,
bool  dropDescendants,
InputType::InputType  inputType 
)
private

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

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

Definition at line 100 of file RootFile.h.

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

Referenced by readCurrentEvent().

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

Definition at line 101 of file RootFile.h.

References eventTree_.

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

Definition at line 93 of file RootFile.h.

References file_.

Referenced by checkReleaseVersion().

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

Definition at line 1143 of file RootFile.cc.

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

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

1143  {
1146  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
RootTree eventTree_
Definition: RootFile.h:196
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
void edm::RootFile::fillHistory ( )
private

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

1149  {
1150  // We could consider doing delayed reading, but because we have to
1151  // store this History object in a different tree than the event
1152  // data tree, this is too hard to do in this first version.
1153 
1154  if(fileFormatVersion().eventHistoryBranch()) {
1155  // Lumi block number was not in EventID for the relevant releases.
1156  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1157  if(eventProcessHistoryIter_->eventID() != id) {
1158  EventProcessHistoryID target(id, ProcessHistoryID());
1160  assert(eventProcessHistoryIter_->eventID() == id);
1161  }
1164  } else if(fileFormatVersion().eventHistoryTree()) {
1165  // for backward compatibility.
1166  History* pHistory = history_.get();
1167  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1168  if(!eventHistoryBranch) {
1170  << "Failed to find history branch in event history tree.\n";
1171  }
1172  eventHistoryBranch->SetAddress(&pHistory);
1174  eventAux_.setProcessHistoryID(history_->processHistoryID());
1175  eventSelectionIDs_.reset(&history_->eventSelectionIDs(), do_nothing_deleter());
1176  branchListIndexes_.reset(&history_->branchListIndexes(), do_nothing_deleter());
1177  } else if(fileFormatVersion().noMetaDataTrees()) {
1178  // Current format
1180  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1181  assert(eventSelectionIDBranch != 0);
1182  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1183  BranchListIndexes* pBLI = branchListIndexes_.get();
1184  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1185  assert(branchListIndexesBranch != 0);
1186  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1187  }
1188  if(provenanceAdaptor_) {
1189  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1190  for(EventSelectionIDVector::iterator i = eventSelectionIDs_->begin(), e = eventSelectionIDs_->end(); i != e; ++i) {
1191  (*i) = provenanceAdaptor_->convertID(*i);
1192  }
1193  }
1194  if(daqProvenanceHelper_) {
1196  }
1198  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1199  provenanceAdaptor_->branchListIndexes(*branchListIndexes_);
1200  }
1202  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:273
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:212
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:208
std::unique_ptr< History > history_
Definition: RootFile.h:209
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
ForwardSequence::const_iterator lower_bound_all(ForwardSequence const &s, Datum const &d)
wrappers for std::lower_bound
Definition: Algorithms.h:91
std::string const & eventSelectionsBranchName()
Definition: BranchType.cc:237
static void fixBranchListIndexes(BranchListIndexes &indexes)
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:188
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:96
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:196
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:207
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:217
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:241
EventAuxiliary eventAux_
Definition: RootFile.h:195
TTree * eventHistoryTree_
Definition: RootFile.h:206
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:187
void edm::RootFile::fillIndexIntoFile ( )
private

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

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

Definition at line 1205 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1205  {
1206  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1207  if(fileFormatVersion().newAuxiliary()) {
1208  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1209  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1210  } else {
1211  LuminosityBlockAux lumiAux;
1212  LuminosityBlockAux *pLumiAux = &lumiAux;
1213  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1214  conversion(lumiAux, *lumiAuxiliary);
1215  }
1216  if(provenanceAdaptor_) {
1217  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1218  }
1219  if(daqProvenanceHelper_) {
1220  lumiAuxiliary->setProcessHistoryID(daqProvenanceHelper_->mapProcessHistoryID(lumiAuxiliary->processHistoryID()));
1221  }
1222  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1223  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1224  }
1225  return lumiAuxiliary;
1226  }
std::unique_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:212
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
RootTree lumiTree_
Definition: RootFile.h:197
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:217
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 1229 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

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

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

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

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

728  {
730  if(entryType == IndexIntoFile::kEnd) {
731  return IndexIntoFile::kEnd;
732  }
733  if(entryType == IndexIntoFile::kRun) {
734  return IndexIntoFile::kRun;
735  } else if(processingMode_ == InputSource::Runs) {
737  return getNextEntryTypeWanted();
738  }
739  if(entryType == IndexIntoFile::kLumi) {
740  return IndexIntoFile::kLumi;
743  return getNextEntryTypeWanted();
744  }
745  if(isDuplicateEvent()) {
747  return getNextEntryTypeWanted();
748  }
749  return IndexIntoFile::kEvent;
750  }
IndexIntoFile::EntryType getEntryTypeWithSkipping()
Definition: RootFile.cc:701
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:203
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
IndexIntoFile::EntryType getNextEntryTypeWanted()
Definition: RootFile.cc:728
bool isDuplicateEvent()
Definition: RootFile.cc:717
bool edm::RootFile::goToEvent ( EventID const &  eventID)

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

1321  {
1322 
1324 
1325  if(duplicateChecker_) {
1326  duplicateChecker_->disable();
1327  }
1328 
1331 
1332  IndexIntoFile::IndexIntoFileItr iter =
1334 
1335  if(iter == indexIntoFile_.end(sortOrder)) {
1336  return false;
1337  }
1338  indexIntoFileIter_ = iter;
1339  return true;
1340  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & eventID() const
Definition: RootFile.h:100
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
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:211
bool noEventSort_
Definition: RootFile.h:191
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:182
void fillEventNumbers() const
std::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 106 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

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

Definition at line 647 of file RootFile.cc.

References indexIntoFileIter_.

647  {
648  return indexIntoFileIter_;
649  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 133 of file RootFile.h.

References indexIntoFileSharedPtr_.

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

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

Referenced by RootFile().

1666  {
1667  if(duplicateChecker_) {
1668  if(eventTree_.next()) {
1670  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1672  indexesIntoFiles,
1673  currentIndexIntoFile);
1674  }
1676  }
1677  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:211
bool next()
Definition: RootTree.h:79
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:196
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:182
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
bool edm::RootFile::isDuplicateEvent ( )
private

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

717  {
719  if(duplicateChecker_.get() == 0) {
720  return false;
721  }
723  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
725  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1143
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
LuminosityBlockNumber_t lumi() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:211
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:195
std::string const file_
Definition: RootFile.h:173
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 102 of file RootFile.h.

References lumiTree_.

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

Definition at line 1758 of file RootFile.cc.

References daqProvenanceHelper_, eventBranchMapper_, eventTree_, and provenanceReaderMaker_.

Referenced by readCurrentEvent().

1758  {
1759  if(!eventBranchMapper_) {
1760  eventBranchMapper_.reset(new BranchMapper(provenanceReaderMaker_->makeReader(eventTree_, daqProvenanceHelper_.get())));
1761  }
1762  eventBranchMapper_->reset();
1763  return eventBranchMapper_;
1764  }
std::unique_ptr< MakeProvenanceReader > provenanceReaderMaker_
Definition: RootFile.h:213
boost::shared_ptr< BranchMapper > eventBranchMapper_
Definition: RootFile.h:215
RootTree eventTree_
Definition: RootFile.h:196
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:217
std::unique_ptr< MakeProvenanceReader > edm::RootFile::makeProvenanceReaderMaker ( ) const
private

Definition at line 1745 of file RootFile.cc.

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

Referenced by RootFile().

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

Definition at line 108 of file RootFile.h.

References daqProvenanceHelper_.

Referenced by createFileBlock().

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

Definition at line 638 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

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

Definition at line 131 of file RootFile.h.

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

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

Definition at line 1605 of file RootFile.cc.

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

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

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

Definition at line 1613 of file RootFile.cc.

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

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

Definition at line 1621 of file RootFile.cc.

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

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

Definition at line 94 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

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

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

1380  {
1381  if(!eventTree_.current()) {
1382  return 0;
1383  }
1385  if(!fileFormatVersion().lumiInEventID()) {
1386  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1387  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1389  }
1390  fillHistory();
1392 
1393  // We're not done ... so prepare the EventPrincipal
1394  cache.fillEventPrincipal(eventAux(),
1395  lb,
1398  makeBranchMapper(),
1400 
1401  // report event read from file
1402  filePtr_->eventReadFromFile(eventID().run(), eventID().event());
1403  return &cache;
1404  }
EventID const & eventID() const
Definition: RootFile.h:100
bool isRealData() const
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:208
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:196
void fillHistory()
Definition: RootFile.cc:1149
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:207
DelayedReader * rootDelayedReader() const
Definition: RootTree.cc:80
EventID const & id() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1605
boost::shared_ptr< BranchMapper > makeBranchMapper()
Definition: RootFile.cc:1758
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:177
EventAuxiliary eventAux_
Definition: RootFile.h:195
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
bool current()
Definition: RootTree.h:81
void edm::RootFile::readEntryDescriptionTree ( )
private

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

483  {
484  // Called only for old format files.
485  if(!fileFormatVersion().perEventProductIDs()) return;
486  // We use a smart pointer so the tree will be deleted after use, and not kept for the life of the file.
487  std::unique_ptr<TTree> entryDescriptionTree(dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str())));
488  if(0 == entryDescriptionTree.get()) {
489  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
490  << " in the input file.\n";
491  }
492 
493  EntryDescriptionID idBuffer;
494  EntryDescriptionID* pidBuffer = &idBuffer;
495  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
496 
498 
499  EventEntryDescription entryDescriptionBuffer;
500  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
501  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
502 
503  // Fill in the parentage registry.
505 
506  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
507  roottree::getEntry(entryDescriptionTree.get(), i);
508  if(idBuffer != entryDescriptionBuffer.id()) {
509  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
510  }
511  oldregistry.insertMapped(entryDescriptionBuffer);
512  Parentage parents;
513  parents.parents() = entryDescriptionBuffer.parents();
515  ParentageID const oldID = parents.id();
516  daqProvenanceHelper_->fixMetaData(parents.parents());
517  ParentageID newID = parents.id();
518  if(newID != oldID) {
519  daqProvenanceHelper_->parentageIDMap_.insert(std::make_pair(oldID, newID));
520  }
521  }
522  registry.insertMapped(parents);
523  }
524  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), 0);
525  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), 0);
526  }
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:104
static ThreadSafeRegistry * instance()
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
Hash< EntryDescriptionType > EntryDescriptionID
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:145
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
std::unique_ptr< DaqProvenanceHelper > daqProvenanceHelper_
Definition: RootFile.h:217
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:149
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:177
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 1356 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().

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

Definition at line 1636 of file RootFile.cc.

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

Referenced by RootFile().

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

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

1550  {
1553  // Begin code for backward compatibility before the existence of lumi trees.
1554  if(!lumiTree_.isValid()) {
1556  return lbCache;
1557  }
1558  // End code for backward compatibility before the existence of lumi trees.
1560  lbCache->fillLuminosityBlockPrincipal(lumiTree_.rootDelayedReader());
1561  // Read in all the products now.
1562  lbCache->readImmediate();
1564  return lbCache;
1565  }
RootTree lumiTree_
Definition: RootFile.h:197
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
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 1506 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().

1506  {
1509  // Begin code for backward compatibility before the existence of lumi trees.
1510  if(!lumiTree_.isValid()) {
1512  assert(eventEntry != IndexIntoFile::invalidEntry);
1514  eventTree_.setEntryNumber(eventEntry);
1515  assert(eventTree_.current());
1517  eventTree_.setEntryNumber(savedEntry);
1518 
1520  overrideRunNumber(lumi);
1521  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1522  }
1523  // End code for backward compatibility before the existence of lumi trees.
1525  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1526  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1527  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1528  overrideRunNumber(lumiAuxiliary->id());
1529  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1530  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1532  if(eventEntry != IndexIntoFile::invalidEntry) {
1534  eventTree_.setEntryNumber(eventEntry);
1535  assert(eventTree_.current());
1537  eventTree_.setEntryNumber(savedEntry);
1538 
1539  lumiAuxiliary->setBeginTime(eventAux().time());
1540  }
1541  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1542  }
1543  if(!fileFormatVersion().processHistorySameWithinRun() && savedRunAuxiliary_) {
1544  lumiAuxiliary->setProcessHistoryID(savedRunAuxiliary_->processHistoryID());
1545  }
1546  return lumiAuxiliary;
1547  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:189
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:197
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
LuminosityBlockNumber_t lumi() const
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:196
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:1205
bool isValid() const
Definition: RootTree.cc:68
EntryNumber_t firstEventEntryThisLumi() const
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1605
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:177
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
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 529 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().

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

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

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

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

1419  {
1422 
1423  // Begin code for backward compatibility before the existence of run trees.
1424  if(!runTree_.isValid()) {
1425 
1426  // prior to the support of run trees.
1427  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1429  assert(eventEntry != IndexIntoFile::invalidEntry);
1431  eventTree_.setEntryNumber(eventEntry);
1432  assert(eventTree_.current());
1434  eventTree_.setEntryNumber(savedEntry);
1435 
1437  overrideRunNumber(run);
1438  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(run.run(), eventAux().time(), Timestamp::invalidTimestamp()));
1439  }
1440  // End code for backward compatibility before the existence of run trees.
1442  boost::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1443  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1444  overrideRunNumber(runAuxiliary->id());
1445  filePtr_->reportInputRunNumber(runAuxiliary->run());
1446  // If RunAuxiliary did not contain a valid begin timestamp, invalidate any end timestamp.
1447  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1448  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1449  }
1450 
1451  // If RunAuxiliary did not contain a valid timestamp, or if this an old format file from
1452  // when the Run's ProcessHistory included only processes where products were added to the Run itself,
1453  // we attempt to read the first event in the run to get appropriate info.
1454  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp() ||
1456 
1458  // If we have a valid event, use its information.
1459  if(eventEntry != IndexIntoFile::invalidEntry) {
1461  eventTree_.setEntryNumber(eventEntry);
1462  assert(eventTree_.current());
1464 
1465  // RunAuxiliary did not contain a valid timestamp. Take it from the next event in this run if there is one.
1466  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1467  runAuxiliary->setBeginTime(eventAux().time());
1468  }
1469 
1470  // For backwards compatibility when the Run's ProcessHistory included only processes where products were added to the
1471  // Run, and then the Run and Event auxiliaries could be different. Use the event ProcessHistoryID if there is one. It should
1472  // almost always be correct by the current definition (processes included if any products are added. This makes the run, lumi,
1473  // and event ProcessHistory's always be the same if no file merging occurs).
1474  if(!fileFormatVersion().processHistorySameWithinRun()) {
1475  fillHistory();
1476  runAuxiliary->setProcessHistoryID(eventAux().processHistoryID());
1477  savedRunAuxiliary_ = runAuxiliary;
1478  }
1479  eventTree_.setEntryNumber(savedEntry);
1480  } else {
1481  // No valid event, just use what is there, because it is the best we can do.
1482  savedRunAuxiliary_ = runAuxiliary;
1483  }
1484  }
1485  return runAuxiliary;
1486  }
boost::shared_ptr< RunAuxiliary > savedRunAuxiliary_
Definition: RootFile.h:189
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:104
EntryNumber_t firstEventEntryThisRun() const
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1229
long long EntryNumber_t
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
EventAuxiliary const & eventAux() const
Definition: RootFile.h:96
RootTree eventTree_
Definition: RootFile.h:196
void fillHistory()
Definition: RootFile.cc:1149
RootTree runTree_
Definition: RootFile.h:198
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:1605
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:177
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
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 1098 of file RootFile.cc.

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

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

Definition at line 119 of file RootFile.h.

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

119  {
121  eventTree_.rewind();
122  lumiTree_.rewind();
123  runTree_.rewind();
124  }
RootTree lumiTree_
Definition: RootFile.h:197
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
RootTree eventTree_
Definition: RootFile.h:196
RootTree runTree_
Definition: RootFile.h:198
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:184
void rewind()
Definition: RootTree.h:82
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 103 of file RootFile.h.

References runTree_.

Referenced by validateFile().

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

Definition at line 140 of file RootFile.h.

References secondaryEventPrincipal_.

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

Definition at line 1414 of file RootFile.cc.

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

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

Definition at line 1568 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1568  {
1570  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1572  return true;
1573  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
RootTree eventTree_
Definition: RootFile.h:196
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:182
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 110 of file RootFile.h.

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

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

Definition at line 1576 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1576  {
1578  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1580  return true;
1581  }
tuple lumi
Definition: fjr2json.py:35
RootTree lumiTree_
Definition: RootFile.h:197
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:182
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 1592 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().

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

Definition at line 1584 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1584  {
1586  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1588  return true;
1589  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:182
RootTree runTree_
Definition: RootFile.h:198
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:155
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

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

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

Definition at line 652 of file RootFile.cc.

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

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

Definition at line 125 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

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

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

1250  {
1251  while(offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1252 
1253  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1254  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1257 
1258  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1259  runOfSkippedEvent,
1260  lumiOfSkippedEvent,
1261  skippedEventEntry);
1262 
1263  // At the end of the file and there were no more events to skip
1264  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1265 
1266  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1267  eventTree_.setEntryNumber(skippedEventEntry);
1269  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1270  continue;
1271  }
1272  }
1273  if(duplicateChecker_ &&
1274  !duplicateChecker_->checkDisabled() &&
1275  !duplicateChecker_->noDuplicatesInFile()) {
1276 
1277  eventTree_.setEntryNumber(skippedEventEntry);
1279  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1280  runOfSkippedEvent,
1281  lumiOfSkippedEvent,
1282  eventAux_.id().event(),
1283  file_)) {
1284  continue;
1285  }
1286  }
1287  --offset;
1288  }
1289 
1290  while(offset < 0) {
1291 
1292  if(duplicateChecker_) {
1293  duplicateChecker_->disable();
1294  }
1295 
1296  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1299  EntryNumber_t eventEntry = IndexIntoFile::invalidEntry;
1300 
1301  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1302  runOfEvent,
1303  lumiOfEvent,
1304  eventEntry);
1305 
1306  if(eventEntry == IndexIntoFile::invalidEntry) break;
1307 
1308  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1309  eventTree_.setEntryNumber(eventEntry);
1311  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1312  continue;
1313  }
1314  }
1315  ++offset;
1316  }
1318  }
EventNumber_t event() const
Definition: EventID.h:44
static int const invalidIndex
void fillEventAuxiliary()
Definition: RootFile.cc:1143
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:211
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:185
static RunNumber_t const invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RootTree eventTree_
Definition: RootFile.h:196
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:195
void fillThisEventAuxiliary()
Definition: RootFile.cc:1124
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:178
std::string const file_
Definition: RootFile.h:173
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 657 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().

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

Definition at line 146 of file RootFile.h.

References treePointers_.

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

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

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

Definition at line 760 of file RootFile.cc.

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

760  {
761  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
762  int phIndex;
765  IndexIntoFile::EntryNumber_t eventEntry;
766  itr.skipEventBackward(phIndex,
767  run,
768  lumi,
769  eventEntry);
770  itr.skipEventBackward(phIndex,
771  run,
772  lumi,
773  eventEntry);
774  return eventEntry == IndexIntoFile::invalidEntry;
775  }
tuple lumi
Definition: fjr2json.py:35
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
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 753 of file RootFile.cc.

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

753  {
754  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
755  itr.advanceToEvent();
756  return itr.getEntryType() == IndexIntoFile::kEnd;
757  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:186
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 105 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

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

Member Data Documentation

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

Definition at line 210 of file RootFile.h.

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

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

Definition at line 202 of file RootFile.h.

Referenced by branchIDLists(), and RootFile().

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

Definition at line 208 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

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

Referenced by makeBranchMapper().

TTree* edm::RootFile::eventHistoryTree_
private

Definition at line 206 of file RootFile.h.

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

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

Definition at line 187 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 188 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 207 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

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

Definition at line 178 of file RootFile.h.

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

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

Definition at line 180 of file RootFile.h.

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

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

Definition at line 173 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

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

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

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

Definition at line 193 of file RootFile.h.

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

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

Definition at line 209 of file RootFile.h.

Referenced by fillHistory(), and readEventHistoryTree().

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

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

Referenced by indexIntoFileSharedPtr().

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

Definition at line 200 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 191 of file RootFile.h.

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

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

Definition at line 183 of file RootFile.h.

Referenced by validateFile().

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

Definition at line 216 of file RootFile.h.

Referenced by makeProvenanceReaderMaker(), and readParentageTree().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 175 of file RootFile.h.

ProcessConfigurationVector edm::RootFile::processConfigurations_
private

Definition at line 176 of file RootFile.h.

Referenced by checkReleaseVersion(), and RootFile().

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

Definition at line 203 of file RootFile.h.

Referenced by getNextEntryTypeWanted(), and setIfFastClonable().

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

Definition at line 201 of file RootFile.h.

Referenced by productRegistry(), and RootFile().

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

Definition at line 212 of file RootFile.h.

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

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

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

Referenced by readLuminosityBlockAuxiliary_(), and readRunAuxiliary_().

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

Definition at line 214 of file RootFile.h.

Referenced by RootFile(), and secondaryEventPrincipal().

bool edm::RootFile::skipAnyEvents_
private

Definition at line 190 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 199 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 192 of file RootFile.h.

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