ATLAS Offline Software
Loading...
Searching...
No Matches
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
18class StatusCode;
19
20namespace CP
21{
22 class CorrectionCode;
23
24
25
33
35 {
37 public:
38 template<typename T>
39 OutOfValidityEventHelper (T *owner, const std::string& propertyName = "outOfValidity",
40 const std::string& propertyDescription = "how to handle out of validity results");
41
42
44 public:
45 ::StatusCode initialize ();
46
48 public:
49 ::StatusCode check (const CP::CorrectionCode& code,
50 const char *context) const;
51
52
54 private:
56
62 private:
63 bool m_isInitialized = false;
64 };
65
66
67
68 template<typename T> OutOfValidityEventHelper ::
69 OutOfValidityEventHelper (T *owner, const std::string& propertyName,
70 const std::string& propertyDescription)
71 : asg::AsgMessagingForward (owner)
72 {
73 owner->declareProperty (propertyName, m_action,
74 propertyDescription);
75 }
76}
77
79#define ANA_CHECK_CORRECTION_EVENT(helper,expr) \
80 { if (ATH_UNLIKELY((helper).check ((expr), #expr).isFailure())) \
81 return StatusCode::FAILURE; }
82
83#endif
Base class for elements of a container that can have aux data.
Return value from object correction CP tools.
OutOfValidityEventHelper(T *owner, const std::string &propertyName="outOfValidity", const std::string &propertyDescription="how to handle out of validity results")
standard constructor
::StatusCode initialize()
standard initialize
unsigned m_action
the action to take
::StatusCode check(const CP::CorrectionCode &code, const char *context) const
check the correction code and do the proper thing
bool m_isInitialized
whether we have been initialized
base class to forward messages to another class
AsgMessagingForward(T *owner)
forwarding constructor
Select isolated Photons, Electrons and Muons.
@ ABORT
print an error message and return a failure status code (triggering an abort)
::StatusCode StatusCode
StatusCode definition for legacy code.