ATLAS Offline Software
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 
21 namespace CP
22 {
23 
24  // Get the singleton registry instance
26  {
27  TTHREAD_TLS( SystematicRegistry ) systRegistry;
28  return systRegistry;
29  }
30 
31 
33  {
34  return m_globalSystematics;
35  }
36 
37 
39  {
41  }
42 
43 
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
87  (const SystematicSet& systematics)
88  {
89  std::set<SystematicVariation>::const_iterator sysItr;
90  for(sysItr = systematics.begin(); sysItr != systematics.end(); ++sysItr)
91  {
93  if(code != StatusCode::SUCCESS) return code;
94  }
95  return StatusCode::SUCCESS;
96  }
97 
98 
99  // Private constructor
101  {
102  }
103 
104 }
xAOD::TTHREAD_TLS
TTHREAD_TLS(TStore *) s_store
Pointer to the currently active TStore object of the thread.
CP::SystematicRegistry::addSystematicToRecommended
StatusCode addSystematicToRecommended(const SystematicVariation &systematic)
description: add a systematic to the recommended set
Definition: SystematicRegistry.cxx:72
SystematicSet.h
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP::SystematicRegistry::globalSystematics
const SystematicSet & globalSystematics() const
returns: the global set of systematics
Definition: SystematicRegistry.cxx:32
CP::SystematicVariation
Definition: SystematicVariation.h:47
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::SystematicRegistry::registerSystematics
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Definition: SystematicRegistry.cxx:45
SystematicRegistry.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::SystematicSet::FULLORCONTINUOUS
@ FULLORCONTINUOUS
Definition: SystematicSet.h:90
StatusCode.h
IReentrantSystematicsTool.h
CheckAppliedSFs.systematics
def systematics
Definition: CheckAppliedSFs.py:231
pmontree.code
code
Definition: pmontree.py:443
CP::SystematicRegistry::SystematicRegistry
SystematicRegistry()
Private constructor.
Definition: SystematicRegistry.cxx:100
CP::SystematicSet::insert
void insert(const SystematicVariation &systematic)
description: insert a systematic into the set
Definition: SystematicSet.cxx:88
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
CP::SystematicRegistry::registerSystematic
void registerSystematic(const SystematicVariation &systematic)
description: add a systematic to the global registry set
Definition: SystematicRegistry.cxx:54
CP::SystematicRegistry
This module implements the central registry for handling systematic uncertainties with CP tools.
Definition: SystematicRegistry.h:25
CP::SystematicRegistry::recommendedSystematics
const SystematicSet & recommendedSystematics() const
returns: the recommended set of systematics
Definition: SystematicRegistry.cxx:38
CP::SystematicSet::matchSystematic
bool matchSystematic(const SystematicVariation &systematic, MATCHTYPE type=FULL) const
Definition: SystematicSet.cxx:128
CP::IReentrantSystematicsTool
interface for all CP tools supporting systematic variations within a reentrant algorithm
Definition: IReentrantSystematicsTool.h:58
CP::SystematicRegistry::addSystematicsToRecommended
StatusCode addSystematicsToRecommended(const SystematicSet &systematics)
description: add a set of systematics to the recommended set
Definition: SystematicRegistry.cxx:87
CP::SystematicRegistry::m_globalSystematics
SystematicSet m_globalSystematics
Global set of possible systematics.
Definition: SystematicRegistry.h:78
CP::SystematicRegistry::getInstance
static SystematicRegistry & getInstance()
Get the singleton instance of the registry for the curren thread.
Definition: SystematicRegistry.cxx:25
CP::SystematicRegistry::m_recommendedSystematics
SystematicSet m_recommendedSystematics
recommended set of systematics
Definition: SystematicRegistry.h:81