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>

Inheritance diagram for edm::RootFile:

Public Types

typedef boost::array< RootTree
*, NumBranchTypes
RootTreePtrArray
 

Public Member Functions

BranchIDListRegistry::collection_type
const & 
branchIDLists ()
 
bool branchListIndexesUnchanged () const
 
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)
 
boost::array< bool,
NumBranchTypes > const & 
hasNewlyDroppedBranch () const
 
IndexIntoFile::IndexIntoFileItr indexIntoFileIter () const
 
boost::shared_ptr< IndexIntoFileindexIntoFileSharedPtr () const
 
RootTree const & lumiTree () const
 
bool nextEventEntry ()
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry () const
 
EventPrincipalreadCurrentEvent (EventPrincipal &cache, boost::shared_ptr< RootFile > rootFilePtr, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
 
EventPrincipalreadEvent (EventPrincipal &cache, boost::shared_ptr< RootFile > rootFilePtr, 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, bool secondaryFile, 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 usingGoToEvent)
 
RootTree const & runTree () const
 
void setAtEventEntry (IndexIntoFile::EntryNumber_t entry)
 
bool setEntryAtEvent (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool setEntryAtLumi (RunNumber_t run, LuminosityBlockNumber_t lumi)
 
bool setEntryAtRun (RunNumber_t run)
 
void setPosition (IndexIntoFile::IndexIntoFileItr const &position)
 
void setToLastEntry ()
 
bool skipEvents (int &offset)
 
bool wasFirstEventJustRead () const
 
bool wasLastEventJustRead () const
 
int whyNotFastClonable () const
 
 ~RootFile ()
 

Private Member Functions

void dropOnInput (ProductRegistry &reg, GroupSelectorRules const &rules, bool dropDescendants, bool secondaryFile)
 
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 (RootTree &rootTree, BranchType const &type) 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 (bool secondaryFile, bool usingGoToEvent)
 

Private Attributes

boost::shared_ptr< BranchChildrenbranchChildren_
 
boost::shared_ptr
< BranchIDListRegistry::collection_type
const > 
branchIDLists_
 
boost::shared_ptr
< BranchListIndexes
branchListIndexes_
 
bool branchListIndexesUnchanged_
 
boost::shared_ptr
< DuplicateChecker
duplicateChecker_
 
EventAuxiliary eventAux_
 
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_
 
boost::array< bool,
NumBranchTypes
hasNewlyDroppedBranch_
 
boost::shared_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_
 
ProcessConfiguration const & processConfiguration_
 
InputSource::ProcessingMode processingMode_
 
boost::shared_ptr
< ProductRegistry const > 
productRegistry_
 
boost::shared_ptr
< ProvenanceAdaptor
provenanceAdaptor_
 
RootTree runTree_
 
bool skipAnyEvents_
 
RootTreePtrArray treePointers_
 
int whyNotFastClonable_
 

Detailed Description

Definition at line 44 of file RootFile.h.

Member Typedef Documentation

Definition at line 46 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,
bool  secondaryFile,
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  usingGoToEvent 
)

Definition at line 99 of file RootFile.cc.

References edm::IndexIntoFile::begin(), branchChildren_, edm::poolNames::branchIDListBranchName(), branchIDLists_, branchListIndexesUnchanged_, edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), edm::BranchTypeToAuxiliaryBranchName(), edm::BranchDescription::className(), 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, 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_, edm::poolNames::metaDataTreeName(), edm::poolNames::moduleDescriptionMapBranchName(), newBranchToOldBranch(), newBranchToOldBranch_, edm::IndexIntoFile::numericalOrder, edm::poolNames::parameterSetMapBranchName(), edm::poolNames::parameterSetsTreeName(), edm::poolNames::processConfigurationBranchName(), edm::poolNames::processHistoryBranchName(), edm::poolNames::processHistoryMapBranchName(), parseEventContent::prod, edm::poolNames::productDependenciesBranchName(), edm::poolNames::productDescriptionBranchName(), edm::ProductRegistry::productList(), productRegistry(), productRegistry_, provenanceAdaptor_, MultipleCompare::pset, readEventHistoryTree(), readParentageTree(), edm::RootTree::resetTraining(), runTree_, setIfFastClonable(), edm::setRefCoreStreamer(), edm::RootTree::trainCache(), edm::roottree::trainCache(), treePointers_, edm::errors::UnimplementedFeature, edm::BranchDescription::updateFriendlyClassName(), edm::BranchIDListHelper::updateFromInput(), validateFile(), and whyNotFastClonable_.

119  :
120  file_(fileName),
121  logicalFile_(logicalFileName),
122  processConfiguration_(processConfiguration),
123  filePtr_(filePtr),
124  eventSkipperByID_(eventSkipperByID),
126  fid_(),
127  indexIntoFileSharedPtr_(new IndexIntoFile),
129  orderedProcessHistoryIDs_(orderedProcessHistoryIDs),
135  skipAnyEvents_(skipAnyEvents),
140  eventAux_(),
141  eventTree_(filePtr_, InEvent, treeMaxVirtualSize, treeCacheSize, roottree::defaultLearningEntries),
144  treePointers_(),
147  branchIDLists_(),
149  forcedRunOffset_(0),
154  history_(),
155  branchChildren_(new BranchChildren),
156  duplicateChecker_(duplicateChecker),
158 
159  hasNewlyDroppedBranch_.assign(false);
160 
164 
165  // Read the metadata tree.
166  TTree *metaDataTree = dynamic_cast<TTree *>(filePtr_->Get(poolNames::metaDataTreeName().c_str()));
167  if(!metaDataTree)
168  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::metaDataTreeName()
169  << " in the input file.\n";
170 
171  // To keep things simple, we just read in every possible branch that exists.
172  // We don't pay attention to which branches exist in which file format versions
173 
174  FileFormatVersion *fftPtr = &fileFormatVersion_;
175  if(metaDataTree->FindBranch(poolNames::fileFormatVersionBranchName().c_str()) != 0) {
176  TBranch *fft = metaDataTree->GetBranch(poolNames::fileFormatVersionBranchName().c_str());
177  fft->SetAddress(&fftPtr);
178  roottree::getEntry(fft, 0);
179  metaDataTree->SetBranchAddress(poolNames::fileFormatVersionBranchName().c_str(), &fftPtr);
180  }
181 
182  setRefCoreStreamer(0, !fileFormatVersion().splitProductIDs(), !fileFormatVersion().productIDIsInt()); // backward compatibility
183 
184  FileID *fidPtr = &fid_;
185  if(metaDataTree->FindBranch(poolNames::fileIdentifierBranchName().c_str()) != 0) {
186  metaDataTree->SetBranchAddress(poolNames::fileIdentifierBranchName().c_str(), &fidPtr);
187  }
188 
189  IndexIntoFile *iifPtr = &indexIntoFile_;
190  if(metaDataTree->FindBranch(poolNames::indexIntoFileBranchName().c_str()) != 0) {
191  metaDataTree->SetBranchAddress(poolNames::indexIntoFileBranchName().c_str(), &iifPtr);
192  }
193 
194  // Need to read to a temporary registry so we can do a translation of the BranchKeys.
195  // This preserves backward compatibility against friendly class name algorithm changes.
196  ProductRegistry inputProdDescReg;
197  ProductRegistry *ppReg = &inputProdDescReg;
198  metaDataTree->SetBranchAddress(poolNames::productDescriptionBranchName().c_str(), (&ppReg));
199 
200  typedef std::map<ParameterSetID, ParameterSetBlob> PsetMap;
201  PsetMap psetMap;
202  PsetMap *psetMapPtr = &psetMap;
203  if(metaDataTree->FindBranch(poolNames::parameterSetMapBranchName().c_str()) != 0) {
204  //backward compatibility
205  assert(!fileFormatVersion().parameterSetsTree());
206  metaDataTree->SetBranchAddress(poolNames::parameterSetMapBranchName().c_str(), &psetMapPtr);
207  } else {
208  assert(fileFormatVersion().parameterSetsTree());
209  TTree* psetTree = dynamic_cast<TTree *>(filePtr_->Get(poolNames::parameterSetsTreeName().c_str()));
210  if(0 == psetTree) {
211  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parameterSetsTreeName()
212  << " in the input file.\n";
213  }
214 
215  typedef std::pair<ParameterSetID, ParameterSetBlob> IdToBlobs;
216  IdToBlobs idToBlob;
217  IdToBlobs* pIdToBlob = &idToBlob;
218  psetTree->SetBranchAddress(poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
219 
220  std::auto_ptr<TTreeCache> psetTreeCache = roottree::trainCache(psetTree, *filePtr_, roottree::defaultNonEventCacheSize, "*");
221  filePtr_->SetCacheRead(psetTreeCache.get());
222  for(Long64_t i = 0; i != psetTree->GetEntries(); ++i) {
223  psetTree->GetEntry(i);
224  psetMap.insert(idToBlob);
225  }
226  filePtr_->SetCacheRead(0);
227  }
228 
229  // backward compatibility
231  ProcessHistoryRegistry::collection_type *pHistMapPtr = &pHistMap;
232  if(metaDataTree->FindBranch(poolNames::processHistoryMapBranchName().c_str()) != 0) {
233  metaDataTree->SetBranchAddress(poolNames::processHistoryMapBranchName().c_str(), &pHistMapPtr);
234  }
235 
237  ProcessHistoryRegistry::vector_type *pHistVectorPtr = &pHistVector;
238  if(metaDataTree->FindBranch(poolNames::processHistoryBranchName().c_str()) != 0) {
239  metaDataTree->SetBranchAddress(poolNames::processHistoryBranchName().c_str(), &pHistVectorPtr);
240  }
241 
242  ProcessConfigurationVector procConfigVector;
243  ProcessConfigurationVector* procConfigVectorPtr = &procConfigVector;
244  if(metaDataTree->FindBranch(poolNames::processConfigurationBranchName().c_str()) != 0) {
245  metaDataTree->SetBranchAddress(poolNames::processConfigurationBranchName().c_str(), &procConfigVectorPtr);
246  }
247 
248  std::auto_ptr<BranchIDListRegistry::collection_type> branchIDListsAPtr(new BranchIDListRegistry::collection_type);
249  BranchIDListRegistry::collection_type *branchIDListsPtr = branchIDListsAPtr.get();
250  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) != 0) {
251  metaDataTree->SetBranchAddress(poolNames::branchIDListBranchName().c_str(), &branchIDListsPtr);
252  }
253 
254  BranchChildren* branchChildrenBuffer = branchChildren_.get();
255  if(metaDataTree->FindBranch(poolNames::productDependenciesBranchName().c_str()) != 0) {
256  metaDataTree->SetBranchAddress(poolNames::productDependenciesBranchName().c_str(), &branchChildrenBuffer);
257  }
258 
259  // backward compatibility
260  std::vector<EventProcessHistoryID> *eventHistoryIDsPtr = &eventProcessHistoryIDs_;
261  if(metaDataTree->FindBranch(poolNames::eventHistoryBranchName().c_str()) != 0) {
262  metaDataTree->SetBranchAddress(poolNames::eventHistoryBranchName().c_str(), &eventHistoryIDsPtr);
263  }
264 
265  if(metaDataTree->FindBranch(poolNames::moduleDescriptionMapBranchName().c_str()) != 0) {
266  if(metaDataTree->GetBranch(poolNames::moduleDescriptionMapBranchName().c_str())->GetSplitLevel() != 0) {
267  metaDataTree->SetBranchStatus((poolNames::moduleDescriptionMapBranchName() + ".*").c_str(), 0);
268  } else {
269  metaDataTree->SetBranchStatus(poolNames::moduleDescriptionMapBranchName().c_str(), 0);
270  }
271  }
272 
273  // Here we read the metadata tree
274  roottree::getEntry(metaDataTree, 0);
275 
277 
278  // Here we read the event history tree, if we have one.
280 
282  if(!fileFormatVersion().triggerPathsTracked()) {
283  ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion().parameterSetsByReference());
284  } else {
285  // Merge into the parameter set registry.
286  pset::Registry& psetRegistry = *pset::Registry::instance();
287  for(PsetMap::const_iterator i = psetMap.begin(), iEnd = psetMap.end(); i != iEnd; ++i) {
288  ParameterSet pset(i->second.pset());
289  pset.setID(i->first);
290  psetRegistry.insertMapped(pset);
291  }
292  }
293  if(!fileFormatVersion().splitProductIDs()) {
294  // Old provenance format input file. Create a provenance adaptor.
295  provenanceAdaptor_.reset(new ProvenanceAdaptor(
296  inputProdDescReg, pHistMap, pHistVector, procConfigVector, psetIdConverter, true));
297  // Fill in the branchIDLists branch from the provenance adaptor
298  branchIDLists_ = provenanceAdaptor_->branchIDLists();
299  } else {
300  if(!fileFormatVersion().triggerPathsTracked()) {
301  // New provenance format, but change in ParameterSet Format. Create a provenance adaptor.
302  provenanceAdaptor_.reset(new ProvenanceAdaptor(
303  inputProdDescReg, pHistMap, pHistVector, procConfigVector, psetIdConverter, false));
304  }
305  // New provenance format input file. The branchIDLists branch was read directly from the input file.
306  if(metaDataTree->FindBranch(poolNames::branchIDListBranchName().c_str()) == 0) {
308  << "Failed to find branchIDLists branch in metaData tree.\n";
309  }
310  branchIDLists_.reset(branchIDListsAPtr.release());
311  }
312 
313  // Merge into the hashed registries.
316 
318 
319  validateFile(secondaryFile, usingGoToEvent);
320 
321  // Read the parentage tree. Old format files are handled internally in readParentageTree().
323 
324  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
326  }
327 
328  initializeDuplicateChecker(indexesIntoFiles, currentIndexIntoFile);
331  forcedRunOffset_ = forcedRunOffset(forcedRunNumber, indexIntoFileBegin_, indexIntoFileEnd_);
333 
334  // Set product presence information in the product registry.
335  ProductRegistry::ProductList const& pList = inputProdDescReg.productList();
336  for(ProductRegistry::ProductList::const_iterator it = pList.begin(), itEnd = pList.end();
337  it != itEnd; ++it) {
338  BranchDescription const& prod = it->second;
339  treePointers_[prod.branchType()]->setPresence(prod);
340  }
341 
342  fillProductRegistryTransients(procConfigVector, inputProdDescReg);
343 
344  std::auto_ptr<ProductRegistry> newReg(new ProductRegistry);
345 
346  // Do the translation from the old registry to the new one
347  {
348  ProductRegistry::ProductList const& prodList = inputProdDescReg.productList();
349  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
350  it != itEnd; ++it) {
351  BranchDescription const& prod = it->second;
352  std::string newFriendlyName = friendlyname::friendlyName(prod.className());
353  if(newFriendlyName == prod.friendlyClassName()) {
354  newReg->copyProduct(prod);
355  } else {
356  if(fileFormatVersion().splitProductIDs()) {
358  << "Cannot change friendly class name algorithm without more development work\n"
359  << "to update BranchIDLists. Contact the framework group.\n";
360  }
361  BranchDescription newBD(prod);
362  newBD.updateFriendlyClassName();
363  newReg->copyProduct(newBD);
364  newBranchToOldBranch_.insert(std::make_pair(newBD.branchName(), prod.branchName()));
365  }
366  }
367  dropOnInput(*newReg, groupSelectorRules, dropDescendants, secondaryFile);
368  // freeze the product registry
369  newReg->setFrozen();
370  productRegistry_.reset(newReg.release());
371  }
372 
373 
374  // Set up information from the product registry.
375  ProductRegistry::ProductList const& prodList = productRegistry()->productList();
376  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
377  it != itEnd; ++it) {
378  BranchDescription const& prod = it->second;
379  treePointers_[prod.branchType()]->addBranch(it->first, prod,
380  newBranchToOldBranch(prod.branchName()));
381  }
382 
383  // Determine if this file is fast clonable.
384  setIfFastClonable(remainingEvents, remainingLumis);
385 
386  // Update the branch id info.
387  if(!secondaryFile) {
389  }
390 
391  setRefCoreStreamer(true); // backward compatibility
392 
393  // We are done with our initial reading of EventAuxiliary.
395 
396  // Tell the event tree to begin training at the next read.
398 
399  // Train the run and lumi trees.
400  runTree_.trainCache("*");
401  lumiTree_.trainCache("*");
402  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:251
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:239
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:190
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:188
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:108
unsigned int const defaultNonEventLearningEntries
Definition: RootTree.h:42
void doneFileInitialization() const
Clears the temporary vector of event numbers to reduce memory usage.
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:173
void readParentageTree()
Definition: RootFile.cc:444
int whyNotFastClonable_
Definition: RootFile.h:172
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:185
std::map< BranchKey, BranchDescription > ProductList
static bool updateFromInput(BranchIDLists const &bidlists, std::string const &fileName)
RootTree lumiTree_
Definition: RootFile.h:177
void setRefCoreStreamer(bool resetAll=false)
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:202
IndexIntoFileItr begin(SortOrder sortOrder) const
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:183
boost::shared_ptr< History > history_
Definition: RootFile.h:189
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
detail::ThreadSafeRegistry< ParameterSetID, ParameterSet, ProcessParameterSetIDCache > Registry
Definition: Registry.h:37
void trainCache(char const *branchNames)
Definition: RootTree.cc:231
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
std::vector< EventSelectionID > EventSelectionIDVector
FileFormatVersion fileFormatVersion_
Definition: RootFile.h:160
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:235
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:169
FileID fid_
Definition: RootFile.h:161
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
std::auto_ptr< TTreeCache > trainCache(TTree *tree, InputFile &file, unsigned int cacheSize, char const *branchNames)
Definition: RootTree.cc:275
std::string const logicalFile_
Definition: RootFile.h:156
std::map< key_type, value_type > collection_type
std::vector< BranchListIndex > BranchListIndexes
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:182
bool noEventSort_
Definition: RootFile.h:171
std::string friendlyName(std::string const &iFullName)
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:180
std::string const & indexIntoFileBranchName()
Definition: BranchType.cc:217
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:222
bool skipAnyEvents_
Definition: RootFile.h:170
RootTree eventTree_
Definition: RootFile.h:176
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
void dropOnInput(ProductRegistry &reg, GroupSelectorRules const &rules, bool dropDescendants, bool secondaryFile)
Definition: RootFile.cc:1484
std::string const & metaDataTreeName()
Definition: BranchType.cc:157
void insertCollection(collection_type const &c)
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:172
boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs_
Definition: RootFile.h:187
std::string const & processHistoryBranchName()
Definition: BranchType.cc:187
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
RootTree runTree_
Definition: RootFile.h:178
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:162
ProcessConfiguration const & processConfiguration_
Definition: RootFile.h:157
void setIfFastClonable(int remainingEvents, int remainingLumis)
Definition: RootFile.cc:470
std::string const & productDescriptionBranchName()
Definition: BranchType.cc:162
std::string const & processConfigurationBranchName()
Definition: BranchType.cc:192
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:165
bool branchListIndexesUnchanged_
Definition: RootFile.h:174
unsigned int const defaultNonEventCacheSize
Definition: RootTree.h:40
std::vector< value_type > vector_type
RootTreePtrArray treePointers_
Definition: RootFile.h:179
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:181
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:164
std::string const & productDependenciesBranchName()
Definition: BranchType.cc:167
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
void initializeDuplicateChecker(std::vector< boost::shared_ptr< IndexIntoFile > > const &indexesIntoFiles, std::vector< boost::shared_ptr< IndexIntoFile > >::size_type currentIndexIntoFile)
Definition: RootFile.cc:1468
std::string const & branchIDListBranchName()
Definition: BranchType.cc:197
static ThreadSafeRegistry * instance()
boost::shared_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:192
EventAuxiliary eventAux_
Definition: RootFile.h:175
void resetTraining()
Definition: RootTree.h:127
boost::shared_ptr< BranchIDListRegistry::collection_type const > branchIDLists_
Definition: RootFile.h:182
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:536
unsigned int const defaultLearningEntries
Definition: RootTree.h:41
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:159
TTree * eventHistoryTree_
Definition: RootFile.h:186
std::string const & fileIdentifierBranchName()
Definition: BranchType.cc:207
void validateFile(bool secondaryFile, bool usingGoToEvent)
Definition: RootFile.cc:940
boost::shared_ptr< ProductRegistry const > productRegistry() const
Definition: RootFile.h:83
std::string const & moduleDescriptionMapBranchName()
Definition: BranchType.cc:177
std::string const file_
Definition: RootFile.h:155
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:168
void readEventHistoryTree()
Definition: RootFile.cc:1455
int forcedRunOffset_
Definition: RootFile.h:184
edm::RootFile::~RootFile ( )

Definition at line 404 of file RootFile.cc.

404  {
405  }

Member Function Documentation

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

Definition at line 84 of file RootFile.h.

References branchIDLists_.

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

Definition at line 96 of file RootFile.h.

References branchListIndexesUnchanged_.

Referenced by createFileBlock().

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

Definition at line 992 of file RootFile.cc.

References eventHistoryTree_, filePtr_, and treePointers_.

Referenced by python.Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and python.Vispa.Gui.FindDialog.FindDialog::keyPressEvent().

992  {
993  // Just to play it safe, zero all pointers to objects in the InputFile to be closed.
994  eventHistoryTree_ = 0;
995  for(RootTreePtrArray::iterator it = treePointers_.begin(), itEnd = treePointers_.end(); it != itEnd; ++it) {
996  (*it)->close();
997  (*it) = 0;
998  }
999  filePtr_->Close();
1000  filePtr_.reset();
1001  }
RootTreePtrArray treePointers_
Definition: RootFile.h:179
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
TTree * eventHistoryTree_
Definition: RootFile.h:186
boost::shared_ptr< FileBlock > edm::RootFile::createFileBlock ( ) const

Definition at line 520 of file RootFile.cc.

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

520  {
521  return boost::shared_ptr<FileBlock>(new FileBlock(fileFormatVersion(),
522  eventTree_.tree(),
524  lumiTree_.tree(),
526  runTree_.tree(),
527  runTree_.metaTree(),
530  file_,
532  branchChildren_));
533  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:190
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
boost::array< bool, NumBranchTypes > const & hasNewlyDroppedBranch() const
Definition: RootFile.h:95
bool branchListIndexesUnchanged() const
Definition: RootFile.h:96
RootTree lumiTree_
Definition: RootFile.h:177
TTree const * metaTree() const
Definition: RootTree.h:115
TTree const * tree() const
Definition: RootTree.h:113
int whyNotFastClonable() const
Definition: RootFile.h:94
RootTree eventTree_
Definition: RootFile.h:176
RootTree runTree_
Definition: RootFile.h:178
std::string const file_
Definition: RootFile.h:155
void edm::RootFile::dropOnInput ( ProductRegistry reg,
GroupSelectorRules const &  rules,
bool  dropDescendants,
bool  secondaryFile 
)
private

Definition at line 1484 of file RootFile.cc.

References edm::ProductRegistry::allBranchDescriptions(), branchChildren_, edm::BranchDescription::branchID(), edm::BranchDescription::branchName(), edm::BranchDescription::branchType(), CommonMethods::cp(), drop, file_, hasNewlyDroppedBranch_, edm::InEvent, edm::GroupSelector::initialize(), newBranchToOldBranch(), parseEventContent::prod, edm::ProductRegistry::productListUpdator(), edm::GroupSelector::selected(), treePointers_, and edm::BranchDescription::wrappedName().

Referenced by RootFile().

1484  {
1485  // This is the selector for drop on input.
1486  GroupSelector groupSelector;
1487  groupSelector.initialize(rules, reg.allBranchDescriptions());
1488 
1489  ProductRegistry::ProductList& prodList = reg.productListUpdator();
1490  // Do drop on input. On the first pass, just fill in a set of branches to be dropped.
1491  std::set<BranchID> branchesToDrop;
1492  for(ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
1493  it != itEnd; ++it) {
1494  BranchDescription const& prod = it->second;
1495  if(!groupSelector.selected(prod)) {
1496  if(dropDescendants) {
1497  branchChildren_->appendToDescendants(prod.branchID(), branchesToDrop);
1498  } else {
1499  branchesToDrop.insert(prod.branchID());
1500  }
1501  }
1502  }
1503 
1504  // On this pass, actually drop the branches.
1505  std::set<BranchID>::const_iterator branchesToDropEnd = branchesToDrop.end();
1506  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1507  BranchDescription const& prod = it->second;
1508  bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
1509  if(drop) {
1510  if(groupSelector.selected(prod)) {
1511  LogWarning("RootFile")
1512  << "Branch '" << prod.branchName() << "' is being dropped from the input\n"
1513  << "of file '" << file_ << "' because it is dependent on a branch\n"
1514  << "that was explicitly dropped.\n";
1515  }
1516  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1517  hasNewlyDroppedBranch_[prod.branchType()] = true;
1518  ProductRegistry::ProductList::iterator icopy = it;
1519  ++it;
1520  prodList.erase(icopy);
1521  } else {
1522  ++it;
1523  }
1524  }
1525 
1526  // Drop on input mergeable run and lumi products, this needs to be invoked for secondary file input
1527  if(secondaryFile) {
1528  for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
1529  BranchDescription const& prod = it->second;
1530  if(prod.branchType() != InEvent) {
1531  TClass *cp = gROOT->GetClass(prod.wrappedName().c_str());
1532  boost::shared_ptr<EDProduct> dummy(static_cast<EDProduct *>(cp->New()));
1533  if(dummy->isMergeable()) {
1534  treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
1535  ProductRegistry::ProductList::iterator icopy = it;
1536  ++it;
1537  prodList.erase(icopy);
1538  } else {
1539  ++it;
1540  }
1541  }
1542  else ++it;
1543  }
1544  }
1545  }
boost::shared_ptr< BranchChildren > branchChildren_
Definition: RootFile.h:190
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:173
std::map< BranchKey, BranchDescription > ProductList
const int drop
RootTreePtrArray treePointers_
Definition: RootFile.h:179
std::string const & newBranchToOldBranch(std::string const &newBranch) const
Definition: RootFile.cc:536
std::string const file_
Definition: RootFile.h:155
EventAuxiliary const& edm::RootFile::eventAux ( ) const
inline
EventID const& edm::RootFile::eventID ( ) const
inline

Definition at line 89 of file RootFile.h.

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

Referenced by readCurrentEvent().

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

Definition at line 90 of file RootFile.h.

References eventTree_.

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

Definition at line 82 of file RootFile.h.

References file_.

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

Definition at line 1023 of file RootFile.cc.

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

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

1023  {
1026  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
RootTree eventTree_
Definition: RootFile.h:176
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
void edm::RootFile::fillHistory ( )
private

Definition at line 1029 of file RootFile.cc.

References branchListIndexes_, edm::poolNames::branchListIndexesBranchName(), edm::RootTree::entryNumber(), event(), eventAux(), eventAux_, edm::errors::EventCorruption, edm::poolNames::eventHistoryBranchName(), edm::FileFormatVersion::eventHistoryTree(), eventHistoryTree_, eventProcessHistoryIDs_, eventProcessHistoryIter_, eventSelectionIDs_, edm::poolNames::eventSelectionsBranchName(), eventTree_, edm::hlt::Exception, fileFormatVersion(), edm::RootTree::fillBranchEntry(), edm::roottree::getEntry(), history_, i, edm::lower_bound_all(), edm::FileFormatVersion::noMetaDataTrees(), provenanceAdaptor_, DTTTrigCorrFirst::run, edm::EventAuxiliary::setProcessHistoryID(), filterCSVwithJSON::target, and edm::RootTree::tree().

Referenced by fillIndexIntoFile(), and readCurrentEvent().

1029  {
1030  // We could consider doing delayed reading, but because we have to
1031  // store this History object in a different tree than the event
1032  // data tree, this is too hard to do in this first version.
1033 
1034  if(fileFormatVersion().eventHistoryBranch()) {
1035  // Lumi block number was not in EventID for the relevant releases.
1036  EventID id(eventAux().id().run(), 0, eventAux().id().event());
1037  if(eventProcessHistoryIter_->eventID() != id) {
1038  EventProcessHistoryID target(id, ProcessHistoryID());
1040  assert(eventProcessHistoryIter_->eventID() == id);
1041  }
1044  } else if(fileFormatVersion().eventHistoryTree()) {
1045  // for backward compatibility.
1046  History* pHistory = history_.get();
1047  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(poolNames::eventHistoryBranchName().c_str());
1048  if(!eventHistoryBranch) {
1050  << "Failed to find history branch in event history tree.\n";
1051  }
1052  eventHistoryBranch->SetAddress(&pHistory);
1054  eventAux_.setProcessHistoryID(history_->processHistoryID());
1055  eventSelectionIDs_.reset(&history_->eventSelectionIDs(), do_nothing_deleter());
1056  branchListIndexes_.reset(&history_->branchListIndexes(), do_nothing_deleter());
1057  } else if(fileFormatVersion().noMetaDataTrees()) {
1058  // Current format
1060  TBranch* eventSelectionIDBranch = eventTree_.tree()->GetBranch(poolNames::eventSelectionsBranchName().c_str());
1061  assert(eventSelectionIDBranch != 0);
1062  eventTree_.fillBranchEntry(eventSelectionIDBranch, pESV);
1063  BranchListIndexes* pBLI = branchListIndexes_.get();
1064  TBranch* branchListIndexesBranch = eventTree_.tree()->GetBranch(poolNames::branchListIndexesBranchName().c_str());
1065  assert(branchListIndexesBranch != 0);
1066  eventTree_.fillBranchEntry(branchListIndexesBranch, pBLI);
1067  }
1068  if(provenanceAdaptor_) {
1069  eventAux_.setProcessHistoryID(provenanceAdaptor_->convertID(eventAux().processHistoryID()));
1070  for(EventSelectionIDVector::iterator i = eventSelectionIDs_->begin(), e = eventSelectionIDs_->end(); i != e; ++i) {
1071  (*i) = provenanceAdaptor_->convertID(*i);
1072  }
1073  }
1074  if(!fileFormatVersion().splitProductIDs()) {
1075  // old format. branchListIndexes_ must be filled in from the ProvenanceAdaptor.
1076  provenanceAdaptor_->branchListIndexes(*branchListIndexes_);
1077  }
1078  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:251
int i
Definition: DBlmapReader.cc:9
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:188
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
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:227
boost::shared_ptr< History > history_
Definition: RootFile.h:189
std::vector< EventSelectionID > EventSelectionIDVector
std::vector< EventProcessHistoryID >::const_iterator eventProcessHistoryIter_
Definition: RootFile.h:169
TTree const * tree() const
Definition: RootTree.h:113
std::vector< BranchListIndex > BranchListIndexes
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:222
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
bool eventHistoryTree() const
RootTree eventTree_
Definition: RootFile.h:176
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:187
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
void fillBranchEntry(TBranch *branch, T *&pbuf)
Definition: RootTree.h:108
void setProcessHistoryID(ProcessHistoryID const &phid)
std::string const & branchListIndexesBranchName()
Definition: BranchType.cc:231
boost::shared_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:192
EventAuxiliary eventAux_
Definition: RootFile.h:175
TTree * eventHistoryTree_
Definition: RootFile.h:186
std::vector< EventProcessHistoryID > eventProcessHistoryIDs_
Definition: RootFile.h:168
void edm::RootFile::fillIndexIntoFile ( )
private

Definition at line 721 of file RootFile.cc.

References edm::RootTree::entries(), python.tagInventory::entries, edm::RootTree::entryNumber(), event(), eventAux(), eventAux_, eventTree_, fileFormatVersion(), fillHistory(), fillLumiAuxiliary(), fillRunAuxiliary(), fillThisEventAuxiliary(), edm::find_in_all(), i, indexIntoFile_, edm::RootTree::isValid(), lastEventEntryNumberRead_, edm::EventAuxiliary::luminosityBlock(), lumiTree_, edm::RootTree::next(), edm::EventAuxiliary::processHistoryID(), DTTTrigCorrFirst::run, edm::EventAuxiliary::run(), getRunRegistry::runs, runTree_, edm::second(), edm::RootTree::setEntryNumber(), edm::IndexIntoFile::setProcessHistoryIDs(), edm::IndexIntoFile::setRunOrLumiEntries(), edm::stable_sort_all(), and edm::IndexIntoFile::unsortedEventNumbers().

Referenced by validateFile().

721  {
722  // This function is for backward compatibility.
723  // If reading a current format file, indexIntoFile_ is read from the input
724  // file and should always be there. Note that the algorithm below will work
725  // sometimes but often fail with the new format introduced in release 3_8_0.
726  // If it ever becomes necessary to rebuild IndexIntoFile from the new format,
727  // probably a separate function should be written to deal with the task.
728  // This is possible just not implemented yet.
729  assert(!fileFormatVersion().hasIndexIntoFile());
730 
731  typedef std::list<LumiItem> LumiList;
732  LumiList lumis; // (declare 1)
733 
734  typedef std::set<LuminosityBlockID> RunLumiSet;
735  RunLumiSet runLumiSet; // (declare 2)
736 
737  typedef std::list<RunItem> RunList;
738  RunList runs; // (declare 5)
739 
740  typedef std::set<RunNumber_t> RunSet;
741  RunSet runSet; // (declare 4)
742 
743  typedef std::set<RunItem, RunItemSortByRunPhid> RunItemSet;
744  RunItemSet runItemSet; // (declare 3)
745 
746  typedef std::map<RunNumber_t, ProcessHistoryID> PHIDMap;
747  PHIDMap phidMap;
748 
749  RunNumber_t prevRun = 0;
750  LuminosityBlockNumber_t prevLumi = 0;
751  ProcessHistoryID prevPhid;
752 
753  indexIntoFile_.unsortedEventNumbers().clear(); // should already be empty, just being careful
755 
756  // First, loop through the event tree.
757  while(eventTree_.next()) {
758  bool newRun = false;
759  bool newLumi = false;
761  fillHistory();
762 
763  // Save the event numbers as we loop through the event auxiliary to avoid
764  // having to read through the event auxiliary again later. These event numbers
765  // are not actually used in this function, but could be needed elsewhere.
767 
768  if(prevPhid != eventAux().processHistoryID() || prevRun != eventAux().run()) {
769  newRun = newLumi = true;
770  } else if(prevLumi != eventAux().luminosityBlock()) {
771  newLumi = true;
772  }
773  prevPhid = eventAux().processHistoryID();
774  prevRun = eventAux().run();
775  prevLumi = eventAux().luminosityBlock();
776  if(newLumi) {
777  lumis.push_back(LumiItem(eventAux().processHistoryID(),
778  eventAux().run(), eventAux().luminosityBlock(), eventTree_.entryNumber())); // (insert 1)
779  runLumiSet.insert(LuminosityBlockID(eventAux().run(), eventAux().luminosityBlock())); // (insert 2)
780  } else {
781  LumiItem& currentLumi = lumis.back();
782  assert(currentLumi.lastEventEntry_ == eventTree_.entryNumber());
783  ++currentLumi.lastEventEntry_;
784  }
785  if(newRun) {
786  // Insert run in list if it is not already there.
787  RunItem item(eventAux().processHistoryID(), eventAux().run());
788  if(runItemSet.insert(item).second) { // (check 3, insert 3)
789  runs.push_back(item); // (insert 5)
790  runSet.insert(eventAux().run()); // (insert 4)
791  phidMap.insert(std::make_pair(eventAux().run(), eventAux().processHistoryID()));
792  }
793  }
794  }
795  // now clean up.
797  eventAux_ = EventAuxiliary();
799 
800  // Loop over run entries and fill information.
801 
802  typedef std::map<RunNumber_t, EntryNumber_t> RunMap;
803  RunMap runMap; // (declare 11)
804 
805  typedef std::vector<RunItem> RunVector;
806  RunVector emptyRuns; // (declare 12)
807 
808  if(runTree_.isValid()) {
809  while(runTree_.next()) {
810  // Note: adjacent duplicates will be skipped without an explicit check.
811  boost::shared_ptr<RunAuxiliary> runAux = fillRunAuxiliary();
812  if(runSet.insert(runAux->run()).second) { // (check 4, insert 4)
813  // This run was not assciated with any events or lumis.
814  emptyRuns.push_back(RunItem(runAux->processHistoryID(), runAux->run())); // (insert 12)
815  }
816  runMap.insert(std::make_pair(runAux->run(), runTree_.entryNumber())); // (insert 11)
817  phidMap.insert(std::make_pair(runAux->run(), runAux->processHistoryID()));
818  }
819  // now clean up.
821  }
822 
823  // Insert the ordered empty runs into the run list.
824  RunItemSortByRun runItemSortByRun;
825  stable_sort_all(emptyRuns, runItemSortByRun);
826 
827  RunList::iterator itRuns = runs.begin(), endRuns = runs.end();
828  for (RunVector::const_iterator i = emptyRuns.begin(), iEnd = emptyRuns.end(); i != iEnd; ++i) {
829  for (; itRuns != endRuns; ++itRuns) {
830  if(runItemSortByRun(*i, *itRuns)) {
831  break;
832  }
833  }
834  runs.insert(itRuns, *i);
835  }
836 
837  // Loop over luminosity block entries and fill information.
838 
839  typedef std::vector<LumiItem> LumiVector;
840  LumiVector emptyLumis; // (declare 7)
841 
842  typedef std::map<LuminosityBlockID, EntryNumber_t> RunLumiMap;
843  RunLumiMap runLumiMap; // (declare 6)
844 
845  if(lumiTree_.isValid()) {
846  while(lumiTree_.next()) {
847  // Note: adjacent duplicates will be skipped without an explicit check.
848  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAux = fillLumiAuxiliary();
849  LuminosityBlockID lumiID = LuminosityBlockID(lumiAux->run(), lumiAux->luminosityBlock());
850  if(runLumiSet.insert(lumiID).second) { // (check 2, insert 2)
851  // This lumi was not associated with any events.
852  // Use the process history ID from the corresponding run. In cases of practical
853  // importance, this should be the correct process history ID, but it is possible
854  // to construct files where this is not the correct process history ID ...
855  PHIDMap::const_iterator iPhidMap = phidMap.find(lumiAux->run());
856  assert(iPhidMap != phidMap.end());
857  emptyLumis.push_back(LumiItem(iPhidMap->second, lumiAux->run(), lumiAux->luminosityBlock(), -1LL)); // (insert 7)
858  }
859  runLumiMap.insert(std::make_pair(lumiID, lumiTree_.entryNumber()));
860  }
861  // now clean up.
863  }
864 
865  // Insert the ordered empty lumis into the lumi list.
866  LumiItemSortByRunLumi lumiItemSortByRunLumi;
867  stable_sort_all(emptyLumis, lumiItemSortByRunLumi);
868 
869  LumiList::iterator itLumis = lumis.begin(), endLumis = lumis.end();
870  for (LumiVector::const_iterator i = emptyLumis.begin(), iEnd = emptyLumis.end(); i != iEnd; ++i) {
871  for (; itLumis != endLumis; ++itLumis) {
872  if(lumiItemSortByRunLumi(*i, *itLumis)) {
873  break;
874  }
875  }
876  lumis.insert(itLumis, *i);
877  }
878 
879  // Create a map of RunItems that gives the order of first appearance in the list.
880  // Also fill in the vector of process history IDs
881  typedef std::map<RunItem, int, RunItemSortByRunPhid> RunCountMap;
882  RunCountMap runCountMap; // Declare (17)
883  std::vector<ProcessHistoryID>& phids = indexIntoFile_.setProcessHistoryIDs();
884  assert(phids.empty());
885  std::vector<IndexIntoFile::RunOrLumiEntry>& entries = indexIntoFile_.setRunOrLumiEntries();
886  assert(entries.empty());
887  int rcount = 0;
888  for (RunList::iterator it = runs.begin(), itEnd = runs.end(); it != itEnd; ++it) {
889  RunCountMap::const_iterator countMapItem = runCountMap.find(*it);
890  if(countMapItem == runCountMap.end()) {
891  countMapItem = runCountMap.insert(std::make_pair(*it, rcount)).first; // Insert (17)
892  assert(countMapItem != runCountMap.end());
893  ++rcount;
894  }
895  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, it->phid_);
896  if(phidItem == phids.end()) {
897  phids.push_back(it->phid_);
898  phidItem = phids.end() - 1;
899  }
900  entries.push_back(IndexIntoFile::RunOrLumiEntry(
901  countMapItem->second, // use (17)
902  -1LL,
903  runMap[it->run_], // use (11)
904  phidItem - phids.begin(),
905  it->run_,
906  0U,
907  -1LL,
908  -1LL));
909  }
910 
911  // Create a map of LumiItems that gives the order of first appearance in the list.
912  typedef std::map<LumiItem, int, LumiItemSortByRunLumiPhid> LumiCountMap;
913  LumiCountMap lumiCountMap; // Declare (19)
914  int lcount = 0;
915  for (LumiList::iterator it = lumis.begin(), itEnd = lumis.end(); it != itEnd; ++it) {
916  RunCountMap::const_iterator runCountMapItem = runCountMap.find(RunItem(it->phid_, it->run_));
917  assert(runCountMapItem != runCountMap.end());
918  LumiCountMap::const_iterator countMapItem = lumiCountMap.find(*it);
919  if(countMapItem == lumiCountMap.end()) {
920  countMapItem = lumiCountMap.insert(std::make_pair(*it, lcount)).first; // Insert (17)
921  assert(countMapItem != lumiCountMap.end());
922  ++lcount;
923  }
924  std::vector<ProcessHistoryID>::const_iterator phidItem = find_in_all(phids, it->phid_);
925  assert(phidItem != phids.end());
926  entries.push_back(IndexIntoFile::RunOrLumiEntry(
927  runCountMapItem->second,
928  countMapItem->second,
929  runLumiMap[LuminosityBlockID(it->run_, it->lumi_)],
930  phidItem - phids.begin(),
931  it->run_,
932  it->lumi_,
933  it->firstEventEntry_,
934  it->lastEventEntry_));
935  }
936  stable_sort_all(entries);
937  }
int i
Definition: DBlmapReader.cc:9
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
RootTree lumiTree_
Definition: RootFile.h:177
EntryNumber const & entries() const
Definition: RootTree.h:87
RunNumber_t run() const
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1102
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
U second(std::pair< T, U > const &p)
std::vector< ProcessHistoryID > & setProcessHistoryIDs()
bool next()
Definition: RootTree.h:81
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:180
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
void fillHistory()
Definition: RootFile.cc:1029
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:163
RootTree runTree_
Definition: RootFile.h:178
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
std::vector< RunOrLumiEntry > & setRunOrLumiEntries()
std::vector< EventNumber_t > & unsortedEventNumbers() const
ForwardSequence::const_iterator find_in_all(ForwardSequence const &s, Datum const &d)
wrappers for std::find
Definition: Algorithms.h:32
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1081
bool isValid() const
Definition: RootTree.cc:66
ProcessHistoryID const & processHistoryID() const
unsigned int RunNumber_t
Definition: EventRange.h:32
EventAuxiliary eventAux_
Definition: RootFile.h:175
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::fillLumiAuxiliary ( )
private

Definition at line 1081 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readLuminosityBlockAuxiliary_().

1081  {
1082  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary(new LuminosityBlockAuxiliary);
1083  if(fileFormatVersion().newAuxiliary()) {
1084  LuminosityBlockAuxiliary *pLumiAux = lumiAuxiliary.get();
1085  lumiTree_.fillAux<LuminosityBlockAuxiliary>(pLumiAux);
1086  } else {
1087  LuminosityBlockAux lumiAux;
1088  LuminosityBlockAux *pLumiAux = &lumiAux;
1089  lumiTree_.fillAux<LuminosityBlockAux>(pLumiAux);
1090  conversion(lumiAux, *lumiAuxiliary);
1091  }
1092  if(provenanceAdaptor_) {
1093  lumiAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(lumiAuxiliary->processHistoryID()));
1094  }
1095  if(lumiAuxiliary->luminosityBlock() == 0 && !fileFormatVersion().runsAndLumis()) {
1096  lumiAuxiliary->id() = LuminosityBlockID(RunNumber_t(1), LuminosityBlockNumber_t(1));
1097  }
1098  return lumiAuxiliary;
1099  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
RootTree lumiTree_
Definition: RootFile.h:177
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
unsigned int RunNumber_t
Definition: EventRange.h:32
boost::shared_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:192
void fillAux(T *&pAux)
Definition: RootTree.h:92
boost::shared_ptr< RunAuxiliary > edm::RootFile::fillRunAuxiliary ( )
private

Definition at line 1102 of file RootFile.cc.

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

Referenced by fillIndexIntoFile(), and readRunAuxiliary_().

1102  {
1103  boost::shared_ptr<RunAuxiliary> runAuxiliary(new RunAuxiliary);
1104  if(fileFormatVersion().newAuxiliary()) {
1105  RunAuxiliary *pRunAux = runAuxiliary.get();
1106  runTree_.fillAux<RunAuxiliary>(pRunAux);
1107  } else {
1108  RunAux runAux;
1109  RunAux *pRunAux = &runAux;
1110  runTree_.fillAux<RunAux>(pRunAux);
1111  conversion(runAux, *runAuxiliary);
1112  }
1113  if(provenanceAdaptor_) {
1114  runAuxiliary->setProcessHistoryID(provenanceAdaptor_->convertID(runAuxiliary->processHistoryID()));
1115  }
1116  return runAuxiliary;
1117  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
RootTree runTree_
Definition: RootFile.h:178
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
boost::shared_ptr< ProvenanceAdaptor > provenanceAdaptor_
Definition: RootFile.h:192
void fillAux(T *&pAux)
Definition: RootTree.h:92
void edm::RootFile::fillThisEventAuxiliary ( )
private

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

1004  {
1006  // Already read.
1007  return;
1008  }
1010  EventAuxiliary *pEvAux = &eventAux_;
1011  eventTree_.fillAux<EventAuxiliary>(pEvAux);
1012  } else {
1013  // for backward compatibility.
1014  EventAux eventAux;
1015  EventAux *pEvAux = &eventAux;
1016  eventTree_.fillAux<EventAux>(pEvAux);
1017  conversion(eventAux, eventAux_);
1018  }
1020  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
IndexIntoFile::EntryNumber_t lastEventEntryNumberRead_
Definition: RootFile.h:180
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
EntryNumber const & entryNumber() const
Definition: RootTree.h:86
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
EventAuxiliary eventAux_
Definition: RootFile.h:175
void fillAux(T *&pAux)
Definition: RootTree.h:92
IndexIntoFile::EntryType edm::RootFile::getEntryTypeWithSkipping ( )
private
IndexIntoFile::EntryType edm::RootFile::getNextEntryTypeWanted ( )

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

626  {
628  if(entryType == IndexIntoFile::kEnd) {
629  return IndexIntoFile::kEnd;
630  }
631  if(entryType == IndexIntoFile::kRun) {
632  return IndexIntoFile::kRun;
633  } else if(processingMode_ == InputSource::Runs) {
635  return getNextEntryTypeWanted();
636  }
637  if(entryType == IndexIntoFile::kLumi) {
638  return IndexIntoFile::kLumi;
641  return getNextEntryTypeWanted();
642  }
643  if(isDuplicateEvent()) {
645  return getNextEntryTypeWanted();
646  }
647  return IndexIntoFile::kEvent;
648  }
IndexIntoFile::EntryType getEntryTypeWithSkipping()
Definition: RootFile.cc:599
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:183
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::EntryType getNextEntryTypeWanted()
Definition: RootFile.cc:626
bool isDuplicateEvent()
Definition: RootFile.cc:615
bool edm::RootFile::goToEvent ( EventID const &  eventID)

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

1191  {
1192 
1194 
1195  if(duplicateChecker_) {
1196  duplicateChecker_->disable();
1197  }
1198 
1201 
1202  IndexIntoFile::IndexIntoFileItr iter =
1204 
1205  if(iter == indexIntoFile_.end(sortOrder)) {
1206  return false;
1207  }
1208  indexIntoFileIter_ = iter;
1209  return true;
1210  }
RunNumber_t run() const
Definition: EventID.h:42
EventID const & eventID() const
Definition: RootFile.h:89
EventNumber_t event() const
Definition: EventID.h:44
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
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:191
bool noEventSort_
Definition: RootFile.h:171
IndexIntoFileItr end(SortOrder sortOrder) const
Used to end an iteration over the Runs, Lumis, and Events in a file.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
void fillEventNumbers() const
boost::array<bool, NumBranchTypes> const& edm::RootFile::hasNewlyDroppedBranch ( ) const
inline

Definition at line 95 of file RootFile.h.

References hasNewlyDroppedBranch_.

Referenced by createFileBlock().

95 {return hasNewlyDroppedBranch_;}
boost::array< bool, NumBranchTypes > hasNewlyDroppedBranch_
Definition: RootFile.h:173
IndexIntoFile::IndexIntoFileItr edm::RootFile::indexIntoFileIter ( ) const

Definition at line 545 of file RootFile.cc.

References indexIntoFileIter_.

545  {
546  return indexIntoFileIter_;
547  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
boost::shared_ptr<IndexIntoFile> edm::RootFile::indexIntoFileSharedPtr ( ) const
inline

Definition at line 120 of file RootFile.h.

References indexIntoFileSharedPtr_.

120  {
122  }
boost::shared_ptr< IndexIntoFile > indexIntoFileSharedPtr_
Definition: RootFile.h:162
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 1468 of file RootFile.cc.

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

Referenced by RootFile().

1470  {
1471  if(duplicateChecker_) {
1472  if(eventTree_.next()) {
1474  duplicateChecker_->inputFileOpened(eventAux().isRealData(),
1476  indexesIntoFiles,
1477  currentIndexIntoFile);
1478  }
1480  }
1481  }
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
bool next()
Definition: RootTree.h:81
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
bool edm::RootFile::isDuplicateEvent ( )
private

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

615  {
617  if(duplicateChecker_.get() == 0) {
618  return false;
619  }
621  return duplicateChecker_->isDuplicateAndCheckActive(indexIntoFileIter_.processHistoryIDIndex(),
623  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1023
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
LuminosityBlockNumber_t lumi() const
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:175
std::string const file_
Definition: RootFile.h:155
RootTree const& edm::RootFile::lumiTree ( ) const
inline

Definition at line 91 of file RootFile.h.

References lumiTree_.

91 {return lumiTree_;}
RootTree lumiTree_
Definition: RootFile.h:177
boost::shared_ptr< BranchMapper > edm::RootFile::makeBranchMapper ( RootTree rootTree,
BranchType const &  type 
) const
private

Definition at line 1637 of file RootFile.cc.

References fileFormatVersion(), and productRegistry_.

Referenced by readCurrentEvent(), readLumi(), and readRun_().

1637  {
1638  if(fileFormatVersion().splitProductIDs()) {
1639  return makeBranchMapperInRelease300(rootTree);
1640  } else if(fileFormatVersion().perEventProductIDs()) {
1641  return makeBranchMapperInRelease210(rootTree, type);
1642  } else if(fileFormatVersion().eventHistoryTree()) {
1643  return makeBranchMapperInRelease200(rootTree, type, *productRegistry_);
1644  } else {
1645  return makeBranchMapperInRelease180(rootTree, type, *productRegistry_);
1646  }
1647  }
type
Definition: HCALResponse.h:22
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
boost::shared_ptr< ProductRegistry const > productRegistry_
Definition: RootFile.h:181
std::string const & edm::RootFile::newBranchToOldBranch ( std::string const &  newBranch) const
private

Definition at line 536 of file RootFile.cc.

References newBranchToOldBranch_.

Referenced by dropOnInput(), and RootFile().

536  {
537  std::map<std::string, std::string>::const_iterator it = newBranchToOldBranch_.find(newBranch);
538  if(it != newBranchToOldBranch_.end()) {
539  return it->second;
540  }
541  return newBranch;
542  }
std::map< std::string, std::string > newBranchToOldBranch_
Definition: RootFile.h:185
bool edm::RootFile::nextEventEntry ( )
inline

Definition at line 118 of file RootFile.h.

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

118 {return eventTree_.next();}
bool next()
Definition: RootTree.h:81
RootTree eventTree_
Definition: RootFile.h:176
void edm::RootFile::overrideRunNumber ( RunID id)
private

Definition at line 1424 of file RootFile.cc.

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

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

1424  {
1425  if(forcedRunOffset_ != 0) {
1426  id = RunID(id.run() + forcedRunOffset_);
1427  }
1428  if(id < RunID::firstValidRun()) id = RunID::firstValidRun();
1429  }
static RunID firstValidRun()
Definition: RunID.h:82
int forcedRunOffset_
Definition: RootFile.h:184
void edm::RootFile::overrideRunNumber ( LuminosityBlockID id)
private

Definition at line 1432 of file RootFile.cc.

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

1432  {
1433  if(forcedRunOffset_ != 0) {
1434  id = LuminosityBlockID(id.run() + forcedRunOffset_, id.luminosityBlock());
1435  }
1436  if(RunID(id.run()) < RunID::firstValidRun()) id = LuminosityBlockID(RunID::firstValidRun().run(), id.luminosityBlock());
1437  }
static RunID firstValidRun()
Definition: RunID.h:82
int forcedRunOffset_
Definition: RootFile.h:184
void edm::RootFile::overrideRunNumber ( EventID id,
bool  isRealData 
)
private

Definition at line 1440 of file RootFile.cc.

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

1440  {
1441  if(forcedRunOffset_ != 0) {
1442  if(isRealData) {
1443  throw Exception(errors::Configuration, "RootFile::RootFile()")
1444  << "The 'setRunNumber' parameter of PoolSource cannot be used with real data.\n";
1445  }
1446  id = EventID(id.run() + forcedRunOffset_, id.luminosityBlock(), id.event());
1447  }
1448  if(RunID(id.run()) < RunID::firstValidRun()) {
1450  }
1451  }
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:184
boost::shared_ptr<ProductRegistry const> edm::RootFile::productRegistry ( ) const
inline

Definition at line 83 of file RootFile.h.

References productRegistry_.

Referenced by RootFile().

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

Definition at line 1243 of file RootFile.cc.

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

Referenced by readEvent().

1245  {
1246  if(!eventTree_.current()) {
1247  return 0;
1248  }
1250  if(!fileFormatVersion().lumiInEventID()) {
1251  //ugly, but will disappear when the backward compatibility is done with schema evolution.
1252  const_cast<EventID&>(eventAux_.id()).setLuminosityBlockNumber(eventAux_.oldLuminosityBlock());
1254  }
1255  fillHistory();
1257 
1258  std::auto_ptr<EventAuxiliary> aux(new EventAuxiliary(eventAux()));
1259  // We're not done ... so prepare the EventPrincipal
1260  cache.fillEventPrincipal(aux,
1261  lb,
1266 
1267  // report event read from file
1268  filePtr_->eventReadFromFile(eventID().run(), eventID().event());
1269  return &cache;
1270  }
EventID const & eventID() const
Definition: RootFile.h:89
bool isRealData() const
boost::shared_ptr< BranchListIndexes > branchListIndexes_
Definition: RootFile.h:188
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
void fillHistory()
Definition: RootFile.cc:1029
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:187
boost::shared_ptr< DelayedReader > makeDelayedReader(FileFormatVersion const &fileFormatVersion, boost::shared_ptr< RootFile > rootFilePtr=boost::shared_ptr< RootFile >()) const
Definition: RootTree.cc:133
EventID const & id() const
boost::shared_ptr< BranchMapper > makeBranchMapper(RootTree &rootTree, BranchType const &type) const
Definition: RootFile.cc:1637
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1424
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
EventAuxiliary eventAux_
Definition: RootFile.h:175
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
bool current()
Definition: RootTree.h:83
void edm::RootFile::readEntryDescriptionTree ( )
private

Definition at line 408 of file RootFile.cc.

References 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::EventEntryDescription::id(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), edm::numEntries(), parents, edm::EventEntryDescription::parents(), edm::Parentage::parents(), and PhysicsTools::registry.

Referenced by readParentageTree().

408  {
409  // Called only for old format files.
410  if(!fileFormatVersion().perEventProductIDs()) return;
411  TTree* entryDescriptionTree = dynamic_cast<TTree*>(filePtr_->Get(poolNames::entryDescriptionTreeName().c_str()));
412  if(!entryDescriptionTree)
413  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::entryDescriptionTreeName()
414  << " in the input file.\n";
415 
416 
417  EntryDescriptionID idBuffer;
418  EntryDescriptionID* pidBuffer = &idBuffer;
419  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), &pidBuffer);
420 
422 
423  EventEntryDescription entryDescriptionBuffer;
424  EventEntryDescription *pEntryDescriptionBuffer = &entryDescriptionBuffer;
425  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), &pEntryDescriptionBuffer);
426 
427  // Fill in the parentage registry.
429 
430  for(Long64_t i = 0, numEntries = entryDescriptionTree->GetEntries(); i < numEntries; ++i) {
431  roottree::getEntry(entryDescriptionTree, i);
432  if(idBuffer != entryDescriptionBuffer.id())
433  throw Exception(errors::EventCorruption) << "Corruption of EntryDescription tree detected.\n";
434  oldregistry.insertMapped(entryDescriptionBuffer);
435  Parentage parents;
436  parents.parents() = entryDescriptionBuffer.parents();
437  registry.insertMapped(parents);
438  }
439  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionIDBranchName().c_str(), 0);
440  entryDescriptionTree->SetBranchAddress(poolNames::entryDescriptionBranchName().c_str(), 0);
441  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:251
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:143
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
edm::detail::ThreadSafeRegistry< edm::ParentageID, edm::Parentage > ParentageRegistry
Hash< EntryDescriptionType > EntryDescriptionID
std::string const & entryDescriptionTreeName()
Definition: BranchType.cc:135
Long64_t numEntries(TFile *hdl, std::string const &trname)
Definition: CollUtil.cc:50
std::string const & entryDescriptionIDBranchName()
Definition: BranchType.cc:139
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
static ThreadSafeRegistry * instance()
static Interceptor::Registry registry("Interceptor")
EventPrincipal * edm::RootFile::readEvent ( EventPrincipal cache,
boost::shared_ptr< RootFile rootFilePtr,
boost::shared_ptr< LuminosityBlockPrincipal lb = boost::shared_ptr<LuminosityBlockPrincipal>() 
)

Definition at line 1226 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), eventTree_, forcedRunOffset_, edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::IndexIntoFile::kEvent, edm::IndexIntoFile::IndexIntoFileItr::lumi(), readCurrentEvent(), DTTTrigCorrFirst::run, edm::IndexIntoFile::IndexIntoFileItr::run(), and edm::RootTree::setEntryNumber().

1226  {
1229  // Set the entry in the tree, and read the event at that entry.
1231  EventPrincipal* ep = readCurrentEvent(cache, rootFilePtr, lb);
1232 
1233  assert(ep != 0);
1234  assert(eventAux().run() == indexIntoFileIter_.run() + forcedRunOffset_);
1235  assert(eventAux().luminosityBlock() == indexIntoFileIter_.lumi());
1236 
1238  return ep;
1239  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
EventPrincipal * readCurrentEvent(EventPrincipal &cache, boost::shared_ptr< RootFile > rootFilePtr, boost::shared_ptr< LuminosityBlockPrincipal > lb=boost::shared_ptr< LuminosityBlockPrincipal >())
Definition: RootFile.cc:1243
int forcedRunOffset_
Definition: RootFile.h:184
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
void edm::RootFile::readEventHistoryTree ( )
private

Definition at line 1455 of file RootFile.cc.

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

Referenced by RootFile().

1455  {
1456  // Read in the event history tree, if we have one...
1457  if(fileFormatVersion().eventHistoryTree()) {
1458  history_.reset(new History);
1459  eventHistoryTree_ = dynamic_cast<TTree*>(filePtr_->Get(poolNames::eventHistoryTreeName().c_str()));
1460  if(!eventHistoryTree_) {
1462  << "Failed to find the event history tree.\n";
1463  }
1464  }
1465  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
boost::shared_ptr< History > history_
Definition: RootFile.h:189
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:252
TTree * eventHistoryTree_
Definition: RootFile.h:186
boost::shared_ptr< LuminosityBlockPrincipal > edm::RootFile::readLumi ( boost::shared_ptr< LuminosityBlockPrincipal lbCache)

Definition at line 1381 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), fileFormatVersion(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::InLumi, edm::RootTree::isValid(), edm::IndexIntoFile::kLumi, lumiTree_, makeBranchMapper(), edm::RootTree::makeDelayedReader(), and edm::RootTree::setEntryNumber().

1381  {
1384  // Begin code for backward compatibility before the existence of lumi trees.
1385  if(!lumiTree_.isValid()) {
1387  return lbCache;
1388  }
1389  // End code for backward compatibility before the existence of lumi trees.
1391  lbCache->fillLuminosityBlockPrincipal(makeBranchMapper(lumiTree_, InLumi),
1393  // Read in all the products now.
1394  lbCache->readImmediate();
1396  return lbCache;
1397  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
RootTree lumiTree_
Definition: RootFile.h:177
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
boost::shared_ptr< DelayedReader > makeDelayedReader(FileFormatVersion const &fileFormatVersion, boost::shared_ptr< RootFile > rootFilePtr=boost::shared_ptr< RootFile >()) const
Definition: RootTree.cc:133
bool isValid() const
Definition: RootTree.cc:66
boost::shared_ptr< BranchMapper > makeBranchMapper(RootTree &rootTree, BranchType const &type) const
Definition: RootFile.cc:1637
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
boost::shared_ptr< LuminosityBlockAuxiliary > edm::RootFile::readLuminosityBlockAuxiliary_ ( )

Definition at line 1337 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), eventTree_, fileFormatVersion(), filePtr_, fillLumiAuxiliary(), fillThisEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, edm::Timestamp::invalidTimestamp(), edm::RootTree::isValid(), edm::IndexIntoFile::kLumi, fjr2json::lumi, edm::IndexIntoFile::IndexIntoFileItr::lumi(), edm::LuminosityBlockID::luminosityBlock(), lumiTree_, edm::RootTree::next(), overrideRunNumber(), edm::RootTree::previous(), edm::IndexIntoFile::processHistoryID(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), edm::LuminosityBlockID::run(), edm::IndexIntoFile::IndexIntoFileItr::run(), edm::RootTree::setEntryNumber(), cond::rpcobgas::time, and edm::EventAuxiliary::time().

1337  {
1340  // Begin code for backward compatibility before the existence of lumi trees.
1341  if(!lumiTree_.isValid()) {
1342  if(eventTree_.next()) {
1344  // back up, so event will not be skipped.
1345  eventTree_.previous();
1346  }
1347 
1349  overrideRunNumber(lumi);
1350  return boost::shared_ptr<LuminosityBlockAuxiliary>(new LuminosityBlockAuxiliary(lumi.run(), lumi.luminosityBlock(), eventAux().time(), Timestamp::invalidTimestamp()));
1351  }
1352  // End code for backward compatibility before the existence of lumi trees.
1354  boost::shared_ptr<LuminosityBlockAuxiliary> lumiAuxiliary = fillLumiAuxiliary();
1355  assert(lumiAuxiliary->run() == indexIntoFileIter_.run());
1356  assert(lumiAuxiliary->luminosityBlock() == indexIntoFileIter_.lumi());
1357  overrideRunNumber(lumiAuxiliary->id());
1358  filePtr_->reportInputLumiSection(lumiAuxiliary->run(), lumiAuxiliary->luminosityBlock());
1359 
1360  if(lumiAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1361  // LuminosityBlockAuxiliary did not contain a timestamp. Take it from the next event.
1362  if(eventTree_.next()) {
1364  // back up, so event will not be skipped.
1365  eventTree_.previous();
1366  }
1367  lumiAuxiliary->setBeginTime(eventAux().time());
1368  lumiAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1369  }
1370  if(fileFormatVersion().processHistorySameWithinRun()) {
1372  assert(lumiAuxiliary->processHistoryID() == phid);
1373  } else {
1375  lumiAuxiliary->setProcessHistoryID(phid);
1376  }
1377  return lumiAuxiliary;
1378  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
tuple lumi
Definition: fjr2json.py:41
RootTree lumiTree_
Definition: RootFile.h:177
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
LuminosityBlockNumber_t lumi() const
bool previous()
Definition: RootTree.h:82
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
bool next()
Definition: RootTree.h:81
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
boost::shared_ptr< LuminosityBlockAuxiliary > fillLumiAuxiliary()
Definition: RootFile.cc:1081
ProcessHistoryID const & processHistoryID(int i) const
bool isValid() const
Definition: RootTree.cc:66
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1424
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
void edm::RootFile::readParentageTree ( )
private

Definition at line 444 of file RootFile.cc.

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

Referenced by RootFile().

444  {
445  if(!fileFormatVersion().splitProductIDs()) {
446  // Old format file.
448  return;
449  }
450  // New format file
451  TTree* parentageTree = dynamic_cast<TTree*>(filePtr_->Get(poolNames::parentageTreeName().c_str()));
452  if(!parentageTree)
453  throw Exception(errors::FileReadError) << "Could not find tree " << poolNames::parentageTreeName()
454  << " in the input file.\n";
455 
456  Parentage parentageBuffer;
457  Parentage *pParentageBuffer = &parentageBuffer;
458  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), &pParentageBuffer);
459 
461 
462  for(Long64_t i = 0, numEntries = parentageTree->GetEntries(); i < numEntries; ++i) {
463  roottree::getEntry(parentageTree, i);
464  registry.insertMapped(parentageBuffer);
465  }
466  parentageTree->SetBranchAddress(poolNames::parentageBranchName().c_str(), 0);
467  }
Int_t getEntry(TBranch *branch, EntryNumber entryNumber)
Definition: RootTree.cc:251
int i
Definition: DBlmapReader.cc:9
std::string const & parentageTreeName()
Definition: BranchType.cc:148
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
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:408
std::string const & parentageBranchName()
Definition: BranchType.cc:152
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
static ThreadSafeRegistry * instance()
static Interceptor::Registry registry("Interceptor")
boost::shared_ptr< RunPrincipal > edm::RootFile::readRun_ ( boost::shared_ptr< RunPrincipal rpCache)

Definition at line 1320 of file RootFile.cc.

References fileFormatVersion(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFileEnd_, indexIntoFileIter_, edm::InRun, edm::RootTree::isValid(), edm::IndexIntoFile::kRun, makeBranchMapper(), edm::RootTree::makeDelayedReader(), and runTree_.

1320  {
1323  // Begin code for backward compatibility before the existence of run trees.
1324  if(!runTree_.isValid()) {
1326  return rpCache;
1327  }
1328  // End code for backward compatibility before the existence of run trees.
1330  // Read in all the products now.
1331  rpCache->readImmediate();
1333  return rpCache;
1334  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
RootTree runTree_
Definition: RootFile.h:178
boost::shared_ptr< DelayedReader > makeDelayedReader(FileFormatVersion const &fileFormatVersion, boost::shared_ptr< RootFile > rootFilePtr=boost::shared_ptr< RootFile >()) const
Definition: RootTree.cc:133
bool isValid() const
Definition: RootTree.cc:66
boost::shared_ptr< BranchMapper > makeBranchMapper(RootTree &rootTree, BranchType const &type) const
Definition: RootFile.cc:1637
boost::shared_ptr< RunAuxiliary > edm::RootFile::readRunAuxiliary_ ( )

Definition at line 1278 of file RootFile.cc.

References edm::IndexIntoFile::IndexIntoFileItr::entry(), eventAux(), eventTree_, fileFormatVersion(), filePtr_, fillRunAuxiliary(), fillThisEventAuxiliary(), edm::IndexIntoFile::IndexIntoFileItr::getEntryType(), indexIntoFile_, indexIntoFileEnd_, indexIntoFileIter_, edm::Timestamp::invalidTimestamp(), edm::RootTree::isValid(), edm::IndexIntoFile::kRun, edm::RootTree::next(), overrideRunNumber(), edm::RootTree::previous(), edm::IndexIntoFile::processHistoryID(), edm::IndexIntoFile::IndexIntoFileItr::processHistoryIDIndex(), edm::FileFormatVersion::processHistorySameWithinRun(), edm::RunID::run(), DTTTrigCorrFirst::run, edm::IndexIntoFile::IndexIntoFileItr::run(), runTree_, edm::RootTree::setEntryNumber(), cond::rpcobgas::time, and edm::EventAuxiliary::time().

1278  {
1281  // Begin code for backward compatibility before the existence of run trees.
1282  if(!runTree_.isValid()) {
1283  // prior to the support of run trees.
1284  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1285  if(eventTree_.next()) {
1287  // back up, so event will not be skipped.
1288  eventTree_.previous();
1289  }
1291  overrideRunNumber(run);
1292  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(run.run(), eventAux().time(), Timestamp::invalidTimestamp()));
1293  }
1294  // End code for backward compatibility before the existence of run trees.
1296  boost::shared_ptr<RunAuxiliary> runAuxiliary = fillRunAuxiliary();
1297  assert(runAuxiliary->run() == indexIntoFileIter_.run());
1298  overrideRunNumber(runAuxiliary->id());
1299  filePtr_->reportInputRunNumber(runAuxiliary->run());
1300  if(runAuxiliary->beginTime() == Timestamp::invalidTimestamp()) {
1301  // RunAuxiliary did not contain a valid timestamp. Take it from the next event.
1302  if(eventTree_.next()) {
1304  // back up, so event will not be skipped.
1305  eventTree_.previous();
1306  }
1307  runAuxiliary->setBeginTime(eventAux().time());
1308  runAuxiliary->setEndTime(Timestamp::invalidTimestamp());
1309  }
1312  assert(runAuxiliary->processHistoryID() == phid);
1313  } else {
1314  runAuxiliary->setProcessHistoryID(phid);
1315  }
1316  return runAuxiliary;
1317  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
Timestamp const & time() const
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
boost::shared_ptr< RunAuxiliary > fillRunAuxiliary()
Definition: RootFile.cc:1102
bool previous()
Definition: RootTree.h:82
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
bool next()
Definition: RootTree.h:81
EventAuxiliary const & eventAux() const
Definition: RootFile.h:85
RootTree eventTree_
Definition: RootFile.h:176
Hash< ProcessHistoryType > ProcessHistoryID
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
RootTree runTree_
Definition: RootFile.h:178
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
bool processHistorySameWithinRun() const
ProcessHistoryID const & processHistoryID(int i) const
bool isValid() const
Definition: RootTree.cc:66
void overrideRunNumber(RunID &id)
Definition: RootFile.cc:1424
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
void edm::RootFile::reportOpened ( std::string const &  inputType)

Definition at line 978 of file RootFile.cc.

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

978  {
979  // Report file opened.
980  std::string const label = "source";
981  std::string moduleName = "PoolSource";
982  filePtr_->inputFileOpened(
983  logicalFile_,
984  inputType,
985  moduleName,
986  label,
987  fid_.fid(),
989  }
const std::string & label
Definition: MVAComputer.cc:186
std::vector< std::string > const & branchNames() const
Definition: RootTree.h:89
FileID fid_
Definition: RootFile.h:161
std::string const logicalFile_
Definition: RootFile.h:156
std::string const & fid() const
Definition: FileID.h:19
RootTree eventTree_
Definition: RootFile.h:176
boost::shared_ptr< InputFile > filePtr_
Definition: RootFile.h:158
void edm::RootFile::rewind ( )
inline

Definition at line 106 of file RootFile.h.

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

106  {
108  eventTree_.rewind();
109  lumiTree_.rewind();
110  runTree_.rewind();
111  }
RootTree lumiTree_
Definition: RootFile.h:177
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
RootTree eventTree_
Definition: RootFile.h:176
RootTree runTree_
Definition: RootFile.h:178
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:165
void rewind()
Definition: RootTree.h:84
RootTree const& edm::RootFile::runTree ( ) const
inline

Definition at line 92 of file RootFile.h.

References runTree_.

Referenced by validateFile().

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

Definition at line 1273 of file RootFile.cc.

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

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

Definition at line 1400 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1400  {
1402  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1404  return true;
1405  }
tuple lumi
Definition: fjr2json.py:41
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
RootTree eventTree_
Definition: RootFile.h:176
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:163
IndexIntoFileItr findEventPosition(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
bool edm::RootFile::setEntryAtItem ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi,
EventNumber_t  event 
)
inline

Definition at line 98 of file RootFile.h.

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

98  {
100  }
tuple lumi
Definition: fjr2json.py:41
bool setEntryAtRun(RunNumber_t run)
Definition: RootFile.cc:1416
bool setEntryAtLumi(RunNumber_t run, LuminosityBlockNumber_t lumi)
Definition: RootFile.cc:1408
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:1400
bool edm::RootFile::setEntryAtLumi ( RunNumber_t  run,
LuminosityBlockNumber_t  lumi 
)

Definition at line 1408 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1408  {
1410  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1412  return true;
1413  }
tuple lumi
Definition: fjr2json.py:41
RootTree lumiTree_
Definition: RootFile.h:177
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
IndexIntoFileItr findLumiPosition(RunNumber_t run, LuminosityBlockNumber_t lumi) const
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
bool edm::RootFile::setEntryAtRun ( RunNumber_t  run)

Definition at line 1416 of file RootFile.cc.

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

Referenced by setEntryAtItem().

1416  {
1418  if(indexIntoFileIter_ == indexIntoFileEnd_) return false;
1420  return true;
1421  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFileItr findRunPosition(RunNumber_t run) const
Same as findPosition.
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
RootTree runTree_
Definition: RootFile.h:178
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
void edm::RootFile::setIfFastClonable ( int  remainingEvents,
int  remainingLumis 
)
private

Definition at line 470 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::InputSource::RunsLumisAndEvents, skipAnyEvents_, and whyNotFastClonable_.

Referenced by RootFile().

470  {
471  if(!fileFormatVersion().splitProductIDs()) {
473  return;
474  }
477  return;
478  }
479  // Find entry for first event in file
480  IndexIntoFile::IndexIntoFileItr it = indexIntoFileBegin_;
481  while(it != indexIntoFileEnd_ && it.getEntryType() != IndexIntoFile::kEvent) {
482  ++it;
483  }
484  if(it == indexIntoFileEnd_) {
486  return;
487  }
488 
489  // From here on, record all reasons we can't fast clone.
494  }
495  if(skipAnyEvents_) {
497  }
498  if(remainingEvents >= 0 && eventTree_.entries() > remainingEvents) {
500  }
501  if(remainingLumis >= 0 && lumiTree_.entries() > remainingLumis) {
503  }
504  // We no longer fast copy the EventAuxiliary branch, so there
505  // is no longer any need to disable fast copying because the run
506  // number is being modified. Also, this check did not work anyway
507  // because this function is called before forcedRunOffset_ is set.
508 
509  // if(forcedRunOffset_ != 0) {
510  // whyNotFastClonable_ += FileBlock::RunNumberModified;
511  // }
512  if(duplicateChecker_ &&
513  !duplicateChecker_->checkDisabled() &&
514  !duplicateChecker_->noDuplicatesInFile()) {
516  }
517  }
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
int whyNotFastClonable_
Definition: RootFile.h:172
RootTree lumiTree_
Definition: RootFile.h:177
EntryNumber const & entries() const
Definition: RootTree.h:87
InputSource::ProcessingMode processingMode_
Definition: RootFile.h:183
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
bool noEventSort_
Definition: RootFile.h:171
bool skipAnyEvents_
Definition: RootFile.h:170
RootTree eventTree_
Definition: RootFile.h:176
bool iterationWillBeInEntryOrder(SortOrder sortOrder) const
Used to determine whether or not to disable fast cloning.
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
IndexIntoFile::IndexIntoFileItr indexIntoFileBegin_
Definition: RootFile.h:165
void edm::RootFile::setPosition ( IndexIntoFile::IndexIntoFileItr const &  position)

Definition at line 550 of file RootFile.cc.

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

550  {
552  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
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 112 of file RootFile.h.

References indexIntoFileEnd_, and indexIntoFileIter_.

112  {
114  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
bool edm::RootFile::skipEvents ( int &  offset)

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

1120  {
1121  while (offset > 0 && indexIntoFileIter_ != indexIntoFileEnd_) {
1122 
1123  int phIndexOfSkippedEvent = IndexIntoFile::invalidIndex;
1124  RunNumber_t runOfSkippedEvent = IndexIntoFile::invalidRun;
1127 
1128  indexIntoFileIter_.skipEventForward(phIndexOfSkippedEvent,
1129  runOfSkippedEvent,
1130  lumiOfSkippedEvent,
1131  skippedEventEntry);
1132 
1133  // At the end of the file and there were no more events to skip
1134  if(skippedEventEntry == IndexIntoFile::invalidEntry) break;
1135 
1136  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1137  eventTree_.setEntryNumber(skippedEventEntry);
1139  if(eventSkipperByID_->skipIt(runOfSkippedEvent, lumiOfSkippedEvent, eventAux_.id().event())) {
1140  continue;
1141  }
1142  }
1143  if(duplicateChecker_ &&
1144  !duplicateChecker_->checkDisabled() &&
1145  !duplicateChecker_->noDuplicatesInFile()) {
1146 
1147  eventTree_.setEntryNumber(skippedEventEntry);
1149  if(duplicateChecker_->isDuplicateAndCheckActive(phIndexOfSkippedEvent,
1150  runOfSkippedEvent,
1151  lumiOfSkippedEvent,
1152  eventAux_.id().event(),
1153  file_)) {
1154  continue;
1155  }
1156  }
1157  --offset;
1158  }
1159 
1160  while(offset < 0) {
1161 
1162  if(duplicateChecker_) {
1163  duplicateChecker_->disable();
1164  }
1165 
1166  int phIndexOfEvent = IndexIntoFile::invalidIndex;
1169  EntryNumber_t eventEntry = IndexIntoFile::invalidEntry;
1170 
1171  indexIntoFileIter_.skipEventBackward(phIndexOfEvent,
1172  runOfEvent,
1173  lumiOfEvent,
1174  eventEntry);
1175 
1176  if(eventEntry == IndexIntoFile::invalidEntry) break;
1177 
1178  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
1179  eventTree_.setEntryNumber(eventEntry);
1181  if(eventSkipperByID_->skipIt(runOfEvent, lumiOfEvent, eventAux_.id().event())) {
1182  continue;
1183  }
1184  }
1185  ++offset;
1186  }
1188  }
EventNumber_t event() const
Definition: EventID.h:44
static int const invalidIndex
void fillEventAuxiliary()
Definition: RootFile.cc:1023
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
long long EntryNumber_t
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
static RunNumber_t const invalidRun
void skipEventBackward(int &phIndexOfEvent, RunNumber_t &runOfEvent, LuminosityBlockNumber_t &lumiOfEvent, EntryNumber_t &eventEntry)
RootTree eventTree_
Definition: RootFile.h:176
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:175
void fillThisEventAuxiliary()
Definition: RootFile.cc:1004
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:159
std::string const file_
Definition: RootFile.h:155
void skipEventForward(int &phIndexOfSkippedEvent, RunNumber_t &runOfSkippedEvent, LuminosityBlockNumber_t &lumiOfSkippedEvent, EntryNumber_t &skippedEventEntry)
are no more events in the current run or lumi.
void setEntryNumber(EntryNumber theEntryNumber)
Definition: RootTree.cc:154
bool edm::RootFile::skipThisEntry ( )
private

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

555  {
557  return false;
558  }
559  if(eventSkipperByID_ && eventSkipperByID_->somethingToSkip()) {
560 
561  // See first if the entire lumi or run is skipped, so we won't have to read the event Auxiliary in that case.
563  return true;
564  }
565 
566  // The Lumi is not skipped. If this is an event, see if the event is skipped.
571  eventAux_.id().event())) {
572  return true;
573  }
574  }
575 
576  // Skip runs with no lumis if either lumisToSkip or lumisToProcess have been set to select lumis
578  eventSkipperByID_->skippingLumis()) {
579  IndexIntoFile::IndexIntoFileItr iterLumi = indexIntoFileIter_;
580 
581  // There are no lumis in this run, not even ones we will skip
582  if(iterLumi.peekAheadAtLumi() == IndexIntoFile::invalidLumi) {
583  return true;
584  }
585  // If we get here there are lumis in the run, check to see if we are skipping all of them
586  do {
587  if(!eventSkipperByID_->skipIt(iterLumi.run(), iterLumi.peekAheadAtLumi(), 0U)) {
588  return false;
589  }
590  }
591  while(iterLumi.skipLumiInRun());
592  return true;
593  }
594  }
595  return false;
596  }
EventNumber_t event() const
Definition: EventID.h:44
void fillEventAuxiliary()
Definition: RootFile.cc:1023
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
LuminosityBlockNumber_t lumi() const
IndexIntoFile::IndexIntoFileItr indexIntoFileEnd_
Definition: RootFile.h:166
static LuminosityBlockNumber_t const invalidLumi
EventID const & id() const
EventAuxiliary eventAux_
Definition: RootFile.h:175
boost::shared_ptr< EventSkipperByID > eventSkipperByID_
Definition: RootFile.h:159
RootTreePtrArray& edm::RootFile::treePointers ( )
inlineprivate

Definition at line 129 of file RootFile.h.

References treePointers_.

129 {return treePointers_;}
RootTreePtrArray treePointers_
Definition: RootFile.h:179
void edm::RootFile::validateFile ( bool  secondaryFile,
bool  usingGoToEvent 
)
private

Definition at line 940 of file RootFile.cc.

References edm::createGlobalIdentifier(), 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_, runTree(), edm::IndexIntoFile::setEventFinder(), and edm::IndexIntoFile::setNumberOfEvents().

Referenced by RootFile().

940  {
941  if(!fid_.isValid()) {
942  fid_ = FileID(createGlobalIdentifier());
943  }
944  if(!eventTree_.isValid()) {
946  "'Events' tree is corrupted or not present\n" << "in the input file.\n";
947  }
948 
949  if(fileFormatVersion().hasIndexIntoFile()) {
950  if(runTree().entries() > 0) {
951  assert(!indexIntoFile_.empty());
952  }
953  }
954  else {
955  assert(indexIntoFile_.empty());
957  }
958 
961  indexIntoFile_.setEventFinder(boost::shared_ptr<IndexIntoFile::EventFinder>(new RootFileEventFinder(eventTree_)));
962  // We fill the event numbers explicitly if we need to find events in closed files,
963  // such as for secondary files (or secondary sources) or if duplicate checking across files.
964  bool needEventNumbers = false;
965  bool needIndexesForDuplicateChecker = duplicateChecker_ && duplicateChecker_->checkingAllFiles() && !duplicateChecker_->checkDisabled();
966  if(secondaryFile || needIndexesForDuplicateChecker || usingGoToEvent) {
967  needEventNumbers = true;
968  }
969  bool needEventEntries = false;
970  if(secondaryFile || !noEventSort_) {
971  // We need event entries for sorting or for secondary files or sources.
972  needEventEntries = true;
973  }
974  indexIntoFile_.fillEventNumbersOrEntries(needEventNumbers, needEventEntries);
975  }
void fillEventNumbersOrEntries(bool needEventNumbers, bool needEventEntries) const
FileFormatVersion fileFormatVersion() const
Definition: RootFile.h:93
bool empty() const
True if no runs, lumis, or events are in the file.
EntryNumber const & entries() const
Definition: RootTree.h:87
FileID fid_
Definition: RootFile.h:161
boost::shared_ptr< DuplicateChecker > duplicateChecker_
Definition: RootFile.h:191
bool noEventSort_
Definition: RootFile.h:171
RootTree const & runTree() const
Definition: RootFile.h:92
RootTree eventTree_
Definition: RootFile.h:176
bool isValid() const
Definition: FileID.h:18
IndexIntoFile & indexIntoFile_
Definition: RootFile.h:163
void fixIndexes(std::vector< ProcessHistoryID > &processHistoryIDs)
bool isValid() const
Definition: RootTree.cc:66
void setEventFinder(boost::shared_ptr< EventFinder > ptr) const
void fillIndexIntoFile()
Definition: RootFile.cc:721
std::vector< ProcessHistoryID > & orderedProcessHistoryIDs_
Definition: RootFile.h:164
void setNumberOfEvents(EntryNumber_t nevents) const
std::string createGlobalIdentifier()
bool edm::RootFile::wasFirstEventJustRead ( ) const

Definition at line 658 of file RootFile.cc.

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

658  {
659  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
660  int phIndex;
663  IndexIntoFile::EntryNumber_t eventEntry;
664  itr.skipEventBackward(phIndex,
665  run,
666  lumi,
667  eventEntry);
668  itr.skipEventBackward(phIndex,
669  run,
670  lumi,
671  eventEntry);
672  return eventEntry == IndexIntoFile::invalidEntry;
673  }
tuple lumi
Definition: fjr2json.py:41
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
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 651 of file RootFile.cc.

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

651  {
652  IndexIntoFile::IndexIntoFileItr itr(indexIntoFileIter_);
653  itr.advanceToEvent();
654  return itr.getEntryType() == IndexIntoFile::kEnd;
655  }
IndexIntoFile::IndexIntoFileItr indexIntoFileIter_
Definition: RootFile.h:167
int edm::RootFile::whyNotFastClonable ( ) const
inline

Definition at line 94 of file RootFile.h.

References whyNotFastClonable_.

Referenced by createFileBlock().

94 {return whyNotFastClonable_;}
int whyNotFastClonable_
Definition: RootFile.h:172

Member Data Documentation

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

Definition at line 190 of file RootFile.h.

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

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

Definition at line 182 of file RootFile.h.

Referenced by branchIDLists(), and RootFile().

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

Definition at line 188 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

bool edm::RootFile::branchListIndexesUnchanged_
private

Definition at line 174 of file RootFile.h.

Referenced by branchListIndexesUnchanged(), and RootFile().

boost::shared_ptr<DuplicateChecker> edm::RootFile::duplicateChecker_
private
EventAuxiliary edm::RootFile::eventAux_
private
TTree* edm::RootFile::eventHistoryTree_
private

Definition at line 186 of file RootFile.h.

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

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

Definition at line 168 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 169 of file RootFile.h.

Referenced by fillHistory(), and RootFile().

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

Definition at line 187 of file RootFile.h.

Referenced by fillHistory(), and readCurrentEvent().

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

Definition at line 159 of file RootFile.h.

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

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

Definition at line 161 of file RootFile.h.

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

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

Definition at line 155 of file RootFile.h.

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

FileFormatVersion edm::RootFile::fileFormatVersion_
private

Definition at line 160 of file RootFile.h.

Referenced by fileFormatVersion(), and RootFile().

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

Definition at line 184 of file RootFile.h.

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

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

Definition at line 173 of file RootFile.h.

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

boost::shared_ptr<History> edm::RootFile::history_
private

Definition at line 189 of file RootFile.h.

Referenced by fillHistory(), and readEventHistoryTree().

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

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

Referenced by indexIntoFileSharedPtr().

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

Definition at line 180 of file RootFile.h.

Referenced by fillIndexIntoFile(), and fillThisEventAuxiliary().

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

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

Referenced by newBranchToOldBranch(), and RootFile().

bool edm::RootFile::noEventSort_
private

Definition at line 171 of file RootFile.h.

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

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

Definition at line 164 of file RootFile.h.

Referenced by validateFile().

ProcessConfiguration const& edm::RootFile::processConfiguration_
private

Definition at line 157 of file RootFile.h.

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

Definition at line 183 of file RootFile.h.

Referenced by getNextEntryTypeWanted(), and setIfFastClonable().

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

Definition at line 181 of file RootFile.h.

Referenced by makeBranchMapper(), productRegistry(), and RootFile().

boost::shared_ptr<ProvenanceAdaptor> edm::RootFile::provenanceAdaptor_
private

Definition at line 192 of file RootFile.h.

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

RootTree edm::RootFile::runTree_
private
bool edm::RootFile::skipAnyEvents_
private

Definition at line 170 of file RootFile.h.

Referenced by setIfFastClonable().

RootTreePtrArray edm::RootFile::treePointers_
private

Definition at line 179 of file RootFile.h.

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

int edm::RootFile::whyNotFastClonable_
private

Definition at line 172 of file RootFile.h.

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