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::OptionalThinnedKey getThinnedKeyFrom (edm::ProductID const &parent, unsigned int key, edm::ProductID const &thinned) const
 
std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > 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 114 of file Event.cc.

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

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 172 of file Event.cc.

172  {
173  for (auto const& label : labels_) {
174  delete[] label;
175  }
176  delete pOldAux_;
177  }

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 267 of file Event.cc.

267  {
268  Long_t eventIndex = branchMap_.getEventEntry();
269  return eventIndex == -1 or eventIndex == size();
270  }

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 238 of file Event.cc.

238  {
239  GetterOperate op(dataHelper_.getter());
240  branchMap_.getEventTree()->Draw(opt);
241  }

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 300 of file Event.cc.

300  {
301  Long_t eventIndex = branchMap_.getEventEntry();
302  updateAux(eventIndex);
303  return aux_;
304  }

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

Referenced by getLuminosityBlock(), and getRun().

◆ fillParameterSetRegistry()

void Event::fillParameterSetRegistry ( ) const
private

Definition at line 418 of file Event.cc.

418  {
420  return;
422 
423  TTree* meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
424  if (nullptr == meta) {
425  throw cms::Exception("NoMetaTree") << "The TFile does not contain a TTree named "
427  }
428 
429  edm::FileFormatVersion fileFormatVersion;
430  edm::FileFormatVersion* fftPtr = &fileFormatVersion;
431  if (meta->FindBranch(edm::poolNames::fileFormatVersionBranchName().c_str()) != nullptr) {
432  TBranch* fft = meta->GetBranch(edm::poolNames::fileFormatVersionBranchName().c_str());
433  fft->SetAddress(&fftPtr);
434  fft->GetEntry(0);
435  }
436 
437  typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
438  PsetMap psetMap;
439  TTree* psetTree(nullptr);
440  if (meta->FindBranch(edm::poolNames::parameterSetMapBranchName().c_str()) != nullptr) {
441  PsetMap* psetMapPtr = &psetMap;
442  TBranch* b = meta->GetBranch(edm::poolNames::parameterSetMapBranchName().c_str());
443  b->SetAddress(&psetMapPtr);
444  b->GetEntry(0);
445  } else if (nullptr == (psetTree = dynamic_cast<TTree*>(
447  throw cms::Exception("NoParameterSetMapTree")
448  << "The TTree " << edm::poolNames::parameterSetsTreeName() << " could not be found in the file.";
449  } else {
450  typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
451  IdToBlobs idToBlob;
452  IdToBlobs* pIdToBlob = &idToBlob;
453  psetTree->SetBranchAddress(edm::poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
454  for (long long i = 0; i != psetTree->GetEntries(); ++i) {
455  psetTree->GetEntry(i);
456  psetMap.insert(idToBlob);
457  }
458  }
460  if (!fileFormatVersion.triggerPathsTracked()) {
461  edm::ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion.parameterSetsByReference());
462  } else {
463  // Merge into the parameter set registry.
465  for (auto const& item : psetMap) {
466  edm::ParameterSet pset(item.second.pset());
467  pset.setID(item.first);
468  psetRegistry.insertMapped(pset);
469  }
470  }
471  }

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 281 of file Event.cc.

284  {
285  return dataHelper_.getBranchNameFor(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel);
286  }

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 288 of file Event.cc.

292  {
293  if (atEnd()) {
294  throw cms::Exception("OffEnd") << "You have requested data past the last event";
295  }
296  Long_t eventIndex = branchMap_.getEventEntry();
297  return dataHelper_.getByLabel(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel, oData, eventIndex);
298  }

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 377 of file Event.cc.

377  {
378  Long_t eventEntry = branchMap_.getEventEntry();
379  return dataHelper_.getByProductID(iID, eventEntry);
380  }

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 505 of file Event.cc.

505  {
506  if (not lumi_) {
507  // Branch map pointer not really being shared, owned by event, have to trick Lumi
508  lumi_ = std::make_shared<fwlite::LuminosityBlock>(std::shared_ptr<BranchMapReader>(&branchMap_, NoDelete()),
509  runFactory_);
510  }
513  lumi_->to(run, lumi);
514  return *lumi_;
515  }

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 272 of file Event.cc.

272  {
273  if (procHistoryNames_.empty()) {
274  for (auto const& proc : history()) {
275  procHistoryNames_.push_back(proc.processName());
276  }
277  }
278  return procHistoryNames_;
279  }

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

Referenced by FWLiteJobMetadataManager::doUpdate().

◆ getRun()

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

Definition at line 517 of file Event.cc.

517  {
518  run_ = runFactory_->makeRun(std::shared_ptr<BranchMapReader>(&branchMap_, NoDelete()));
520  run_->to(run);
521  return *run_;
522  }

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

◆ getThinnedKeyFrom()

edm::OptionalThinnedKey Event::getThinnedKeyFrom ( edm::ProductID const &  parent,
unsigned int  key,
edm::ProductID const &  thinned 
) const

◆ getThinnedProduct()

std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > 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 388 of file Event.cc.

390  {
391  Long_t eventEntry = branchMap_.getEventEntry();
392  return dataHelper_.getThinnedProducts(pid, foundContainers, keys, eventEntry);
393  }

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 316 of file Event.cc.

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

References aux_, b, branchMap_, edm::poolNames::eventHistoryBranchName(), eventHistoryTree_, eventProcessHistoryIDs_, Exception, edm::errors::FatalRootError, fileVersion_, fwlite::BranchMapReader::getEventEntry(), fwlite::BranchMapReader::getFile(), historyMap_, edm::EventAuxiliary::id(), pfDeepBoostedJetPreprocessParams_cfi::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 260 of file Event.cc.

260  {
261  Long_t eventIndex = branchMap_.getEventEntry();
262  return eventIndex != -1 and eventIndex < size();
263  }

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 265 of file Event.cc.

265 { return isValid(); }

◆ operator++()

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

Advance to next event in the TFile.

Implements fwlite::EventBase.

Definition at line 194 of file Event.cc.

194  {
195  Long_t eventIndex = branchMap_.getEventEntry();
196  if (eventIndex < size()) {
197  branchMap_.updateEvent(++eventIndex);
198  }
199  return *this;
200  }

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 473 of file Event.cc.

473  {
476  }
477  return parameterSetForID_(psID);
478  }

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

◆ processHistory()

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

Implements edm::EventBase.

Definition at line 179 of file Event.h.

179 { 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 199 of file Event.h.

199 { 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 492 of file Event.cc.

495  {
496  edm::TypeID type(iType);
498  << "A branch was found for \n type ='" << type.className() << "'\n module='" << iModule
499  << "'\n productInstance='" << ((nullptr != iProduct) ? iProduct : "") << "'\n process='"
500  << ((nullptr != iProcess) ? iProcess : "")
501  << "'\n"
502  "but no data is available for this Event";
503  }

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 228 of file Event.cc.

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

References edmPickEvents::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 217 of file Event.cc.

217 { 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 208 of file Event.cc.

208  {
209  if (iEntry < size()) {
210  // this is a valid entry
211  return branchMap_.updateEvent(iEntry);
212  }
213  // if we're here, then iEntry was not valid
214  return false;
215  }

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 230 of file Event.cc.

230  {
232  return *this;
233  }

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 402 of file Event.cc.

402  {
404  if (names != nullptr)
405  return *names;
406 
410  }
411  if (names != nullptr)
412  return *names;
413 
414  throw cms::Exception("TriggerNamesNotFound") << "TriggerNames not found in ParameterSet registry";
415  return *names;
416  }

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 306 of file Event.cc.

306  {
307  if (auxBranch_->GetEntryNumber() != eventIndex) {
308  auxBranch_->GetEntry(eventIndex);
309  //handling dealing with old version
310  if (nullptr != pOldAux_) {
312  }
313  }
314  }

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 189 of file Event.h.

◆ EventHistoryGetter

friend class EventHistoryGetter
friend

Definition at line 190 of file Event.h.

◆ internal::ProductGetter

friend class internal::ProductGetter
friend

Definition at line 188 of file Event.h.

Member Data Documentation

◆ aux_

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

Definition at line 216 of file Event.h.

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

◆ auxBranch_

TBranch* fwlite::Event::auxBranch_
private

Definition at line 220 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 217 of file Event.h.

Referenced by indexFromEventId(), and to().

◆ eventHistoryTree_

TTree* fwlite::Event::eventHistoryTree_
private

Definition at line 205 of file Event.h.

Referenced by Event(), and history().

◆ eventProcessHistoryIDs_

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

Definition at line 214 of file Event.h.

Referenced by history().

◆ file_

TFile* fwlite::Event::file_
mutableprivate

Definition at line 203 of file Event.h.

◆ fileVersion_

int fwlite::Event::fileVersion_
private

Definition at line 221 of file Event.h.

Referenced by Event(), and history().

◆ historyMap_

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

Definition at line 213 of file Event.h.

Referenced by history().

◆ labels_

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

Definition at line 212 of file Event.h.

Referenced by ~Event().

◆ lumi_

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

Definition at line 207 of file Event.h.

Referenced by getLuminosityBlock().

◆ parameterSetRegistryFilled_

bool fwlite::Event::parameterSetRegistryFilled_
mutableprivate

◆ pAux_

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

Definition at line 218 of file Event.h.

Referenced by Event().

◆ pOldAux_

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

Definition at line 219 of file Event.h.

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

◆ procHistoryNames_

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

Definition at line 215 of file Event.h.

Referenced by getProcessHistory(), and history().

◆ run_

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

Definition at line 208 of file Event.h.

Referenced by getRun().

◆ runFactory_

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

Definition at line 225 of file Event.h.

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

edm::poolNames::idToParameterSetBlobsBranchName
std::string const & idToParameterSetBlobsBranchName()
Definition: BranchType.cc:206
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:428
edm::poolNames::fileFormatVersionBranchName
std::string const & fileFormatVersionBranchName()
Definition: BranchType.cc:182
fwlite::DataGetterHelper::getThinnedProduct
std::optional< std::tuple< edm::WrapperBase const *, unsigned int > > getThinnedProduct(edm::ProductID const &pid, unsigned int key, Long_t eventEntry) const
Definition: DataGetterHelper.cc:403
edm::conversion
void conversion(EventAux const &from, EventAuxiliary &to)
Definition: EventAux.cc:9
edm::poolNames::eventTreeName
std::string const & eventTreeName()
Definition: BranchType.cc:208
fwlite::EntryFinder::invalidEntry
static const EntryNumber_t invalidEntry
Definition: EntryFinder.h:41
fwlite::Event::runFactory_
std::shared_ptr< RunFactory > runFactory_
Definition: Event.h:225
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:208
converter
Definition: CandidateProducer.h:25
fwlite::Event::aux_
edm::EventAuxiliary aux_
Definition: Event.h:216
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:204
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:207
edm::ParameterSetConverter
Definition: ParameterSetConverter.h:40
fwlite::Event::labels_
std::vector< char const * > labels_
Definition: Event.h:212
relativeConstraints.keys
keys
Definition: relativeConstraints.py:89
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:291
edm::BranchTypeToAuxiliaryBranchName
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Definition: BranchType.cc:109
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:414
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:258
fwlite::Event::pOldAux_
edm::EventAux const * pOldAux_
Definition: Event.h:219
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:203
edm::ProcessHistoryMap
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
Definition: ProcessHistoryRegistry.h:15
fwlite::Event::fillParameterSetRegistry
void fillParameterSetRegistry() const
Definition: Event.cc:418
fwlite::Event::eventProcessHistoryIDs_
std::vector< edm::EventProcessHistoryID > eventProcessHistoryIDs_
Definition: Event.h:214
fwlite::BranchMapReader::getFileVersion
int getFileVersion(TFile *file)
Definition: BranchMapReader.cc:589
fwlite::Event::updateAux
void updateAux(Long_t eventIndex) const
Definition: Event.cc:306
fwlite::Event::entryFinder_
EntryFinder entryFinder_
Definition: Event.h:217
names
const std::string names[nVars_]
Definition: PhotonIDValueMapProducer.cc:124
fwlite::Event::pAux_
edm::EventAuxiliary const * pAux_
Definition: Event.h:218
edm::poolNames::processHistoryBranchName
std::string const & processHistoryBranchName()
Definition: BranchType.cc:170
edm::errors::FatalRootError
Definition: EDMException.h:51
fwlite::DataGetterHelper::setGetter
void setGetter(std::shared_ptr< edm::EDProductGetter const > getter)
Definition: DataGetterHelper.h:88
fwlite::DataGetterHelper::getByLabel
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *, Long_t) const
Definition: DataGetterHelper.cc:282
fwlite::Event::procHistoryNames_
std::vector< std::string > procHistoryNames_
Definition: Event.h:215
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:161
b
double b
Definition: hdecay.h:118
edm::FileFormatVersion::parameterSetsByReference
bool parameterSetsByReference() const
Definition: FileFormatVersion.cc:25
fwlite::Event::dataHelper_
fwlite::DataGetterHelper dataHelper_
Definition: Event.h:224
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
edm::BranchTypeToAuxBranchName
std::string const & BranchTypeToAuxBranchName(BranchType const &branchType)
Definition: BranchType.cc:115
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::ParameterSet
Definition: ParameterSet.h:47
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:300
edm::EventBase::luminosityBlock
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
edmPickEvents.event
event
Definition: edmPickEvents.py:273
fwlite::Event::parameterSetRegistryFilled_
bool parameterSetRegistryFilled_
Definition: Event.h:222
edm::ProcessHistoryVector
std::vector< ProcessHistory > ProcessHistoryVector
Definition: ProcessHistoryRegistry.h:16
fwlite::Event::historyMap_
edm::ProcessHistoryMap historyMap_
Definition: Event.h:213
edm::TriggerResultsByName
Definition: TriggerResultsByName.h:48
edm::poolNames::processHistoryMapBranchName
std::string const & processHistoryMapBranchName()
Definition: BranchType.cc:167
fwlite::Event::run_
std::shared_ptr< fwlite::Run > run_
Definition: Event.h:208
fwlite::DataGetterHelper::getThinnedKeyFrom
edm::OptionalThinnedKey getThinnedKeyFrom(edm::ProductID const &parent, unsigned int key, edm::ProductID const &thinned, Long_t eventEntry) const
Definition: DataGetterHelper.cc:428
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:205
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:260
edm::ProcessHistory::setProcessHistoryID
ProcessHistoryID setProcessHistoryID()
Definition: ProcessHistory.cc:27
fwlite::Event::atEnd
bool atEnd() const override
Definition: Event.cc:267
fwlite::BranchMapReader::getFile
TFile const * getFile() const
Definition: BranchMapReader.h:92
edm::TypeID
Definition: TypeID.h:22
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:269
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition: ProcessHistoryID.h:8
edm::poolNames::metaDataTreeName
std::string const & metaDataTreeName()
Definition: BranchType.cc:152
edm::EventAuxiliary::processHistoryID
ProcessHistoryID const & processHistoryID() const
Definition: EventAuxiliary.h:61
fwlite::Event::history
edm::ProcessHistory const & history() const
Definition: Event.cc:316
fwlite::DataGetterHelper::getter
edm::EDProductGetter const * getter() const
Definition: DataGetterHelper.h:90
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:209
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:344
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:212
fwlite::Event::fileVersion_
int fileVersion_
Definition: Event.h:221
event
Definition: event.py:1
crabWrapper.key
key
Definition: crabWrapper.py:19
lumi
Definition: LumiSectionData.h:20
class-composition.parent
parent
Definition: class-composition.py:88
label
const char * label
Definition: PFTauDecayModeTools.cc:11
fwlite::Event::auxBranch_
TBranch * auxBranch_
Definition: Event.h:220
edm::pset::Registry
Definition: Registry.h:26
edm::ParameterSetConverter::ParameterSetIdConverter
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
Definition: ParameterSetConverter.h:45
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::poolNames::eventHistoryBranchName
std::string const & eventHistoryBranchName()
Definition: BranchType.cc:197