ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
CP::IsolationConditionHist Class Reference

#include <IsolationConditionHist.h>

Inheritance diagram for CP::IsolationConditionHist:
Collaboration diagram for CP::IsolationConditionHist:

Public Member Functions

 IsolationConditionHist (const std::string &name, xAOD::Iso::IsolationType isoType, const std::string &isolationFunction, std::unique_ptr< TH3F > efficiencyHisto3D)
 
virtual ~IsolationConditionHist ()=default
 
bool accept (const xAOD::IParticle &x) const override
 
bool accept (const strObj &x) const override
 
void setInterp (std::shared_ptr< Interp3D > interp)
 
const std::string & name () const
 
unsigned int num_types () const
 
xAOD::Iso::IsolationType type (unsigned int n=0) const
 
const FloatAccessoraccessor (unsigned int n=0) const
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Protected Attributes

std::string m_isoDecSuffix {}
 

Private Member Functions

float getCutValue (const float pt, const float eta) const
 
void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::shared_ptr< TH3F > m_efficiencyHisto3D {nullptr}
 
std::unique_ptr< TF1 > m_isolationFunction {nullptr}
 
bool m_ptGeV {false}
 
std::shared_ptr< Interp3Dm_interp
 
std::string m_name
 
std::vector< xAOD::Iso::IsolationTypem_isolationType
 
std::vector< FloatAccessorm_acc
 
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 23 of file IsolationConditionHist.h.

Constructor & Destructor Documentation

◆ IsolationConditionHist()

CP::IsolationConditionHist::IsolationConditionHist ( const std::string &  name,
xAOD::Iso::IsolationType  isoType,
const std::string &  isolationFunction,
std::unique_ptr< TH3F >  efficiencyHisto3D 
)

check if pt is using GeV as unit

Definition at line 18 of file IsolationConditionHist.cxx.

19  :
20  IsolationCondition(name, isoType),
21  m_efficiencyHisto3D(std::move(efficiencyHisto3D)),
22  m_isolationFunction (std::make_unique<TF1>(isolationFunction.c_str(), isolationFunction.c_str(), 0.0, 1000.0))
23  {
25  std::string xtitle(m_efficiencyHisto3D->GetXaxis()->GetTitle());
26  m_ptGeV = (xtitle.find("GeV") != std::string::npos);
27  }

◆ ~IsolationConditionHist()

virtual CP::IsolationConditionHist::~IsolationConditionHist ( )
virtualdefault

Member Function Documentation

◆ accept() [1/2]

bool CP::IsolationConditionHist::accept ( const strObj x) const
overridevirtual

Implements CP::IsolationCondition.

Definition at line 33 of file IsolationConditionHist.cxx.

33  {
34  const float cutValue = getCutValue(x.pt, x.eta);
35  return x.isolationValues[type()] <= cutValue * x.pt;
36  }

◆ accept() [2/2]

bool CP::IsolationConditionHist::accept ( const xAOD::IParticle x) const
overridevirtual

Implements CP::IsolationCondition.

Definition at line 28 of file IsolationConditionHist.cxx.

28  {
29  const float cutValue = getCutValue(x.pt(), x.eta());
30  return accessor()(x) <= cutValue * x.pt();
31  }

◆ accessor()

const SG::AuxElement::ConstAccessor< float > & CP::IsolationCondition::accessor ( unsigned int  n = 0) const
inherited

Definition at line 38 of file IsolationCondition.cxx.

38 { return m_acc.at(n); }

◆ getCutValue()

float CP::IsolationConditionHist::getCutValue ( const float  pt,
const float  eta 
) const
private

Definition at line 38 of file IsolationConditionHist.cxx.

38  {
39  float xpt = pt * MeVtoGeV; // convert to GeV
40  if (!m_interp)
41  return m_efficiencyHisto3D->GetBinContent(m_efficiencyHisto3D->GetXaxis()->FindBin((m_ptGeV ? xpt : pt)),
42  m_efficiencyHisto3D->GetYaxis()->FindBin(eta),
43  std::min(int(m_isolationFunction->Eval(xpt)), 99));
44  return m_interp->Interpol3d(m_ptGeV ? xpt : pt, eta, std::min(m_isolationFunction->Eval(xpt), 99.), m_efficiencyHisto3D);
45  }

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

◆ name()

const std::string & CP::IsolationCondition::name ( ) const
inherited

Definition at line 36 of file IsolationCondition.cxx.

36 { return m_name; }

◆ num_types()

unsigned int CP::IsolationCondition::num_types ( ) const
inherited

Definition at line 35 of file IsolationCondition.cxx.

35 { return m_isolationType.size(); }

◆ setInterp()

void CP::IsolationConditionHist::setInterp ( std::shared_ptr< Interp3D interp)
inline

Definition at line 31 of file IsolationConditionHist.h.

31 { m_interp = interp; }

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

◆ type()

xAOD::Iso::IsolationType CP::IsolationCondition::type ( unsigned int  n = 0) const
inherited

Definition at line 37 of file IsolationCondition.cxx.

37 { return m_isolationType[n]; }

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_acc

std::vector<FloatAccessor> CP::IsolationCondition::m_acc
privateinherited

Definition at line 53 of file IsolationCondition.h.

◆ m_efficiencyHisto3D

std::shared_ptr<TH3F> CP::IsolationConditionHist::m_efficiencyHisto3D {nullptr}
private

Definition at line 35 of file IsolationConditionHist.h.

◆ m_imsg

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

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_interp

std::shared_ptr<Interp3D> CP::IsolationConditionHist::m_interp
private

Definition at line 38 of file IsolationConditionHist.h.

◆ m_isoDecSuffix

std::string CP::IsolationCondition::m_isoDecSuffix {}
protectedinherited

Definition at line 56 of file IsolationCondition.h.

◆ m_isolationFunction

std::unique_ptr<TF1> CP::IsolationConditionHist::m_isolationFunction {nullptr}
private

Definition at line 36 of file IsolationConditionHist.h.

◆ m_isolationType

std::vector<xAOD::Iso::IsolationType> CP::IsolationCondition::m_isolationType
privateinherited

Definition at line 52 of file IsolationCondition.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 CP::IsolationCondition::m_name
privateinherited

Definition at line 51 of file IsolationCondition.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_ptGeV

bool CP::IsolationConditionHist::m_ptGeV {false}
private

Definition at line 37 of file IsolationConditionHist.h.


The documentation for this class was generated from the following files:
CP::IsolationConditionHist::getCutValue
float getCutValue(const float pt, const float eta) const
Definition: IsolationConditionHist.cxx:38
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
test_pyathena.pt
pt
Definition: test_pyathena.py:11
CP::MeVtoGeV
constexpr float MeVtoGeV
Definition: IsolationCloseByCorrectionTool.cxx:33
CP::IsolationCondition::type
xAOD::Iso::IsolationType type(unsigned int n=0) const
Definition: IsolationCondition.cxx:37
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
x
#define x
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
beamspotman.n
n
Definition: beamspotman.py:731
CP::IsolationConditionHist::m_isolationFunction
std::unique_ptr< TF1 > m_isolationFunction
Definition: IsolationConditionHist.h:36
CP::IsolationConditionHist::m_efficiencyHisto3D
std::shared_ptr< TH3F > m_efficiencyHisto3D
Definition: IsolationConditionHist.h:35
CP::IsolationConditionHist::m_ptGeV
bool m_ptGeV
Definition: IsolationConditionHist.h:37
CP::IsolationCondition::IsolationCondition
IsolationCondition(const std::string &name, xAOD::Iso::IsolationType isoType, const std::string &isoDecSuffix="")
Definition: IsolationCondition.cxx:30
CP::IsolationCondition::name
const std::string & name() const
Definition: IsolationCondition.cxx:36
min
#define min(a, b)
Definition: cfImp.cxx:40
CP::IsolationCondition::accessor
const FloatAccessor & accessor(unsigned int n=0) const
Definition: IsolationCondition.cxx:38
CP::IsolationCondition::m_acc
std::vector< FloatAccessor > m_acc
Definition: IsolationCondition.h:53
CP::IsolationCondition::m_name
std::string m_name
Definition: IsolationCondition.h:51
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
plotting.yearwise_efficiency.xtitle
string xtitle
Definition: yearwise_efficiency.py:32
CP::IsolationCondition::m_isolationType
std::vector< xAOD::Iso::IsolationType > m_isolationType
Definition: IsolationCondition.h:52
CP::IsolationConditionHist::m_interp
std::shared_ptr< Interp3D > m_interp
Definition: IsolationConditionHist.h:38
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7