CMS 3D CMS Logo

SelectionAdderTrait.h
Go to the documentation of this file.
1 #ifndef UtilAlgos_SelectionAdderTrait_h
2 #define UtilAlgos_SelectionAdderTrait_h
3 /* \class SelectionAdderTrait
4  *
5  * \author Luca Lista, INFN
6  */
14 
15 namespace helper {
16 
17  template <typename StoreContainer>
19  template <typename C>
20  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
21  selected.push_back((*c)[idx]);
22  }
23  };
24 
25  template <typename StoreContainer>
27  template <typename C>
28  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
29  selected.push_back(&(*c)[idx]);
30  }
31  };
32 
33  template <typename StoreContainer>
35  template <typename C>
36  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
37  selected.push_back(&*(*c)[idx]);
38  }
39  };
40 
41  template <typename StoreContainer>
43  template <typename C>
44  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
45  selected.push_back(&*((*c)[idx].first));
46  }
47  };
48 
49  template <typename StoreContainer>
51  template <typename C>
52  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
53  selected.push_back((*c)[idx].first);
54  }
55  };
56 
57  template <typename StoreContainer>
59  template <typename C>
60  void operator()(StoreContainer &selected, const edm::Handle<C> &c, size_t idx) {
61  selected.push_back(edm::Ref<C>(c, idx));
62  }
63  };
64 
65  template <typename T>
67  void operator()(edm::RefToBaseVector<T> &selected, const edm::Handle<edm::View<T> > &c, size_t idx) {
68  selected.push_back(c->refAt(idx));
69  }
70  };
71 
72  template <typename T>
74  void operator()(edm::PtrVector<T> &selected, const edm::Handle<edm::View<T> > &c, size_t idx) {
75  selected.push_back(c->ptrAt(idx));
76  }
77  };
78 
79  template <typename InputCollection, typename StoreContainer>
81  static_assert(sizeof(InputCollection) == 0);
82  };
83 
84  template <typename InputCollection, typename T>
87  };
88 
89  template <typename InputCollection, typename C>
92  };
93 
94  template <typename C>
97  };
98 
99  template <typename C, typename T>
100  struct SelectionAdderTrait<edm::RefVector<C>, std::vector<const T *> > {
102  };
103 
104  template <typename T>
107  };
108 
109  template <typename T>
112  };
113 
114  template <typename K, typename C, typename T>
115  struct SelectionAdderTrait<edm::AssociationVector<edm::RefProd<K>, C>, std::vector<const T *> > {
117  };
118 
119  template <typename C, typename T>
120  struct SelectionAdderTrait<edm::AssociationVector<edm::RefToBaseProd<T>, C>, std::vector<const T *> > {
122  };
123 
124  template <typename K, typename C>
125  struct SelectionAdderTrait<edm::AssociationVector<edm::RefProd<K>, C>, edm::RefVector<K> > {
127  };
128 
129  template <typename T, typename C>
130  struct SelectionAdderTrait<edm::AssociationVector<edm::RefToBaseProd<T>, C>, edm::RefToBaseVector<T> > {
132  };
133 
134  template <typename T>
137  };
138 
139  template <typename T>
142  };
143 
144 } // namespace helper
145 
146 #endif
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
Definition: helper.py:1
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:149
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
void operator()(edm::RefToBaseVector< T > &selected, const edm::Handle< edm::View< T > > &c, size_t idx)
void operator()(edm::PtrVector< T > &selected, const edm::Handle< edm::View< T > > &c, size_t idx)
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
void operator()(StoreContainer &selected, const edm::Handle< C > &c, size_t idx)
HLT enums.
void push_back(const RefToBase< T > &)
edm::RefVector< Container > RefVector