ATLAS Offline Software
Loading...
Searching...
No Matches
JCT::HotCell Class Reference
Inheritance diagram for JCT::HotCell:
Collaboration diagram for JCT::HotCell:

Public Member Functions

 HotCell (const int layer, const float etaMin, const float etaMax, const float phiMin, const float phiMax)
virtual ~HotCell ()
bool jetAffectedByHotCell (const xAOD::Jet &jet) const
void setLevel (MSG::Level lvl)
 Change the current logging level.
Functions providing the same interface as AthMessaging
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object.
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.

Private Member Functions

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

Private Attributes

const int m_layer
const float m_etaMin
const float m_etaMax
const float m_phiMin
const float m_phiMax
SG::ConstAccessor< std::vector< float > > m_ePerSamp {"EnergyPerSampling"}
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels)
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging)

Detailed Description

Definition at line 38 of file JetCleaningTool.cxx.

Constructor & Destructor Documentation

◆ HotCell()

JCT::HotCell::HotCell ( const int layer,
const float etaMin,
const float etaMax,
const float phiMin,
const float phiMax )

Definition at line 53 of file JetCleaningTool.cxx.

54 : asg::AsgMessaging("HotCell")
55 , m_layer(layer)
56 , m_etaMin(etaMin)
57 , m_etaMax(etaMax)
58 , m_phiMin(phiMin)
59 , m_phiMax(phiMax) { }
const float m_etaMin
const float m_etaMax
const float m_phiMax
const float m_phiMin

◆ ~HotCell()

virtual JCT::HotCell::~HotCell ( )
inlinevirtual

Definition at line 42 of file JetCleaningTool.cxx.

42{}

Member Function Documentation

◆ 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 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)

◆ jetAffectedByHotCell()

bool JCT::HotCell::jetAffectedByHotCell ( const xAOD::Jet & jet) const

Definition at line 61 of file JetCleaningTool.cxx.

62{
63 // First check if the jet points to the cell
64 const float eta = jet.eta();
65 const float phi = jet.phi();
66 if ( (m_etaMin < eta && eta < m_etaMax) && (m_phiMin < phi && phi < m_phiMax) )
67 {
68 // It points to the cell, now check if the maximum layer is the hot cell or if at least 40% of the energy is the hot cell
69 const int fmaxIndex = jet.getAttribute<int>(xAOD::JetAttribute::FracSamplingMaxIndex);
70 float ePerSamp = 0;
71 if( m_ePerSamp.isAvailable(jet) )
72 ePerSamp = m_ePerSamp(jet).at(m_layer)/jet.e();
73 else
74 ATH_MSG_WARNING("Could not retrieve EnergyPerSampling from jet, cleaning performance may be reduced");
75
76 if (fmaxIndex == m_layer || ePerSamp > 0.4)
77 return true;
78 }
79 return false;
80}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_WARNING(x)
SG::ConstAccessor< std::vector< float > > m_ePerSamp
virtual double phi() const
The azimuthal angle ( ) of the particle.
Definition Jet_v1.cxx:54
bool getAttribute(AttributeID type, T &value) const
Retrieve attribute moment by enum.
virtual double eta() const
The pseudorapidity ( ) of the particle.
Definition Jet_v1.cxx:49
virtual double e() const
The total energy of the particle.
Definition Jet_v1.cxx:63

◆ 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
51 return ::AthMessaging::msg();
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
59 return ::AthMessaging::msg( lvl );
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}

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_ePerSamp

SG::ConstAccessor< std::vector<float> > JCT::HotCell::m_ePerSamp {"EnergyPerSampling"}
private

Definition at line 50 of file JetCleaningTool.cxx.

50{"EnergyPerSampling"};

◆ m_etaMax

const float JCT::HotCell::m_etaMax
private

Definition at line 47 of file JetCleaningTool.cxx.

◆ m_etaMin

const float JCT::HotCell::m_etaMin
private

Definition at line 46 of file JetCleaningTool.cxx.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_layer

const int JCT::HotCell::m_layer
private

Definition at line 45 of file JetCleaningTool.cxx.

◆ m_lvl

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

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ 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_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_phiMax

const float JCT::HotCell::m_phiMax
private

Definition at line 49 of file JetCleaningTool.cxx.

◆ m_phiMin

const float JCT::HotCell::m_phiMin
private

Definition at line 48 of file JetCleaningTool.cxx.


The documentation for this class was generated from the following file: