1 #ifndef art_Framework_Principal_DataViewImpl_h 2 #define art_Framework_Principal_DataViewImpl_h 72 template <
typename PROD>
73 std::ostream& operator<<(std::ostream& os, Handle<PROD>
const& h);
85 cet::exempt_ptr<Consumer> consumer);
89 template <
typename PROD>
92 template <
typename PROD>
95 template <
typename PROD>
97 std::string
const& productInstanceName,
100 template <
typename PROD>
102 std::string
const& productInstanceName,
103 std::string
const& processName,
107 template <
typename PROD>
110 template <
typename PROD>
113 template <
typename PROD>
116 template <
typename PROD>
119 template <
typename PROD>
122 template <
typename PROD>
125 template <
typename PROD>
128 template <
typename PROD>
133 template <
typename ELEMENT>
134 std::size_t
getView(std::string
const& moduleLabel,
135 std::string
const& productInstanceName,
136 std::vector<ELEMENT const*>& result)
const;
138 template <
typename ELEMENT>
140 std::vector<ELEMENT const*>& result)
const;
142 template <
typename ELEMENT>
144 std::vector<ELEMENT const*>& result)
const;
146 template <
typename ELEMENT>
147 bool getView(std::string
const& moduleLabel,
148 std::string
const& instanceName,
151 template <
typename ELEMENT>
154 template <
typename ELEMENT>
157 template <
typename PROD>
170 std::unique_ptr<EDProduct>
prod;
207 std::set<TypeLabel>
const& expectedProducts,
212 std::string
const& productInstanceName)
const;
222 std::string
const& moduleLabel,
223 std::string
const& productInstanceName,
224 std::string
const& processName)
const;
229 SelectorBase
const&)
const;
234 std::string
const& label,
235 std::string
const& productInstanceName,
236 std::string
const& processName)
const;
239 SelectorBase
const& sel)
const;
242 std::string
const& label,
243 std::string
const& productInstanceName,
244 std::string
const& processName)
const;
248 template <
typename ELEMENT>
250 std::string
const& productInstanceName,
251 std::string
const& processName)
const;
253 template <
typename ELEMENT>
255 std::vector<ELEMENT const*>& result)
const;
294 template <
typename PROD>
296 art::operator<<(std::ostream& os, Handle<PROD>
const& h)
298 os << h.product() <<
" " << h.provenance() <<
" " << h.id();
305 template <
typename PROD>
320 template <
typename PROD>
335 template <
typename PROD>
342 template <
typename PROD>
345 std::string
const& productInstanceName,
348 return getByLabel<PROD>(
label, productInstanceName, {}, result);
351 template <
typename PROD>
354 std::string
const& productInstanceName,
355 std::string
const& processName,
359 auto const wrapped = WrappedTypeID::make<PROD>();
361 wrapped.product_type,
367 getByLabel_(wrapped, label, productInstanceName, processName);
376 template <
typename PROD>
385 template <
typename PROD>
391 return getByLabel(tag.label(), tag.instance(), tag.process(), result);
394 template <
typename PROD>
403 template <
typename PROD>
412 template <
typename PROD>
416 return getValidHandle<PROD>(token.
inputTag_);
419 template <
typename PROD>
424 auto const wrapped = WrappedTypeID::make<PROD>();
429 std::vector<Handle<PROD>> products;
430 for (
auto const& qr :
getMany_(wrapped, sel)) {
433 products.push_back(result);
435 results.swap(products);
440 for (
auto const& h : results)
444 template <
typename PROD>
451 template <
typename ELEMENT>
454 std::string
const& productInstanceName,
455 std::string
const& processName)
const 457 TypeID const typeID{
typeid(ELEMENT)};
468 bhv.size(), typeID, moduleLabel, productInstanceName, processName);
472 template <
typename ELEMENT>
475 std::string
const& productInstanceName,
476 std::vector<ELEMENT const*>& result)
const 478 auto bhv = getView_<ELEMENT>(moduleLabel, productInstanceName, {});
479 std::size_t
const orig_size = result.size();
481 return result.size() - orig_size;
484 template <
typename ELEMENT>
487 std::vector<ELEMENT const*>& result)
const 490 std::size_t
const orig_size = result.size();
492 return result.size() - orig_size;
495 template <
typename ELEMENT>
498 std::string
const& productInstanceName,
501 auto bhv = getView_<ELEMENT>(moduleLabel, productInstanceName, {});
504 bhv[0].result()->uniqueProduct());
508 template <
typename ELEMENT>
515 bhv[0].result()->uniqueProduct());
519 template <
typename ELEMENT>
529 template <
typename ELEMENT>
532 std::vector<ELEMENT const*>& result)
const 534 std::vector<void const*> erased_ptrs;
535 auto product = bh.
result()->uniqueProduct();
539 product->fillView(erased_ptrs);
542 std::vector<ELEMENT const*> vals;
543 cet::transform_all(erased_ptrs, std::back_inserter(vals), [](
auto p) {
544 return static_cast<ELEMENT const*
>(p);
549 template <
typename PROD>
GroupQueryResultVec getView_(std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName) const
std::set< ProductID > RetrievedProductSet
RetrievedProductSet const & retrievedProducts() const
Principal const & principal_
void recordAsParent(Provenance const &prov) const
void ensureUniqueProduct_(std::size_t nFound, TypeID const &typeID, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName) const
PROD const * getPointerByLabel(InputTag const &tag) const
BranchDescription const & pd
GroupQueryResult get_(WrappedTypeID const &wrapped, SelectorBase const &) const
ProcessHistory const & processHistory() const
bool get(SelectorBase const &, Handle< PROD > &result) const
BranchDescription const & getProductDescription(TypeID const &type, std::string const &productInstanceName) const
BranchType const branchType_
cet::exempt_ptr< Consumer > consumer_
PMValue(std::unique_ptr< EDProduct > &&p, BranchDescription const &b, RangeSet const &r)
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
void getMany(SelectorBase const &, std::vector< Handle< PROD >> &results) const
TypeLabelMap const & putProducts() const
Provenance const * provenance() const
void removeNonViewableMatches_(TypeID const &requestedElementType, GroupQueryResultVec &results) const
std::map< TypeLabel, PMValue > TypeLabelMap
std::vector< ProductID > RetrievedProductIDs
void convert_handle(GroupQueryResult const &, Handle< T > &)
Provenance const * provenance() const
void getManyByType(std::vector< Handle< PROD >> &results) const
ModuleDescription const & md_
GroupQueryResult getByProductID_(ProductID const pid) const
GroupQueryResult getByLabel_(WrappedTypeID const &wrapped, std::string const &label, std::string const &productInstanceName, std::string const &processName) const
GroupQueryResultVec getMany_(WrappedTypeID const &wrapped, SelectorBase const &sel) const
GroupQueryResultVec getMatchingSequenceByLabel_(std::string const &label, std::string const &productInstanceName, std::string const &processName) const
std::unique_ptr< EDProduct > prod
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
std::vector< GroupQueryResult > GroupQueryResultVec
void fillView_(GroupQueryResult &bh, std::vector< ELEMENT const * > &result) const
void removeCachedProduct_(ProductID const pid) const
RetrievedProductSet retrievedProducts_
cet::exempt_ptr< Group const > result() const
void set_innards(ProductID const &id, EDProduct const *p)
TypeLabelMap & putProducts()
DataViewImpl & operator=(DataViewImpl const &)=delete
RetrievedProductIDs retrievedProductIDs() const
bool removeCachedProduct(Handle< PROD > &h) const
DataViewImpl(DataViewImpl const &)=delete
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
TypeLabelMap putProducts_
bool getByToken(ProductToken< PROD > const &token, Handle< PROD > &result) const
void checkPutProducts(bool checkProducts, std::set< TypeLabel > const &expectedProducts, TypeLabelMap const &putProducts)
bool const recordParents_