DAS  3.0
Das Analysis System
Variation.h
Go to the documentation of this file.
1 #pragma once
2 
3 // STD
4 #include <iostream>
5 #include <memory>
6 #include <string>
7 
8 // Darwin
9 #include <Weight.h>
10 
11 namespace Darwin::Physics {
12 
13 enum VarType {
14  single = 0b0000,
15  symmetric = 0b0001,
16  replicas = 0b0010,
17  bits = 0b0100
18 };
19 
20 using enum VarType;
21 
26 class Variation {
27 
28  std::string group;
29  std::string name;
30 
31  std::size_t index;
32  int bit;
33 
34 public:
35 
38  ~Variation () = default;
39 
42  Variation (const char * group, const char * name,
43  size_t index = 0, int bit = 0) :
45  { }
46 
49  Variation (const std::string& group, const std::string& name,
50  size_t index = 0, int bit = 0) :
52  { }
53 
56  Variation (const Variation& v) :
57  group(v.group), name(v.name), index(v.index), bit(v.bit)
58  { }
59 
63  group(std::move(v.group)), name(std::move(v.name)), index(v.index), bit(v.bit)
64  { }
65 
66  inline std::string_view Group () const { return group; }
67  inline std::string_view Name () const { return name ; }
68  inline size_t Index () const { return index; }
69  inline int Bit () const { return bit ; }
70 };
71 
72 inline const Variation nominal("", "nominal");
73 
74 std::strong_ordering operator<=> (const Variation& lhs, const Variation& rhs);
75 
76 } // end of namespace Darwin::Physics
77 
78 std::ostream& operator<< (std::ostream& s, const Darwin::Physics::Variation& v);
Darwin::Physics::operator<=>
std::strong_ordering operator<=>(const Variation &lhs, const Variation &rhs)
Definition: Variation.cc:10
Darwin::Physics::replicas
@ replicas
Definition: Variation.h:16
Darwin::Physics::Variation::Variation
Variation(Variation &&v)
Move constructor.
Definition: Variation.h:62
Darwin::Physics::Variation::Index
size_t Index() const
Definition: Variation.h:68
Darwin::Physics::Variation::Variation
Variation(const std::string &group, const std::string &name, size_t index=0, int bit=0)
Normal constructor with std::strings.
Definition: Variation.h:49
Darwin::Physics::bits
@ bits
Definition: Variation.h:17
Darwin::Physics::Variation::Group
std::string_view Group() const
Definition: Variation.h:66
Weight.h
Darwin::Physics::VarType
VarType
Definition: Variation.h:13
Darwin::Physics::Variation
Definition: Variation.h:26
Darwin::Physics::Variation::Bit
int Bit() const
Definition: Variation.h:69
Darwin::Physics::Variation::bit
int bit
correlation bit (needed for binned corrections with own stat. unc.)
Definition: Variation.h:32
Darwin::Physics::Variation::~Variation
~Variation()=default
Destructor.
Darwin::Physics::nominal
const Variation nominal("", "nominal")
Darwin::Physics::single
@ single
Definition: Variation.h:14
Darwin::Physics::Variation::name
std::string name
variation name (including "Up" or "Down")
Definition: Variation.h:29
Darwin::Physics::Variation::group
std::string group
e.g. "GenEventWgts"
Definition: Variation.h:28
Darwin::Physics::Variation::Variation
Variation(const Variation &v)
Copy constructor.
Definition: Variation.h:56
Darwin::Physics
Everything what concerns physics analysis directly.
Definition: darwin.h:24
Darwin::Physics::Variation::Name
std::string_view Name() const
Definition: Variation.h:67
Darwin::Physics::Variation::Variation
Variation(const char *group, const char *name, size_t index=0, int bit=0)
Normal constructor with C-style strings.
Definition: Variation.h:42
operator<<
std::ostream & operator<<(std::ostream &s, const Darwin::Physics::Variation &v)
Definition: Variation.cc:20
Darwin::Physics::Variation::index
std::size_t index
e.g. index in PhysicsObject::scales
Definition: Variation.h:31
Darwin::Physics::symmetric
@ symmetric
Definition: Variation.h:15