ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
JetCalibrationStep Class Referenceabstract

#include <JetCalibrationStep.h>

Inherits asg::AsgMessaging.

Inherited by BcidOffsetCorrection [virtual], EtaJESCorrection [virtual], GlobalLargeRDNNCalibration [virtual], GlobalNNCalibration [virtual], GlobalSequentialCorrection [virtual], InsituDataCorrection [virtual], JetPileupCorrection [virtual], JetSmearingCorrection [virtual], and JMSCorrection [virtual].

Collaboration diagram for JetCalibrationStep:

Public Member Functions

 JetCalibrationStep (const char *name="JetCalibrationStep")
 
virtual ~JetCalibrationStep ()
 
virtual StatusCode initialize ()=0
 
virtual StatusCode calibrate (xAOD::Jet &, JetEventInfo &) const =0
 
virtual void setUnitsGeV (bool useGeV)
 
virtual StatusCode getNominalResolutionData (const xAOD::Jet &, double &) const
 
virtual StatusCode getNominalResolutionMC (const xAOD::Jet &, double &) const
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Protected Member Functions

virtual StatusCode setStartP4 (xAOD::Jet &jet) const
 

Protected Attributes

double m_GeV
 
std::string m_jetStartScale
 
std::string m_name
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 19 of file JetCalibrationStep.h.

Constructor & Destructor Documentation

◆ JetCalibrationStep()

JetCalibrationStep::JetCalibrationStep ( const char *  name = "JetCalibrationStep")

Definition at line 12 of file JetCalibrationStep.cxx.

12  :
13  asg::AsgMessaging(std::string(name)),
14  m_GeV(1000),
15  m_name(name)
16 {}

◆ ~JetCalibrationStep()

JetCalibrationStep::~JetCalibrationStep ( )
virtualdefault

Member Function Documentation

◆ calibrate()

virtual StatusCode JetCalibrationStep::calibrate ( xAOD::Jet ,
JetEventInfo  
) const
pure virtual

◆ getNominalResolutionData()

StatusCode JetCalibrationStep::getNominalResolutionData ( const xAOD::Jet ,
double &   
) const
virtual

Reimplemented in JetSmearingCorrection.

Definition at line 33 of file JetCalibrationStep.cxx.

33  {
34  ATH_MSG_ERROR("Nominal data resolution requested from a jet calibration step that doesn't define it.");
35  return StatusCode::FAILURE;
36 }

◆ getNominalResolutionMC()

StatusCode JetCalibrationStep::getNominalResolutionMC ( const xAOD::Jet ,
double &   
) const
virtual

Reimplemented in JetSmearingCorrection.

Definition at line 38 of file JetCalibrationStep.cxx.

38  {
39  ATH_MSG_ERROR("Nominal MC resolution requested from a jet calibration step that doesn't define it.");
40  return StatusCode::FAILURE;
41 }

◆ initialize()

virtual StatusCode JetCalibrationStep::initialize ( )
pure virtual

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ msg() [1/2]

MsgStream & asg::AsgMessaging::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 49 of file AsgMessaging.cxx.

49  {
50 #ifndef XAOD_STANDALONE
52 #else // not XAOD_STANDALONE
53  return m_msg;
54 #endif // not XAOD_STANDALONE
55  }

◆ msg() [2/2]

MsgStream & asg::AsgMessaging::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 57 of file AsgMessaging.cxx.

57  {
58 #ifndef XAOD_STANDALONE
60 #else // not XAOD_STANDALONE
61  m_msg << lvl;
62  return m_msg;
63 #endif // not XAOD_STANDALONE
64  }

◆ msgLvl()

bool asg::AsgMessaging::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 41 of file AsgMessaging.cxx.

41  {
42 #ifndef XAOD_STANDALONE
43  return ::AthMessaging::msgLvl( lvl );
44 #else // not XAOD_STANDALONE
45  return m_msg.msgLevel( lvl );
46 #endif // not XAOD_STANDALONE
47  }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ setStartP4()

StatusCode JetCalibrationStep::setStartP4 ( xAOD::Jet jet) const
protectedvirtual

Definition at line 21 of file JetCalibrationStep.cxx.

21  {
23  if ( m_jetStartScale.compare("Default") == 0 ) {
24  return StatusCode::SUCCESS;
25  } else if ( jet.getAttribute<xAOD::JetFourMom_t>(m_jetStartScale.c_str(),tmp) ) {
26  jet.setJetP4(tmp);
27  return StatusCode::SUCCESS;
28  }
29  ATH_MSG_WARNING("Jet does not have the requested momentum state: " << m_jetStartScale);
30  return StatusCode::FAILURE;
31 }

◆ setUnitsGeV()

virtual void JetCalibrationStep::setUnitsGeV ( bool  useGeV)
inlinevirtual

Definition at line 30 of file JetCalibrationStep.h.

30 { if (useGeV) m_GeV=1; else m_GeV=1000; }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_GeV

double JetCalibrationStep::m_GeV
protected

Definition at line 40 of file JetCalibrationStep.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_jetStartScale

std::string JetCalibrationStep::m_jetStartScale
protected

Definition at line 41 of file JetCalibrationStep.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_name

std::string JetCalibrationStep::m_name
protected

Definition at line 42 of file JetCalibrationStep.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
JetCalibrationStep::m_name
std::string m_name
Definition: JetCalibrationStep.h:42
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
xAOD::JetFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > JetFourMom_t
Base 4 Momentum type for Jet.
Definition: JetTypes.h:17
JetCalibrationStep::m_jetStartScale
std::string m_jetStartScale
Definition: JetCalibrationStep.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition: AsgMessaging.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
JetCalibrationStep::m_GeV
double m_GeV
Definition: JetCalibrationStep.h:40