CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Static Public Member Functions | Private Types
edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef > Class Template Reference

#include <OneToManyWithQualityGeneric.h>

Public Types

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

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 More...
 
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 More...
 
static void sort (map_type &m)
 sort More...
 
static transient_key_vector transientKeyVector (const ref_type &ref, const map_type &map)
 fill transient key vector More...
 
static transient_map_type transientMap (const ref_type &ref, const map_type &map)
 fill transient map More...
 
static transient_val_vector transientValVector (const ref_type &ref, const map_type &map)
 fill transient val vector More...
 
static val_type val (const ref_type &ref, const map_assoc &iv)
 return values collection More...
 

Private Types

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

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 22 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

insert val type

Definition at line 36 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 index edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::index_type

index type

Definition at line 38 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 KeyRef edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::key_type

insert key type

Definition at line 34 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 KeyRefProd edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::keyrefprod_type
private

reference to "key" collection

Definition at line 24 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 28 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

map type

Definition at line 40 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 helpers::KeyVal<keyrefprod_type, valrefprod_type> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::ref_type

reference set type

Definition at line 42 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<const typename CKey::value_type *> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_key_vector

transient key vector

Definition at line 48 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<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

transient map type

Definition at line 46 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::vector<std::pair<const typename CVal::value_type *, Q > > > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transient_val_vector

transient val vector

Definition at line 51 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<ValRef, Q> > edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::val_type

values reference collection type

Definition at line 32 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 ValRefProd edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::valrefprod_type
private

reference to "value" collection

Definition at line 26 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 
)
inlinestatic

insert in the map

Definition at line 53 of file OneToManyWithQualityGeneric.h.

Referenced by BeautifulSoup.PageElement::_invert(), and edm::OneToManyWithQualityGeneric< std::vector< reco::Track >, std::vector< reco::Vertex >, int, unsigned int >::insert().

54  {
55  const ValRef & vref = v.first;
56  if (k.isNull() || vref.isNull())
58  "can't insert null references in AssociationMap");
59  if(ref.key.isNull()) {
60  if(k.isTransient() || vref.isTransient()) {
62  "can't insert transient references in uninitialized AssociationMap");
63  }
64  //another thread might cause productGetter() to return a different value
65  EDProductGetter const* getter = ref.key.productGetter();
66  if(getter == nullptr) {
68  "Can't insert into AssociationMap unless it was properly initialized.\n"
69  "The most common fix for this is to add arguments to the call to the\n"
70  "AssociationMap constructor that are valid Handle's to the containers.\n"
71  "If you don't have valid handles or either template parameter to the\n"
72  "AssociationMap is a View, then see the comments in AssociationMap.h.\n"
73  "(note this was a new requirement added in the 7_5_X release series)\n");
74  }
75  ref.key = KeyRefProd(k.id(), getter);
76  ref.val = ValRefProd(vref.id(), ref.val.productGetter());
77  }
78  helpers::checkRef(ref.key, k); helpers::checkRef(ref.val, vref);
79  index_type ik = index_type(k.key()), iv = index_type(vref.key());
80  m[ik].push_back(std::make_pair(iv, v.second));
81  }
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
void checkRef(const RP &rp, const R &r)
throw if r hasn&#39;t the same id as rp
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 
)
inlinestatic

Definition at line 82 of file OneToManyWithQualityGeneric.h.

Referenced by BeautifulSoup.PageElement::_invert().

82  {
83  for(typename val_type::const_iterator i = v.begin(), iEnd = v.end(); i != iEnd; ++i)
84  insert(ref, m, k, *i);
85  }
int i
Definition: DBlmapReader.cc:9
static void insert(ref_type &ref, map_type &m, const key_type &k, const data_type &v)
insert in the map
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)
inlinestatic

size of data_type

Definition at line 94 of file OneToManyWithQualityGeneric.h.

94 { 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)
inlinestatic

sort

Definition at line 100 of file OneToManyWithQualityGeneric.h.

100  {
101  // using namespace boost::lambda;
102  for(typename map_type::iterator i = m.begin(), iEnd = m.end(); i != iEnd; ++i) {
103 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
104  using std::placeholders::_1;
105  using std::placeholders::_2;
106 #endif
107  map_assoc & v = i->second;
108  // Q std::pair<index, Q>::*quality = &std::pair<index, Q>::second;
109  // std::sort(v.begin(), v.end(),
110  // bind(quality, boost::lambda::_2) < bind(quality, boost::lambda::_1));
111  std::sort(v.begin(), v.end(),
112 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
113  std::bind(std::less<Q>(),
114  std::bind(&std::pair<index, Q>::second,_2), std::bind( &std::pair<index, Q>::second,_1)
115 #else
116  boost::bind(std::less<Q>(),
117  boost::bind(&std::pair<index, Q>::second,_2), boost::bind( &std::pair<index, Q>::second,_1)
118 #endif
119  )
120  );
121 
122  }
123  }
int i
Definition: DBlmapReader.cc:9
U second(std::pair< T, U > const &p)
std::vector< std::pair< index, Q > > map_assoc
internal map associated data
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 
)
inlinestatic

fill transient key vector

Definition at line 144 of file OneToManyWithQualityGeneric.h.

144  {
146  if(!map.empty()) {
147  const CKey & ckey = * ref.key;
148  for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i)
149  m.push_back(& ckey[i->first]);
150  }
151  return m;
152  }
int i
Definition: DBlmapReader.cc:9
std::vector< const typename CKey::value_type * > transient_key_vector
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>
static transient_map_type edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientMap ( const ref_type ref,
const map_type map 
)
inlinestatic

fill transient map

Definition at line 125 of file OneToManyWithQualityGeneric.h.

125  {
127  if(!map.empty()) {
128  const CKey & ckey = * ref.key;
129  const CVal & cval = * ref.val;
130  for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) {
131  const map_assoc & a = i->second;
132  const typename CKey::value_type * k = & ckey[i->first];
133  std::vector<std::pair<const typename CVal::value_type *, Q> > v;
134  for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j) {
135  const typename CVal::value_type * val = & cval[j->first];
136  v.push_back(std::make_pair(val, j->second));
137  }
138  m.insert(std::make_pair(k, v));
139  }
140  }
141  return m;
142  }
int i
Definition: DBlmapReader.cc:9
static val_type val(const ref_type &ref, const map_assoc &iv)
return values collection
int j
Definition: DBlmapReader.cc:9
Container::value_type value_type
std::vector< std::pair< index, Q > > map_assoc
internal map associated data
double a
Definition: hdecay.h:121
std::map< const typename CKey::value_type *, std::vector< std::pair< const typename CVal::value_type *, Q > > > transient_map_type
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>
static transient_val_vector edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::transientValVector ( const ref_type ref,
const map_type map 
)
inlinestatic

fill transient val vector

Definition at line 154 of file OneToManyWithQualityGeneric.h.

154  {
156  if(!map.empty()) {
157  const CVal & cval = * ref.val;
158  for(typename map_type::const_iterator i = map.begin(); i != map.end(); ++ i) {
159  const map_assoc & a = i->second;
160  std::vector<std::pair<const typename CVal::value_type *, Q> > v;
161  m.push_back(v);
162  for(typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j)
163  m.back().push_back(std::make_pair(& cval[ j->first ], j->second));
164  }
165  }
166  return m;
167  }
int i
Definition: DBlmapReader.cc:9
int j
Definition: DBlmapReader.cc:9
std::vector< std::pair< index, Q > > map_assoc
internal map associated data
std::vector< std::vector< std::pair< const typename CVal::value_type *, Q > > > transient_val_vector
transient val vector
double a
Definition: hdecay.h:121
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 
)
inlinestatic

return values collection

Definition at line 87 of file OneToManyWithQualityGeneric.h.

Referenced by edm::OneToManyWithQualityGeneric< std::vector< reco::Track >, std::vector< reco::Vertex >, int, unsigned int >::transientMap().

87  {
88  val_type v;
89  for(typename map_assoc::const_iterator idx = iv.begin(), idxEnd = iv.end(); idx != idxEnd; ++idx)
90  v.push_back(std::make_pair(ValRef(ref.val, idx->first), idx->second));
91  return v;
92  }
std::vector< std::pair< ValRef, Q > > val_type
values reference collection type
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...