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, const edm::ParameterSet &cfg, edm::ConsumesCollector &&cc)
 
- Public Member Functions inherited from SimpleFlatTableProducer< T >::ExtVariable
 ExtVariable (const std::string &aname, 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

◆ ValueMapVariable()

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

Definition at line 197 of file SimpleFlatTableProducer.h.

198  : ExtVariable(aname, cfg), token_(cc.consumes<edm::ValueMap<TIn>>(cfg.getParameter<edm::InputTag>("src"))) {}

Member Function Documentation

◆ fill()

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 199 of file SimpleFlatTableProducer.h.

199  {
201  iEvent.getByToken(token_, vmap);
202  std::vector<ValType> vals(selptrs.size());
203  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
204  vals[i] = (*vmap)[selptrs[i]];
205  }
206  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->precision_);
207  }

References SimpleFlatTableProducerBase< T, edm::View< T > >::doc_, mps_fire::i, iEvent, dqmiodumpmetadata::n, SimpleFlatTableProducerBase< T, edm::View< T > >::name_, MillePedeFileConverter_cfg::out, and SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >::token_.

Member Data Documentation

◆ token_

template<typename T >
template<typename TIn , typename ValType = TIn>
edm::EDGetTokenT<edm::ValueMap<TIn> > SimpleFlatTableProducer< T >::ValueMapVariable< TIn, ValType >::token_
protected
SimpleFlatTableProducer::ExtVariable::ExtVariable
ExtVariable(const std::string &aname, const edm::ParameterSet &cfg)
Definition: SimpleFlatTableProducer.h:191
mps_fire.i
i
Definition: mps_fire.py:428
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
SimpleFlatTableProducer::ValueMapVariable::token_
edm::EDGetTokenT< edm::ValueMap< TIn > > token_
Definition: SimpleFlatTableProducer.h:210
edm::Handle
Definition: AssociativeIterator.h:50
SimpleFlatTableProducerBase< T, edm::View< T > >::name_
const std::string name_
Definition: SimpleFlatTableProducer.h:58
iEvent
int iEvent
Definition: GenABIO.cc:224
cc
looper.cfg
cfg
Definition: looper.py:297
edm::ValueMap
Definition: ValueMap.h:107
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SimpleFlatTableProducerBase< T, edm::View< T > >::doc_
const std::string doc_
Definition: SimpleFlatTableProducer.h:59
edm::InputTag
Definition: InputTag.h:15