ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
SelectionHelpers
SelectionHelpers
OutOfValidityHelper.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
#ifndef SELECTION_HELPERS__OUT_OF_VALIDITY_HELPER_H
9
#define SELECTION_HELPERS__OUT_OF_VALIDITY_HELPER_H
10
11
#include <
AsgMessaging/AsgMessagingForward.h
>
12
#include <
AthContainers/AuxElement.h
>
13
#include <
SelectionHelpers/ISelectionWriteAccessor.h
>
14
#include <
SelectionHelpers/ISelectionReadAccessor.h
>
15
#include <
xAODBase/IParticle.h
>
16
#include <memory>
17
18
class
StatusCode
;
19
20
namespace
CP
21
{
22
class
CorrectionCode
;
23
24
33
34
enum class
OutOfValidityAction
35
{
44
ABORT
,
45
51
WARNING
,
52
58
SILENT
59
};
60
61
62
70
71
class
OutOfValidityHelper
final :
public
asg::AsgMessagingForward
72
{
74
public
:
75
template
<
typename
T>
76
OutOfValidityHelper
(T *owner,
const
std::string& propertyName =
"outOfValidity"
,
77
const
std::string& propertyDescription =
"how to handle out of validity results"
);
78
79
81
public
:
82
::StatusCode
initialize
();
83
85
public
:
86
::StatusCode
check
(
const
xAOD::IParticle
& particle,
87
const
CP::CorrectionCode
& code,
88
const
char
*context)
const
;
89
91
public
:
92
bool
get
(
const
xAOD::IParticle
& particle)
const
;
93
95
private
:
96
unsigned
m_action
{
unsigned
(
OutOfValidityAction::ABORT
)};
97
99
private
:
100
std::unique_ptr<ISelectionWriteAccessor>
m_write_accessor
;
101
std::unique_ptr<ISelectionReadAccessor>
m_read_accessor
;
102
104
private
:
105
std::string
m_decorationName
;
106
112
private
:
113
bool
m_isInitialized
=
false
;
114
};
115
116
117
118
template
<
typename
T> OutOfValidityHelper ::
119
OutOfValidityHelper (T *owner,
const
std::string& propertyName,
120
const
std::string& propertyDescription)
121
:
asg
::
AsgMessagingForward
(owner)
122
{
123
owner->declareProperty (propertyName,
m_action
,
124
propertyDescription);
125
owner->declareProperty (propertyName +
"Deco"
,
m_decorationName
,
126
"decoration to set alongside action described by "
+ propertyName);
127
}
128
}
129
131
#define ANA_CHECK_CORRECTION(helper,object,expr) \
132
{ if ((helper).check ((object), (expr), #expr).isFailure()) [[unlikely]] \
133
return StatusCode::FAILURE; }
134
135
#endif
AsgMessagingForward.h
AuxElement.h
Base class for elements of a container that can have aux data.
IParticle.h
ISelectionReadAccessor.h
ISelectionWriteAccessor.h
CP::CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
CP::OutOfValidityHelper::get
bool get(const xAOD::IParticle &particle) const
retrieve the OutOfValidity decision, where true = particle passes validity check
Definition
OutOfValidityHelper.cxx:71
CP::OutOfValidityHelper::OutOfValidityHelper
OutOfValidityHelper(T *owner, const std::string &propertyName="outOfValidity", const std::string &propertyDescription="how to handle out of validity results")
standard constructor
Definition
OutOfValidityHelper.h:119
CP::OutOfValidityHelper::initialize
::StatusCode initialize()
standard initialize
Definition
OutOfValidityHelper.cxx:25
CP::OutOfValidityHelper::m_decorationName
std::string m_decorationName
the decoration name we use (if we have one)
Definition
OutOfValidityHelper.h:105
CP::OutOfValidityHelper::check
::StatusCode check(const xAOD::IParticle &particle, const CP::CorrectionCode &code, const char *context) const
check the correction code and do the proper thing
Definition
OutOfValidityHelper.cxx:39
CP::OutOfValidityHelper::m_write_accessor
std::unique_ptr< ISelectionWriteAccessor > m_write_accessor
the accessor if we apply one
Definition
OutOfValidityHelper.h:100
CP::OutOfValidityHelper::m_action
unsigned m_action
the action to take
Definition
OutOfValidityHelper.h:96
CP::OutOfValidityHelper::m_isInitialized
bool m_isInitialized
whether we have been initialized
Definition
OutOfValidityHelper.h:113
CP::OutOfValidityHelper::m_read_accessor
std::unique_ptr< ISelectionReadAccessor > m_read_accessor
Definition
OutOfValidityHelper.h:101
asg::AsgMessagingForward
base class to forward messages to another class
Definition
AsgMessagingForward.h:29
asg::AsgMessagingForward::AsgMessagingForward
AsgMessagingForward(T *owner)
forwarding constructor
Definition
AsgMessagingForward.h:83
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
CP::OutOfValidityAction
OutOfValidityAction
the action to perform on encountering an OutOfValidityRange in OutOfValidityHelper
Definition
OutOfValidityHelper.h:35
CP::OutOfValidityAction::WARNING
@ WARNING
print a warning message and return a success status code.
Definition
OutOfValidityHelper.h:51
CP::OutOfValidityAction::SILENT
@ SILENT
don't print anything and return success
Definition
OutOfValidityHelper.h:58
CP::OutOfValidityAction::ABORT
@ ABORT
print an error message and return a failure status code (triggering an abort)
Definition
OutOfValidityHelper.h:44
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
asg
Definition
DataHandleTestTool.h:28
xAOD::unsigned
unsigned
Definition
RingSetConf_v1.cxx:656
Generated on
for ATLAS Offline Software by
1.17.0