|
ATLAS Offline Software
|
Go to the documentation of this file.
22 return a.name() <
b.name();
28 return a.name() ==
b.name();
45 std::string packUnsigned (
unsigned value)
60 unsigned unpackUnsigned (
const std::string&
value)
80 std::string packFloat (
float value,
const std::string& plus,
81 const std::string& minus)
83 std::string separator = plus;
91 std::ostringstream
str;
110 bool unpackFloatHelper (
const std::string&
value,
111 const std::string& separator,
114 if (!separator.empty())
116 std::string::size_type
split =
value.rfind (separator);
117 if (
split != std::string::npos)
140 float unpackFloat (
const std::string&
value,
const std::string& plus,
141 const std::string& minus)
185 const std::string& val_subvariation)
186 : m_name (val_basename +
"__" + val_subvariation)
197 std::string separator =
"up";
198 if (val_parameter < 0)
203 std::ostringstream
str;
204 str << rint (val_parameter * 10000);
229 : m_name (val_basename +
"__continuous")
239 unsigned toyIndex,
float toyScale)
244 (
basename,
"toy_" + packUnsigned (toyIndex) +
"_" + packFloat (toyScale,
"scale",
""));
275 const std::string& val_basename)
279 for (std::set<SystematicVariation>::const_iterator
283 if (
sys->basename() == val_basename)
316 std::string::size_type
split =
m_name.rfind (
"__");
317 if (
split != std::string::npos)
330 std::string::size_type
split =
m_name.rfind (
"__");
331 if (
split != std::string::npos)
347 if (
split != std::string::npos)
358 if (
split != std::string::npos)
380 const std::size_t prefixSize = 4;
381 const auto split1 = variation.find (
"toy_");
384 const auto split2 = variation.find (
"_", split1 + prefixSize);
385 if (split2 == std::string::npos)
388 const auto sub1 = variation.substr (prefixSize, split2 - prefixSize);
389 const auto sub2 = variation.substr (split2 + 1);
390 return std::make_pair (unpackUnsigned (sub1), unpackFloat (sub2,
"scale",
""));
SystematicVariation()
effects: standard default constructor guarantee: no-fail
static SystematicVariation makeToyVariation(const std::string &basename, unsigned toyIndex, float toyScale)
constructor for toy systematics
std::string basename() const
description: the base name, i.e.
const std::string & name() const
description: the full systematics name, for use in strings, etc.
bool ensembleContains(const SystematicVariation &sys) const
whether this is an ensemble that contains the given systematic variation
Select isolated Photons, Electrons and Muons.
bool isToyVariation() const
whether this represents a toy variation
bool isContinuousVariation() const
whether this represents a continuous variation
bool operator<(const CP::SystematicVariation &a, const CP::SystematicVariation &b)
CONTINUOUS_ARG
effects: constructor for indicating continuous systematics guarantee: strong failures: out of memory ...
bool isEnsemble() const
whether this represents any form of ensemble
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
static SystematicVariation makeContinuousEnsemble(const std::string &basename)
constructor for continuous systematics ensemble
static SystematicVariation makeContinuous(const std::string &basename)
Named constructor for continuous systematics.
bool operator==(const CP::SystematicVariation &a, const CP::SystematicVariation &b)
std::ostream & operator<<(std::ostream &str, const CP::SystematicVariation &obj)
std::pair< unsigned, float > getToyVariation() const
unpack the toy variation
bool empty() const
returns: whether this is an empty systematic, i.e.
#define RCU_THROW_MSG(message)
static SystematicVariation makeToyEnsemble(const std::string &basename)
constructor for toy systematics ensemble
std::string subvariation() const
description: the part of the name that indicates by how many sigmas we varied guarantee: strong failu...
#define RCU_READ_INVARIANT(x)
bool isToyEnsemble() const
whether this represents a toy ensemble
bool isContinuousEnsemble() const
whether this represents a continuous ensemble
std::string m_name
description: members directly corresponding to accessors
float parameter() const
description: the numeric parameter contained in the subvariation(), or 0 if the subvariation can't be...
#define RCU_NEW_INVARIANT(x)