1 #ifndef DataFormats_Common_RefItemGet_h
2 #define DataFormats_Common_RefItemGet_h
18 template <
typename C,
typename T,
typename F,
typename K>
21 T const*
item = finder(*container, key);
25 template <
typename C,
typename T,
typename F,
typename KEY>
29 if (item !=
nullptr) {
33 if (
nullptr == prodGetter) {
35 if (item !=
nullptr) {
40 C const* prod =
edm::template getProductWithCoreFromRef<C>(product, prodGetter);
47 item =
func(*prod, key);
48 product.setProductPtr(item);
53 template <
typename C,
typename T,
typename F>
57 if (item !=
nullptr) {
61 if (getter ==
nullptr) {
63 if (prod !=
nullptr) {
65 return static_cast<T const*
>(prod);
68 C const* prod =
edm::template tryToGetProductWithCoreFromRef<C>(product, getter);
69 if (prod !=
nullptr) {
71 item =
func(*prod, key);
72 product.setProductPtr(item);
75 unsigned int thinnedKey;
76 std::tie(prod, thinnedKey) =
edm::template getThinnedProduct<C>(product,
key, getter);
78 item =
func(*prod, thinnedKey);
79 product.setProductPtr(item);
85 template <
typename C,
typename T,
typename F,
typename KEY>
91 template <
typename C,
typename KEY>
106 if (getter !=
nullptr) {
115 template <
typename C,
typename KEY>
128 template <
typename C,
typename T,
typename F>
132 if (parent.
id() == thinned.
id()) {
137 if (std::holds_alternative<unsigned int>(thinnedKey)) {
138 return Ref<C, T, F>(thinned, std::get<unsigned int>(thinnedKey));
139 }
else if (std::holds_alternative<detail::GetThinnedKeyFromExceptionFactory>(thinnedKey)) {
140 auto ex = std::get<detail::GetThinnedKeyFromExceptionFactory>(thinnedKey)();
141 ex.addContext(
"Calling edm::thinnedRefFrom()");
156 template <
typename C,
typename T,
typename F>
160 if (parent.
id() == thinned.
id()) {
165 if (std::holds_alternative<unsigned int>(thinnedKey)) {
166 return Ref<C, T, F>(thinned, std::get<unsigned int>(thinnedKey));
bool isThinnedAvailable(RefCore const &product, KEY const &iKey)
T const * getRefPtr(RefCore const &product, KEY const &iKey)
void setProductPtr(void const *prodPtr) const
static bool isThinnedAvailable_(RefCore const &product, KEY const &key)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
key_type key() const
Accessor for product key.
static T const * getRefPtr_(RefCore const &product, unsigned int key)
ProductID id() const
Accessor for product ID.
void findRefItem(RefCore const &refCore, C const *container, K const &key)
void const * productPtr() const
tuple key
prepare the HTCondor submission files and eventually submit them
Ref< C, T, F > thinnedRefFrom(Ref< C, T, F > const &parent, RefProd< C > const &thinned, edm::EDProductGetter const &prodGetter)
Return a Ref to thinned collection corresponding to an element of the Ref to parent collection...
static T const * getRefPtr_(RefCore const &product, KEY const &key)
bool isThinnedAvailable(unsigned int key, EDProductGetter const *prodGetter) const
Ref< C, T, F > tryThinnedRefFrom(Ref< C, T, F > const &parent, RefProd< C > const &thinned, edm::EDProductGetter const &prodGetter)
Return a Ref to thinned collection corresponding to an element of the Ref to parent collection...
EDProductGetter const * productGetter() const
virtual OptionalThinnedKey getThinnedKeyFrom(ProductID const &parent, unsigned int key, ProductID const &thinned) const =0
ProductID id() const
Accessor for product ID.
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
static bool isThinnedAvailable_(RefCore const &ref, unsigned int key)