TTTT Analysis  0.1
selection.hpp
Go to the documentation of this file.
1 
34 #ifndef SELECTION_HPP
35 #define SELECTION_HPP
36 
37 #include <iostream>
38 #include <vector>
39 #include <utility>
40 #include <numeric>
41 #include <limits>
42 
43 #include "filval/filval.hpp"
44 #include "filval_root/filval_root.hpp"
45 
46 #include <TSystem.h>
47 
48 #define JET_REQUIREMENT 6
49 #define B_JET_REQUIREMENT 3
50 #define B_JET_WP 0. // lower bound on CMVA value
51 using namespace fv;
52 struct Selection {
53 public:
54 
55  static ObsFilter* trilepton_filter;
56 
57  static ObsFilter* jet_multiplicity_filter;
58  static ObsFilter* b_jet_multiplicity_filter;
59 
60  static void init(){
61  auto nLep = lookup<int>("nLepGood");
62  trilepton_filter = obs_filter("trilepton_filter",GenFunction::register_function<bool()>("trilepton_filter",
63  FUNC(([nLep=nLep](){
64  return nLep->get_value() == 3;
65  }))));
66 
67 
68  auto nJet = lookup<int>("nJet");
69  jet_multiplicity_filter = obs_filter("jet_multiplicity_filter",GenFunction::register_function<bool()>("jet_multiplicity_filter",
70  FUNC(([nJet=nJet](){
71  return nJet->get_value() >= JET_REQUIREMENT;
72  }))));
73 
74  auto bJet_MVA = lookup<std::vector<float>>("Jet_btagCMVA");
75  b_jet_multiplicity_filter = obs_filter("b_jet_multiplicity_filter",GenFunction::register_function<bool()>("b_jet_multiplicity_filter",
76  FUNC(([bJet_MVA=bJet_MVA](){
77  int n_b_jet = 0;
78  for(auto j : bJet_MVA->get_value()){
79  if(j > B_JET_WP){
80  n_b_jet++;
81  }
82  }
83  return n_b_jet >= B_JET_REQUIREMENT;
84  }))));
85  }
86 };
87 #endif // SELECTION_HPP
The namespace containing all filval classes and functions.
Definition: api.hpp:46