ATLAS Offline Software
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 
13 
17 
18 //
19 // method implementations
20 //
21 
22 namespace CP
23 {
25  initialize ()
26  {
27  m_isInitialized = true;
28  return StatusCode::SUCCESS;
29  }
30 
31 
34  const char *context) const
35  {
36  assert (m_isInitialized);
37 
38  switch (code)
39  {
41  return StatusCode::SUCCESS;
43  return StatusCode::FAILURE;
45  switch (OutOfValidityAction (m_action))
46  {
48  ANA_MSG_ERROR ("encountered OutOfValidity: " << context);
49  return StatusCode::FAILURE;
51  ANA_MSG_WARNING ("encountered OutOfValidity: " << context);
52  return StatusCode::SUCCESS;
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 }
CP::OutOfValidityAction::SILENT
@ SILENT
don't print anything and return success
ANA_MSG_ERROR
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:294
CP::OutOfValidityEventHelper::m_isInitialized
bool m_isInitialized
whether we have been initialized
Definition: OutOfValidityEventHelper.h:64
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::OutOfValidityEventHelper::m_action
unsigned m_action
the action to take
Definition: OutOfValidityEventHelper.h:56
CP::OutOfValidityAction::ABORT
@ ABORT
print an error message and return a failure status code (triggering an abort)
CP::CorrectionCode::OutOfValidityRange
@ OutOfValidityRange
Input object is out of validity range.
Definition: CorrectionCode.h:37
CP::CorrectionCode::Error
@ Error
Some error happened during the object correction.
Definition: CorrectionCode.h:36
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::OutOfValidityAction
OutOfValidityAction
the action to perform on encountering an OutOfValidityRange in OutOfValidityHelper
Definition: OutOfValidityHelper.h:36
MessageCheck.h
macros for messaging and checking status codes
ANA_MSG_WARNING
#define ANA_MSG_WARNING(xmsg)
Macro printing warning messages.
Definition: Control/AthToolSupport/AsgMessaging/AsgMessaging/MessageCheck.h:292
CP::OutOfValidityEventHelper::check
::StatusCode check(const CP::CorrectionCode &code, const char *context) const
check the correction code and do the proper thing
Definition: OutOfValidityEventHelper.cxx:33
StatusCode.h
CP::OutOfValidityEventHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityEventHelper.cxx:25
pmontree.code
code
Definition: pmontree.py:443
CP::OutOfValidityAction::WARNING
@ WARNING
print a warning message and return a success status code.
CP::CorrectionCode::Ok
@ Ok
The correction was done successfully.
Definition: CorrectionCode.h:38
OutOfValidityEventHelper.h
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
CorrectionCode.h