CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | 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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AssociationVector2ValueMap (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &) override
 

Private Attributes

edm::EDGetTokenT< av_tav_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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.

35  :
36  av_(consumes<av_t>(cfg.template getParameter<edm::InputTag>("src"))) {
37  produces<vm_t>();
38 }

Member Function Documentation

template<typename KeyRefProd , typename CVal >
void AssociationVector2ValueMap< KeyRefProd, CVal >::produce ( edm::Event evt,
const edm::EventSetup  
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 41 of file AssociationVector2ValueMap.h.

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

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

41  {
42  using namespace edm;
43  using namespace std;
44  Handle<av_t> av;
45  evt.getByToken(av_, av);
46 
47  auto_ptr<vm_t> vm(new vm_t);
48  typename vm_t::Filler filler(*vm);
49  filler.fill();
50  size_t size = av->size();
51  vector<value_t> values;
52  values.reserve(size);
53  for(typename av_t::const_iterator i = av->begin(); i != av->end(); ++i) {
54  values.push_back(i->second);
55  }
56  filler.insert(av->keyProduct(), values.begin(), values.end());
57  evt.put(vm);
58 }
int i
Definition: DBlmapReader.cc:9
transient_vector_type::const_iterator const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
helper::Filler< ValueMap< T > > Filler
Definition: ValueMap.h:156
tuple size
Write out results.

Member Data Documentation

template<typename KeyRefProd , typename CVal >
edm::EDGetTokenT<av_t> AssociationVector2ValueMap< KeyRefProd, CVal >::av_
private

Definition at line 25 of file AssociationVector2ValueMap.h.