1 #ifndef DataFormats_Common_AssociativeIterator_h
2 #define DataFormats_Common_AssociativeIterator_h
46 template <
class T>
class View;
50 template <
class T>
class Ptr;
51 template <
class C,
class T,
class F>
class Ref;
60 template<
typename RefFrom,
typename RefTo>
62 static RefTo
convert(
const RefFrom &ref) {
return RefTo(ref); }
68 template<
typename T,
typename C,
typename V,
typename F>
76 template<
typename RefType>
102 template<
typename AC>
113 template<
typename KeyRefType,
typename AssociativeCollection,
140 operator bool()
const {
return idx_ <
map_.size(); }
150 const AssociativeCollection &
map_;
163 template<
typename KeyRefType,
typename AC,
typename IG>
165 map_(map), ioi_(map_.ids().
begin()), ioi2_(ioi_+1), idx_(0),
171 template<
typename KeyRefType,
typename AC,
typename IG>
175 if (ioi2_ < map_.ids().end()) {
176 if (ioi2_->second == idx_) {
183 template<
typename KeyRefType,
typename AC,
typename IG>
187 if (ioi_->second < idx_) {
194 template<
typename KeyRefType,
typename AC,
typename IG>
198 if (ioi_ == map_.ids().end()) {
213 template<
typename KeyRefType,
typename AC,
typename IG>
216 ret.
ioi_ = map_.ids().end();
218 ret.
idx_ = map_.size();
222 template<
typename KeyRefType,
typename AC,
typename IG>
225 pair_.first = getter_.get(
id(), idx_ - ioi_->second);
226 pair_.second = map_.get(idx_);
value_type const * get() const
AssociativeIterator(const AssociativeCollection &map, const ItemGetter &getter)
Create the associative iterator, pointing at the beginning of the collection.
KeyRefType::value_type key_val_type
Association< C >::reference_type type
AssociativeCollection::id_offset_vector id_offset_vector
static HepMC::IO_HEPEVT conv
const val_type & val() const
Handle< View< element_type > > view_
AssociativeIterator< KeyRefType, AssociativeCollection, ItemGetter > self_type
reco::GenParticleCollection::const_iterator IG
const edm::Event & iEvent_
self_type & nextProductID()
static RefTo convert(const RefFrom &ref)
EdmEventItemGetter(const edm::Event &iEvent)
const value_type & operator*() const
Helper class that fetches some type of Ref given ProductID and index, using the edm::Event.
bool get(ProductID const &oid, Handle< PROD > &result) const
bool operator<(const self_type &other) const
Container::value_type value_type
RefType::value_type element_type
const value_type * operator->() const
id_offset_vector::const_iterator id_offset_iterator
std::pair< key_type, val_type > value_type
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
static Ptr< T > convert(const RefToBase< T > &ref)
const AssociativeCollection & map_
helper::AssociativeCollectionValueType< AssociativeCollection >::type val_type
bool operator!=(const self_type &other) const
bool operator==(const self_type &other) const
static Ref< C, V, F > convert(const RefToBase< T > &ref)
volatile std::atomic< bool > shutdown_flag false
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
const ProductID & id() const
const key_type & key() const