#include <PhysicsTools/UtilAlgos/interface/AssociationMapOneToOne2Association.h>
Public Member Functions | |
AssociationMapOneToOne2Association (const edm::ParameterSet &) | |
Private Types | |
typedef edm::AssociationMap < edm::OneToOne< CKey, CVal > > | am_t |
typedef edm::Association< CVal > | as_t |
Private Member Functions | |
void | produce (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | am_ |
Definition at line 17 of file AssociationMapOneToOne2Association.h.
typedef edm::AssociationMap<edm::OneToOne<CKey, CVal> > AssociationMapOneToOne2Association< CKey, CVal >::am_t [private] |
Definition at line 21 of file AssociationMapOneToOne2Association.h.
typedef edm::Association<CVal> AssociationMapOneToOne2Association< CKey, CVal >::as_t [private] |
Definition at line 22 of file AssociationMapOneToOne2Association.h.
AssociationMapOneToOne2Association< CKey, CVal >::AssociationMapOneToOne2Association | ( | const edm::ParameterSet & | cfg | ) | [inline] |
Definition at line 34 of file AssociationMapOneToOne2Association.h.
00034 : 00035 am_(cfg.template getParameter<edm::InputTag>("src")) { 00036 produces<as_t>(); 00037 }
void AssociationMapOneToOne2Association< CKey, CVal >::produce | ( | edm::Event & | evt, | |
const edm::EventSetup & | ||||
) | [inline, private, virtual] |
Implements edm::EDProducer.
Definition at line 40 of file AssociationMapOneToOne2Association.h.
References AssociationMapOneToOne2Association< CKey, CVal >::am_, as, edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), edm::Event::put(), size, and std.
00040 { 00041 using namespace edm; 00042 using namespace std; 00043 Handle<am_t> am; 00044 evt.getByLabel(am_, am); 00045 00046 auto_ptr<as_t> as(new as_t); 00047 typename as_t::Filler filler(*as); 00048 filler.fill(); 00049 size_t size = am->size(); 00050 vector<int> indices; 00051 indices.reserve(size); 00052 for(typename am_t::const_iterator i = am->begin(); i != am->end(); ++i) { 00053 indices.push_back(i->val.key()); 00054 } 00055 filler.insert(am->refProd().key, indices.begin(), indices.end()); 00056 evt.put(as); 00057 }
edm::InputTag AssociationMapOneToOne2Association< CKey, CVal >::am_ [private] |
Definition at line 24 of file AssociationMapOneToOne2Association.h.
Referenced by AssociationMapOneToOne2Association< CKey, CVal >::produce().