Branch.hh
Go to the documentation of this file.
1 
4 #pragma once
5 // include the Units header
6 #include "boca/units/Units.hh"
7 // include Branch base
8 #include "boca/branch/Bdt.hh"
9 // include Observables
11 
12 namespace simple
13 {
14 
15 // use the namespace for units
16 using namespace boca::units;
17 
18 // define the branch for saving the root file
19 // inherits from the BDT branch base class
20 class Branch : public boca::branch::Bdt
21 {
22 
23 public:
24 
25  // Constructor
26  Branch();
27 
28  // All observables must be saved as floats
29  float jet_number;
31  float missing_et;
32  float scalar_ht;
33  float jet_1_pt;
34  float jet_2_pt;
35  float jet_3_pt;
36  float jet_4_pt;
37 
38  // define how the branches are going to be filled from the Observables
39  template<typename Multiplet_>
40  void Fill(Multiplet_ const &multiplet)
41  {
42  // store the BDT value in the BDT member
43  boca::branch::Bdt::Fill(multiplet);
44  // store the other multiplet in their fields
45  jet_number = multiplet.JetNumber();
46  bottom_number = multiplet.BottomNumber();
47  // note that the Branch only takes plain numbers
48  missing_et = multiplet.MissingEt() / GeV;
49  scalar_ht = multiplet.ScalarHt() / GeV;
50  jet_1_pt = multiplet.JetPt(0) / GeV;
51  jet_2_pt = multiplet.JetPt(1) / GeV;
52  jet_3_pt = multiplet.JetPt(2) / GeV;
53  jet_4_pt = multiplet.JetPt(3) / GeV;
54  }
55 
56  // return the Variables for TMVA
57  boca::Observables Variables() override;
58 
59 private:
60  ClassDef(Branch, 1)
61 };
62 
63 }
float jet_3_pt
Definition: Branch.hh:35
Definition: Branch.hh:20
float missing_et
Definition: Branch.hh:31
float jet_2_pt
Definition: Branch.hh:34
void Fill(Multiplet_ const &multiplet)
Definition: Branch.hh:40
float bottom_number
Definition: Branch.hh:30
float jet_1_pt
Definition: Branch.hh:33
Example.
Definition: Analysis.hh:11
void Fill(Multiplet_ const &multiplet)
Definition: Bdt.hh:28
float jet_4_pt
Definition: Branch.hh:36
Units.
Definition: Barn.hh:14
Branch
Definition: TreeReader.hh:18
float scalar_ht
Definition: Branch.hh:32
float jet_number
Definition: Branch.hh:29
Container for Observable.
Definition: Observables.hh:17
Bdt base tree branch
Definition: Bdt.hh:18