CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
VariablePower Class Reference

#include <CachingVariable.h>

Inheritance diagram for VariablePower:
CachingVariable

Public Member Functions

CachingVariable::evalType eval (const edm::Event &iEvent) const
 
 VariablePower (CachingVariableFactoryArg arg)
 
 ~VariablePower ()
 
- Public Member Functions inherited from CachingVariable
void addDescriptionLine (const std::string &s)
 
 CachingVariable (std::string m, std::string n, const edm::ParameterSet &iConfig)
 
bool compute (const edm::Event &iEvent) const
 
const Descriptiondescription () const
 
const std::string & holderName () const
 
const std::string & method () const
 
const std::string & name () const
 
valueType operator() (const edm::Event &iEvent) const
 
void print () const
 
void setHolder (std::string hn) const
 
virtual ~CachingVariable ()
 

Private Attributes

double power_
 
std::string var_
 

Additional Inherited Members

- Public Types inherited from CachingVariable
typedef std::pair< bool,
valueType
evalType
 
typedef double valueType
 
typedef std::map< std::string,
const CachingVariable * > 
vMap
 
- Protected Member Functions inherited from CachingVariable
evalTypebaseEval (const edm::Event &iEvent) const
 
void setCache (valueType &v) const
 
void setNotCompute () const
 
- Protected Attributes inherited from CachingVariable
evalType cache_
 
edm::ParameterSet conf_
 
Description d_
 
std::string holderName_
 
std::string method_
 
std::string name_
 

Detailed Description

Definition at line 482 of file CachingVariable.h.

Constructor & Destructor Documentation

VariablePower::VariablePower ( CachingVariableFactoryArg  arg)
inline

Definition at line 484 of file CachingVariable.h.

References CachingVariable::addDescriptionLine(), edm::ParameterSet::getParameter(), CachingVariable::CachingVariableFactoryArg::iConfig, CachingVariable::CachingVariableFactoryArg::m, CachingVariable::CachingVariableFactoryArg::n, power_, and var_.

484  :
485  CachingVariable("Power",arg.n,arg.iConfig){
486  power_=arg.iConfig.getParameter<double>("power");
487  var_=arg.iConfig.getParameter<std::string>("var");
488  std::stringstream ss("Calculare X^Y, with X=");
489  ss<<var_<<" and Y="<<power_;
490  addDescriptionLine(ss.str());
491  arg.m[arg.n]=this;
492  }
A arg
Definition: Factorize.h:36
void addDescriptionLine(const std::string &s)
CachingVariable(std::string m, std::string n, const edm::ParameterSet &iConfig)
std::string var_
VariablePower::~VariablePower ( )
inline

Definition at line 493 of file CachingVariable.h.

493 {}

Member Function Documentation

CachingVariable::evalType VariablePower::eval ( const edm::Event iEvent) const
virtual

Reimplemented from CachingVariable.

Definition at line 26 of file CachingVariable.cc.

References CachingVariable::compute(), create_public_lumi_plots::exp, iEvent, create_public_lumi_plots::log, AlCaHLTBitMon_ParallelJobs::p, power_, v, and var_.

26  {
27  const CachingVariable * var=edm::Service<VariableHelperService>()->get().variable(var_);
28  if (!var->compute(iEvent)) return std::make_pair(false,0);
29 
30  double v=(*var)(iEvent);
31  double p=exp(power_*log(v));
32  return std::make_pair(true,p);
33 }
int iEvent
Definition: GenABIO.cc:243
bool compute(const edm::Event &iEvent) const
std::string var_
mathSSE::Vec4< T > v

Member Data Documentation

double VariablePower::power_
private

Definition at line 499 of file CachingVariable.h.

Referenced by eval(), and VariablePower().

std::string VariablePower::var_
private

Definition at line 500 of file CachingVariable.h.

Referenced by eval(), and VariablePower().