CMS 3D CMS Logo

AssociationMapOneToOne2Association< CKey, CVal > Class Template Reference

#include <PhysicsTools/UtilAlgos/interface/AssociationMapOneToOne2Association.h>

Inheritance diagram for AssociationMapOneToOne2Association< CKey, CVal >:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

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_


Detailed Description

template<typename CKey, typename CVal>
class AssociationMapOneToOne2Association< CKey, CVal >

Definition at line 17 of file AssociationMapOneToOne2Association.h.


Member Typedef Documentation

template<typename CKey, typename CVal>
typedef edm::AssociationMap<edm::OneToOne<CKey, CVal> > AssociationMapOneToOne2Association< CKey, CVal >::am_t [private]

Definition at line 21 of file AssociationMapOneToOne2Association.h.

template<typename CKey, typename CVal>
typedef edm::Association<CVal> AssociationMapOneToOne2Association< CKey, CVal >::as_t [private]

Definition at line 22 of file AssociationMapOneToOne2Association.h.


Constructor & Destructor Documentation

template<typename CKey, typename CVal>
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 }


Member Function Documentation

template<typename CKey, typename CVal>
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 }


Member Data Documentation

template<typename CKey, typename CVal>
edm::InputTag AssociationMapOneToOne2Association< CKey, CVal >::am_ [private]

Definition at line 24 of file AssociationMapOneToOne2Association.h.

Referenced by AssociationMapOneToOne2Association< CKey, CVal >::produce().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:14:49 2009 for CMSSW by  doxygen 1.5.4