CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType > Class Template Reference

#include <SimpleFlatTableProducer.h>

Inheritance diagram for SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >:
SimpleFlatTableProducer< T >::ExtVariable

Public Member Functions

void fill (const edm::Event &iEvent, std::vector< edm::Ptr< T >> selptrs, nanoaod::FlatTable &out) const override
 
 ValueMapVariable (const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg, edm::ConsumesCollector &&cc)
 
- Public Member Functions inherited from SimpleFlatTableProducer< T >::ExtVariable
 ExtVariable (const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)
 

Protected Attributes

edm::EDGetTokenT< edm::ValueMap< TIn > > token_
 

Detailed Description

template<typename T>
template<typename TIn, typename ValType = TIn>
class SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >

Definition at line 195 of file SimpleFlatTableProducer.h.

Constructor & Destructor Documentation

template<typename T >
template<typename TIn , typename ValType = TIn>
SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >::ValueMapVariable ( const std::string &  aname,
nanoaod::FlatTable::ColumnType  atype,
const edm::ParameterSet cfg,
edm::ConsumesCollector &&  cc 
)
inline

Definition at line 197 of file SimpleFlatTableProducer.h.

201  : ExtVariable(aname, atype, cfg),
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::ValueMap< TIn > > token_
ExtVariable(const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)

Member Function Documentation

template<typename T >
template<typename TIn , typename ValType = TIn>
void SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >::fill ( const edm::Event iEvent,
std::vector< edm::Ptr< T >>  selptrs,
nanoaod::FlatTable out 
) const
inlineoverridevirtual

Implements SimpleFlatTableProducer< T >::ExtVariable.

Definition at line 203 of file SimpleFlatTableProducer.h.

References SimpleFlatTableProducerBase< T, TProd >::VariableBase::doc_, edm::Event::getByToken(), mps_fire::i, dqmiodumpmetadata::n, SimpleFlatTableProducerBase< T, TProd >::VariableBase::name_, SimpleFlatTableProducerBase< T, TProd >::VariableBase::precision_, and SimpleFlatTableProducerBase< T, TProd >::VariableBase::type_.

203  {
205  iEvent.getByToken(token_, vmap);
206  std::vector<ValType> vals(selptrs.size());
207  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
208  vals[i] = (*vmap)[selptrs[i]];
209  }
210  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->type_, this->precision_);
211  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< edm::ValueMap< TIn > > token_

Member Data Documentation

template<typename T >
template<typename TIn , typename ValType = TIn>
edm::EDGetTokenT<edm::ValueMap<TIn> > SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >::token_
protected

Definition at line 214 of file SimpleFlatTableProducer.h.