ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JetHelper::InputVariable Class Reference

Class InputVariable This is design to read any kind of xAOD::Jet or JetContext variable e.g pt, eta, phi, m ..etc The user need to initialize the class with the name of the variable and the scale. More...

#include <InputVariable.h>

Inheritance diagram for JetHelper::InputVariable:
Collaboration diagram for JetHelper::InputVariable:

Public Member Functions

 InputVariable (const std::string &name)
 Constructors. More...
 
 InputVariable (const std::string &name, std::function< float(const xAOD::Jet &jet, const JetContext &jc)> func)
 
virtual ~InputVariable ()=default
 Default destructor. More...
 
float getValue (const xAOD::Jet &jet, const JetContext &jc) const override
 return the value of the variable choose by the user More...
 
std::string getName () const
 This function return the name of the variable. More...
 
float getScale () const
 This function return the scale of the variable. More...
 
void setScale (const float scale)
 This function set the scale of the variable. More...
 
void setGeV ()
 This function set the scale to GeV, assuming MeV by default. More...
 
void setMeV ()
 This function set the scale to MeV, assuming MeV by default (it does nothing) More...
 
 InputVariable (const InputVariable &)=delete
 

Static Public Member Functions

static std::unique_ptr< InputVariablecreateVariable (const std::string &name, const std::string &type, const bool isJetVar)
 This function specialize the variable to the one choose by the user. More...
 

Protected Member Functions

virtual float getValue_prot (const xAOD::Jet &jet, const JetContext &jc) const
 

Protected Attributes

const std::string m_name
 
float m_scale
 
std::function< float(const xAOD::Jet &jet, const JetContext &jc)> m_customFunction
 

Detailed Description

Class InputVariable This is design to read any kind of xAOD::Jet or JetContext variable e.g pt, eta, phi, m ..etc The user need to initialize the class with the name of the variable and the scale.

Definition at line 26 of file InputVariable.h.

Constructor & Destructor Documentation

◆ InputVariable() [1/3]

JetHelper::InputVariable::InputVariable ( const std::string &  name)
inline

Constructors.

Definition at line 39 of file InputVariable.h.

39 : m_name{name}, m_scale{1.} {}

◆ InputVariable() [2/3]

JetHelper::InputVariable::InputVariable ( const std::string &  name,
std::function< float(const xAOD::Jet &jet, const JetContext &jc)>  func 
)

◆ ~InputVariable()

virtual JetHelper::InputVariable::~InputVariable ( )
virtualdefault

Default destructor.

◆ InputVariable() [3/3]

JetHelper::InputVariable::InputVariable ( const InputVariable )
delete

Member Function Documentation

◆ createVariable()

static std::unique_ptr<InputVariable> JetHelper::InputVariable::createVariable ( const std::string &  name,
const std::string &  type,
const bool  isJetVar 
)
static

This function specialize the variable to the one choose by the user.

◆ getName()

std::string JetHelper::InputVariable::getName ( ) const
inline

This function return the name of the variable.

Definition at line 54 of file InputVariable.h.

54 { return m_name; }

◆ getScale()

float JetHelper::InputVariable::getScale ( ) const
inline

This function return the scale of the variable.

Definition at line 56 of file InputVariable.h.

56 { return m_scale; }

◆ getValue()

float JetHelper::InputVariable::getValue ( const xAOD::Jet jet,
const JetContext jc 
) const
inlineoverridevirtual

return the value of the variable choose by the user

Implements JetHelper::IInputVariable.

Reimplemented in JetHelper::InputVariableAttribute< T >, and JetHelper::InputVariableJetContext< T >.

Definition at line 49 of file InputVariable.h.

49  {
50  return m_scale * getValue_prot(jet, jc);
51  }

◆ getValue_prot()

virtual float JetHelper::InputVariable::getValue_prot ( const xAOD::Jet jet,
const JetContext jc 
) const
inlineprotectedvirtual

Definition at line 72 of file InputVariable.h.

72  {
73  return (m_customFunction(jet, jc));
74  }

◆ setGeV()

void JetHelper::InputVariable::setGeV ( )
inline

This function set the scale to GeV, assuming MeV by default.

Definition at line 60 of file InputVariable.h.

60 { m_scale = 1.e-3; }

◆ setMeV()

void JetHelper::InputVariable::setMeV ( )
inline

This function set the scale to MeV, assuming MeV by default (it does nothing)

Definition at line 62 of file InputVariable.h.

62 { m_scale = 1.; }

◆ setScale()

void JetHelper::InputVariable::setScale ( const float  scale)
inline

This function set the scale of the variable.

Definition at line 58 of file InputVariable.h.

58 { m_scale = scale; }

Member Data Documentation

◆ m_customFunction

std::function<float(const xAOD::Jet& jet, const JetContext& jc)> JetHelper::InputVariable::m_customFunction
protected

Definition at line 70 of file InputVariable.h.

◆ m_name

const std::string JetHelper::InputVariable::m_name
protected

Definition at line 67 of file InputVariable.h.

◆ m_scale

float JetHelper::InputVariable::m_scale
protected

Definition at line 68 of file InputVariable.h.


The documentation for this class was generated from the following file:
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
JetHelper::InputVariable::m_customFunction
std::function< float(const xAOD::Jet &jet, const JetContext &jc)> m_customFunction
Definition: InputVariable.h:70
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
JetHelper::InputVariable::m_scale
float m_scale
Definition: InputVariable.h:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
JetHelper::InputVariable::getValue_prot
virtual float getValue_prot(const xAOD::Jet &jet, const JetContext &jc) const
Definition: InputVariable.h:72
JetHelper::InputVariable::m_name
const std::string m_name
Definition: InputVariable.h:67