ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
PATInterfaces
PATInterfaces
CorrectionCode.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef PATINTERFACES_CORRECTIONCODE_H
6
#define PATINTERFACES_CORRECTIONCODE_H
7
8
#include "
CxxUtils/nodiscard.h
"
9
10
namespace
CP
{
11
31
class
ATLAS_NODISCARD
CorrectionCode
{
32
33
public
:
35
enum
ErrorCode
{
36
Error
= 0,
37
OutOfValidityRange
= 1,
38
Ok
= 2
39
};
40
42
CorrectionCode
(
ErrorCode
code
=
Ok
) noexcept :
m_code
(
code
) { }
43
45
ErrorCode
code
()
const
noexcept {
return
m_code
;}
46
48
operator
ErrorCode
()
const
noexcept {
return
code
(); }
49
52
bool
operator <
(
const
CorrectionCode
& rhs )
const
noexcept
{
53
return
m_code
< rhs.m_code;
54
}
55
57
void
ignore
()
const
noexcept { }
58
63
void
setChecked
()
const
noexcept { }
64
static
void
enableFailure
() noexcept {}
65
static
void
disableFailure
() noexcept {}
66
67
private
:
68
ErrorCode
m_code
;
69
70
};
// class CorrectionCode
71
72
}
// namespace CP
73
74
namespace
asg
75
{
78
template
<
typename
T>
struct
CheckHelper;
79
80
template
<>
struct
CheckHelper
<
CP
::
CorrectionCode
>
81
{
83
static
inline
bool
isSuccess
(
const
CP::CorrectionCode
&
sc
) {
84
return
sc
==
CP::CorrectionCode::Ok
; }
85
87
static
inline
bool
isOutOfValidityRange
(
const
CP::CorrectionCode
&
sc
) {
88
return
sc
==
CP::CorrectionCode::OutOfValidityRange
; }
89
91
static
inline
CP::CorrectionCode
successCode
() {
92
return
CP::CorrectionCode::Ok
;}
93
95
static
inline
CP::CorrectionCode
failureCode
() {
96
return
CP::CorrectionCode::Error
;}
97
};
98
}
99
100
#endif
// not PATINTERFACES_CORRECTIONCODE_H
operator<
bool operator<(const DataVector< T > &a, const DataVector< T > &b)
Vector ordering relation.
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
CP::CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
CP::CorrectionCode::ErrorCode
ErrorCode
Possible values for the correction code.
Definition
CorrectionCode.h:35
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition
CorrectionCode.h:36
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition
CorrectionCode.h:37
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition
CorrectionCode.h:38
CP::CorrectionCode::setChecked
void setChecked() const noexcept
Older functions for backward compatibility with the pre-nondiscard version of this class in which we ...
Definition
CorrectionCode.h:63
CP::CorrectionCode::disableFailure
static void disableFailure() noexcept
Definition
CorrectionCode.h:65
CP::CorrectionCode::code
ErrorCode code() const noexcept
The code stored internally.
Definition
CorrectionCode.h:45
CP::CorrectionCode::m_code
ErrorCode m_code
The stored correction code.
Definition
CorrectionCode.h:68
CP::CorrectionCode::CorrectionCode
CorrectionCode(ErrorCode code=Ok) noexcept
Constructor with a correction code.
Definition
CorrectionCode.h:42
CP::CorrectionCode::enableFailure
static void enableFailure() noexcept
Definition
CorrectionCode.h:64
CP::CorrectionCode::ignore
void ignore() const noexcept
Ignore the correction code.
Definition
CorrectionCode.h:57
CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
CorrectionCode::CorrectionCode
CorrectionCode(ErrorCode code=Ok) noexcept
Constructor with a correction code.
Definition
CorrectionCode.h:42
const
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
asg
Definition
DataHandleTestTool.h:28
nodiscard.h
Macro wrapping the [[nodiscard]] attribute.
ATLAS_NODISCARD
#define ATLAS_NODISCARD
Definition
nodiscard.h:18
asg::CheckHelper< CP::CorrectionCode >::isSuccess
static bool isSuccess(const CP::CorrectionCode &sc)
whether the status code reports a success
Definition
CorrectionCode.h:83
asg::CheckHelper< CP::CorrectionCode >::successCode
static CP::CorrectionCode successCode()
produce a status code to report success
Definition
CorrectionCode.h:91
asg::CheckHelper< CP::CorrectionCode >::isOutOfValidityRange
static bool isOutOfValidityRange(const CP::CorrectionCode &sc)
whether the status code reports out of validity
Definition
CorrectionCode.h:87
asg::CheckHelper< CP::CorrectionCode >::failureCode
static CP::CorrectionCode failureCode()
produce a status code to report failure
Definition
CorrectionCode.h:95
asg::CheckHelper
this is an internal traits class for status codes used by the ANA_CHECK* macros
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:174
Generated on
for ATLAS Offline Software by
1.17.0