CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType > Class Template Reference
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 168 of file SimpleFlatTableProducer.cc.

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 170 of file SimpleFlatTableProducer.cc.

170  :
171  ExtVariable(aname, atype, cfg), token_(cc.consumes<edm::ValueMap<TIn>>(cfg.getParameter<edm::InputTag>("src"))) {}
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 172 of file SimpleFlatTableProducer.cc.

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

172  {
174  iEvent.getByToken(token_, vmap);
175  std::vector<ValType> vals(selptrs.size());
176  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
177  vals[i] = (*vmap)[selptrs[i]];
178  }
179  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->type_, this->precision_);
180  }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
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 182 of file SimpleFlatTableProducer.cc.