#include <DataFormats/Common/interface/AssociationVector.h>
Public Types | |
typedef KeyRefProd::product_type | CKey |
typedef transient_vector_type::const_iterator | const_iterator |
typedef const value_type & | const_reference |
typedef KeyRef::value_type | key_type |
typedef KeyRefProd | refprod_type |
typedef SizeType | size_type |
typedef std::vector< value_type > | transient_vector_type |
typedef std::pair< KeyRef, typename CVal::value_type > | value_type |
Public Member Functions | |
AssociationVector (const AssociationVector &) | |
AssociationVector (const KeyRefProd &ref, const CKey *=0) | |
AssociationVector () | |
const_iterator | begin () const |
void | clear () |
bool | empty () const |
const_iterator | end () const |
void | fillView (ProductID const &id, std::vector< void const * > &pointers, helper_vector &helpers) const |
KeyRef | key (size_type i) const |
const KeyRefProd & | keyProduct () const |
self & | operator= (const self &) |
CVal::reference | operator[] (const KeyRef &k) |
CVal::const_reference | operator[] (const KeyRef &k) const |
const_reference | operator[] (size_type n) const |
void | setValue (size_type i, const typename CVal::value_type &val) |
size_type | size () const |
void | swap (self &other) |
const CVal::value_type | value (size_type i) const |
~AssociationVector () | |
Private Types | |
typedef AssociationVector < KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > | self |
Private Member Functions | |
BOOST_STATIC_ASSERT ((boost::is_same< SizeType, typename CVal::size_type >::value)) | |
void | fixup () const |
const transient_vector_type & | transientVector () const |
Private Attributes | |
CVal | data_ |
bool | fixed_ |
KeyRefProd | ref_ |
transient_vector_type | transientVector_ |
Definition at line 61 of file AssociationVector.h.
typedef KeyRefProd::product_type edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::CKey |
Definition at line 67 of file AssociationVector.h.
typedef transient_vector_type::const_iterator edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::const_iterator |
Definition at line 96 of file AssociationVector.h.
typedef const value_type& edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::const_reference |
Definition at line 72 of file AssociationVector.h.
typedef KeyRef::value_type edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::key_type |
Definition at line 69 of file AssociationVector.h.
typedef KeyRefProd edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::refprod_type |
Definition at line 66 of file AssociationVector.h.
typedef AssociationVector<KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper> edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::self [private] |
Definition at line 63 of file AssociationVector.h.
typedef SizeType edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size_type |
Definition at line 68 of file AssociationVector.h.
typedef std::vector<value_type> edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transient_vector_type |
Definition at line 71 of file AssociationVector.h.
typedef std::pair<KeyRef, typename CVal::value_type> edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::value_type |
Definition at line 70 of file AssociationVector.h.
edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::AssociationVector | ( | ) | [inline] |
Definition at line 111 of file AssociationVector.h.
00111 : 00112 data_(), ref_(), transientVector_(), fixed_(false) { }
edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::AssociationVector | ( | const KeyRefProd & | ref, | |
const CKey * | coll = 0 | |||
) | [inline] |
Definition at line 115 of file AssociationVector.h.
00116 : 00117 data_(coll == 0 ? ref->size() : coll->size()), ref_(ref), 00118 transientVector_(coll == 0 ? ref->size() : coll->size()), fixed_(true) { }
edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::AssociationVector | ( | const AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > & | o | ) | [inline] |
Definition at line 122 of file AssociationVector.h.
00122 : 00123 data_(o.data_), ref_(o.ref_), transientVector_(o.transientVector_), fixed_(o.fixed_) { }
edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::~AssociationVector | ( | ) | [inline] |
const_iterator edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::begin | ( | ) | const [inline] |
Definition at line 98 of file AssociationVector.h.
Referenced by BTagPerformanceAnalyzerOnData::analyze(), BTagPerformanceAnalyzerMC::analyze(), BTagPerformanceAnalyzer::analyze(), HLTJetTag::filter(), and VisJetTagTwig::onNewEvent().
00098 { return transientVector().begin(); }
edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::BOOST_STATIC_ASSERT | ( | (boost::is_same< SizeType, typename CVal::size_type >::value) | ) | [private] |
void edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::clear | ( | void | ) | [inline] |
Definition at line 188 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_, and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector_.
00188 { 00189 data_.clear(); 00190 transientVector_.clear(); 00191 ref_ = KeyRefProd(); 00192 fixed_ = true; 00193 }
bool edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::empty | ( | ) | const [inline] |
Definition at line 183 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_.
00183 { 00184 return data_.empty(); 00185 }
const_iterator edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::end | ( | ) | const [inline] |
Definition at line 99 of file AssociationVector.h.
Referenced by BTagPerformanceAnalyzerOnData::analyze(), BTagPerformanceAnalyzerMC::analyze(), BTagPerformanceAnalyzer::analyze(), HLTJetTag::filter(), and VisJetTagTwig::onNewEvent().
00099 { return transientVector().end(); }
void edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fillView | ( | ProductID const & | id, | |
std::vector< void const * > & | pointers, | |||
helper_vector & | helpers | |||
) | const [inline] |
Definition at line 215 of file AssociationVector.h.
References edm::detail::reallyFillView().
Referenced by edm::fillView().
00218 { 00219 detail::reallyFillView(*this, id, pointers, helpers); 00220 // pointers.reserve(this->size()); 00221 // for(typename CVal::const_iterator i=data_.begin(), e=data_.end(); i!=e; ++i) 00222 // pointers.push_back(&(*i)); 00223 // // helpers is not yet filled in. 00224 // //throw edm::Exception(errors::UnimplementedFeature, "AssociationVector<T>::fillView(...)"); 00225 }
void edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup | ( | ) | const [inline, private] |
Definition at line 204 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_, i, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector_.
Referenced by edm::edm::AssociationVector< int > >::transientVector().
00204 { 00205 if (!fixed_) { 00206 fixed_ = true; 00207 transientVector_.resize( size() ); 00208 for( size_type i = 0; i != size(); ++ i ) { 00209 transientVector_[ i ] = std::make_pair( KeyRef(ref_, i), data_[ i ] ); 00210 } 00211 } 00212 }
KeyRef edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::key | ( | size_type | i | ) | const [inline] |
const KeyRefProd& edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::keyProduct | ( | ) | const [inline] |
AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper > & edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator= | ( | const self & | o | ) | [inline] |
Definition at line 161 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_, and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_.
00161 { 00162 data_ = o.data_; 00163 ref_ = o.ref_; 00164 fixed_ = false; 00165 return * this; 00166 }
CVal::reference edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[] | ( | const KeyRef & | k | ) | [inline] |
Definition at line 148 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_, DBSPlugin::get(), edm::errors::InvalidReference, and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_.
00148 { 00149 KeyRef keyRef = KeyReferenceHelper::get( k, ref_.id() ); 00150 fixed_ = false; 00151 if ( keyRef.id() == ref_.id() ) 00152 return data_[ keyRef.key() ]; 00153 else 00154 throw edm::Exception(edm::errors::InvalidReference) 00155 << "AssociationVector: trying to use [] operator passing a reference" 00156 << " with the wrong product id (i.e.: pointing to the wrong collection)"; 00157 }
CVal::const_reference edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[] | ( | const KeyRef & | k | ) | const [inline] |
Definition at line 136 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, DBSPlugin::get(), edm::errors::InvalidReference, and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_.
00136 { 00137 KeyRef keyRef = KeyReferenceHelper::get( k, ref_.id() ); 00138 if ( keyRef.id() == ref_.id() ) 00139 return data_[ keyRef.key() ]; 00140 else 00141 throw edm::Exception(edm::errors::InvalidReference) 00142 << "AssociationVector: trying to use [] operator passing a reference" 00143 << " with the wrong product id (i.e.: pointing to the wrong collection)"; 00144 }
AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::const_reference edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[] | ( | size_type | n | ) | const [inline] |
Definition at line 130 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector().
00130 { 00131 return transientVector()[ n ]; 00132 }
void edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue | ( | size_type | i, | |
const typename CVal::value_type & | val | |||
) | [inline] |
Definition at line 169 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_, and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector_.
Referenced by EgammaPhotonTkIsolationProducer::produce(), EgammaElectronTkIsolationProducer::produce(), EgammaElectronTkNumIsolationProducer::produce(), EgammaPhotonTkNumIsolationProducer::produce(), EgammaHcalIsolationProducer::produce(), EgammaEcalRecHitIsolationProducer::produce(), EgammaEcalIsolationProducer::produce(), and EgammaTowerIsolationProducer::produce().
00169 { 00170 data_[ i ] = val; 00171 KeyRef ref(ref_, i); 00172 transientVector_[ i ].first = ref; 00173 transientVector_[ i ].second = data_[ i ]; 00174 }
AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size_type edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size | ( | void | ) | const [inline] |
Definition at line 178 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_.
Referenced by HLTBJet::analyseLifetime(), HLTBJet::analyseLifetimeLoose(), HLTBJet::analysePerformance(), HLTBJet::analyseSoftmuon(), BTagPerformanceAnalyzerOnData::analyze(), BTagPerformanceAnalyzerMC::analyze(), BTagPerformanceAnalyzer::analyze(), closestJet(), HLTJetTag::filter(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup().
00178 { 00179 return data_.size(); 00180 }
void edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::swap | ( | self & | other | ) | [inline] |
Definition at line 196 of file AssociationVector.h.
References edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_, std::swap(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector_.
Referenced by edm::swap().
00196 { 00197 data_.swap(other.data_); 00198 transientVector_.swap(other.transientVector_); 00199 ref_.swap( other.ref_); 00200 std::swap(fixed_, other.fixed_); 00201 }
const transient_vector_type& edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector | ( | ) | const [inline, private] |
Definition at line 106 of file AssociationVector.h.
Referenced by edm::edm::AssociationVector< int > >::begin(), edm::edm::AssociationVector< int > >::end(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[]().
00106 { fixup(); return transientVector_; }
const CVal::value_type edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::value | ( | size_type | i | ) | const [inline] |
CVal edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::data_ [private] |
Definition at line 102 of file AssociationVector.h.
Referenced by edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::clear(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::empty(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator=(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[](), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::size(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::swap(), and edm::edm::AssociationVector< int > >::value().
bool edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixed_ [mutable, private] |
Definition at line 105 of file AssociationVector.h.
Referenced by edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::clear(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator=(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[](), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::swap().
KeyRefProd edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::ref_ [private] |
Definition at line 103 of file AssociationVector.h.
Referenced by edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::clear(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup(), edm::edm::AssociationVector< int > >::key(), edm::edm::AssociationVector< int > >::keyProduct(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator=(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::operator[](), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), and edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::swap().
transient_vector_type edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::transientVector_ [mutable, private] |
Definition at line 104 of file AssociationVector.h.
Referenced by edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::clear(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::fixup(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::setValue(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::swap(), and edm::edm::AssociationVector< int > >::transientVector().