CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Attributes
SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType > Class Template Reference

#include <SimpleFlatTableProducer.h>

Inheritance diagram for SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >:
SimpleFlatTableProducerBase< T, TProd >::Variable SimpleFlatTableProducerBase< T, TProd >::VariableBase

Public Member Functions

void fill (std::vector< const T * > selobjs, nanoaod::FlatTable &out) const override
 
 FuncVariable (const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)
 
 ~FuncVariable () override
 
- Public Member Functions inherited from SimpleFlatTableProducerBase< T, TProd >::Variable
 Variable (const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)
 
- Public Member Functions inherited from SimpleFlatTableProducerBase< T, TProd >::VariableBase
const std::string & name () const
 
const nanoaod::FlatTable::ColumnTypetype () const
 
 VariableBase (const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)
 
virtual ~VariableBase ()
 

Protected Attributes

StringFunctor func_
 
StringFunctor precisionFunc_
 
- Protected Attributes inherited from SimpleFlatTableProducerBase< T, TProd >::VariableBase
std::string doc_
 
std::string name_
 
int precision_
 
nanoaod::FlatTable::ColumnType type_
 

Detailed Description

template<typename T, typename TProd>
template<typename StringFunctor, typename ValType>
class SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >

Definition at line 84 of file SimpleFlatTableProducer.h.

Constructor & Destructor Documentation

template<typename T, typename TProd>
template<typename StringFunctor , typename ValType >
SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >::FuncVariable ( const std::string &  aname,
nanoaod::FlatTable::ColumnType  atype,
const edm::ParameterSet cfg 
)
inline

Definition at line 86 of file SimpleFlatTableProducer.h.

86  :
87  Variable(aname, atype, cfg), func_(cfg.getParameter<std::string>("expr"), true), precisionFunc_(cfg.existsAs<std::string>("precision") ? cfg.getParameter<std::string>("precision") : "23",true){}
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
Variable(const std::string &aname, nanoaod::FlatTable::ColumnType atype, const edm::ParameterSet &cfg)
template<typename T, typename TProd>
template<typename StringFunctor , typename ValType >
SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >::~FuncVariable ( )
inlineoverride

Definition at line 88 of file SimpleFlatTableProducer.h.

88 {}

Member Function Documentation

template<typename T, typename TProd>
template<typename StringFunctor , typename ValType >
void SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >::fill ( std::vector< const T * >  selobjs,
nanoaod::FlatTable out 
) const
inlineoverridevirtual

Implements SimpleFlatTableProducerBase< T, TProd >::Variable.

Definition at line 89 of file SimpleFlatTableProducer.h.

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

89  {
90  std::vector<ValType> vals(selobjs.size());
91  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
92  if(this->precision_ == -2){
94  }
95  else vals[i] = func_(*selobjs[i]);
96  }
97  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->type_,this->precision_);
98  }
static float reduceMantissaToNbitsRounding(const float &f)
Definition: libminifloat.h:86

Member Data Documentation

template<typename T, typename TProd>
template<typename StringFunctor , typename ValType >
StringFunctor SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >::func_
protected

Definition at line 100 of file SimpleFlatTableProducer.h.

template<typename T, typename TProd>
template<typename StringFunctor , typename ValType >
StringFunctor SimpleFlatTableProducerBase< T, TProd >::FuncVariable< StringFunctor, ValType >::precisionFunc_
protected

Definition at line 101 of file SimpleFlatTableProducer.h.