ATLAS Offline Software
OutOfValidityEventHelper.h
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 #ifndef SELECTION_HELPERS__OUT_OF_VALIDITY_EVENT_HELPER_H
9 #define SELECTION_HELPERS__OUT_OF_VALIDITY_EVENT_HELPER_H
10 
16 #include <xAODBase/IParticle.h>
17 #include <memory>
18 
19 class StatusCode;
20 
21 namespace CP
22 {
23  class CorrectionCode;
24 
25 
26 
34 
36  {
38  public:
39  template<typename T>
40  OutOfValidityEventHelper (T *owner, const std::string& propertyName = "outOfValidity",
41  const std::string& propertyDescription = "how to handle out of validity results");
42 
43 
45  public:
47 
49  public:
51  const char *context) const;
52 
53 
55  private:
57 
63  private:
64  bool m_isInitialized = false;
65  };
66 
67 
68 
69  template<typename T> OutOfValidityEventHelper ::
70  OutOfValidityEventHelper (T *owner, const std::string& propertyName,
71  const std::string& propertyDescription)
72  : asg::AsgMessagingForward (owner)
73  {
74  owner->declareProperty (propertyName, m_action,
75  propertyDescription);
76  }
77 }
78 
80 #define ANA_CHECK_CORRECTION_EVENT(helper,expr) \
81  { if (ATH_UNLIKELY((helper).check ((expr), #expr).isFailure())) \
82  return StatusCode::FAILURE; }
83 
84 #endif
OutOfValidityHelper.h
IParticle.h
asg::AsgMessagingForward
base class to forward messages to another class
Definition: AsgMessagingForward.h:29
asg
Definition: DataHandleTestTool.h:28
AsgMessagingForward.h
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
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
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)
AthUnlikelyMacros.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
CP::OutOfValidityEventHelper::initialize
::StatusCode initialize()
standard initialize
Definition: OutOfValidityEventHelper.cxx:25
CP::OutOfValidityEventHelper
a helper to translate a CP::CorrectionCode into a ::StatusCode
Definition: OutOfValidityEventHelper.h:36
pmontree.code
code
Definition: pmontree.py:443
CP::OutOfValidityEventHelper::OutOfValidityEventHelper
OutOfValidityEventHelper(T *owner, const std::string &propertyName="outOfValidity", const std::string &propertyDescription="how to handle out of validity results")
standard constructor
Definition: OutOfValidityEventHelper.h:70
CP::CorrectionCode
Return value from object correction CP tools.
Definition: CorrectionCode.h:31
ISelectionWriteAccessor.h
AuxElement.h
Base class for elements of a container that can have aux data.