ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
PATInterfaces
Root
SystematicRegistry.cxx
Go to the documentation of this file.
1
// Author: Steve Farrell (steven.farrell@cern.ch)
2
3
4
//
5
// includes
6
//
7
8
// ROOT include(s):
9
#include <ThreadLocalStorage.h>
10
11
// Local include(s):
12
#include <
PATInterfaces/SystematicRegistry.h
>
13
#include <
PATInterfaces/IReentrantSystematicsTool.h
>
14
#include <
PATInterfaces/SystematicSet.h
>
15
#include <
AsgMessaging/StatusCode.h
>
16
17
//
18
// method implementations
19
//
20
21
namespace
CP
22
{
23
24
// Get the singleton registry instance
25
SystematicRegistry
&
SystematicRegistry::getInstance
()
26
{
27
TTHREAD_TLS
(
SystematicRegistry
) systRegistry;
28
return
systRegistry;
29
}
30
31
32
const
SystematicSet
&
SystematicRegistry::globalSystematics
()
const
33
{
34
return
m_globalSystematics
;
35
}
36
37
38
const
SystematicSet
&
SystematicRegistry::recommendedSystematics
()
const
39
{
40
return
m_recommendedSystematics
;
41
}
42
43
44
StatusCode SystematicRegistry ::
45
registerSystematics (
const
IReentrantSystematicsTool
& tool)
46
{
47
registerSystematics
(tool.affectingSystematics());
48
return
addSystematicsToRecommended
(tool.recommendedSystematics());
49
}
50
51
52
// Add a systematic to the global set
53
void
SystematicRegistry::registerSystematic
54
(
const
SystematicVariation
& systematic)
55
{
56
m_globalSystematics
.insert(systematic);
57
}
58
59
// Add a set of systematics to the global set
60
void
SystematicRegistry::registerSystematics
(
const
SystematicSet
&
systematics
)
61
{
62
std::set<SystematicVariation>::const_iterator sysItr;
63
for
(sysItr =
systematics
.begin(); sysItr !=
systematics
.end(); ++sysItr)
64
{
65
registerSystematic
(*sysItr);
66
}
67
}
68
69
70
// Add a systematic to the configuratin set
71
StatusCode
SystematicRegistry::addSystematicToRecommended
72
(
const
SystematicVariation
& systematic)
73
{
74
// Check for consistency
75
if
(!
m_globalSystematics
.matchSystematic(systematic,
76
SystematicSet::FULLORCONTINUOUS
))
77
{
78
return
StatusCode::FAILURE;
79
}
80
m_recommendedSystematics
.insert(systematic);
81
return
StatusCode::SUCCESS;
82
}
83
84
85
// Add a systematic set to the configuration set
86
StatusCode
SystematicRegistry::addSystematicsToRecommended
87
(
const
SystematicSet
&
systematics
)
88
{
89
std::set<SystematicVariation>::const_iterator sysItr;
90
for
(sysItr =
systematics
.begin(); sysItr !=
systematics
.end(); ++sysItr)
91
{
92
StatusCode code =
addSystematicToRecommended
(*sysItr);
93
if
(code != StatusCode::SUCCESS)
return
code;
94
}
95
return
StatusCode::SUCCESS;
96
}
97
98
99
// Private constructor
100
SystematicRegistry::SystematicRegistry
()
101
{
102
}
103
104
}
StatusCode.h
IReentrantSystematicsTool.h
systematics
static const std::vector< std::string > systematics
Definition
MuonTriggerSFFilesTest.cxx:23
SystematicRegistry.h
SystematicSet.h
CP::IReentrantSystematicsTool
interface for all CP tools supporting systematic variations within a reentrant algorithm
Definition
IReentrantSystematicsTool.h:58
CP::SystematicRegistry::recommendedSystematics
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
Definition
SystematicRegistry.cxx:38
CP::SystematicRegistry::addSystematicToRecommended
StatusCode addSystematicToRecommended(const SystematicVariation &systematic)
description: add a systematic to the recommended set
Definition
SystematicRegistry.cxx:72
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition
SystematicRegistry.cxx:25
CP::SystematicRegistry::registerSystematic
void registerSystematic(const SystematicVariation &systematic)
description: add a systematic to the global registry set
Definition
SystematicRegistry.cxx:54
CP::SystematicRegistry::addSystematicsToRecommended
StatusCode addSystematicsToRecommended(const SystematicSet &systematics)
description: add a set of systematics to the recommended set
Definition
SystematicRegistry.cxx:87
CP::SystematicRegistry::globalSystematics
const SystematicSet & globalSystematics() const
returns: the global set of systematics
Definition
SystematicRegistry.cxx:32
CP::SystematicRegistry::m_recommendedSystematics
SystematicSet m_recommendedSystematics
recommended set of systematics
Definition
SystematicRegistry.h:81
CP::SystematicRegistry::SystematicRegistry
SystematicRegistry()
Private constructor.
Definition
SystematicRegistry.cxx:100
CP::SystematicRegistry::registerSystematics
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Definition
SystematicRegistry.cxx:45
CP::SystematicRegistry::m_globalSystematics
SystematicSet m_globalSystematics
Global set of possible systematics.
Definition
SystematicRegistry.h:78
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition
SystematicSet.h:31
CP::SystematicSet::FULLORCONTINUOUS
@ FULLORCONTINUOUS
Definition
SystematicSet.h:90
CP::SystematicVariation
Definition
SystematicVariation.h:47
CP
Select isolated Photons, Electrons and Muons.
Definition
Control/xAODRootAccess/xAODRootAccess/TEvent.h:27
xAOD::TTHREAD_TLS
TTHREAD_TLS(TStore *) s_store
Pointer to the currently active TStore object of the thread.
Generated on
for ATLAS Offline Software by
1.17.0