ATLAS Offline Software
Loading...
Searching...
No Matches
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):
16
17//
18// method implementations
19//
20
21namespace CP
22{
23
24 // Get the singleton registry instance
26 {
27 TTHREAD_TLS( SystematicRegistry ) systRegistry;
28 return systRegistry;
29 }
30
31
36
37
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
54 (const SystematicVariation& systematic)
55 {
56 m_globalSystematics.insert(systematic);
57 }
58
59 // Add a set of systematics to the global set
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
72 (const SystematicVariation& systematic)
73 {
74 // Check for consistency
75 if(!m_globalSystematics.matchSystematic(systematic,
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
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
103
104}
static const std::vector< std::string > systematics
interface for all CP tools supporting systematic variations within a reentrant algorithm
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
StatusCode addSystematicToRecommended(const SystematicVariation &systematic)
description: add a systematic to the recommended set
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
void registerSystematic(const SystematicVariation &systematic)
description: add a systematic to the global registry set
StatusCode addSystematicsToRecommended(const SystematicSet &systematics)
description: add a set of systematics to the recommended set
const SystematicSet & globalSystematics() const
returns: the global set of systematics
SystematicSet m_recommendedSystematics
recommended set of systematics
SystematicRegistry()
Private constructor.
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
SystematicSet m_globalSystematics
Global set of possible systematics.
Class to wrap a set of SystematicVariations.
Select isolated Photons, Electrons and Muons.
TTHREAD_TLS(TStore *) s_store
Pointer to the currently active TStore object of the thread.