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#include <memory>
18
19class StatusCode;
20
21namespace 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:
46 ::StatusCode initialize ();
47
49 public:
50 ::StatusCode check (const CP::CorrectionCode& code,
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
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)