CMS 3D CMS Logo

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

AssociationVector2ValueMap< KeyRefProd, CVal > Class Template Reference

#include <AssociationVector2ValueMap.h>

Inheritance diagram for AssociationVector2ValueMap< KeyRefProd, CVal >:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 AssociationVector2ValueMap (const edm::ParameterSet &)

Private Types

typedef edm::AssociationVector
< KeyRefProd, CVal > 
av_t
typedef av_t::CKey collection_t
typedef CVal::value_type value_t
typedef edm::ValueMap< value_tvm_t

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

edm::InputTag av_

Detailed Description

template<typename KeyRefProd, typename CVal>
class AssociationVector2ValueMap< KeyRefProd, CVal >

Definition at line 16 of file AssociationVector2ValueMap.h.


Member Typedef Documentation

template<typename KeyRefProd , typename CVal >
typedef edm::AssociationVector<KeyRefProd, CVal> AssociationVector2ValueMap< KeyRefProd, CVal >::av_t [private]

Definition at line 20 of file AssociationVector2ValueMap.h.

template<typename KeyRefProd , typename CVal >
typedef av_t::CKey AssociationVector2ValueMap< KeyRefProd, CVal >::collection_t [private]

Definition at line 23 of file AssociationVector2ValueMap.h.

template<typename KeyRefProd , typename CVal >
typedef CVal::value_type AssociationVector2ValueMap< KeyRefProd, CVal >::value_t [private]

Definition at line 21 of file AssociationVector2ValueMap.h.

template<typename KeyRefProd , typename CVal >
typedef edm::ValueMap<value_t> AssociationVector2ValueMap< KeyRefProd, CVal >::vm_t [private]

Definition at line 22 of file AssociationVector2ValueMap.h.


Constructor & Destructor Documentation

template<typename KeyRefProd , typename CVal >
AssociationVector2ValueMap< KeyRefProd, CVal >::AssociationVector2ValueMap ( const edm::ParameterSet cfg)

Definition at line 35 of file AssociationVector2ValueMap.h.

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

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 41 of file AssociationVector2ValueMap.h.

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

                                                                                              {
  using namespace edm;
  using namespace std;
  Handle<av_t> av;
  evt.getByLabel(av_, av);

  auto_ptr<vm_t> vm(new vm_t);  
  typename vm_t::Filler filler(*vm);
  filler.fill();
  size_t size = av->size();
  vector<value_t> values;
  values.reserve(size);
  for(typename av_t::const_iterator i = av->begin(); i != av->end(); ++i) {
    values.push_back(i->second);
  }
  filler.insert(av->keyProduct(), values.begin(), values.end());
  evt.put(vm);
}

Member Data Documentation

template<typename KeyRefProd , typename CVal >
edm::InputTag AssociationVector2ValueMap< KeyRefProd, CVal >::av_ [private]

Definition at line 25 of file AssociationVector2ValueMap.h.