#include <IsolationConditionCombined.h>
|
| | IsolationConditionCombined (const std::string &name, const std::vector< xAOD::Iso::IsolationType > &isoType, std::unique_ptr< TF1 > isoFunction, const std::string &cutFunction, const std::string &isoDecSuffix="", bool invertCut=false) |
| | IsolationConditionCombined (const std::string &name, const std::vector< std::string > &isoType, std::unique_ptr< TF1 > isoFunction, const std::string &cutFunction, const std::string &isoDecSuffix="", bool invertCut=false) |
| virtual | ~IsolationConditionCombined ()=default |
| bool | accept (const xAOD::IParticle &x) const override |
| bool | accept (const strObj &x) const override |
| const std::string & | name () const |
| unsigned int | num_types () const |
| xAOD::Iso::IsolationType | type (unsigned int n=0) const |
| const FloatAccessor & | accessor (unsigned int n=0) const |
| const FloatAccessor & | accessor_noCloseBy (unsigned int n=0) const |
| void | setLevel (MSG::Level lvl) |
| | Change the current logging level.
|
| 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.
|
|
| void | initMessaging () const |
| | Initialize our message level and MessageSvc.
|
◆ IsolationConditionCombined() [1/2]
| CP::IsolationConditionCombined::IsolationConditionCombined |
( |
const std::string & | name, |
|
|
const std::vector< xAOD::Iso::IsolationType > & | isoType, |
|
|
std::unique_ptr< TF1 > | isoFunction, |
|
|
const std::string & | cutFunction, |
|
|
const std::string & | isoDecSuffix = "", |
|
|
bool | invertCut = false ) |
Definition at line 15 of file IsolationConditionCombined.cxx.
16 :
18 m_cutFunction (std::make_unique<TF1>(cutFunction.c_str(), cutFunction.c_str())),
21 {
22 }
std::unique_ptr< TF1 > m_isoFunction
std::unique_ptr< TF1 > m_cutFunction
IsolationCondition(const std::string &name, xAOD::Iso::IsolationType isoType, const std::string &isoDecSuffix="")
const std::string & name() const
◆ IsolationConditionCombined() [2/2]
| CP::IsolationConditionCombined::IsolationConditionCombined |
( |
const std::string & | name, |
|
|
const std::vector< std::string > & | isoType, |
|
|
std::unique_ptr< TF1 > | isoFunction, |
|
|
const std::string & | cutFunction, |
|
|
const std::string & | isoDecSuffix = "", |
|
|
bool | invertCut = false ) |
◆ ~IsolationConditionCombined()
| virtual CP::IsolationConditionCombined::~IsolationConditionCombined |
( |
| ) |
|
|
virtualdefault |
◆ accept() [1/2]
| bool CP::IsolationConditionCombined::accept |
( |
const strObj & | x | ) |
const |
|
overridevirtual |
Implements CP::IsolationCondition.
Definition at line 64 of file IsolationConditionCombined.cxx.
64 {
66 std::vector<double> isoVars;
67 for (
unsigned int itype = 0; itype <
num_types(); ++itype) isoVars.push_back(
x.isolationValues[
type(itype)]);
69 const float isoValue =
f->EvalPar(isoVars.data());
71 return isoValue > cutValue;
72 }
std::atomic_flag m_initialized ATLAS_THREAD_SAFE
Messaging initialized (initMessaging)
unsigned int num_types() const
xAOD::Iso::IsolationType type(unsigned int n=0) const
◆ accept() [2/2]
Implements CP::IsolationCondition.
Definition at line 32 of file IsolationConditionCombined.cxx.
32 {
34 std::vector<double> isoVars(
num_types(), 0);
35 for (
unsigned int iacc = 0; iacc <
num_types(); ++iacc) {
37
38 if (!
acc.isAvailable(
x)) {
39
40
42 if (acc_noCloseBy.isAvailable(
x)) {
43 isoVars[iacc] = acc_noCloseBy(
x);
44 }
45 else {
47 <<" is not available. Expected when using primary AODs, post-p3793 derivations (only for *FixedRad or FixedCutPflow* for electrons), "
48 <<" pre-p3517 derivations (only for FC*), or pre-p3830 derivations (for other electron WPs)");
49 if (!
m_isoDecSuffix.empty())
throw std::runtime_error (
"IsolationConditionCombined: IsolationSelectionTool property 'IsoDecSuffix' is set to " +
m_isoDecSuffix +
". Must run on derivation made with IsolationCloseByCorrection to create the isolation variables with this suffix, or remove 'IsoDecSuffix'. ");
50 isoVars[iacc] = FLT_MAX;
51 }
52 } else
53 isoVars[iacc] =
acc(
x);
54 }
55
56
57
59 const float isoValue =
f->EvalPar(isoVars.data());
61 return isoValue > cutValue;
62 }
#define ATH_MSG_WARNING(x)
std::string m_isoDecSuffix
const FloatAccessor & accessor_noCloseBy(unsigned int n=0) const
const FloatAccessor & accessor(unsigned int n=0) const
static AuxTypeRegistry & instance()
Return the singleton registry instance.
SG::AuxElement::ConstAccessor< float > FloatAccessor
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
◆ accessor()
◆ accessor_noCloseBy()
◆ 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
43 if (
m_lvl == MSG::NIL) {
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)
◆ 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
53 return m_msg;
54#endif
55 }
◆ msg() [2/2]
| MsgStream & asg::AsgMessaging::msg |
( |
const MSG::Level | lvl | ) |
const |
|
inherited |
The standard message stream.
- Parameters
-
| lvl | The 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
61 m_msg << lvl;
62 return m_msg;
63#endif
64 }
◆ msgLvl()
| bool asg::AsgMessaging::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inherited |
Test the output level of the object.
- Parameters
-
| lvl | The 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
45 return m_msg.msgLevel( lvl );
46#endif
47 }
◆ name()
| const std::string & CP::IsolationCondition::name |
( |
| ) |
const |
|
inherited |
◆ num_types()
| unsigned int CP::IsolationCondition::num_types |
( |
| ) |
const |
|
inherited |
◆ setLevel()
| void AthMessaging::setLevel |
( |
MSG::Level | lvl | ) |
|
|
inherited |
◆ type()
◆ ATLAS_THREAD_SAFE
| std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_acc
◆ m_acc_noCloseBy
| std::vector<FloatAccessor> CP::IsolationCondition::m_acc_noCloseBy |
|
privateinherited |
◆ m_cutFunction
| std::unique_ptr<TF1> CP::IsolationConditionCombined::m_cutFunction |
|
private |
◆ m_imsg
| std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_invertCut
| bool CP::IsolationConditionCombined::m_invertCut {false} |
|
private |
◆ m_isoDecSuffix
| std::string CP::IsolationCondition::m_isoDecSuffix {} |
|
protectedinherited |
◆ m_isoFunction
| std::unique_ptr<TF1> CP::IsolationConditionCombined::m_isoFunction |
|
private |
◆ m_isolationType
◆ m_lvl
| std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ 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 |
◆ m_nm
| std::string AthMessaging::m_nm |
|
privateinherited |
The documentation for this class was generated from the following files: