/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
DataFormats/FWLite/src/RunBase.cc
67 строк
3 KB
Christopher Jones
using for ProductDescription
27 янв 2025, 17:16
27 янв 2025, 17:16
9fe870c
Код
Авторство
О чём код?
// -*- C++ -*- // // Package: DataFormats/FWLite // Class : RunBase // /**\class RunBase RunBase.h DataFormats/FWLite/interface/RunBase.h Description: <one line class summary> Usage: <usage> */ // // Original Author: Eric Vaandering // Created: Wed Jan 13 15:01:20 EDT 2007 // // system include files #include <iostream> // user include files #include "DataFormats/FWLite/interface/RunBase.h" #include "DataFormats/Common/interface/FunctorHandleExceptionFactory.h" #include "FWCore/Utilities/interface/do_nothing_deleter.h" #include "FWCore/Utilities/interface/EDMException.h" #include "FWCore/Utilities/interface/TypeID.h" static const edm::ProductID s_id; static edm::ProductDescription const s_branch = edm::ProductDescription(edm::ProductDescription()); static const edm::Provenance s_prov(std::shared_ptr<edm::ProductDescription const>(&s_branch, edm::do_nothing_deleter()), s_id); namespace fwlite { RunBase::RunBase() {} RunBase::~RunBase() {} edm::BasicHandle RunBase::getByLabelImpl(std::type_info const& iWrapperInfo, std::type_info const& /*iProductInfo*/, const edm::InputTag& iTag) const { edm::WrapperBase* prod = nullptr; void* prodPtr = ∏ getByLabel(iWrapperInfo, iTag.label().c_str(), iTag.instance().empty() ? static_cast<char const*>(nullptr) : iTag.instance().c_str(), iTag.process().empty() ? static_cast<char const*>(nullptr) : iTag.process().c_str(), prodPtr); if (prod == nullptr || !prod->isPresent()) { edm::TypeID productType(iWrapperInfo); edm::BasicHandle failed(edm::makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> { std::shared_ptr<cms::Exception> whyFailed(std::make_shared<edm::Exception>(edm::errors::ProductNotFound)); *whyFailed << "getByLabel: Found zero products matching all criteria\n" << "Looking for type: " << productType << "\n" << "Looking for module label: " << iTag.label() << "\n" << "Looking for productInstanceName: " << iTag.instance() << "\n" << (iTag.process().empty() ? "" : "Looking for process: ") << iTag.process() << "\n"; return whyFailed; })); return failed; } edm::BasicHandle value(prod, &s_prov); return value; } } // namespace fwlite