ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JetHelper::InputVariableJetContext< T > Class Template Reference

Template to read JetContext. More...

#include <InputVariable.h>

Inheritance diagram for JetHelper::InputVariableJetContext< T >:
Collaboration diagram for JetHelper::InputVariableJetContext< T >:

Public Member Functions

 InputVariableJetContext (const std::string &name)
 
virtual float getValue (const xAOD::Jet &, const JetContext &event) const
 return the value of the variable choose by the user More...
 
const 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...
 

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

template<typename T>
class JetHelper::InputVariableJetContext< T >

Template to read JetContext.

Definition at line 78 of file InputVariable.h.

Constructor & Destructor Documentation

◆ InputVariableJetContext()

template<typename T >
JetHelper::InputVariableJetContext< T >::InputVariableJetContext ( const std::string &  name)
inline

Definition at line 80 of file InputVariable.h.

80 : InputVariable(name) {}

Member Function Documentation

◆ createVariable()

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

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

◆ getName()

const std::string& JetHelper::InputVariable::getName ( ) const
inlineinherited

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
inlineinherited

This function return the scale of the variable.

Definition at line 56 of file InputVariable.h.

56 { return m_scale; }

◆ getValue()

template<typename T >
virtual float JetHelper::InputVariableJetContext< T >::getValue ( const xAOD::Jet jet,
const JetContext jc 
) const
inlinevirtual

return the value of the variable choose by the user

Reimplemented from JetHelper::InputVariable.

Definition at line 82 of file InputVariable.h.

82  {
83  if (event.isAvailable(m_name)) {
84  return event.getValue<T>(m_name);
85  } else {
86  throw std::runtime_error("Value " + m_name + " is not available");
87  }
88  }

◆ getValue_prot()

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

Definition at line 72 of file InputVariable.h.

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

◆ setGeV()

void JetHelper::InputVariable::setGeV ( )
inlineinherited

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 ( )
inlineinherited

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)
inlineinherited

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
protectedinherited

Definition at line 70 of file InputVariable.h.

◆ m_name

const std::string JetHelper::InputVariable::m_name
protectedinherited

Definition at line 67 of file InputVariable.h.

◆ m_scale

float JetHelper::InputVariable::m_scale
protectedinherited

Definition at line 68 of file InputVariable.h.


The documentation for this class was generated from the following file:
JetHelper::InputVariable::InputVariable
InputVariable(const std::string &name)
Constructors.
Definition: InputVariable.h:39
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
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
JetHelper::InputVariable::m_scale
float m_scale
Definition: InputVariable.h:68
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
JetHelper::InputVariable::m_name
const std::string m_name
Definition: InputVariable.h:67
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35