CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

AssociationMapOneToOne2Association< CKey, CVal > Class Template Reference

#include <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)

Definition at line 34 of file AssociationMapOneToOne2Association.h.

                                                                                                             :
  am_(cfg.template getParameter<edm::InputTag>("src")) {
  produces<as_t>();
}

Member Function Documentation

template<typename CKey , typename CVal >
void AssociationMapOneToOne2Association< CKey, CVal >::produce ( edm::Event evt,
const edm::EventSetup  
) [private, virtual]

Implements edm::EDProducer.

Definition at line 40 of file AssociationMapOneToOne2Association.h.

References edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), i, edm::helper::Filler< Map >::insert(), edm::Event::put(), and findQualityFiles::size.

                                                                                                {
  using namespace edm;
  using namespace std;
  Handle<am_t> am;
  evt.getByLabel(am_, am);

  auto_ptr<as_t> as(new as_t);  
  typename as_t::Filler filler(*as);
  filler.fill();
  size_t size = am->size();
  vector<int> indices;
  indices.reserve(size);
  for(typename am_t::const_iterator i = am->begin(); i != am->end(); ++i) {
    indices.push_back(i->val.key());
  }
  filler.insert(am->refProd().key, indices.begin(), indices.end());
  evt.put(as);
}

Member Data Documentation

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

Definition at line 24 of file AssociationMapOneToOne2Association.h.