CMS 3D CMS Logo

Public Types | Static Public Member Functions | Private Types

edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef > Class Template Reference

#include <OneToManyWithQualityGeneric.h>

List of all members.

Public Types

typedef std::pair< ValRef, Q > data_type
 insert val type
typedef index index_type
 index type
typedef KeyRef key_type
 insert key type
typedef std::map< index_type,
map_assoc
map_type
 map type
typedef helpers::KeyVal
< keyrefprod_type,
valrefprod_type
ref_type
 reference set type
typedef std::vector< const
typename CKey::value_type * > 
transient_key_vector
 transient key vector
typedef std::map< const
typename CKey::value_type
*, std::vector< std::pair
< const typename
CVal::value_type *, Q > > > 
transient_map_type
 transient map type
typedef std::vector
< std::vector< std::pair
< const typename
CVal::value_type *, Q > > > 
transient_val_vector
 transient val vector
typedef std::vector< std::pair
< ValRef, Q > > 
val_type
 values reference collection type

Static Public Member Functions

static void insert (ref_type &ref, map_type &m, const key_type &k, const data_type &v)
 insert in the map
static void insert (ref_type &ref, map_type &m, const key_type &k, const val_type &v)
static map_type::size_type size (const map_assoc &v)
 size of data_type
static void sort (map_type &m)
 sort
static transient_key_vector transientKeyVector (const ref_type &ref, const map_type &map)
 fill transient key vector
static transient_map_type transientMap (const ref_type &ref, const map_type &map)
 fill transient map
static transient_val_vector transientValVector (const ref_type &ref, const map_type &map)
 fill transient val vector
static val_type val (const ref_type &ref, const map_assoc &iv)
 return values collection

Private Types

typedef KeyRefProd keyrefprod_type
 reference to "key" collection
typedef std::vector< std::pair
< index, Q > > 
map_assoc
 internal map associated data
typedef ValRefProd valrefprod_type
 reference to "value" collection

Detailed Description

template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
class edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >

Definition at line 19 of file OneToManyWithQualityGeneric.h.


Member Typedef Documentation

template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::pair<ValRef, Q> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::data_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef index edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::index_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef KeyRef edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::key_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef KeyRefProd edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::keyrefprod_type [private]

reference to "key" collection

Definition at line 21 of file OneToManyWithQualityGeneric.h.

template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<std::pair<index, Q> > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::map_assoc [private]

internal map associated data

Definition at line 25 of file OneToManyWithQualityGeneric.h.

template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::map<index_type, map_assoc> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::map_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef helpers::KeyVal<keyrefprod_type, valrefprod_type> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::ref_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<const typename CKey::value_type *> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_key_vector
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::map<const typename CKey::value_type *, std::vector<std::pair<const typename CVal::value_type *, Q > > > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_map_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<std::vector<std::pair<const typename CVal::value_type *, Q > > > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_val_vector
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef std::vector<std::pair<ValRef, Q> > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::val_type
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
typedef ValRefProd edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::valrefprod_type [private]

reference to "value" collection

Definition at line 23 of file OneToManyWithQualityGeneric.h.


Member Function Documentation

template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static void edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::insert ( ref_type ref,
map_type m,
const key_type k,
const data_type v 
) [inline, static]

insert in the map

Definition at line 50 of file OneToManyWithQualityGeneric.h.

Referenced by edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double >::insert().

                                                                 {
      const ValRef & vref = v.first;
      if (k.isNull() || vref.isNull())
        Exception::throwThis(errors::InvalidReference,
          "can't insert null references in AssociationMap");
      if (ref.key.isNull()) {
        ref.key = keyrefprod_type(k);
        ref.val = valrefprod_type(vref);
      }
      helpers::checkRef(ref.key, k); helpers::checkRef(ref.val, vref);
      index_type ik = index_type(k.key()), iv = index_type(vref.key());
      m[ik].push_back(std::make_pair(iv, v.second));
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static void edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::insert ( ref_type ref,
map_type m,
const key_type k,
const val_type v 
) [inline, static]

Definition at line 64 of file OneToManyWithQualityGeneric.h.

                                                                                             {
      for(typename val_type::const_iterator i = v.begin(), iEnd = v.end(); i != iEnd; ++i)
      insert(ref, m, k, *i);
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static map_type::size_type edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::size ( const map_assoc v) [inline, static]

size of data_type

Definition at line 76 of file OneToManyWithQualityGeneric.h.

{ return v.size(); }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static void edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::sort ( map_type m) [inline, static]

sort

Definition at line 78 of file OneToManyWithQualityGeneric.h.

Referenced by edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double >::sort().

                                   {
      //      using namespace boost::lambda;
      for(typename map_type::iterator i = m.begin(), iEnd = m.end(); i != iEnd; ++i) {
        map_assoc & v = i->second;
        // Q std::pair<index, Q>::*quality = &std::pair<index, Q>::second;
        // std::sort(v.begin(), v.end(),
        //        bind(quality, boost::lambda::_2) < bind(quality, boost::lambda::_1));
           std::sort(v.begin(), v.end(), 
                  boost::bind(std::less<Q>(), 
                  boost::bind(&std::pair<index, Q>::second,_2), boost::bind( &std::pair<index, Q>::second,_1)
                             )
           );

      }
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_key_vector edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientKeyVector ( const ref_type ref,
const map_type map 
) [inline, static]

fill transient key vector

Definition at line 111 of file OneToManyWithQualityGeneric.h.

                                                                                               {
      transient_key_vector m;
      const CKey & ckey = * ref.key;
      for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i)
        m.push_back(& ckey[i->first]);
      return m;
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_map_type edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientMap ( const ref_type ref,
const map_type map 
) [inline, static]

fill transient map

Definition at line 94 of file OneToManyWithQualityGeneric.h.

                                                                                       {
      transient_map_type m;
      const CKey & ckey = * ref.key;
      const CVal & cval = * ref.val;
      for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) {
        const map_assoc & a = i->second;
        const typename CKey::value_type * k = & ckey[i->first];
        std::vector<std::pair<const typename CVal::value_type *, Q> > v;
        for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j) {
          const typename CVal::value_type * val = & cval[j->first];
          v.push_back(std::make_pair(val, j->second));
        }
        m.insert(std::make_pair(k, v));
      }
      return m;
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static transient_val_vector edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientValVector ( const ref_type ref,
const map_type map 
) [inline, static]

fill transient val vector

Definition at line 119 of file OneToManyWithQualityGeneric.h.

                                                                                               {
      transient_val_vector m;
      const CVal & cval = * ref.val;
      for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) {
        const map_assoc & a = i->second;
        std::vector<std::pair<const typename CVal::value_type *, Q> > v;
        m.push_back(v);
        for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j)
          m.back().push_back(std::make_pair(& cval[ j->first ], j->second));
      }
      return m;
    }
template<typename CKey, typename CVal, typename Q, typename index = unsigned int, typename KeyRefProd = typename helper::MapRefViewTrait<CKey>::refprod_type, typename ValRefProd = typename helper::MapRefViewTrait<CVal>::refprod_type, typename KeyRef = typename helper::MapRefViewTrait<CKey>::ref_type, typename ValRef = typename helper::MapRefViewTrait<CVal>::ref_type>
static val_type edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::val ( const ref_type ref,
const map_assoc iv 
) [inline, static]

return values collection

Definition at line 69 of file OneToManyWithQualityGeneric.h.

Referenced by edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double >::transientMap().

                                                                    {
      val_type v;
      for(typename map_assoc::const_iterator idx = iv.begin(), idxEnd = iv.end(); idx != idxEnd; ++idx)
        v.push_back(std::make_pair(ValRef(ref.val, idx->first), idx->second));
      return v;
    }