CMS 3D CMS Logo

List of all members | 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::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AssociationMapOneToOne2Association (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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

Private Attributes

edm::EDGetTokenT< am_tam_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 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.

34  :
35  am_(consumes<am_t>(cfg.template getParameter<edm::InputTag>("src"))) {
36  produces<as_t>();
37 }

Member Function Documentation

template<typename CKey , typename CVal >
void AssociationMapOneToOne2Association< CKey, CVal >::produce ( edm::Event evt,
const edm::EventSetup  
)
overrideprivate

Definition at line 40 of file AssociationMapOneToOne2Association.h.

References AssociationMapOneToOne2Association< CKey, CVal >::am_, edm::helper::Filler< Map >::fill(), objects.autophobj::filler, edm::Event::getByToken(), mps_fire::i, edm::helper::Filler< Map >::insert(), eostools::move(), edm::Event::put(), and findQualityFiles::size.

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

40  {
41  using namespace edm;
42  using namespace std;
43  Handle<am_t> am;
44  evt.getByToken(am_, am);
45 
46  unique_ptr<as_t> as(new as_t);
47  typename as_t::Filler filler(*as);
48  filler.fill();
49  size_t size = am->size();
50  vector<int> indices;
51  indices.reserve(size);
52  for(typename am_t::const_iterator i = am->begin(); i != am->end(); ++i) {
53  indices.push_back(i->val.key());
54  }
55  filler.insert(am->refProd().key, indices.begin(), indices.end());
56  evt.put(std::move(as));
57 }
size
Write out results.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
friend struct const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
helper::Filler< ValueMap< int > > Filler
Definition: ValueMap.h:168
HLT enums.
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename CKey , typename CVal >
edm::EDGetTokenT<am_t> AssociationMapOneToOne2Association< CKey, CVal >::am_
private