EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EventSelectionModule.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EventSelectionModule.h
1 #ifndef EVENTSELECTIONMODULE_HH
2 #define EVENTSELECTIONMODULE_HH
3 
4 #include "Module.h"
5 #include "classes/DelphesClasses.h"
6 #include <vector>
7 #include <map>
8 #include <utility>
9 #include "TMVA/Factory.h"
10 #include "TMVA/DataLoader.h"
11 #include "TMVA/Reader.h"
12 #include "TMVA/Tools.h"
13 
14 
15 class EventSelectionModule : public Module {
16 public:
17 
18  EventSelectionModule(ExRootTreeReader *data);
19 
21 
22  void initialize() override;
23  bool execute(std::map<std::string, std::any> *DataStore) override;
24  void finalize() override;
25 
26 private:
27 
28  // Branch variables for storage to disk
29  unsigned int _charmjet_n;
30  std::vector<float>_charmjet_pt;
31  std::vector<float>_charmjet_eta;
32 
33 
34  unsigned int _pid_track_n;
35  std::vector<int>_pid_track_true_pid;
36  std::vector<int>_pid_track_reco_pid;
37  std::vector<float>_pid_track_pt;
38  std::vector<float>_pid_track_eta;
39  std::vector<int>_pid_track_jetmother;
40  std::vector<float>_pid_track_jet_eta;
41  std::vector<float>_pid_track_jet_pt;
42 
43  unsigned int _jet_n;
44  std::vector<float>_jet_pt;
45  std::vector<float>_jet_eta;
46  std::vector<int>_jet_flavor;
47  std::vector<int>_jet_nconstituents;
48  std::vector<int>_jet_sip3dtag;
49 
50  // kaon information
51  std::vector<int>_jet_ktag;
52 
53  std::vector<float>_jet_k1_pt;
54  std::vector<float>_jet_k1_sIP3D;
55  std::vector<int>_jet_k1_pid;
56  std::vector<float>_jet_k2_pt;
57  std::vector<float>_jet_k2_sIP3D;
58  std::vector<int>_jet_k2_pid;
59 
60  std::vector<float>_jet_e1_pt;
61  std::vector<float>_jet_e1_sIP3D;
62  std::vector<float>_jet_e2_pt;
63  std::vector<float>_jet_e2_sIP3D;
64 
65  std::vector<float>_jet_mu1_pt;
66  std::vector<float>_jet_mu1_sIP3D;
67  std::vector<float>_jet_mu2_pt;
68  std::vector<float>_jet_mu2_sIP3D;
69 
70  std::vector<float>_jet_t1_sIP3D;
71  std::vector<float>_jet_t2_sIP3D;
72  std::vector<float>_jet_t3_sIP3D;
73  std::vector<float>_jet_t4_sIP3D;
74 
75  std::vector<float>_jet_t1_pt;
76  std::vector<float>_jet_t2_pt;
77  std::vector<float>_jet_t3_pt;
78  std::vector<float>_jet_t4_pt;
79 
80 
81  std::vector<int>_jet_etag;
82  std::vector<int>_jet_mutag;
83  std::vector<float>_jet_charge;
84  std::vector<std::vector<float> >_jet_Ks_mass;
85  std::vector<std::vector<float> >_jet_Ks_p;
86  std::vector<std::vector<float> >_jet_Ks_flightlength;
87  std::vector<float>_jet_Ks_sumpt;
88  std::vector<float>_jet_K_sumpt;
89  std::vector<std::vector<float> >_jet_Ks_zhadron;
90  std::vector<std::vector<float> >_jet_K_zhadron;
91  std::vector<float>_jet_Ks_leading_zhadron;
92  std::vector<float>_jet_K_leading_zhadron;
93  std::vector<float>_jet_ehadoveremratio;
94 
95  std::vector<float>_jet_mlp_ktagger;
96  std::vector<float>_jet_mlp_eltagger;
97  std::vector<float>_jet_mlp_mutagger;
98  std::vector<float>_jet_mlp_ip3dtagger;
99  std::vector<float>_jet_mlp_globaltagger;
100 
101 
102  float _met_et;
103 
104  // DIS variables
105  float _bjorken_x;
106  float _bjorken_Q2;
107  float _bjorken_y;
108  float _jb_x;
109  float _jb_Q2;
110 
111  // Cut flow
112  // std::vector<std::pair<std::string, int>> _cut_flow;
113  std::map<std::string, int>_cut_flow;
114 
115  // Global variables
116  float _mpi;
117  float _mK;
118 
119  // Branch pointers - only initialize once per run
120  TClonesArray *_branch_mRICHTracks;
124 
125  // High-level multivariate tagging
126  TMVA::Reader *_mva_reader_ip3dtagger;
127  TMVA::Reader *_mva_reader_ktagger;
128  TMVA::Reader *_mva_reader_eltagger;
129  TMVA::Reader *_mva_reader_mutagger;
131 
132  std::map<TString, Float_t>_mva_inputs_float;
133  std::map<TString, Int_t>_mva_inputs_int;
134 };
135 
136 #endif // ifndef EVENTSELECTIONMODULE_HH