1 #ifndef canvas_Persistency_Common_Sampled_h 2 #define canvas_Persistency_Common_Sampled_h 58 #include "cetlib/exempt_ptr.h" 59 #include "cetlib_except/demangle.h" 63 #include <type_traits> 72 using container_t = std::map<std::string, std::map<SubRunID, T>>;
84 cet::exempt_ptr<T const>
get(std::string
const& dataset,
85 RunID const& id)
const;
87 cet::exempt_ptr<T const>
get(std::string
const& dataset,
112 return process_name.insert(0,
"SampledFrom");
116 template <
typename T>
124 auto const type_name = cet::demangle_symbol(
typeid(*this).name());
125 if (type_name.find(
"art::Assns") != std::string::npos ||
126 type_name.find(
"art::Ptr") != std::string::npos) {
128 <<
"An attempt was made to create the type " 129 << cet::demangle_symbol(
typeid(T).name())
131 "This is not allowed. Please contact artists@fnal.gov for " 136 template <
typename T>
143 template <
typename T>
150 template <
typename T>
151 cet::exempt_ptr<T const>
157 template <
typename T>
158 cet::exempt_ptr<T const>
161 cet::exempt_ptr<T const> result{
nullptr};
162 auto dataset_it =
products_.find(dataset);
167 auto const& ids = dataset_it->second;
168 auto id_it = ids.find(
id);
169 if (id_it == ids.cend()) {
173 return cet::make_exempt_ptr(&id_it->second);
static short Class_Version()
InputTag const & originalInputTag() const
auto sampled_from(std::string process_name)
std::map< std::string, std::map< SubRunID, T >> container_t
cet::exempt_ptr< T const > get(std::string const &dataset, RunID const &id) const
void insert(std::string const &dataset, SubRunID const &id, T &&value)
typename container_t::const_iterator const_iterator
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
static SubRunID invalidSubRun(RunID const &rID)