ra4_stats  0341147a0dc35f80f4e12c6003afb76a38e2ed6e
process.hpp
Go to the documentation of this file.
1 #ifndef H_PROCESS
2 #define H_PROCESS
3 
4 #include <string>
5 #include <set>
6 #include <initializer_list>
7 #include <tuple>
8 #include <memory>
9 #include <ostream>
10 
11 #include "TChain.h"
12 
13 #include "cut.hpp"
14 #include "gamma_params.hpp"
15 #include "systematic.hpp"
16 
17 class Process{
18  typedef std::set<Systematic> SystCollection;
19 public:
20  Process() = default;
21  Process(const std::string &name,
22  const std::set<std::string> &file_names,
23  const Cut &cut = ::Cut(),
24  bool is_data = false,
25  bool is_signal = false,
26  bool count_zeros = true,
27  const SystCollection &systematics = SystCollection());
28  Process(const std::string &name,
29  std::initializer_list<std::string> file_names,
30  const Cut &cut = ::Cut(),
31  bool is_data = false,
32  bool is_signal = false,
33  bool count_zeros = true,
34  const SystCollection &systematics = SystCollection());
35 
36  const std::string & Name() const;
37  Process & Name(const std::string &name);
38 
39  const class Cut & Cut() const;
40  class Cut & Cut();
41 
42  const bool & IsData() const;
43  bool & IsData();
44 
45  const bool & IsSignal() const;
46  bool & IsSignal();
47 
48  const bool & CountZeros() const;
49  bool & CountZeros();
50 
51  const std::set<std::string> & FileNames() const;
52 
53  long GetEntries() const;
54  GammaParams GetYield(const class Cut &cut = ::Cut("1")) const;
55 
56  const SystCollection & Systematics() const;
57  Process & Systematics(const SystCollection &systematics);
58  Process & AddSystematic(const Systematic &systematic);
59  Process & AddSystematics(const SystCollection &systematic);
60  bool HasSystematic(const Systematic &systematic) const;
61  Process & RemoveSystematic(const Systematic &systematic);
63  Process & SetSystematicStrength(const std::string &name, double strength);
64 
65  bool operator<(const Process &p) const;
66  bool operator==(const Process &p) const;
67 
68 private:
69  std::set<std::string> file_names_;
70  mutable std::shared_ptr<TChain> chain_;
71  class Cut cut_;
72  std::string name_;
73  bool is_data_;
74  bool is_signal_;
76  SystCollection systematics_;
77 
78  void CleanName();
79  void AddFiles();
80 };
81 
82 std::ostream & operator<<(std::ostream &stream, const Process &proc);
83 
84 #endif
std::shared_ptr< TChain > chain_
Definition: process.hpp:70
bool HasSystematic(const Systematic &systematic) const
Definition: process.cpp:133
const std::string & Name() const
Definition: process.cpp:52
bool count_zeros_
Definition: process.hpp:75
const SystCollection & Systematics() const
Definition: process.cpp:110
void CleanName()
Definition: process.cpp:178
std::set< std::string > file_names_
Definition: process.hpp:69
Definition: cut.hpp:8
const std::set< std::string > & FileNames() const
Definition: process.cpp:70
long GetEntries() const
Definition: process.cpp:74
const bool & IsData() const
Definition: process.cpp:86
Process & AddSystematic(const Systematic &systematic)
Definition: process.cpp:119
const bool & CountZeros() const
Definition: process.cpp:102
GammaParams GetYield(const class Cut &cut=::Cut("1")) const
Definition: process.cpp:78
bool operator<(const Process &p) const
Definition: process.cpp:168
Process & RemoveSystematics()
Definition: process.cpp:146
Process & SetSystematicStrength(const std::string &name, double strength)
Definition: process.cpp:151
class Cut cut_
Definition: process.hpp:71
bool is_data_
Definition: process.hpp:73
bool operator==(const Process &p) const
Definition: process.cpp:173
bool is_signal_
Definition: process.hpp:74
const class Cut & Cut() const
Definition: process.cpp:62
const bool & IsSignal() const
Definition: process.cpp:94
std::string name_
Definition: process.hpp:72
Process()=default
void AddFiles()
Definition: process.cpp:182
Process & RemoveSystematic(const Systematic &systematic)
Definition: process.cpp:137
std::set< Systematic > SystCollection
Definition: process.hpp:18
std::ostream & operator<<(std::ostream &stream, const Process &proc)
Definition: process.cpp:188
SystCollection systematics_
Definition: process.hpp:76
Process & AddSystematics(const SystCollection &systematic)
Definition: process.cpp:126