CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 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
 
virtual ~EventBase ()
 
- 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<typename T >
bool getByLabel (InputTag 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...
 
edm::EventID id () const
 
bool isRealData () const
 
edm::LuminosityBlockNumber_t luminosityBlock () const
 
int orbitNumber () const
 
virtual ProcessHistory const & processHistory () const =0
 
edm::Timestamp time () const
 
virtual TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const =0
 
virtual TriggerResultsByName triggerResultsByName (std::string const &process) const =0
 

Private Member Functions

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

Additional Inherited Members

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

Detailed Description

Definition at line 38 of file EventBase.h.

Constructor & Destructor Documentation

EventBase::EventBase ( )

Definition at line 33 of file EventBase.cc.

34  {
35  }
EventBase::~EventBase ( )
virtual

Reimplemented from edm::EventBase.

Definition at line 37 of file EventBase.cc.

38  {
39  }

Member Function Documentation

virtual bool fwlite::EventBase::atEnd ( ) const
pure virtual
virtual Long64_t fwlite::EventBase::fileIndex ( ) const
inlinevirtual

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

Definition at line 67 of file EventBase.h.

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

67 { return -1; }
virtual std::string const fwlite::EventBase::getBranchNameFor ( std::type_info const &  ,
char const *  ,
char const *  ,
char const *   
) const
pure virtual
virtual bool fwlite::EventBase::getByLabel ( std::type_info const &  ,
char const *  ,
char const *  ,
char const *  ,
void *   
) const
pure virtual
edm::BasicHandle EventBase::getByLabelImpl ( std::type_info const &  iWrapperInfo,
std::type_info const &  ,
const edm::InputTag iTag 
) const
privatevirtual

Implements edm::EventBase.

Definition at line 42 of file EventBase.cc.

References compareJSON::const, getByLabel(), edm::InputTag::instance(), edm::WrapperBase::isPresent(), edm::InputTag::label(), edm::makeHandleExceptionFactory(), edm::InputTag::process(), parseEventContent::prod, edm::errors::ProductNotFound, s_prov, and relativeConstraints::value.

42  {
43  edm::WrapperBase const* prod = nullptr;
44  void* prodPtr = &prod;
45  getByLabel(iWrapperInfo,
46  iTag.label().c_str(),
47  iTag.instance().empty()?static_cast<char const*>(0):iTag.instance().c_str(),
48  iTag.process().empty()?static_cast<char const*> (0):iTag.process().c_str(),
49  prodPtr);
50  if(prod == nullptr || !prod->isPresent()) {
51  edm::TypeID productType(iWrapperInfo);
52 
53  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]()->std::shared_ptr<cms::Exception>{
54  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
55  *whyFailed
56  << "getByLabel: Found zero products matching all criteria\n"
57  << "Looking for type: " << productType << "\n"
58  << "Looking for module label: " << iTag.label() << "\n"
59  << "Looking for productInstanceName: " << iTag.instance() << "\n"
60  << (iTag.process().empty() ? "" : "Looking for process: ") << iTag.process() << "\n"
61  << "The data is registered in the file but is not available for this event\n";
62  return whyFailed;
63  }));
64  return failed;
65  }
66 
68  return value;
69  }
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
bool isPresent() const
Definition: WrapperBase.h:22
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
string const
Definition: compareJSON.py:14
std::string const & label() const
Definition: InputTag.h:43
std::string const & process() const
Definition: InputTag.h:47
std::string const & instance() const
Definition: InputTag.h:44
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().

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

Implements edm::EventBase.

Definition at line 72 of file EventBase.cc.

References getByProductID(), edm::WrapperBase::isPresent(), edm::makeHandleExceptionFactory(), parseEventContent::prod, edm::errors::ProductNotFound, s_prov, and relativeConstraints::value.

72  {
74  if(prod == nullptr || !prod->isPresent()) {
75  edm::TypeID productType(iProductInfo);
76 
77  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]()->std::shared_ptr<cms::Exception>{
78  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
79  *whyFailed
80  << "EventBase::getImpl: getByProductID found no product with the\n"
81  << "requested ProductID " << pid << "\n"
82  << "Expected type: " << productType << "\n";
83  return whyFailed;
84  }));
85  return failed;
86  }
88  return value;
89  }
virtual edm::WrapperBase const * getByProductID(edm::ProductID const &) const =0
bool isPresent() const
Definition: WrapperBase.h:22
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
tuple pid
Definition: sysUtil.py:22
virtual EventBase const& fwlite::EventBase::operator++ ( )
pure virtual
virtual Long64_t fwlite::EventBase::secondaryFileIndex ( ) const
inlinevirtual

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

Definition at line 68 of file EventBase.h.

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

68 { return -1; }
virtual EventBase const& fwlite::EventBase::toBegin ( )
pure virtual