CMS 3D CMS Logo

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_assocmap_type
 map type More...
 
typedef helpers::KeyVal< keyrefprod_type, valrefprod_typeref_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 21 of file OneToManyWithQualityGeneric.h.

Member Typedef Documentation

◆ 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 std::pair<ValRef, Q> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::data_type

insert val type

Definition at line 35 of file OneToManyWithQualityGeneric.h.

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

index type

Definition at line 37 of file OneToManyWithQualityGeneric.h.

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

insert key type

Definition at line 33 of file OneToManyWithQualityGeneric.h.

◆ keyrefprod_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 23 of file OneToManyWithQualityGeneric.h.

◆ map_assoc

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 27 of file OneToManyWithQualityGeneric.h.

◆ 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::map<index_type, map_assoc> edm::OneToManyWithQualityGeneric< CKey, CVal, Q, index, KeyRefProd, ValRefProd, KeyRef, ValRef >::map_type

map type

Definition at line 39 of file OneToManyWithQualityGeneric.h.

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

reference set type

Definition at line 41 of file OneToManyWithQualityGeneric.h.

◆ 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::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 46 of file OneToManyWithQualityGeneric.h.

◆ 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::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 44 of file OneToManyWithQualityGeneric.h.

◆ 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::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 48 of file OneToManyWithQualityGeneric.h.

◆ 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 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 31 of file OneToManyWithQualityGeneric.h.

◆ valrefprod_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 25 of file OneToManyWithQualityGeneric.h.

Member Function Documentation

◆ insert() [1/2]

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 50 of file OneToManyWithQualityGeneric.h.

50  {
51  const ValRef &vref = v.first;
52  if (k.isNull() || vref.isNull())
53  Exception::throwThis(errors::InvalidReference, "can't insert null references in AssociationMap");
54  if (ref.key.isNull()) {
55  if (k.isTransient() || vref.isTransient()) {
57  "can't insert transient references in uninitialized AssociationMap");
58  }
59  //another thread might cause productGetter() to return a different value
60  EDProductGetter const *getter = ref.key.productGetter();
61  if (getter == nullptr) {
63  "Can't insert into AssociationMap unless it was properly initialized.\n"
64  "The most common fix for this is to add arguments to the call to the\n"
65  "AssociationMap constructor that are valid Handle's to the containers.\n"
66  "If you don't have valid handles or either template parameter to the\n"
67  "AssociationMap is a View, then see the comments in AssociationMap.h.\n"
68  "(note this was a new requirement added in the 7_5_X release series)\n");
69  }
70  ref.key = KeyRefProd(k.id(), getter);
71  ref.val = ValRefProd(vref.id(), ref.val.productGetter());
72  }
73  helpers::checkRef(ref.key, k);
74  helpers::checkRef(ref.val, vref);
75  index_type ik = index_type(k.key()), iv = index_type(vref.key());
76  m[ik].push_back(std::make_pair(iv, v.second));
77  }

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

◆ insert() [2/2]

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 78 of file OneToManyWithQualityGeneric.h.

78  {
79  for (typename val_type::const_iterator i = v.begin(), iEnd = v.end(); i != iEnd; ++i)
80  insert(ref, m, k, *i);
81  }

Referenced by BeautifulSoup.PageElement::append().

◆ 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 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 90 of file OneToManyWithQualityGeneric.h.

90 { return v.size(); }

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

◆ sort()

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 96 of file OneToManyWithQualityGeneric.h.

96  {
97  // using namespace boost::lambda;
98  for (typename map_type::iterator i = m.begin(), iEnd = m.end(); i != iEnd; ++i) {
99  using std::placeholders::_1;
100  using std::placeholders::_2;
101  map_assoc &v = i->second;
102  // Q std::pair<index, Q>::*quality = &std::pair<index, Q>::second;
103  // std::sort(v.begin(), v.end(),
104  // bind(quality, boost::lambda::_2) < bind(quality, boost::lambda::_1));
105  std::sort(v.begin(),
106  v.end(),
107  std::bind(std::less<Q>(),
108  std::bind(&std::pair<index, Q>::second, _2),
109  std::bind(&std::pair<index, Q>::second, _1)));
110  }
111  }

◆ transientKeyVector()

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 132 of file OneToManyWithQualityGeneric.h.

132  {
134  if (!map.empty()) {
135  const CKey &ckey = *ref.key;
136  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i)
137  m.push_back(&ckey[i->first]);
138  }
139  return m;
140  }

◆ transientMap()

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 113 of file OneToManyWithQualityGeneric.h.

113  {
115  if (!map.empty()) {
116  const CKey &ckey = *ref.key;
117  const CVal &cval = *ref.val;
118  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i) {
119  const map_assoc &a = i->second;
120  const typename CKey::value_type *k = &ckey[i->first];
121  std::vector<std::pair<const typename CVal::value_type *, Q> > v;
122  for (typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j) {
123  const typename CVal::value_type *val = &cval[j->first];
124  v.push_back(std::make_pair(val, j->second));
125  }
126  m.insert(std::make_pair(k, v));
127  }
128  }
129  return m;
130  }

◆ transientValVector()

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 142 of file OneToManyWithQualityGeneric.h.

142  {
144  if (!map.empty()) {
145  const CVal &cval = *ref.val;
146  for (typename map_type::const_iterator i = map.begin(); i != map.end(); ++i) {
147  const map_assoc &a = i->second;
148  std::vector<std::pair<const typename CVal::value_type *, Q> > v;
149  m.push_back(v);
150  for (typename map_assoc::const_iterator j = a.begin(); j != a.end(); ++j)
151  m.back().push_back(std::make_pair(&cval[j->first], j->second));
152  }
153  }
154  return m;
155  }

◆ val()

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 83 of file OneToManyWithQualityGeneric.h.

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

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

mps_fire.i
i
Definition: mps_fire.py:355
edm::errors::InvalidReference
Definition: EDMException.h:39
edm::errors::LogicError
Definition: EDMException.h:37
edm::OneToManyWithQualityGeneric::index_type
index index_type
index type
Definition: OneToManyWithQualityGeneric.h:37
edm::OneToManyWithQualityGeneric::map_assoc
std::vector< std::pair< index, Q > > map_assoc
internal map associated data
Definition: OneToManyWithQualityGeneric.h:27
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
findQualityFiles.v
v
Definition: findQualityFiles.py:179
training_settings.idx
idx
Definition: training_settings.py:16
edm::OneToManyWithQualityGeneric::transient_key_vector
std::vector< const typename CKey::value_type * > transient_key_vector
transient key vector
Definition: OneToManyWithQualityGeneric.h:46
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::helpers::checkRef
void checkRef(const RP &rp, const R &r)
throw if r hasn't the same id as rp
Definition: AssociationMapHelpers.h:51
edm::OneToManyWithQualityGeneric::insert
static void insert(ref_type &ref, map_type &m, const key_type &k, const data_type &v)
insert in the map
Definition: OneToManyWithQualityGeneric.h:50
dqmdumpme.k
k
Definition: dqmdumpme.py:60
a
double a
Definition: hdecay.h:119
EDProductGetter
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
edm::Exception::throwThis
static void throwThis(Code category, char const *message0="", char const *message1="", char const *message2="", char const *message3="", char const *message4="")
Definition: EDMException.cc:83
edm::OneToManyWithQualityGeneric::val_type
std::vector< std::pair< ValRef, Q > > val_type
values reference collection type
Definition: OneToManyWithQualityGeneric.h:31
edm::OneToManyWithQualityGeneric::val
static val_type val(const ref_type &ref, const map_assoc &iv)
return values collection
Definition: OneToManyWithQualityGeneric.h:83
genParticles_cff.map
map
Definition: genParticles_cff.py:11
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::OneToManyWithQualityGeneric::transient_val_vector
std::vector< std::vector< std::pair< const typename CVal::value_type *, Q > > > transient_val_vector
transient val vector
Definition: OneToManyWithQualityGeneric.h:48
edm::OneToManyWithQualityGeneric::transient_map_type
std::map< const typename CKey::value_type *, std::vector< std::pair< const typename CVal::value_type *, Q > > > transient_map_type
transient map type
Definition: OneToManyWithQualityGeneric.h:44