CMS 3D CMS Logo

List of all members | Public Member Functions | Static Protected 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 std::string const 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
 
template<typename T >
bool getByToken (edm::EDGetTokenT< T > const &token, edm::Handle< T > &result) 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
 

Static Protected Member Functions

template<typename T >
static edm::EDGetTokenT< TmakeTokenUsing (unsigned int iIndex)
 
- 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)
 

Private Member Functions

edm::BasicHandle getByLabelImpl (std::type_info const &, std::type_info const &, const edm::InputTag &) const override
 
virtual bool getByTokenImp (edm::EDGetToken, edm::WrapperBase const *&) const =0
 
edm::BasicHandle getByTokenImpl (std::type_info const &, edm::EDGetToken) const override
 
edm::BasicHandle getImpl (std::type_info const &, edm::ProductID const &) const override
 

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.

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

56 { return -1; }

◆ getBranchNameFor()

virtual std::string const 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.

References runTheMatrix::const, 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.

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  }
std::string const & instance() const
Definition: InputTag.h:37
std::string const & label() const
Definition: InputTag.h:36
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
std::string const & process() const
Definition: InputTag.h:40

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

◆ getByTokenImp()

virtual bool fwlite::EventBase::getByTokenImp ( edm::EDGetToken  ,
edm::WrapperBase const *&   
) const
privatepure virtual

◆ getByTokenImpl()

edm::BasicHandle EventBase::getByTokenImpl ( std::type_info const &  iProdInfo,
edm::EDGetToken  iToken 
) const
overrideprivatevirtual

Implements edm::EventBase.

Definition at line 67 of file EventBase.cc.

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

67  {
68  edm::WrapperBase const* prod = nullptr;
69  getByTokenImp(iToken, prod);
70  if (prod == nullptr || !prod->isPresent()) {
71  edm::TypeID productType(iProdInfo);
72 
73  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
74  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
75  *whyFailed << "getByToken: Found zero products matching all criteria\n"
76  << "Looking for type: " << productType << "\n"
77  << "The data is registered in the file but is not available for this event\n";
78  return whyFailed;
79  }));
80  return failed;
81  }
82 
84  return value;
85  }
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
virtual bool getByTokenImp(edm::EDGetToken, edm::WrapperBase const *&) const =0

◆ getImpl()

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

Implements edm::EventBase.

Definition at line 87 of file EventBase.cc.

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

87  {
88  edm::WrapperBase const* prod = getByProductID(pid);
89  if (prod == nullptr || !prod->isPresent()) {
90  edm::TypeID productType(iProductInfo);
91 
92  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
93  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
94  *whyFailed << "EventBase::getImpl: getByProductID found no product with the\n"
95  << "requested ProductID " << pid << "\n"
96  << "Expected type: " << productType << "\n";
97  return whyFailed;
98  }));
99  return failed;
100  }
102  return value;
103  }
virtual edm::WrapperBase const * getByProductID(edm::ProductID const &) const =0
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)

◆ makeTokenUsing()

template<typename T >
static edm::EDGetTokenT<T> fwlite::EventBase::makeTokenUsing ( unsigned int  iIndex)
inlinestaticprotected

Definition at line 61 of file EventBase.h.

61  {
62  return edm::EDGetTokenT<T>(iIndex);
63  }

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

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

57 { return -1; }

◆ toBegin()

virtual EventBase const& fwlite::EventBase::toBegin ( )
pure virtual