test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
pat::helper::AnythingToValueMap< Adaptor, Collection, value_type > Class Template Reference

#include <AnythingToValueMap.h>

Inheritance diagram for pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef edm::ValueMap< value_type > Map
 
typedef Map::Filler MapFiller
 
- 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
 

Public Member Functions

 AnythingToValueMap (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~AnythingToValueMap ()
 
- 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)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

Adaptor adaptor_
 
bool failSilently_
 
edm::EDGetTokenT< Collection > src_
 

Additional Inherited Members

- 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<class Adaptor, class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
class pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >

Definition at line 16 of file AnythingToValueMap.h.

Member Typedef Documentation

template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
typedef edm::ValueMap<value_type> pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::Map

Definition at line 18 of file AnythingToValueMap.h.

template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
typedef Map::Filler pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::MapFiller

Definition at line 19 of file AnythingToValueMap.h.

Constructor & Destructor Documentation

template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::AnythingToValueMap ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 20 of file AnythingToValueMap.h.

References pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::adaptor_.

20  :
21  failSilently_(iConfig.getUntrackedParameter<bool>("failSilently", false)),
22  src_(consumes<Collection>(iConfig.getParameter<edm::InputTag>("src"))),
23  adaptor_(iConfig,consumesCollector()) {
24  produces< Map >(adaptor_.label());
25  }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< Collection > src_
template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::~AnythingToValueMap ( )
inline

Definition at line 26 of file AnythingToValueMap.h.

26 { }

Member Function Documentation

template<class Adaptor , class Collection , typename value_type >
void pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 37 of file AnythingToValueMap.h.

References edm::HandleBase::failedToGet(), edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), patZpeak::handle, edm::helper::Filler< Map >::insert(), edm::Event::put(), and runTheMatrix::ret.

37  {
39  iEvent.getByToken(src_, handle);
40  if (handle.failedToGet() && failSilently_) return;
41 
42  bool adaptorOk = adaptor_.init(iEvent);
43  if ((!adaptorOk) && failSilently_) return;
44 
45  std::vector<value_type> ret;
46  ret.reserve(handle->size());
47 
48  adaptor_.run(*handle, ret);
49 
50  std::auto_ptr<Map> map(new Map());
51  MapFiller filler(*map);
52  filler.insert(handle, ret.begin(), ret.end());
53  filler.fill();
54  iEvent.put(map, adaptor_.label());
55 }
tuple ret
prodAgent to be discontinued
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
tuple handle
Definition: patZpeak.py:22
bool failedToGet() const
Definition: HandleBase.h:79
edm::EDGetTokenT< Collection > src_
edm::ValueMap< value_type > Map

Member Data Documentation

template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
Adaptor pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::adaptor_
private
template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
bool pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::failSilently_
private

Definition at line 31 of file AnythingToValueMap.h.

template<class Adaptor , class Collection = typename Adaptor::Collection, typename value_type = typename Adaptor::value_type>
edm::EDGetTokenT<Collection> pat::helper::AnythingToValueMap< Adaptor, Collection, value_type >::src_
private

Definition at line 32 of file AnythingToValueMap.h.