the canonical implementation of ISystematicsSvc
More...
#include <SystematicsSvc.h>
|
Gaudi::Property< std::vector< std::string > > | m_systematicsList {this, "systematicsList", {}, "the list of systematics to run"} |
| the names of the systematics to request More...
|
|
Gaudi::Property< std::string > | m_systematicsRegex {this, "systematicsRegex", "(.*)", "systematics filter regex"} |
| the regular expression for filterinf systematics More...
|
|
Gaudi::Property< float > | m_sigmaRecommended {this, "sigmaRecommended", 0, "the sigma with which to run recommended systematics"} |
| load all recommended systematics at the given number of sigmas More...
|
|
Gaudi::Property< std::string > | m_nominalSystematicsName {this, "nominalSystematicsName", "NOSYS", "the name to use for the nominal systematic (instead of the empty string)"} |
| nominal systematics name More...
|
|
SystematicSet m_affectingSystematics | ATLAS_THREAD_SAFE |
| the list of affecting systematics More...
|
|
SystematicSet m_recommendedSystematics | ATLAS_THREAD_SAFE |
| the list of recommended systematics More...
|
|
std::unordered_map< std::string, CP::SystematicSet > m_objectSystematics | ATLAS_THREAD_SAFE |
| the list of per-object systematics More...
|
|
std::unordered_map< std::string, CP::SystematicSet > m_decorSystematics | ATLAS_THREAD_SAFE |
| the list of per-object-and-decoration systematics More...
|
|
std::unordered_map< std::string, std::string > m_copies | ATLAS_THREAD_SAFE |
| the map of registered copies More...
|
|
std::mutex | m_systematicsMutex |
| a mutex for accessing the above mutable members More...
|
|
the canonical implementation of ISystematicsSvc
Definition at line 23 of file SystematicsSvc.h.
◆ addSystematics()
Definition at line 95 of file SystematicsSvc.cxx.
103 if (affecting.
find (mysys) == affecting.
end())
105 ANA_MSG_ERROR (
"systematic is only registered as recommended, not affecting: " << mysys);
106 return StatusCode::FAILURE;
110 m_affectingSystematics.insert (affecting);
111 m_recommendedSystematics.insert (recommended);
112 return StatusCode::SUCCESS;
◆ finalize()
StatusCode CP::SystematicsSvc::finalize |
( |
| ) |
|
|
overridevirtual |
Definition at line 256 of file SystematicsSvc.cxx.
268 if (m_recommendedSystematics.find (mysys) == m_recommendedSystematics.end())
281 return StatusCode::SUCCESS;
◆ getCopySource()
std::string CP::SystematicsSvc::getCopySource |
( |
const std::string & |
toName | ) |
const |
|
overridevirtual |
Definition at line 209 of file SystematicsSvc.cxx.
213 auto iter = m_copies.find (toName);
214 if (iter == m_copies.end())
◆ getDecorSystematics()
Definition at line 150 of file SystematicsSvc.cxx.
154 const std::string
name = objectName +
"." + decorName;
156 auto iter = m_decorSystematics.find (
name);
157 if (iter != m_decorSystematics.end())
159 auto jter = m_copies.find (objectName);
160 if (jter != m_copies.end())
162 const std::string& copyName = jter->second;
◆ getObjectSystematics()
Definition at line 117 of file SystematicsSvc.cxx.
121 auto iter = m_objectSystematics.find (
name);
122 if (iter != m_objectSystematics.end())
◆ initialize()
StatusCode CP::SystematicsSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Definition at line 29 of file SystematicsSvc.cxx.
36 return StatusCode::FAILURE;
43 ANA_MSG_ERROR (
"can't specify both sigmaRecommended and systematicsList");
44 return StatusCode::FAILURE;
47 return StatusCode::SUCCESS;
◆ makeSystematicsName()
StatusCode CP::SystematicsSvc::makeSystematicsName |
( |
std::string & |
result, |
|
|
const std::string & |
name, |
|
|
const CP::SystematicSet & |
sys |
|
) |
| const |
|
overridevirtual |
Definition at line 222 of file SystematicsSvc.cxx.
229 ANA_MSG_ERROR (
"not allowed to make systematic name for empty string");
230 return StatusCode::FAILURE;
235 const auto sysSplit =
result.find (
"%SYS%");
236 if (sysSplit == std::string::npos)
240 ANA_MSG_ERROR (
"can't set systematics on name without \"%SYS%\": \"" <<
name <<
"\" sys=" <<
sys.name());
241 return StatusCode::FAILURE;
251 return StatusCode::SUCCESS;
◆ makeSystematicsVector()
Definition at line 52 of file SystematicsSvc.cxx.
56 std::vector<CP::SystematicSet> systematicsVector;
64 sys.calc (m_recommendedSystematics);
69 if (!regex_match (mysys.name(), expr))
74 systematicsVector.push_back (mysys);
89 assert (!systematicsVector.empty());
90 return systematicsVector;
◆ registerCopy()
StatusCode CP::SystematicsSvc::registerCopy |
( |
const std::string & |
fromName, |
|
|
const std::string & |
toName |
|
) |
| const |
|
overridevirtual |
Definition at line 193 of file SystematicsSvc.cxx.
198 auto emplace_result = m_copies.try_emplace (toName, fromName);
199 if (emplace_result.second ==
false)
201 ANA_MSG_ERROR (
"duplicate copy registered for name " << toName);
202 return StatusCode::FAILURE;
204 return StatusCode::SUCCESS;
◆ setDecorSystematics()
StatusCode CP::SystematicsSvc::setDecorSystematics |
( |
const std::string & |
objectName, |
|
|
const std::string & |
decorName, |
|
|
const CP::SystematicSet & |
systematics |
|
) |
| const |
|
overridevirtual |
Definition at line 171 of file SystematicsSvc.cxx.
176 const std::string
name = objectName +
"." + decorName;
181 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
183 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
184 return StatusCode::FAILURE;
187 m_decorSystematics[
name] = std::move (mysystematics);
188 return StatusCode::SUCCESS;
◆ setObjectSystematics()
Definition at line 130 of file SystematicsSvc.cxx.
138 if (m_affectingSystematics.find (mysys) == m_affectingSystematics.end())
140 ANA_MSG_ERROR (
"systematic is set as object systematic, but not affecting: " << mysys);
141 return StatusCode::FAILURE;
144 m_objectSystematics[
name] = std::move (mysystematics);
145 return StatusCode::SUCCESS;
◆ ATLAS_THREAD_SAFE [1/5]
SystematicSet m_affectingSystematics CP::SystematicsSvc::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [2/5]
SystematicSet m_recommendedSystematics CP::SystematicsSvc::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [3/5]
std::unordered_map<std::string,CP::SystematicSet> m_objectSystematics CP::SystematicsSvc::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ ATLAS_THREAD_SAFE [4/5]
std::unordered_map<std::string,CP::SystematicSet> m_decorSystematics CP::SystematicsSvc::ATLAS_THREAD_SAFE |
|
mutableprivate |
the list of per-object-and-decoration systematics
Definition at line 103 of file SystematicsSvc.h.
◆ ATLAS_THREAD_SAFE [5/5]
std::unordered_map<std::string,std::string> m_copies CP::SystematicsSvc::ATLAS_THREAD_SAFE |
|
mutableprivate |
◆ m_nominalSystematicsName
Gaudi::Property<std::string> CP::SystematicsSvc::m_nominalSystematicsName {this, "nominalSystematicsName", "NOSYS", "the name to use for the nominal systematic (instead of the empty string)"} |
|
private |
◆ m_sigmaRecommended
Gaudi::Property<float> CP::SystematicsSvc::m_sigmaRecommended {this, "sigmaRecommended", 0, "the sigma with which to run recommended systematics"} |
|
private |
load all recommended systematics at the given number of sigmas
The idea here is that this allows to run a simple analysis by itself without having to generate the list of systematics manually.
Definition at line 82 of file SystematicsSvc.h.
◆ m_systematicsList
Gaudi::Property<std::vector<std::string> > CP::SystematicsSvc::m_systematicsList {this, "systematicsList", {}, "the list of systematics to run"} |
|
private |
◆ m_systematicsMutex
std::mutex CP::SystematicsSvc::m_systematicsMutex |
|
mutableprivate |
a mutex for accessing the above mutable members
Definition at line 111 of file SystematicsSvc.h.
◆ m_systematicsRegex
Gaudi::Property<std::string> CP::SystematicsSvc::m_systematicsRegex {this, "systematicsRegex", "(.*)", "systematics filter regex"} |
|
private |
the regular expression for filterinf systematics
Definition at line 73 of file SystematicsSvc.h.
The documentation for this class was generated from the following files: