ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
CP::SystematicRegistry Class Reference

This module implements the central registry for handling systematic uncertainties with CP tools. More...

#include <SystematicRegistry.h>

Collaboration diagram for CP::SystematicRegistry:

Public Member Functions

const SystematicSetglobalSystematics () const
 returns: the global set of systematics More...
 
const SystematicSetrecommendedSystematics () const
 returns: the recommended set of systematics More...
 
StatusCode registerSystematics (const IReentrantSystematicsTool &tool)
 effects: register all the systematics from the tool More...
 
void registerSystematic (const SystematicVariation &systematic)
 description: add a systematic to the global registry set More...
 
void registerSystematics (const SystematicSet &systematics)
 description: add a set of systematics to the global registry set failures: requesting a systematic that's not on the global list More...
 
StatusCode addSystematicToRecommended (const SystematicVariation &systematic)
 description: add a systematic to the recommended set More...
 
StatusCode addSystematicsToRecommended (const SystematicSet &systematics)
 description: add a set of systematics to the recommended set More...
 

Static Public Member Functions

static SystematicRegistrygetInstance ()
 Get the singleton instance of the registry for the curren thread. More...
 

Private Member Functions

 SystematicRegistry ()
 Private constructor. More...
 
 SystematicRegistry (SystematicRegistry const &)=delete
 Private copy constructor. More...
 
void operator= (SystematicRegistry const &)=delete
 Private assignment operator. More...
 

Private Attributes

Sets of systematics in the registry
SystematicSet m_globalSystematics
 Global set of possible systematics. More...
 
SystematicSet m_recommendedSystematics
 recommended set of systematics More...
 

Detailed Description

This module implements the central registry for handling systematic uncertainties with CP tools.

Author
Steve Farrell steve.nosp@m.n.fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 24 of file SystematicRegistry.h.

Constructor & Destructor Documentation

◆ SystematicRegistry() [1/2]

CP::SystematicRegistry::SystematicRegistry ( )
private

Private constructor.

Definition at line 100 of file SystematicRegistry.cxx.

101  {
102  }

◆ SystematicRegistry() [2/2]

CP::SystematicRegistry::SystematicRegistry ( SystematicRegistry const )
privatedelete

Private copy constructor.

Member Function Documentation

◆ addSystematicsToRecommended()

StatusCode CP::SystematicRegistry::addSystematicsToRecommended ( const SystematicSet systematics)

description: add a set of systematics to the recommended set

Definition at line 86 of file SystematicRegistry.cxx.

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  }

◆ addSystematicToRecommended()

StatusCode CP::SystematicRegistry::addSystematicToRecommended ( const SystematicVariation systematic)

description: add a systematic to the recommended set

Definition at line 71 of file SystematicRegistry.cxx.

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  }

◆ getInstance()

SystematicRegistry & CP::SystematicRegistry::getInstance ( )
static

Get the singleton instance of the registry for the curren thread.

Note that each thread gets its own instance of SystematicRegistry in the current setup. Assuming that all analysis tools get instantiated once per thread.

This will have to be re-visited once we start making analysis tools thread-safe.

Returns
A thread specific SystematicRegistry instance

Definition at line 25 of file SystematicRegistry.cxx.

26  {
27  TTHREAD_TLS( SystematicRegistry ) systRegistry;
28  return systRegistry;
29  }

◆ globalSystematics()

const SystematicSet & CP::SystematicRegistry::globalSystematics ( ) const

returns: the global set of systematics

Definition at line 32 of file SystematicRegistry.cxx.

33  {
34  return m_globalSystematics;
35  }

◆ operator=()

void CP::SystematicRegistry::operator= ( SystematicRegistry const )
privatedelete

Private assignment operator.

◆ recommendedSystematics()

const SystematicSet & CP::SystematicRegistry::recommendedSystematics ( ) const

returns: the recommended set of systematics

Definition at line 38 of file SystematicRegistry.cxx.

39  {
41  }

◆ registerSystematic()

void CP::SystematicRegistry::registerSystematic ( const SystematicVariation systematic)

description: add a systematic to the global registry set

Definition at line 53 of file SystematicRegistry.cxx.

55  {
56  m_globalSystematics.insert(systematic);
57  }

◆ registerSystematics() [1/2]

StatusCode CP::SystematicRegistry::registerSystematics ( const IReentrantSystematicsTool tool)

effects: register all the systematics from the tool

Definition at line 44 of file SystematicRegistry.cxx.

46  {
47  registerSystematics (tool.affectingSystematics());
48  return addSystematicsToRecommended (tool.recommendedSystematics());
49  }

◆ registerSystematics() [2/2]

void CP::SystematicRegistry::registerSystematics ( const SystematicSet systematics)

description: add a set of systematics to the global registry set failures: requesting a systematic that's not on the global list

Definition at line 60 of file SystematicRegistry.cxx.

61  {
62  std::set<SystematicVariation>::const_iterator sysItr;
63  for(sysItr = systematics.begin(); sysItr != systematics.end(); ++sysItr)
64  {
65  registerSystematic(*sysItr);
66  }
67  }

Member Data Documentation

◆ m_globalSystematics

SystematicSet CP::SystematicRegistry::m_globalSystematics
private

Global set of possible systematics.

Definition at line 78 of file SystematicRegistry.h.

◆ m_recommendedSystematics

SystematicSet CP::SystematicRegistry::m_recommendedSystematics
private

recommended set of systematics

Definition at line 81 of file SystematicRegistry.h.


The documentation for this class was generated from the following files:
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
CP::SystematicRegistry::registerSystematics
StatusCode registerSystematics(const IReentrantSystematicsTool &tool)
effects: register all the systematics from the tool
Definition: SystematicRegistry.cxx:45
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
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::SystematicSet::matchSystematic
bool matchSystematic(const SystematicVariation &systematic, MATCHTYPE type=FULL) const
Definition: SystematicSet.cxx:128
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::m_recommendedSystematics
SystematicSet m_recommendedSystematics
recommended set of systematics
Definition: SystematicRegistry.h:81