CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends
fwlite::Event Class Reference

#include <Event.h>

Inheritance diagram for fwlite::Event:
fwlite::EventBase edm::EventBase

Public Member Functions

bool atEnd () const override
 
Long64_t draw (char const *varexp, char const *selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
 
Long64_t draw (char const *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
 
void draw (Option_t *opt)
 Properly setup for edm::Ref, etc and then call TTree method. More...
 
 Event (TFile *iFile, bool useCache=true, std::function< void(TBranch const &)> baFunc=[](TBranch const &) {})
 
edm::EventAuxiliary const & eventAuxiliary () const override
 
std::vector< edm::BranchDescription > const & getBranchDescriptions () const
 
const std::string getBranchNameFor (std::type_info const &, char const *iModuleLabel, char const *iProductInstanceLabel, char const *iProcessName) const override
 Return the branch name in the TFile which contains the data. More...
 
bool getByLabel (std::type_info const &, char const *, char const *, char const *, void *) const override
 This function should only be called by fwlite::Handle<> More...
 
edm::WrapperBase const * getByProductID (edm::ProductID const &) const override
 
fwlite::LuminosityBlock const & getLuminosityBlock () const
 
std::vector< std::string > const & getProcessHistory () const
 
fwlite::Run const & getRun () const
 
TFile * getTFile () const
 
edm::WrapperBase const * getThinnedProduct (edm::ProductID const &pid, unsigned int &key) const
 
void getThinnedProducts (edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const
 
Long64_t indexFromEventId (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 Find index of given event-id. More...
 
bool isValid () const
 
 operator bool () const
 
Event const & operator++ () override
 Advance to next event in the TFile. More...
 
edm::ParameterSet const * parameterSet (edm::ParameterSetID const &psID) const override
 
edm::ProcessHistory const & processHistory () const override
 
Long64_t scan (char const *varexp="", char const *selection="", Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
 
Long64_t size () const
 Returns number of events in the file. More...
 
bool to (const edm::EventID &id)
 Go to event by Run & Event number. More...
 
bool to (edm::RunNumber_t run, edm::EventNumber_t event)
 
bool to (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 
bool to (Long64_t iIndex)
 Go to the event at index iIndex. More...
 
Event const & toBegin () override
 Go to the very first Event. More...
 
edm::TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const override
 
edm::TriggerResultsByName triggerResultsByName (edm::TriggerResults const &triggerResults) const override
 
 ~Event () override
 
- Public Member Functions inherited from fwlite::EventBase
 EventBase ()
 
virtual Long64_t fileIndex () const
 
virtual Long64_t secondaryFileIndex () const
 
 ~EventBase () override
 
- Public Member Functions inherited from edm::EventBase
int bunchCrossing () const
 
 EventBase ()
 
edm::EventAuxiliary::ExperimentType experimentType () const
 
template<typename T >
bool get (ProductID const &, Handle< T > &) const
 
template<>
bool getByLabel (edm::InputTag const &tag, Handle< FWGenericObject > &result) const
 Specialize the getByLabel method to work with a Handle<FWGenericObject> More...
 
template<typename T >
bool getByLabel (InputTag const &, Handle< T > &) const
 
edm::EventID id () const
 
bool isRealData () const
 
edm::LuminosityBlockNumber_t luminosityBlock () const
 
int orbitNumber () const
 
edm::Timestamp time () const
 

Static Public Member Functions

static void throwProductNotFoundException (std::type_info const &, char const *, char const *, char const *)
 

Private Member Functions

 Event (Event const &)=delete
 
void fillParameterSetRegistry () const
 
edm::ProcessHistory const & history () const
 
Event const & operator= (Event const &)=delete
 
void setGetter (std::shared_ptr< edm::EDProductGetter const > getter)
 
void updateAux (Long_t eventIndex) const
 

Private Attributes

edm::EventAuxiliary aux_
 
TBranch * auxBranch_
 
fwlite::BranchMapReader branchMap_
 
fwlite::DataGetterHelper dataHelper_
 
EntryFinder entryFinder_
 
TTree * eventHistoryTree_
 
std::vector< edm::EventProcessHistoryIDeventProcessHistoryIDs_
 
TFile * file_
 
int fileVersion_
 
edm::ProcessHistoryMap historyMap_
 
std::vector< char const * > labels_
 
std::shared_ptr< fwlite::LuminosityBlocklumi_
 
bool parameterSetRegistryFilled_
 
edm::EventAuxiliary const * pAux_
 
edm::EventAux const * pOldAux_
 
std::vector< std::string > procHistoryNames_
 
std::shared_ptr< fwlite::Runrun_
 
std::shared_ptr< RunFactoryrunFactory_
 

Friends

class ChainEvent
 
class EventHistoryGetter
 
class internal::ProductGetter
 

Additional Inherited Members

- Static Protected Member Functions inherited from edm::EventBase
static edm::ParameterSet const * parameterSetForID_ (edm::ParameterSetID const &psID)
 
static TriggerNames const * triggerNames_ (edm::TriggerResults const &triggerResults)
 

Detailed Description

Definition at line 87 of file Event.h.

Constructor & Destructor Documentation

◆ Event() [1/2]

Event::Event ( TFile *  iFile,
bool  useCache = true,
std::function< void(TBranch const &)>  baFunc = [](TBranch const&) {} 
)

Definition at line 101 of file Event.cc.

102  : file_(iFile),
103  // eventTree_(nullptr),
104  eventHistoryTree_(nullptr),
105  // eventIndex_(-1),
106  branchMap_(iFile),
107  pAux_(&aux_),
108  pOldAux_(nullptr),
109  fileVersion_(-1),
112  std::make_shared<EventHistoryGetter>(this),
113  std::shared_ptr<BranchMapReader>(&branchMap_, NoDelete()),
114  std::make_shared<internal::ProductGetter>(this),
115  useCache,
116  baFunc) {
117  if (nullptr == iFile) {
118  throw cms::Exception("NoFile") << "The TFile pointer passed to the constructor was null";
119  }
120 
121  if (nullptr == branchMap_.getEventTree()) {
122  throw cms::Exception("NoEventTree") << "The TFile contains no TTree named " << edm::poolNames::eventTreeName();
123  }
124  //need to know file version in order to determine how to read the basic event info
126 
127  //got this logic from IOPool/Input/src/RootFile.cc
128 
129  TTree* eventTree = branchMap_.getEventTree();
130  if (fileVersion_ >= 3) {
131  auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxiliaryBranchName(edm::InEvent).c_str());
132  if (nullptr == auxBranch_) {
133  throw cms::Exception("NoEventAuxilliary")
134  << "The TTree " << edm::poolNames::eventTreeName() << " does not contain a branch named 'EventAuxiliary'";
135  }
136  auxBranch_->SetAddress(&pAux_);
137  } else {
138  pOldAux_ = new edm::EventAux();
139  auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxBranchName(edm::InEvent).c_str());
140  if (nullptr == auxBranch_) {
141  throw cms::Exception("NoEventAux")
142  << "The TTree " << edm::poolNames::eventTreeName() << " does not contain a branch named 'EventAux'";
143  }
144  auxBranch_->SetAddress(&pOldAux_);
145  }
147 
148  if (fileVersion_ >= 7 && fileVersion_ < 17) {
149  eventHistoryTree_ = dynamic_cast<TTree*>(iFile->Get(edm::poolNames::eventHistoryTreeName().c_str()));
150  }
151  runFactory_ = std::make_shared<RunFactory>();
152  }

References auxBranch_, branchMap_, edm::BranchTypeToAuxBranchName(), edm::BranchTypeToAuxiliaryBranchName(), eventHistoryTree_, edm::poolNames::eventHistoryTreeName(), edm::poolNames::eventTreeName(), Exception, fileVersion_, fwlite::BranchMapReader::getEventTree(), fwlite::BranchMapReader::getFileVersion(), edm::InEvent, pAux_, pOldAux_, runFactory_, and fwlite::BranchMapReader::updateEvent().

◆ ~Event()

Event::~Event ( )
override

Definition at line 159 of file Event.cc.

159  {
160  for (auto const& label : labels_) {
161  delete[] label;
162  }
163  delete pOldAux_;
164  }

References label, labels_, and pOldAux_.

◆ Event() [2/2]

fwlite::Event::Event ( Event const &  )
privatedelete

Member Function Documentation

◆ atEnd()

bool Event::atEnd ( ) const
overridevirtual

Implements fwlite::EventBase.

Definition at line 254 of file Event.cc.

254  {
255  Long_t eventIndex = branchMap_.getEventEntry();
256  return eventIndex == -1 or eventIndex == size();
257  }

References branchMap_, fwlite::BranchMapReader::getEventEntry(), or, and size().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), FWFileEntry::filterEventsWithCustomParser(), and getByLabel().

◆ draw() [1/3]

Long64_t Event::draw ( char const *  varexp,
char const *  selection,
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

◆ draw() [2/3]

Long64_t Event::draw ( char const *  varexp,
const TCut &  selection,
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

◆ draw() [3/3]

void Event::draw ( Option_t *  opt)

Properly setup for edm::Ref, etc and then call TTree method.

Definition at line 225 of file Event.cc.

225  {
226  GetterOperate op(dataHelper_.getter());
227  branchMap_.getEventTree()->Draw(opt);
228  }

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventTree(), fwlite::DataGetterHelper::getter(), and runTheMatrix::opt.

◆ eventAuxiliary()

edm::EventAuxiliary const & Event::eventAuxiliary ( ) const
overridevirtual

Implements edm::EventBase.

Definition at line 287 of file Event.cc.

287  {
288  Long_t eventIndex = branchMap_.getEventEntry();
289  updateAux(eventIndex);
290  return aux_;
291  }

References aux_, branchMap_, fwlite::BranchMapReader::getEventEntry(), and updateAux().

Referenced by getLuminosityBlock(), and getRun().

◆ fillParameterSetRegistry()

void Event::fillParameterSetRegistry ( ) const
private

Definition at line 397 of file Event.cc.

397  {
399  return;
401 
402  TTree* meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
403  if (nullptr == meta) {
404  throw cms::Exception("NoMetaTree") << "The TFile does not contain a TTree named "
406  }
407 
408  edm::FileFormatVersion fileFormatVersion;
409  edm::FileFormatVersion* fftPtr = &fileFormatVersion;
410  if (meta->FindBranch(edm::poolNames::fileFormatVersionBranchName().c_str()) != nullptr) {
411  TBranch* fft = meta->GetBranch(edm::poolNames::fileFormatVersionBranchName().c_str());
412  fft->SetAddress(&fftPtr);
413  fft->GetEntry(0);
414  }
415 
416  typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
417  PsetMap psetMap;
418  TTree* psetTree(nullptr);
419  if (meta->FindBranch(edm::poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
420  PsetMap* psetMapPtr = &psetMap;
421  TBranch* b = meta->GetBranch(edm::poolNames::parameterSetMapBranchName().c_str());
422  b->SetAddress(&psetMapPtr);
423  b->GetEntry(0);
424  } else if (nullptr == (psetTree = dynamic_cast<TTree*>(
426  throw cms::Exception("NoParameterSetMapTree")
427  << "The TTree " << edm::poolNames::parameterSetsTreeName() << " could not be found in the file.";
428  } else {
429  typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
430  IdToBlobs idToBlob;
431  IdToBlobs* pIdToBlob = &idToBlob;
432  psetTree->SetBranchAddress(edm::poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
433  for (long long i = 0; i != psetTree->GetEntries(); ++i) {
434  psetTree->GetEntry(i);
435  psetMap.insert(idToBlob);
436  }
437  }
439  if (!fileFormatVersion.triggerPathsTracked()) {
440  edm::ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion.parameterSetsByReference());
441  } else {
442  // Merge into the parameter set registry.
444  for (auto const& item : psetMap) {
445  edm::ParameterSet pset(item.second.pset());
446  pset.setID(item.first);
447  psetRegistry.insertMapped(pset);
448  }
449  }
450  }

References b, branchMap_, Exception, edm::poolNames::fileFormatVersionBranchName(), fwlite::BranchMapReader::getFile(), mps_fire::i, edm::poolNames::idToParameterSetBlobsBranchName(), edm::pset::Registry::insertMapped(), edm::pset::Registry::instance(), B2GTnPMonitor_cfi::item, edm::poolNames::metaDataTreeName(), edm::poolNames::parameterSetMapBranchName(), parameterSetRegistryFilled_, edm::FileFormatVersion::parameterSetsByReference(), edm::poolNames::parameterSetsTreeName(), muonDTDigis_cfi::pset, and edm::FileFormatVersion::triggerPathsTracked().

Referenced by parameterSet(), triggerNames(), and triggerResultsByName().

◆ getBranchDescriptions()

std::vector<edm::BranchDescription> const& fwlite::Event::getBranchDescriptions ( ) const
inline

◆ getBranchNameFor()

const std::string Event::getBranchNameFor ( std::type_info const &  iInfo,
char const *  iModuleLabel,
char const *  iProductInstanceLabel,
char const *  iProcessName 
) const
overridevirtual

Return the branch name in the TFile which contains the data.

Implements fwlite::EventBase.

Definition at line 268 of file Event.cc.

271  {
272  return dataHelper_.getBranchNameFor(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel);
273  }

References dataHelper_, and fwlite::DataGetterHelper::getBranchNameFor().

Referenced by FWFileEntry::getBranchName(), and FWFileEntry::runFilter().

◆ getByLabel()

bool Event::getByLabel ( std::type_info const &  iInfo,
char const *  iModuleLabel,
char const *  iProductInstanceLabel,
char const *  iProcessLabel,
void *  oData 
) const
overridevirtual

This function should only be called by fwlite::Handle<>

Implements fwlite::EventBase.

Definition at line 275 of file Event.cc.

279  {
280  if (atEnd()) {
281  throw cms::Exception("OffEnd") << "You have requested data past the last event";
282  }
283  Long_t eventIndex = branchMap_.getEventEntry();
284  return dataHelper_.getByLabel(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel, oData, eventIndex);
285  }

References atEnd(), branchMap_, dataHelper_, Exception, fwlite::DataGetterHelper::getByLabel(), and fwlite::BranchMapReader::getEventEntry().

◆ getByProductID()

edm::WrapperBase const * Event::getByProductID ( edm::ProductID const &  iID) const
overridevirtual

Implements fwlite::EventBase.

Definition at line 364 of file Event.cc.

364  {
365  Long_t eventEntry = branchMap_.getEventEntry();
366  return dataHelper_.getByProductID(iID, eventEntry);
367  }

References branchMap_, dataHelper_, fwlite::DataGetterHelper::getByProductID(), and fwlite::BranchMapReader::getEventEntry().

Referenced by fwlite::internal::ProductGetter::getIt().

◆ getLuminosityBlock()

fwlite::LuminosityBlock const & Event::getLuminosityBlock ( ) const

Definition at line 484 of file Event.cc.

484  {
485  if (not lumi_) {
486  // Branch map pointer not really being shared, owned by event, have to trick Lumi
487  lumi_ = std::make_shared<fwlite::LuminosityBlock>(std::shared_ptr<BranchMapReader>(&branchMap_, NoDelete()),
488  runFactory_);
489  }
492  lumi_->to(run, lumi);
493  return *lumi_;
494  }

References branchMap_, eventAuxiliary(), lumi_, edm::EventAuxiliary::luminosityBlock(), writedatasetfile::run, edm::EventAuxiliary::run(), and runFactory_.

◆ getProcessHistory()

std::vector< std::string > const & Event::getProcessHistory ( ) const

Definition at line 259 of file Event.cc.

259  {
260  if (procHistoryNames_.empty()) {
261  for (auto const& proc : history()) {
262  procHistoryNames_.push_back(proc.processName());
263  }
264  }
265  return procHistoryNames_;
266  }

References history(), ValidateTausOnZEEFastSim_cff::proc, and procHistoryNames_.

Referenced by FWLiteJobMetadataManager::doUpdate().

◆ getRun()

fwlite::Run const & Event::getRun ( ) const

Definition at line 496 of file Event.cc.

496  {
497  run_ = runFactory_->makeRun(std::shared_ptr<BranchMapReader>(&branchMap_, NoDelete()));
499  run_->to(run);
500  return *run_;
501  }

References branchMap_, eventAuxiliary(), writedatasetfile::run, edm::EventAuxiliary::run(), run_, and runFactory_.

Referenced by FWMagField::checkFieldInfo().

◆ getTFile()

TFile* fwlite::Event::getTFile ( ) const
inline

Definition at line 161 of file Event.h.

161 { return branchMap_.getFile(); }

References branchMap_, and fwlite::BranchMapReader::getFile().

◆ getThinnedProduct()

edm::WrapperBase const * Event::getThinnedProduct ( edm::ProductID const &  pid,
unsigned int &  key 
) const

◆ getThinnedProducts()

void Event::getThinnedProducts ( edm::ProductID const &  pid,
std::vector< edm::WrapperBase const * > &  foundContainers,
std::vector< unsigned int > &  keys 
) const

Definition at line 374 of file Event.cc.

376  {
377  Long_t eventEntry = branchMap_.getEventEntry();
378  return dataHelper_.getThinnedProducts(pid, foundContainers, keys, eventEntry);
379  }

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventEntry(), fwlite::DataGetterHelper::getThinnedProducts(), and relativeConstraints::keys.

Referenced by fwlite::internal::ProductGetter::getThinnedProducts().

◆ history()

const edm::ProcessHistory & Event::history ( ) const
private

Definition at line 303 of file Event.cc.

303  {
304  edm::ProcessHistoryID processHistoryID;
305 
306  bool newFormat = (fileVersion_ >= 5);
307 
308  Long_t eventIndex = branchMap_.getEventEntry();
309  updateAux(eventIndex);
310  if (!newFormat) {
311  processHistoryID = aux_.processHistoryID();
312  }
313  if (historyMap_.empty() || newFormat) {
314  procHistoryNames_.clear();
315  TTree* meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
316  if (nullptr == meta) {
317  throw cms::Exception("NoMetaTree")
318  << "The TFile does not appear to contain a TTree named " << edm::poolNames::metaDataTreeName();
319  }
320  if (historyMap_.empty()) {
321  if (fileVersion_ < 11) {
323  TBranch* b = meta->GetBranch(edm::poolNames::processHistoryMapBranchName().c_str());
324  b->SetAddress(&pPhm);
325  b->GetEntry(0);
326  } else {
327  edm::ProcessHistoryVector historyVector;
328  edm::ProcessHistoryVector* pPhv = &historyVector;
329  TBranch* b = meta->GetBranch(edm::poolNames::processHistoryBranchName().c_str());
330  b->SetAddress(&pPhv);
331  b->GetEntry(0);
332  for (auto& history : historyVector) {
333  historyMap_.insert(std::make_pair(history.setProcessHistoryID(), history));
334  }
335  }
336  }
337  if (newFormat) {
338  if (fileVersion_ >= 17) {
339  processHistoryID = aux_.processHistoryID();
340  } else if (fileVersion_ >= 7) {
342  edm::History* pHistory = &history;
343  TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
344  if (!eventHistoryBranch)
345  throw edm::Exception(edm::errors::FatalRootError) << "Failed to find history branch in event history tree";
346  eventHistoryBranch->SetAddress(&pHistory);
347  eventHistoryTree_->GetEntry(eventIndex);
348  processHistoryID = history.processHistoryID();
349  } else {
350  std::vector<edm::EventProcessHistoryID>* pEventProcessHistoryIDs = &eventProcessHistoryIDs_;
351  TBranch* b = meta->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
352  b->SetAddress(&pEventProcessHistoryIDs);
353  b->GetEntry(0);
355  processHistoryID = std::lower_bound(eventProcessHistoryIDs_.begin(), eventProcessHistoryIDs_.end(), target)
356  ->processHistoryID();
357  }
358  }
359  }
360 
361  return historyMap_[processHistoryID];
362  }

References aux_, b, branchMap_, edm::poolNames::eventHistoryBranchName(), eventHistoryTree_, eventProcessHistoryIDs_, Exception, edm::errors::FatalRootError, fileVersion_, fwlite::BranchMapReader::getEventEntry(), fwlite::BranchMapReader::getFile(), historyMap_, edm::EventAuxiliary::id(), cuda_std::lower_bound(), edm::poolNames::metaDataTreeName(), edm::poolNames::processHistoryBranchName(), edm::EventAuxiliary::processHistoryID(), edm::poolNames::processHistoryMapBranchName(), procHistoryNames_, edm::ProcessHistory::setProcessHistoryID(), filterCSVwithJSON::target, and updateAux().

Referenced by getProcessHistory(), fwlite::EventHistoryGetter::history(), and processHistory().

◆ indexFromEventId()

Long64_t Event::indexFromEventId ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)

◆ isValid()

bool Event::isValid ( void  ) const

Definition at line 247 of file Event.cc.

247  {
248  Long_t eventIndex = branchMap_.getEventEntry();
249  return eventIndex != -1 and eventIndex < size();
250  }

References branchMap_, fwlite::BranchMapReader::getEventEntry(), and size().

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ operator bool()

Event::operator bool ( ) const

Definition at line 252 of file Event.cc.

252 { return isValid(); }

◆ operator++()

Event const & Event::operator++ ( )
overridevirtual

Advance to next event in the TFile.

Implements fwlite::EventBase.

Definition at line 181 of file Event.cc.

181  {
182  Long_t eventIndex = branchMap_.getEventEntry();
183  if (eventIndex < size()) {
184  branchMap_.updateEvent(++eventIndex);
185  }
186  return *this;
187  }

References branchMap_, fwlite::BranchMapReader::getEventEntry(), size(), and fwlite::BranchMapReader::updateEvent().

◆ operator=()

Event const& fwlite::Event::operator= ( Event const &  )
privatedelete

◆ parameterSet()

edm::ParameterSet const * Event::parameterSet ( edm::ParameterSetID const &  psID) const
overridevirtual

Implements edm::EventBase.

Definition at line 452 of file Event.cc.

452  {
455  }
456  return parameterSetForID_(psID);
457  }

References fillParameterSetRegistry(), edm::EventBase::parameterSetForID_(), and parameterSetRegistryFilled_.

◆ processHistory()

edm::ProcessHistory const& fwlite::Event::processHistory ( ) const
inlineoverridevirtual

Implements edm::EventBase.

Definition at line 175 of file Event.h.

175 { return history(); }

References history().

◆ scan()

Long64_t Event::scan ( char const *  varexp = "",
char const *  selection = "",
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

◆ setGetter()

void fwlite::Event::setGetter ( std::shared_ptr< edm::EDProductGetter const >  getter)
inlineprivate

Definition at line 195 of file Event.h.

195 { return dataHelper_.setGetter(getter); }

References dataHelper_, and fwlite::DataGetterHelper::setGetter().

◆ size()

Long64_t Event::size ( void  ) const

◆ throwProductNotFoundException()

void Event::throwProductNotFoundException ( std::type_info const &  iType,
char const *  iModule,
char const *  iProduct,
char const *  iProcess 
)
static

Definition at line 471 of file Event.cc.

474  {
475  edm::TypeID type(iType);
477  << "A branch was found for \n type ='" << type.className() << "'\n module='" << iModule
478  << "'\n productInstance='" << ((nullptr != iProduct) ? iProduct : "") << "'\n process='"
479  << ((nullptr != iProcess) ? iProcess : "")
480  << "'\n"
481  "but no data is available for this Event";
482  }

References Exception, and edm::errors::ProductNotFound.

Referenced by fwlite::ChainEvent::throwProductNotFoundException().

◆ to() [1/4]

bool Event::to ( const edm::EventID id)

Go to event by Run & Event number.

Definition at line 215 of file Event.cc.

215 { return to(id.run(), id.luminosityBlock(), id.event()); }

References event(), edm::EventBase::luminosityBlock(), writedatasetfile::run, and to().

◆ to() [2/4]

bool Event::to ( edm::RunNumber_t  run,
edm::EventNumber_t  event 
)

Definition at line 204 of file Event.cc.

204 { return to(run, 0U, event); }

References writedatasetfile::run, to(), and mitigatedMETSequence_cff::U.

◆ to() [3/4]

bool Event::to ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)

◆ to() [4/4]

bool Event::to ( Long64_t  iIndex)

Go to the event at index iIndex.

Definition at line 195 of file Event.cc.

195  {
196  if (iEntry < size()) {
197  // this is a valid entry
198  return branchMap_.updateEvent(iEntry);
199  }
200  // if we're here, then iEntry was not valid
201  return false;
202  }

References branchMap_, size(), and fwlite::BranchMapReader::updateEvent().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), FWFileEntry::filterEventsWithCustomParser(), and to().

◆ toBegin()

Event const & Event::toBegin ( )
overridevirtual

Go to the very first Event.

Implements fwlite::EventBase.

Definition at line 217 of file Event.cc.

217  {
219  return *this;
220  }

References branchMap_, and fwlite::BranchMapReader::updateEvent().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), and FWFileEntry::filterEventsWithCustomParser().

◆ triggerNames()

edm::TriggerNames const & Event::triggerNames ( edm::TriggerResults const &  triggerResults) const
overridevirtual

Implements edm::EventBase.

Definition at line 381 of file Event.cc.

381  {
383  if (names != nullptr)
384  return *names;
385 
389  }
390  if (names != nullptr)
391  return *names;
392 
393  throw cms::Exception("TriggerNamesNotFound") << "TriggerNames not found in ParameterSet registry";
394  return *names;
395  }

References Exception, fillParameterSetRegistry(), names, parameterSetRegistryFilled_, edm::EventBase::triggerNames_(), and triggerResults.

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), and FWFileEntry::filterEventsWithCustomParser().

◆ triggerResultsByName()

edm::TriggerResultsByName Event::triggerResultsByName ( edm::TriggerResults const &  triggerResults) const
overridevirtual

◆ updateAux()

void Event::updateAux ( Long_t  eventIndex) const
private

Definition at line 293 of file Event.cc.

293  {
294  if (auxBranch_->GetEntryNumber() != eventIndex) {
295  auxBranch_->GetEntry(eventIndex);
296  //handling dealing with old version
297  if (nullptr != pOldAux_) {
299  }
300  }
301  }

References aux_, auxBranch_, edm::conversion(), and pOldAux_.

Referenced by eventAuxiliary(), and history().

Friends And Related Function Documentation

◆ ChainEvent

friend class ChainEvent
friend

Definition at line 185 of file Event.h.

◆ EventHistoryGetter

friend class EventHistoryGetter
friend

Definition at line 186 of file Event.h.

◆ internal::ProductGetter

friend class internal::ProductGetter
friend

Definition at line 184 of file Event.h.

Member Data Documentation

◆ aux_

edm::EventAuxiliary fwlite::Event::aux_
mutableprivate

Definition at line 212 of file Event.h.

Referenced by eventAuxiliary(), history(), and updateAux().

◆ auxBranch_

TBranch* fwlite::Event::auxBranch_
private

Definition at line 216 of file Event.h.

Referenced by Event(), and updateAux().

◆ branchMap_

fwlite::BranchMapReader fwlite::Event::branchMap_
mutableprivate

◆ dataHelper_

fwlite::DataGetterHelper fwlite::Event::dataHelper_
private

◆ entryFinder_

EntryFinder fwlite::Event::entryFinder_
mutableprivate

Definition at line 213 of file Event.h.

Referenced by indexFromEventId(), and to().

◆ eventHistoryTree_

TTree* fwlite::Event::eventHistoryTree_
private

Definition at line 201 of file Event.h.

Referenced by Event(), and history().

◆ eventProcessHistoryIDs_

std::vector<edm::EventProcessHistoryID> fwlite::Event::eventProcessHistoryIDs_
mutableprivate

Definition at line 210 of file Event.h.

Referenced by history().

◆ file_

TFile* fwlite::Event::file_
mutableprivate

Definition at line 199 of file Event.h.

◆ fileVersion_

int fwlite::Event::fileVersion_
private

Definition at line 217 of file Event.h.

Referenced by Event(), and history().

◆ historyMap_

edm::ProcessHistoryMap fwlite::Event::historyMap_
mutableprivate

Definition at line 209 of file Event.h.

Referenced by history().

◆ labels_

std::vector<char const*> fwlite::Event::labels_
mutableprivate

Definition at line 208 of file Event.h.

Referenced by ~Event().

◆ lumi_

std::shared_ptr<fwlite::LuminosityBlock> fwlite::Event::lumi_
mutableprivate

Definition at line 203 of file Event.h.

Referenced by getLuminosityBlock().

◆ parameterSetRegistryFilled_

bool fwlite::Event::parameterSetRegistryFilled_
mutableprivate

◆ pAux_

edm::EventAuxiliary const* fwlite::Event::pAux_
private

Definition at line 214 of file Event.h.

Referenced by Event().

◆ pOldAux_

edm::EventAux const* fwlite::Event::pOldAux_
private

Definition at line 215 of file Event.h.

Referenced by Event(), updateAux(), and ~Event().

◆ procHistoryNames_

std::vector<std::string> fwlite::Event::procHistoryNames_
mutableprivate

Definition at line 211 of file Event.h.

Referenced by getProcessHistory(), and history().

◆ run_

std::shared_ptr<fwlite::Run> fwlite::Event::run_
mutableprivate

Definition at line 204 of file Event.h.

Referenced by getRun().

◆ runFactory_

std::shared_ptr<RunFactory> fwlite::Event::runFactory_
mutableprivate

Definition at line 221 of file Event.h.

Referenced by Event(), getLuminosityBlock(), and getRun().

edm::poolNames::idToParameterSetBlobsBranchName
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:216
edm::pset::Registry::instance
static Registry * instance()
Definition: Registry.cc:12
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
mps_fire.i
i
Definition: mps_fire.py:355
edm::poolNames::fileFormatVersionBranchName
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:192
edm::conversion
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
edm::poolNames::eventTreeName
std::string const & eventTreeName()
Definition: BranchType.cc:218
fwlite::EntryFinder::invalidEntry
static const EntryNumber_t invalidEntry
Definition: EntryFinder.h:41
fwlite::Event::runFactory_
std::shared_ptr< RunFactory > runFactory_
Definition: Event.h:221
mps_merge.firstentry
bool firstentry
Definition: mps_merge.py:77
fwlite::Event::to
bool to(Long64_t iIndex)
Go to the event at index iIndex.
Definition: Event.cc:195
converter
Definition: CandidateProducer.h:25
fwlite::Event::aux_
edm::EventAuxiliary aux_
Definition: Event.h:212
mps_splice.entry
entry
Definition: mps_splice.py:68
fwlite::BranchMapReader::getEventEntry
Long_t getEventEntry() const
Definition: BranchMapReader.h:101
triggerResults
static const std::string triggerResults
Definition: EdmProvDump.cc:45
edm::poolNames::parameterSetsTreeName
std::string const & parameterSetsTreeName()
Definition: BranchType.cc:214
fwlite::EntryFinder::EntryNumber_t
edm::IndexIntoFile::EntryNumber_t EntryNumber_t
Definition: EntryFinder.h:33
fwlite::Event::lumi_
std::shared_ptr< fwlite::LuminosityBlock > lumi_
Definition: Event.h:203
edm::ParameterSetConverter
Definition: ParameterSetConverter.h:41
fwlite::Event::labels_
std::vector< char const * > labels_
Definition: Event.h:208
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
fwlite::DataGetterHelper::getThinnedProduct
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key, Long_t eventEntry) const
Definition: DataGetterHelper.cc:402
fwlite::BranchMapReader::getEventTree
TTree const * getEventTree() const
Definition: BranchMapReader.h:94
edm::LuminosityBlockNumber_t
unsigned int LuminosityBlockNumber_t
Definition: RunLumiEventNumber.h:13
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
runTheMatrix.opt
opt
Definition: runTheMatrix.py:280
edm::BranchTypeToAuxiliaryBranchName
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:115
edm::FileFormatVersion::triggerPathsTracked
bool triggerPathsTracked() const
Definition: FileFormatVersion.cc:27
fwlite::BranchMapReader::updateEvent
bool updateEvent(Long_t eventEntry)
Definition: BranchMapReader.cc:604
fwlite::DataGetterHelper::getThinnedProducts
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys, Long_t eventEntry) const
Definition: DataGetterHelper.cc:452
fwlite::EntryFinder::fillIndex
void fillIndex(BranchMapReader &branchMap)
Definition: EntryFinder.cc:107
fwlite::Event::size
Long64_t size() const
Returns number of events in the file.
Definition: Event.cc:245
fwlite::Event::pOldAux_
edm::EventAux const * pOldAux_
Definition: Event.h:215
edm::EventAuxiliary::run
RunNumber_t run() const
Definition: EventAuxiliary.h:73
edm::errors::ProductNotFound
Definition: EDMException.h:33
fwlite::EntryFinder::findEvent
EntryNumber_t findEvent(edm::RunNumber_t const &run, edm::LuminosityBlockNumber_t const &lumi, edm::EventNumber_t const &event) const
Definition: EntryFinder.cc:56
fwlite::Event::file_
TFile * file_
Definition: Event.h:199
edm::ProcessHistoryMap
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
Definition: ProcessHistoryRegistry.h:15
fwlite::Event::fillParameterSetRegistry
void fillParameterSetRegistry() const
Definition: Event.cc:397
fwlite::Event::eventProcessHistoryIDs_
std::vector< edm::EventProcessHistoryID > eventProcessHistoryIDs_
Definition: Event.h:210
fwlite::BranchMapReader::getFileVersion
int getFileVersion(TFile *file)
Definition: BranchMapReader.cc:589
fwlite::Event::updateAux
void updateAux(Long_t eventIndex) const
Definition: Event.cc:293
fwlite::Event::entryFinder_
EntryFinder entryFinder_
Definition: Event.h:213
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:122
fwlite::Event::pAux_
edm::EventAuxiliary const * pAux_
Definition: Event.h:214
edm::poolNames::processHistoryBranchName
std::string const & processHistoryBranchName()
Definition: BranchType.cc:180
edm::errors::FatalRootError
Definition: EDMException.h:51
fwlite::DataGetterHelper::setGetter
void setGetter(std::shared_ptr< edm::EDProductGetter const > getter)
Definition: DataGetterHelper.h:82
fwlite::DataGetterHelper::getByLabel
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *, Long_t) const
Definition: DataGetterHelper.cc:281
fwlite::Event::procHistoryNames_
std::vector< std::string > procHistoryNames_
Definition: Event.h:211
corrVsCorr.selection
selection
main part
Definition: corrVsCorr.py:100
edm::EventAuxiliary::id
EventID const & id() const
Definition: EventAuxiliary.h:63
edm::Hash< ProcessHistoryType >
edm::EventProcessHistoryID
Definition: EventProcessHistoryID.h:11
edm::EventAux
Definition: EventAux.h:15
edm::InEvent
Definition: BranchType.h:11
edm::poolNames::parameterSetMapBranchName
std::string const & parameterSetMapBranchName()
Definition: BranchType.cc:171
b
double b
Definition: hdecay.h:118
cuda_std::lower_bound
__host__ constexpr __device__ RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
Definition: cudastdAlgorithm.h:27
edm::FileFormatVersion::parameterSetsByReference
bool parameterSetsByReference() const
Definition: FileFormatVersion.cc:25
fwlite::Event::dataHelper_
fwlite::DataGetterHelper dataHelper_
Definition: Event.h:220
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::BranchTypeToAuxBranchName
std::string const & BranchTypeToAuxBranchName(BranchType const &branchType)
Definition: BranchType.cc:119
edm::ParameterSet
Definition: ParameterSet.h:36
edm::FileFormatVersion
Definition: FileFormatVersion.h:7
ValidateTausOnZEEFastSim_cff.proc
proc
Definition: ValidateTausOnZEEFastSim_cff.py:6
edm::EventAuxiliary::luminosityBlock
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventAuxiliary.h:67
fwlite::Event::eventAuxiliary
edm::EventAuxiliary const & eventAuxiliary() const override
Definition: Event.cc:287
edm::EventBase::luminosityBlock
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
fwlite::Event::parameterSetRegistryFilled_
bool parameterSetRegistryFilled_
Definition: Event.h:218
edm::ProcessHistoryVector
std::vector< ProcessHistory > ProcessHistoryVector
Definition: ProcessHistoryRegistry.h:16
fwlite::Event::historyMap_
edm::ProcessHistoryMap historyMap_
Definition: Event.h:209
edm::TriggerResultsByName
Definition: TriggerResultsByName.h:48
edm::poolNames::processHistoryMapBranchName
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:177
fwlite::Event::run_
std::shared_ptr< fwlite::Run > run_
Definition: Event.h:204
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
fwlite::BranchMapReader::getBranchDescriptions
const std::vector< edm::BranchDescription > & getBranchDescriptions()
Definition: BranchMapReader.cc:641
fwlite::Event::eventHistoryTree_
TTree * eventHistoryTree_
Definition: Event.h:201
edm::pset::Registry::insertMapped
bool insertMapped(value_type const &v, bool forceUpdate=false)
Definition: Registry.cc:32
fwlite::Event::isValid
bool isValid() const
Definition: Event.cc:247
edm::ProcessHistory::setProcessHistoryID
ProcessHistoryID setProcessHistoryID()
Definition: ProcessHistory.cc:27
fwlite::Event::atEnd
bool atEnd() const override
Definition: Event.cc:254
fwlite::BranchMapReader::getFile
TFile const * getFile() const
Definition: BranchMapReader.h:92
edm::TypeID
Definition: TypeID.h:22
type
type
Definition: HCALResponse.h:21
writedatasetfile.run
run
Definition: writedatasetfile.py:27
fwlite::DataGetterHelper::getBranchNameFor
virtual const std::string getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const
Definition: DataGetterHelper.cc:268
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
edm::poolNames::metaDataTreeName
std::string const & metaDataTreeName()
Definition: BranchType.cc:162
edm::EventAuxiliary::processHistoryID
ProcessHistoryID const & processHistoryID() const
Definition: EventAuxiliary.h:61
fwlite::Event::history
edm::ProcessHistory const & history() const
Definition: Event.cc:303
fwlite::DataGetterHelper::getter
edm::EDProductGetter const * getter() const
Definition: DataGetterHelper.h:84
Exception
Definition: hltDiff.cc:246
edm::EventBase::parameterSetForID_
static edm::ParameterSet const * parameterSetForID_(edm::ParameterSetID const &psID)
Definition: EventBase.cc:41
edm::TriggerNames
Definition: TriggerNames.h:55
fwlite::Event::branchMap_
fwlite::BranchMapReader branchMap_
Definition: Event.h:205
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::History
Definition: History.h:22
fwlite::DataGetterHelper::getByProductID
edm::WrapperBase const * getByProductID(edm::ProductID const &pid, Long_t eventEntry) const
Definition: DataGetterHelper.cc:343
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
edm::EventBase::triggerNames_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:45
edm::poolNames::eventHistoryTreeName
std::string const & eventHistoryTreeName()
Definition: BranchType.cc:222
fwlite::Event::fileVersion_
int fileVersion_
Definition: Event.h:217
event
Definition: event.py:1
crabWrapper.key
key
Definition: crabWrapper.py:19
lumi
Definition: LumiSectionData.h:20
event
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
label
const char * label
Definition: PFTauDecayModeTools.cc:11
fwlite::Event::auxBranch_
TBranch * auxBranch_
Definition: Event.h:216
edm::pset::Registry
Definition: Registry.h:26
edm::ParameterSetConverter::ParameterSetIdConverter
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
Definition: ParameterSetConverter.h:46
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::poolNames::eventHistoryBranchName
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:207