1 #ifndef DataFormats_Common_RefItemGet_h 2 #define DataFormats_Common_RefItemGet_h 18 template <
typename C,
typename T,
typename F,
typename K>
25 template <
typename C,
typename T,
typename F,
typename KEY>
29 if (
item !=
nullptr) {
33 if (
nullptr == prodGetter) {
35 if (
item !=
nullptr) {
48 product.setProductPtr(
item);
53 template <
typename C,
typename T,
typename F>
57 if (
item !=
nullptr) {
61 if (getter ==
nullptr) {
63 if (
prod !=
nullptr) {
69 if (
prod !=
nullptr) {
72 product.setProductPtr(
item);
75 unsigned int 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>
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>
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)
static bool isThinnedAvailable_(RefCore const &product, KEY const &key)
void const * productPtr() const
static T const * getRefPtr_(RefCore const &product, unsigned int key)
void findRefItem(RefCore const &refCore, C const *container, K const &key)
bool isThinnedAvailable(unsigned int key, EDProductGetter const *prodGetter) const
void setProductPtr(void const *prodPtr) const
key
prepare the HTCondor submission files and eventually submit them
def template(fileName, svg, replaceme="REPLACEME")
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...
ProductID id() const
Accessor for product ID.
static T const * getRefPtr_(RefCore const &product, KEY const &key)
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...
virtual OptionalThinnedKey getThinnedKeyFrom(ProductID const &parent, unsigned int key, ProductID const &thinned) const =0
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
EDProductGetter const * productGetter() const
static bool isThinnedAvailable_(RefCore const &ref, unsigned int key)