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

84  :
85  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:186
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 86 of file SimpleFlatTableProducer.h.

86 {}

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 87 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.

87  {
88  std::vector<ValType> vals(selobjs.size());
89  for (unsigned int i = 0, n = vals.size(); i < n; ++i) {
90  if(this->precision_ == -2){
92  }
93  else vals[i] = func_(*selobjs[i]);
94  }
95  out.template addColumn<ValType>(this->name_, vals, this->doc_, this->type_,this->precision_);
96  }
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 98 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 99 of file SimpleFlatTableProducer.h.