ATLAS Offline Software
SystematicsSvc.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef SYSTEMATICS_HANDLES__SYSTEMATICS_SVC_H
9 #define SYSTEMATICS_HANDLES__SYSTEMATICS_SVC_H
10 
11 #include <AsgServices/AsgService.h>
16 #include <mutex>
17 #include <unordered_map>
18 
19 namespace CP
20 {
22 
23  class SystematicsSvc final : public extends<asg::AsgService, ISystematicsSvc>
24  {
25 
26  //
27  // public interface
28  //
29 
30  public:
31  using extends::extends; // base class constructor
32 
33  virtual StatusCode initialize () override;
34  virtual StatusCode finalize () override;
35  virtual std::vector<CP::SystematicSet>
36  makeSystematicsVector () const override;
37  virtual StatusCode addSystematics (const CP::SystematicSet& recommended,
38  const CP::SystematicSet& affecting) const override;
39  virtual CP::SystematicSet
40  getObjectSystematics (const std::string& name) const override;
41  virtual StatusCode
42  setObjectSystematics (const std::string& name,
43  const CP::SystematicSet& systematics) const override;
44  virtual CP::SystematicSet
45  getDecorSystematics (const std::string& objectName,
46  const std::string& decorName) const override;
47  virtual StatusCode
48  setDecorSystematics (const std::string& objectName,
49  const std::string& decorName,
50  const CP::SystematicSet& systematics) const override;
51  virtual StatusCode
52  registerCopy (const std::string& fromName,
53  const std::string& toName) const override;
54  virtual std::string
55  getCopySource (const std::string& toName) const override;
56  virtual StatusCode
57  makeSystematicsName (std::string& result,
58  const std::string& name,
59  const CP::SystematicSet& sys) const override;
60 
61 
62 
63  //
64  // private interface
65  //
66 
68  private:
69  Gaudi::Property<std::vector<std::string>> m_systematicsList {this, "systematicsList", {}, "the list of systematics to run"};
70 
72  private:
73  Gaudi::Property<std::string> m_systematicsRegex {this, "systematicsRegex", "(.*)", "systematics filter regex"};
74 
81  private:
82  Gaudi::Property<float> m_sigmaRecommended {this, "sigmaRecommended", 0, "the sigma with which to run recommended systematics"};
83 
85  private:
86  Gaudi::Property<std::string> m_nominalSystematicsName {this, "nominalSystematicsName", "NOSYS", "the name to use for the nominal systematic (instead of the empty string)"};
87 
88 
90  private:
91  mutable SystematicSet m_affectingSystematics ATLAS_THREAD_SAFE;
92 
94  private:
95  mutable SystematicSet m_recommendedSystematics ATLAS_THREAD_SAFE;
96 
98  private:
99  mutable std::unordered_map<std::string,CP::SystematicSet> m_objectSystematics ATLAS_THREAD_SAFE;
100 
102  private:
103  mutable std::unordered_map<std::string,CP::SystematicSet> m_decorSystematics ATLAS_THREAD_SAFE;
104 
106  private:
107  mutable std::unordered_map<std::string,std::string> m_copies ATLAS_THREAD_SAFE;
108 
110  private:
112  };
113 }
114 
115 #endif
CP::SystematicsSvc::makeSystematicsName
virtual StatusCode makeSystematicsName(std::string &result, const std::string &name, const CP::SystematicSet &sys) const override
Definition: SystematicsSvc.cxx:223
CP::SystematicsSvc::finalize
virtual StatusCode finalize() override
Definition: SystematicsSvc.cxx:257
PropertyWrapper.h
get_generator_info.result
result
Definition: get_generator_info.py:21
AsgService.h
CP::SystematicsSvc::ATLAS_THREAD_SAFE
std::unordered_map< std::string, CP::SystematicSet > m_objectSystematics ATLAS_THREAD_SAFE
the list of per-object systematics
Definition: SystematicsSvc.h:99
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
CP::SystematicsSvc::getDecorSystematics
virtual CP::SystematicSet getDecorSystematics(const std::string &objectName, const std::string &decorName) const override
Definition: SystematicsSvc.cxx:151
CP::SystematicsSvc::m_systematicsMutex
std::mutex m_systematicsMutex
a mutex for accessing the above mutable members
Definition: SystematicsSvc.h:111
SystematicSet.h
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
CP::SystematicsSvc::ATLAS_THREAD_SAFE
std::unordered_map< std::string, CP::SystematicSet > m_decorSystematics ATLAS_THREAD_SAFE
the list of per-object-and-decoration systematics
Definition: SystematicsSvc.h:103
CP::SystematicsSvc::setObjectSystematics
virtual StatusCode setObjectSystematics(const std::string &name, const CP::SystematicSet &systematics) const override
Definition: SystematicsSvc.cxx:131
CP::SystematicsSvc::ATLAS_THREAD_SAFE
SystematicSet m_recommendedSystematics ATLAS_THREAD_SAFE
the list of recommended systematics
Definition: SystematicsSvc.h:95
CP::SystematicsSvc::m_systematicsList
Gaudi::Property< std::vector< std::string > > m_systematicsList
the names of the systematics to request
Definition: SystematicsSvc.h:69
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
CP::SystematicsSvc::initialize
virtual StatusCode initialize() override
Definition: SystematicsSvc.cxx:30
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
ISystematicsSvc.h
CP::SystematicsSvc::addSystematics
virtual StatusCode addSystematics(const CP::SystematicSet &recommended, const CP::SystematicSet &affecting) const override
Definition: SystematicsSvc.cxx:96
CP::SystematicsSvc::getObjectSystematics
virtual CP::SystematicSet getObjectSystematics(const std::string &name) const override
Definition: SystematicsSvc.cxx:118
CP::SystematicsSvc::registerCopy
virtual StatusCode registerCopy(const std::string &fromName, const std::string &toName) const override
Definition: SystematicsSvc.cxx:194
CP::SystematicsSvc::m_sigmaRecommended
Gaudi::Property< float > m_sigmaRecommended
load all recommended systematics at the given number of sigmas
Definition: SystematicsSvc.h:82
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CP::SystematicsSvc::makeSystematicsVector
virtual std::vector< CP::SystematicSet > makeSystematicsVector() const override
Definition: SystematicsSvc.cxx:53
CP::SystematicsSvc::getCopySource
virtual std::string getCopySource(const std::string &toName) const override
Definition: SystematicsSvc.cxx:210
CheckAppliedSFs.systematics
def systematics
Definition: CheckAppliedSFs.py:231
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
CP::SystematicsSvc::ATLAS_THREAD_SAFE
std::unordered_map< std::string, std::string > m_copies ATLAS_THREAD_SAFE
the map of registered copies
Definition: SystematicsSvc.h:107
CP::SystematicsSvc::ATLAS_THREAD_SAFE
SystematicSet m_affectingSystematics ATLAS_THREAD_SAFE
the list of affecting systematics
Definition: SystematicsSvc.h:91
CP::SystematicsSvc::m_nominalSystematicsName
Gaudi::Property< std::string > m_nominalSystematicsName
nominal systematics name
Definition: SystematicsSvc.h:86
CP::SystematicsSvc
the canonical implementation of ISystematicsSvc
Definition: SystematicsSvc.h:24
CP::SystematicsSvc::setDecorSystematics
virtual StatusCode setDecorSystematics(const std::string &objectName, const std::string &decorName, const CP::SystematicSet &systematics) const override
Definition: SystematicsSvc.cxx:172
checker_macros.h
Define macros for attributes used to control the static checker.
CP::SystematicsSvc::m_systematicsRegex
Gaudi::Property< std::string > m_systematicsRegex
the regular expression for filterinf systematics
Definition: SystematicsSvc.h:73