CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LuminosityBlockBase.cc
Go to the documentation of this file.
1 // a))*- C++ -*-
2 //
3 // Package: DataFormats/FWLite
4 // Class : LuminosityBlockBase
5 //
14 //
15 // Original Author: Eric Vaandering
16 // Created: Wed Jan 13 15:01:20 EDT 2007
17 //
18 
19 // system include files
20 #include <iostream>
21 
22 // user include files
28 
29 static const edm::ProductID s_id;
31 static const edm::Provenance s_prov(std::shared_ptr<edm::BranchDescription const>(&s_branch, edm::do_nothing_deleter()), s_id);
32 
33 namespace fwlite
34 {
36  {
37  }
38 
40  {
41  }
42 
44  LuminosityBlockBase::getByLabelImpl(std::type_info const& iWrapperInfo, std::type_info const& /*iProductInfo*/, const edm::InputTag& iTag) const {
45  edm::WrapperBase* prod = nullptr;
46  void* prodPtr = &prod;
47  getByLabel(iWrapperInfo,
48  iTag.label().c_str(),
49  iTag.instance().empty()?static_cast<char const*>(0):iTag.instance().c_str(),
50  iTag.process().empty()?static_cast<char const*> (0):iTag.process().c_str(),
51  prodPtr);
52  if(prod == nullptr || !prod->isPresent()) {
53  edm::TypeID productType(iWrapperInfo);
54 
55  edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]()->std::shared_ptr<cms::Exception> {
56  std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound));
57  *whyFailed
58  << "getByLabel: Found zero products matching all criteria\n"
59  << "Looking for type: " << productType << "\n"
60  << "Looking for module label: " << iTag.label() << "\n"
61  << "Looking for productInstanceName: " << iTag.instance() << "\n"
62  << (iTag.process().empty() ? "" : "Looking for process: ") << iTag.process() << "\n";
63  return whyFailed;
64  }));
65  return failed;
66  }
68  return value;
69  }
70 }
static const edm::Provenance s_prov(std::shared_ptr< edm::BranchDescription const >(&s_branch, edm::do_nothing_deleter()), s_id)
virtual edm::BasicHandle getByLabelImpl(std::type_info const &, std::type_info const &, const edm::InputTag &) const
bool isPresent() const
Definition: WrapperBase.h:22
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const =0
static edm::BranchDescription const s_branch
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
static const edm::ProductID s_id