Base.hh
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "boca/generic/Flag.hh"
9 #include "boca/io/FileInfo.hh"
10 #include "boca/latex/Names.hh"
12 
13 namespace boca
14 {
15 class Phase;
16 class Event;
17 namespace tagger{
18 class Base;
19 }
20 
21 enum class Output
22 {
23  none = 0,
24  fast = 1 << 0,
25  normal = 1 << 1,
26  significance = 1 << 2,
27  efficiency = 1 << 3,
28  plot = 1 << 4,
29  cut = 1 << 5,
30  plot_hist = 1 << 6
31 };
32 
33 std::string Name(Output output);
34 
35 template<>
36 struct Flag<Output> {
37  static const bool enable = true;
38 };
39 
44 namespace analysis
45 {
46 
47 // global variabel; FIXME remove again; is necesarry due to bug in root
48 extern std::string _name_;
49 
58 class Base
59 {
60 
61 public:
62 
63  Base();
64 
65  void Run(Output output);
66 
67  Base(Base const&) = default;
68 
69  Base(Base &&) = default;
70 
71  Base &operator=(Base const&) & = default;
72 
73  Base &operator=(Base &&) & = default;
74 
75 protected:
76 
77  ~Base() {}
78 
79  void Initialize();
80 
81  void RunFast();
82 
83  void RunNormal();
84 
85  void RunFullSignificance();
86 
87  void RunFullEfficiency();
88 
89  virtual void RunPlots() = 0;
90 
91  virtual void RunPlotHist() = 0;
92 
93  virtual void RunCut() = 0;
94 
95  virtual void RunSignificance() = 0;
96 
97  virtual void RunEfficiency() = 0;
98 
99  virtual void SetFiles(Phase const& phase) = 0;
100 
101  virtual tagger::Base const& Tagger() const = 0;
102 
103  virtual std::string Name() const;
104 
105  void RunTagger(Stage stage);
106 
107  void RunTrainer();
108 
109  virtual bool PassPreCut(Event const&) const;
110 
111  virtual long TrainNumberMax() const;
112 
113  virtual long ReadNumberMax() const;
114 
115  virtual long EventNumberMax(Stage stage) const;
116 
117  void ClearFiles();
118 
119  std::vector<boca::FileInfo> Files(Tag tag);
120 
121  void PrepareFiles(Stage stage);
122 
123  virtual int BackgroundFileNumber() const;
124 
125  void AddSignal(std::string const& file_name, latex::String const& latex_name = "", boca::Crosssection const& crosssection = 0_b, boca::Mass const& mass = 0_eV, std::string const& path = "");
126 //
127  void AddBackground(std::string const& file_name, latex::String const& latex_name = "", boca::Crosssection const& crosssection = 0_b, boca::Mass const& mass = 0_eV, std::string const& path = "");
128 
129  void AddFile(Tag tag, boca::FileInfo const& file);
130 
131  void AddSignal(boca::FileInfo const& file);
132 
133  void AddBackground(boca::FileInfo const& file);
134 
135  boca::PreCuts PreCuts() const;
136 
137  boca::PreCuts& PreCuts();
138 
139  void PrintGeneratorLevel(Event const& event, bool signature = false) const;
140 
141 private:
142 
143  virtual tagger::Base& Tagger() = 0;
144 
145  virtual void TagLoop(Phase phase) = 0;
146 
151  void AnalysisLoop(Stage stage);
152 
153  boca::PreCuts pre_cuts_;
154 
155  std::vector<boca::FileInfo> files_;
156 
157 };
158 
159 }
160 
161 }
Mark a strongly typed enumerator as a flag.
Definition: Flag.hh:22
~Base()
Definition: Base.hh:77
Stage
The stage of the multivariant tagging process.
Definition: Stage.hh:15
void Run(boca::Output output=boca::Output::fast)
Definition: MainCharged.cpp:5
Base for all analyses.
Definition: Base.hh:58
std::string _name_
Definition: Base.cpp:56
Definition: PreCuts.hh:14
Tag
The Tag distinguishes between signal and background events.
Definition: Tag.hh:14
Output
Definition: Base.hh:21
Base class for the event Topology.
Definition: Event.hh:53
Cut Example.
Definition: Analysis.hh:11
Definition: String.hh:45
Definition: Files.hh:21
Boosted Collider Analysis.
Definition: Analysis.hh:15
Input file infos.
Definition: FileInfo.hh:22
Definition: DelphesClasses.h:50
Tagger base class using Branch template
Definition: Tagger.hh:23
boost::units::quantity< barn::Area > Crosssection
Crosssection measured in barn.
Definition: Barn.hh:36
Prepares multivariant analysis.
Definition: Base.hh:47
std::string Name(Output output)
Definition: Base.cpp:23
The phases of the multivariant tagging process.
Definition: Phase.hh:16
Energy Mass
Mass measured in electronvolt.
Definition: ElectronVolt.hh:62