ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
SelectionHelpers
Root
OutOfValidityEventHelper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
SelectionHelpers/OutOfValidityEventHelper.h
>
13
14
#include <
AsgMessaging/MessageCheck.h
>
15
#include <
AsgMessaging/StatusCode.h
>
16
#include <
PATInterfaces/CorrectionCode.h
>
17
18
//
19
// method implementations
20
//
21
22
namespace
CP
23
{
24
::StatusCode OutOfValidityEventHelper ::
25
initialize ()
26
{
27
m_isInitialized
=
true
;
28
return
StatusCode::SUCCESS;
29
}
30
31
32
::StatusCode OutOfValidityEventHelper ::
33
check (
const
CP::CorrectionCode
& code,
34
const
char
*context)
const
35
{
36
assert (
m_isInitialized
);
37
38
switch
(code)
39
{
40
case
CP::CorrectionCode::Ok
:
41
return
StatusCode::SUCCESS;
42
case
CP::CorrectionCode::Error
:
43
return
StatusCode::FAILURE;
44
case
CP::CorrectionCode::OutOfValidityRange
:
45
switch
(
OutOfValidityAction
(
m_action
))
46
{
47
case
OutOfValidityAction::ABORT
:
48
ANA_MSG_ERROR
(
"encountered OutOfValidity: "
<< context);
49
return
StatusCode::FAILURE;
50
case
OutOfValidityAction::WARNING
:
51
ANA_MSG_WARNING
(
"encountered OutOfValidity: "
<< context);
52
return
StatusCode::SUCCESS;
53
case
OutOfValidityAction::SILENT
:
54
return
StatusCode::SUCCESS;
55
}
56
}
57
ANA_MSG_ERROR
(__FILE__ <<
":"
<< __LINE__ <<
": invalid enum value encountered "
<< code <<
" "
<<
int
(
m_action
));
58
return
StatusCode::FAILURE;
59
}
60
61
}
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg,...)
Macro printing error messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:295
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg,...)
Macro printing warning messages.
Definition
Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:293
StatusCode.h
CorrectionCode.h
OutOfValidityEventHelper.h
CP::CorrectionCode
Return value from object correction CP tools.
Definition
CorrectionCode.h:31
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::OutOfValidityEventHelper::m_action
unsigned m_action
the action to take
Definition
OutOfValidityEventHelper.h:54
CP::OutOfValidityEventHelper::m_isInitialized
bool m_isInitialized
whether we have been initialized
Definition
OutOfValidityEventHelper.h:62
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
Generated on
for ATLAS Offline Software by
1.17.0