CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
fwlite::EventBase Class Referenceabstract

#include <EventBase.h>

Inheritance diagram for fwlite::EventBase:
edm::EventBase fwlite::ChainEvent fwlite::Event fwlite::EventContainer fwlite::MultiChainEvent

Public Member Functions

virtual bool atEnd () const =0
 
 EventBase ()
 
virtual Long64_t fileIndex () const
 
virtual const std::string getBranchNameFor (std::type_info const &, char const *, char const *, char const *) const =0
 
virtual bool getByLabel (std::type_info const &, char const *, char const *, char const *, void *) const =0
 
virtual edm::WrapperBase const * getByProductID (edm::ProductID const &) const =0
 
virtual EventBase const & operator++ ()=0
 
virtual Long64_t secondaryFileIndex () const
 
virtual EventBase const & toBegin ()=0
 
 ~EventBase () override
 
- Public Member Functions inherited from edm::EventBase
int bunchCrossing () const
 
virtual edm::EventAuxiliary const & eventAuxiliary () const =0
 
 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
 
virtual edm::ParameterSet const * parameterSet (edm::ParameterSetID const &psID) const =0
 
virtual ProcessHistory const & processHistory () const =0
 
edm::Timestamp time () const
 
virtual TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const =0
 
virtual TriggerResultsByName triggerResultsByName (edm::TriggerResults const &triggerResults) const =0
 

Private Member Functions

edm::BasicHandle getByLabelImpl (std::type_info const &, std::type_info const &, const edm::InputTag &) const override
 
edm::BasicHandle getImpl (std::type_info const &, edm::ProductID const &) const override
 

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 36 of file EventBase.h.

Constructor & Destructor Documentation

◆ EventBase()

EventBase::EventBase ( )

Definition at line 33 of file EventBase.cc.

33 {}

◆ ~EventBase()

EventBase::~EventBase ( )
overridevirtual

Reimplemented from edm::EventBase.

Definition at line 35 of file EventBase.cc.

35 {}

Member Function Documentation

◆ atEnd()

virtual bool fwlite::EventBase::atEnd ( ) const
pure virtual

◆ fileIndex()

virtual Long64_t fwlite::EventBase::fileIndex ( ) const
inlinevirtual

Reimplemented in fwlite::MultiChainEvent, fwlite::EventContainer, and fwlite::ChainEvent.

Definition at line 56 of file EventBase.h.

56 { return -1; }

Referenced by fwlite::EventContainer::fileIndex(), and python.Events::fileIndicies().

◆ getBranchNameFor()

virtual const std::string fwlite::EventBase::getBranchNameFor ( std::type_info const &  ,
char const *  ,
char const *  ,
char const *   
) const
pure virtual

◆ getByLabel()

virtual bool fwlite::EventBase::getByLabel ( std::type_info const &  ,
char const *  ,
char const *  ,
char const *  ,
void *   
) const
pure virtual

◆ getByLabelImpl()

edm::BasicHandle EventBase::getByLabelImpl ( std::type_info const &  iWrapperInfo,
std::type_info const &  ,
const edm::InputTag iTag 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 37 of file EventBase.cc.

39  {
40  edm::WrapperBase const* prod = nullptr;
41  void* prodPtr = &prod;
42  getByLabel(iWrapperInfo,
43  iTag.label().c_str(),
44  iTag.instance().empty() ? static_cast<char const*>(nullptr) : iTag.instance().c_str(),
45  iTag.process().empty() ? static_cast<char const*>(nullptr) : iTag.process().c_str(),
46  prodPtr);
47  if (prod == nullptr || !prod->isPresent()) {
48  edm::TypeID productType(iWrapperInfo);
49 
50  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
51  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
52  *whyFailed << "getByLabel: Found zero products matching all criteria\n"
53  << "Looking for type: " << productType << "\n"
54  << "Looking for module label: " << iTag.label() << "\n"
55  << "Looking for productInstanceName: " << iTag.instance() << "\n"
56  << (iTag.process().empty() ? "" : "Looking for process: ") << iTag.process() << "\n"
57  << "The data is registered in the file but is not available for this event\n";
58  return whyFailed;
59  }));
60  return failed;
61  }
62 
64  return value;
65  }

References runEdmFileComparison::failed, getByLabel(), edm::InputTag::instance(), edm::InputTag::label(), edm::makeHandleExceptionFactory(), edm::InputTag::process(), dumpMFGeometry_cfg::prod, edm::errors::ProductNotFound, s_prov, and relativeConstraints::value.

◆ getByProductID()

virtual edm::WrapperBase const* fwlite::EventBase::getByProductID ( edm::ProductID const &  ) const
pure virtual

Implemented in fwlite::Event, fwlite::MultiChainEvent, and fwlite::ChainEvent.

Referenced by getImpl().

◆ getImpl()

edm::BasicHandle EventBase::getImpl ( std::type_info const &  iProductInfo,
edm::ProductID const &  pid 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 67 of file EventBase.cc.

67  {
68  edm::WrapperBase const* prod = getByProductID(pid);
69  if (prod == nullptr || !prod->isPresent()) {
70  edm::TypeID productType(iProductInfo);
71 
72  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
73  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
74  *whyFailed << "EventBase::getImpl: getByProductID found no product with the\n"
75  << "requested ProductID " << pid << "\n"
76  << "Expected type: " << productType << "\n";
77  return whyFailed;
78  }));
79  return failed;
80  }
82  return value;
83  }

References runEdmFileComparison::failed, getByProductID(), edm::makeHandleExceptionFactory(), dumpMFGeometry_cfg::prod, edm::errors::ProductNotFound, s_prov, and relativeConstraints::value.

◆ operator++()

virtual EventBase const& fwlite::EventBase::operator++ ( )
pure virtual

◆ secondaryFileIndex()

virtual Long64_t fwlite::EventBase::secondaryFileIndex ( ) const
inlinevirtual

Reimplemented in fwlite::MultiChainEvent, and fwlite::EventContainer.

Definition at line 57 of file EventBase.h.

57 { return -1; }

Referenced by python.Events::fileIndicies(), and fwlite::EventContainer::secondaryFileIndex().

◆ toBegin()

virtual EventBase const& fwlite::EventBase::toBegin ( )
pure virtual
fwlite::EventBase::getByProductID
virtual edm::WrapperBase const * getByProductID(edm::ProductID const &) const =0
edm::InputTag::instance
std::string const & instance() const
Definition: InputTag.h:37
edm::BasicHandle
Definition: BasicHandle.h:43
runEdmFileComparison.failed
failed
Definition: runEdmFileComparison.py:224
edm::InputTag::process
std::string const & process() const
Definition: InputTag.h:40
watchdog.const
const
Definition: watchdog.py:83
edm::makeHandleExceptionFactory
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Definition: FunctorHandleExceptionFactory.h:45
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::errors::ProductNotFound
Definition: EDMException.h:33
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
fwlite::EventBase::getByLabel
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
edm::WrapperBase
Definition: WrapperBase.h:23
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
edm::TypeID
Definition: TypeID.h:22
relativeConstraints.value
value
Definition: relativeConstraints.py:53
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
s_prov
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)