ATLAS Offline Software
Loading...
Searching...
No Matches
SystematicVariation.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8#ifndef PATINTERFACES_SYSTEMATIC_VARIATION_H
9#define PATINTERFACES_SYSTEMATIC_VARIATION_H
10
11// This module implements a class that manages the various
12// representations of a single systematic variation. The interface
13// provided in this module is intended for the general user. The
14// module is considered to be in the pre-alpha stage.
15
16// The current implementation isn't particularly efficient, in fact it
17// is terribly inefficient, as most of the accessors involve a lot of
18// string operations. However, the current accessors should allow for
19// more efficient implementations if needed. And this class is likely
20// only to be used during job startup, meaning an inefficient
21// implementation is likely to have little to no effect on overall job
22// execution time. At the same time objects of this type are likely
23// to be kept around for the entire runtime of the job, meaning the
24// current small memory footprint should have advantages.
25
26
27
29
30#include <iosfwd>
31#include <set>
32#include <string>
33
35//bool operator < (const CP::SystematicVariation& a, const CP::SystematicVariation& b);
36//bool operator == (const CP::SystematicVariation& a, const CP::SystematicVariation& b);
37
38
39namespace CP
40{
41
42 // Pulling global ops into CP. Not ideal.
43 using ::operator<;
44 using ::operator==;
45
47 {
48 //
49 // public interface
50 //
51
54 public:
55 void testInvariant () const;
56
57
60 public:
62
63
67 public:
68 SystematicVariation (const std::string& val_name);
69 SystematicVariation (const std::string& val_basename,
70 const std::string& val_subvariation);
71 SystematicVariation (const std::string& val_basename,
72 float val_parameter);
73
74
78 public:
80#ifndef __MAKECINT__
81#ifndef __ROOTCLING__
82 SystematicVariation (const std::string& val_basename, CONTINUOUS_ARG);
83#endif // not __ROOTCLING__
84#endif // not __MAKECINT__
85
86
92 public:
94 makeToyVariation (const std::string& basename,
95 unsigned toyIndex, float toyScale);
96
97
103 public:
105 makeToyEnsemble (const std::string& basename);
106
107
113 public:
115 makeContinuousEnsemble (const std::string& basename);
116
117
122 public:
123 static SystematicVariation makeContinuous (const std::string& basename);
124
125
126 // TODO: re-evaluate the usefulness of this constructor
137 public:
138 SystematicVariation (const std::set<CP::SystematicVariation>& systematics,
139 const std::string& val_basename);
140
141
148 public:
149 bool empty () const;
150
151
155 public:
156 const std::string& name () const;
157
158
163 public:
164 std::string basename () const;
165
166
174 public:
175 std::string subvariation () const;
176
177
182 public:
183 float parameter () const;
184
185
194 public:
195 std::pair<unsigned,float> getToyVariation () const;
196
197
203 public:
204 bool isToyEnsemble () const;
205
206
212 public:
213 bool isContinuousEnsemble () const;
214
215
224 public:
225 bool isEnsemble () const;
226
227
234 public:
235 bool ensembleContains (const SystematicVariation& sys) const;
236
237
243 public:
244 bool isToyVariation () const;
245
246
252 public:
253 bool isContinuousVariation () const;
254
255
256
257
258 //
259 // private interface
260 //
261
263 private:
264 std::string m_name;
265 };
266
267 std::ostream& operator << (std::ostream& str, const CP::SystematicVariation& obj);
268}
269
270#endif
static const std::vector< std::string > systematics
SystematicVariation()
effects: standard default constructor guarantee: no-fail
bool isContinuousVariation() const
whether this represents a continuous variation
static SystematicVariation makeContinuousEnsemble(const std::string &basename)
constructor for continuous systematics ensemble
bool isToyVariation() const
whether this represents a toy variation
float parameter() const
description: the numeric parameter contained in the subvariation(), or 0 if the subvariation can't be...
CONTINUOUS_ARG
effects: constructor for indicating continuous systematics guarantee: strong failures: out of memory ...
std::string subvariation() const
description: the part of the name that indicates by how many sigmas we varied guarantee: strong failu...
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.
bool ensembleContains(const SystematicVariation &sys) const
whether this is an ensemble that contains the given systematic variation
std::string m_name
description: members directly corresponding to accessors
bool isToyEnsemble() const
whether this represents a toy ensemble
bool empty() const
returns: whether this is an empty systematic, i.e.
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
static SystematicVariation makeToyEnsemble(const std::string &basename)
constructor for toy systematics ensemble
const std::string & name() const
description: the full systematics name, for use in strings, etc.
bool isContinuousEnsemble() const
whether this represents a continuous ensemble
static SystematicVariation makeContinuous(const std::string &basename)
Named constructor for continuous systematics.
bool isEnsemble() const
whether this represents any form of ensemble
std::pair< unsigned, float > getToyVariation() const
unpack the toy variation
Select isolated Photons, Electrons and Muons.
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
std::string basename(std::string name)
Definition utils.cxx:207