LCFIPlus  0.6.5
testproc.h
Go to the documentation of this file.
1 // testproc.h
2 
3 #ifndef testproc_h
4 #define testproc_h 1
5 
6 #include "lcfiplus.h"
7 #include "TNtuple.h"
8 #include "TNtupleD.h"
9 #include "TH2D.h"
10 
11 namespace lcfiplus {
12 
13 class ZHHAlgo : public Algorithm {
14  public:
15  struct data {
16  int mchdecaypdg[2];
17  int mchbb;
18  int mcnb;
19 
20  double thrust;
21  double thaxis[3];
22  double ycuts[10];
23  int ntr;
24  int npfo;
25 
26  double mass[15];
27  double ntrjetmin;
28  double pmiss[3];
29  double emiss;
30 
31  double bcat[6];
32  double btag[6];
33  double ctag[6];
34  double ejet[6];
35  double pxjet[6];
36  double pyjet[6];
37  double pzjet[6];
38  double ntrjet[6];
39  double twovtxprobjet[6];
40  double vtxangle[6];
41  double mcnb6[6];
42  double mcnc6[6];
43 
44  double bcat4[4];
45  double btag4[4];
46  double ctag4[4];
47  double ejet4[4];
48  double pxjet4[4];
49  double pyjet4[4];
50  double pzjet4[4];
51  double ntrjet4[4];
52  double twovtxprobjet4[4];
53  double vtxangle4[4];
54 
55  double bcat5[5];
56  double btag5[5];
57  double ctag5[5];
58  double ejet5[5];
59  double pxjet5[5];
60  double pyjet5[5];
61  double pzjet5[5];
62  double ntrjet5[5];
63  double twovtxprobjet5[5];
64  double vtxangle5[5];
65 
66  double bcat7[7];
67  double btag7[7];
68  double ctag7[7];
69  double ejet7[7];
70  double pxjet7[7];
71  double pyjet7[7];
72  double pzjet7[7];
73  double ntrjet7[7];
74  double twovtxprobjet7[7];
75  double vtxangle7[7];
76 
77  double bcat8[8];
78  double btag8[8];
79  double ctag8[8];
80  double ejet8[8];
81  double pxjet8[8];
82  double pyjet8[8];
83  double pzjet8[8];
84  double ntrjet8[8];
85  double twovtxprobjet8[8];
86  double vtxangle8[8];
87 
88  double bcatnv4[4];
89  double btagnv4[4];
90  double ctagnv4[4];
91  double ejetnv4[4];
92  double pxjetnv4[4];
93  double pyjetnv4[4];
94  double pzjetnv4[4];
95  double ntrjetnv4[4];
96  double twovtxprobjetnv4[4];
97  double vtxanglenv4[4];
98 
99  double bcatnv5[5];
100  double btagnv5[5];
101  double ctagnv5[5];
102  double ejetnv5[5];
103  double pxjetnv5[5];
104  double pyjetnv5[5];
105  double pzjetnv5[5];
106  double ntrjetnv5[5];
107  double twovtxprobjetnv5[5];
108  double vtxanglenv5[5];
109 
110  double bcatnv6[6];
111  double btagnv6[6];
112  double ctagnv6[6];
113  double ejetnv6[6];
114  double pxjetnv6[6];
115  double pyjetnv6[6];
116  double pzjetnv6[6];
117  double ntrjetnv6[6];
118  double twovtxprobjetnv6[6];
119  double vtxanglenv6[6];
120 
121  double bcatnv7[7];
122  double btagnv7[7];
123  double ctagnv7[7];
124  double ejetnv7[7];
125  double pxjetnv7[7];
126  double pyjetnv7[7];
127  double pzjetnv7[7];
128  double ntrjetnv7[7];
129  double twovtxprobjetnv7[7];
130  double vtxanglenv7[7];
131 
132  double bcatnv8[8];
133  double btagnv8[8];
134  double ctagnv8[8];
135  double ejetnv8[8];
136  double pxjetnv8[8];
137  double pyjetnv8[8];
138  double pzjetnv8[8];
139  double ntrjetnv8[8];
140  double twovtxprobjetnv8[8];
141  double vtxanglenv8[8];
142 
143  };
144 
145  ZHHAlgo() {}
146  virtual ~ZHHAlgo() {}
147 
148  static bool sortBtag(const Jet* j1, const Jet* j2) {
149  double btag1 = j1->getParam("lcfiplus")->get<double>("BTag");
150  double btag2 = j2->getParam("lcfiplus")->get<double>("BTag");
151 
152  return btag1 > btag2;
153  }
154 
155  void init(Parameters* param);
156  void process();
157  void end();
158 
159  ClassDef(ZHHAlgo,1);
160 
161  private:
162  TFile* _file;
163 
164  string _jetname;
165  string _jetname4;
166  string _jetname5;
167  string _jetname7;
168  string _jetname8;
169 
170  string _jetnamenv4;
171  string _jetnamenv5;
172  string _jetnamenv6;
173  string _jetnamenv7;
174  string _jetnamenv8;
175 
176  JetVec* _jets;
177  JetVec* _jets4;
178  JetVec* _jets5;
179  JetVec* _jets7;
180  JetVec* _jets8;
181 
182  JetVec* _jetsnv4;
183  JetVec* _jetsnv5;
184  JetVec* _jetsnv6;
185  JetVec* _jetsnv7;
186  JetVec* _jetsnv8;
187 
188  TTree* _tree;
189 
190  data _d;
191 
192 };
193 
194 class TestAlgo : public Algorithm {
195  public:
196  TestAlgo() {}
197  virtual ~TestAlgo() {}
198 
199  void init(Parameters* param);
200  void process();
201  void end();
202 
203  ClassDef(TestAlgo,1);
204 
205  private:
206  TNtupleD* _nt;
207  int _nev;
208 
209  TNtuple* _ntJet2;
210  TNtuple* _nbJet;
211  TFile* _file;
212 
213  string _v0vtxname;
214  string _privtxname;
215  string _jetname;
216  bool _bbhh;
217 
218  VertexVec* _vertices;
219  VertexVec* _v0vertices;
220  JetVec* _jets;
221 
222  // for old version
223 
224  string _vtxname;
225  int _vtxsel;
226  int _refine;
227  TNtupleD* _ntJet;
228 
229  TH2D* _h;
230  TH2D* _he;
231 
232 };
233 
234 class VertexAnalysis : public Algorithm {
235  public:
237  virtual ~VertexAnalysis() {}
238 
239  void init(Parameters* param);
240  void process();
241  void end();
242 
244 
245  private:
246  TNtupleD* _nt;
247  int _nev;
248 
249  TFile* _file;
250 
251  string _privtxname;
252  string _secvtxname;
253 };
254 
255 class FlavtagReader : public Algorithm {
256  public:
258  virtual ~FlavtagReader() {}
259 
260  void init(Parameters* param);
261  void process();
262  void end();
263 
265 
266  private:
267  TNtupleD* _nt;
268  TNtupleD* _ntev;
269  int _nev;
270 
271  TNtuple* _ntJet2;
272  TNtuple* _nbJet;
273  TFile* _file;
274 
275  string _v0vtxname;
276  string _privtxname;
277  string _jetname;
278  bool _bbhh;
279 
280  VertexVec* _vertices;
281  VertexVec* _v0vertices;
282  JetVec* _jets;
283 
284  // for old version
285 
286  string _vtxname;
287  int _vtxsel;
288  int _refine;
289  TNtupleD* _ntJet;
290 
291  TH2D* _h;
292  TH2D* _he;
293 
294 };
295 
296 class TestAlgoV0 : public Algorithm {
297  public:
299  virtual ~TestAlgoV0() {}
300  void init(Parameters* param);
301  void process();
302  void end();
303  ClassDef(TestAlgoV0,1);
304  private:
305  TTree* _ntp;
306  TFile* _file;
307  VertexVec* _vertices;
308  string _vtxname;
309 
310  struct VtxData {
311  double x;
312  double y;
313  double z;
314  double r;
315  double cs;
316  double phi;
317  double chrg;
318  double dirdot;
319  double dirdot2;
320  int ntrk;
321  double mks;
322  double ml0;
323  double mconv;
324  double mks2;
325  double ml02;
326  int v0;
327  int ks;
328  int l0;
329  int conv;
330  int mcpdg1;
331  int mcpdg2;
332  int mcppdg1;
333  int mcppdg2;
334  int mcpp1;
335  int mcpp2;
336  };
337  VtxData _data;
338 };
339 
340 }
341 
342 #endif
double vtxangle[6]
Definition: testproc.h:40
double twovtxprobjetnv7[7]
Definition: testproc.h:129
double mcnb6[6]
Definition: testproc.h:41
double pyjet8[8]
Definition: testproc.h:82
static bool sortBtag(const Jet *j1, const Jet *j2)
Definition: testproc.h:148
void end()
Definition: testproc.cc:1474
double ntrjet7[7]
Definition: testproc.h:73
double pmiss[3]
Definition: testproc.h:28
double pzjet8[8]
Definition: testproc.h:83
double pzjet[6]
Definition: testproc.h:37
double pxjet4[4]
Definition: testproc.h:48
Definition: testproc.h:255
void init(Parameters *param)
Definition: testproc.cc:252
double pyjetnv6[6]
Definition: testproc.h:115
double ycuts[10]
Definition: testproc.h:22
T get(const char *key, T def=T()) const
Definition: lcfiplus.h:217
double ctag8[8]
Definition: testproc.h:79
double vtxanglenv6[6]
Definition: testproc.h:119
double pzjet7[7]
Definition: testproc.h:72
double ejet5[5]
Definition: testproc.h:58
double pzjetnv5[5]
Definition: testproc.h:105
double ntrjetmin
Definition: testproc.h:27
double twovtxprobjet4[4]
Definition: testproc.h:52
double bcatnv6[6]
Definition: testproc.h:110
ClassDef(TestAlgoV0, 1)
double bcat4[4]
Definition: testproc.h:44
double ejetnv6[6]
Definition: testproc.h:113
void end()
Definition: testproc.cc:907
double btag7[7]
Definition: testproc.h:67
double thaxis[3]
Definition: testproc.h:21
double pzjetnv4[4]
Definition: testproc.h:94
double btag[6]
Definition: testproc.h:32
void end()
Definition: testproc.cc:247
double pyjet[6]
Definition: testproc.h:36
void init(Parameters *param)
Definition: testproc.cc:1414
double ejetnv8[8]
Definition: testproc.h:135
double ntrjet[6]
Definition: testproc.h:38
TestAlgoV0()
Definition: testproc.h:298
ClassDef(TestAlgo, 1)
double pxjetnv4[4]
Definition: testproc.h:92
double bcatnv8[8]
Definition: testproc.h:132
int ntr
Definition: testproc.h:23
double btag4[4]
Definition: testproc.h:45
double ctag4[4]
Definition: testproc.h:46
Definition: testproc.h:296
double ntrjetnv5[5]
Definition: testproc.h:106
double thrust
Definition: testproc.h:20
double ntrjet5[5]
Definition: testproc.h:62
double ntrjet4[4]
Definition: testproc.h:51
double pzjetnv6[6]
Definition: testproc.h:116
double pxjetnv6[6]
Definition: testproc.h:114
Definition: lcfiplus.h:269
double ctag[6]
Definition: testproc.h:33
double ntrjet8[8]
Definition: testproc.h:84
double ctagnv7[7]
Definition: testproc.h:123
double ctagnv8[8]
Definition: testproc.h:134
TestAlgo()
Definition: testproc.h:196
double bcatnv5[5]
Definition: testproc.h:99
double ntrjetnv8[8]
Definition: testproc.h:139
int npfo
Definition: testproc.h:24
Definition: lcfiplus.h:152
double ejet8[8]
Definition: testproc.h:80
Definition: testproc.h:194
double ejetnv4[4]
Definition: testproc.h:91
int mchbb
Definition: testproc.h:17
double twovtxprobjet8[8]
Definition: testproc.h:85
double vtxangle7[7]
Definition: testproc.h:75
double twovtxprobjetnv8[8]
Definition: testproc.h:140
Definition: testproc.h:15
double btagnv8[8]
Definition: testproc.h:133
double pzjet4[4]
Definition: testproc.h:50
double mass[15]
Definition: testproc.h:26
double bcat5[5]
Definition: testproc.h:55
double ejetnv5[5]
Definition: testproc.h:102
Definition: testproc.h:234
double pxjet7[7]
Definition: testproc.h:70
void init(Parameters *param)
Definition: testproc.cc:103
double pxjetnv8[8]
Definition: testproc.h:136
double ctag7[7]
Definition: testproc.h:68
int mchdecaypdg[2]
Definition: testproc.h:16
double vtxangle8[8]
Definition: testproc.h:86
int mcnb
Definition: testproc.h:18
FlavtagReader()
Definition: testproc.h:257
virtual ~TestAlgo()
Definition: testproc.h:197
double pyjet5[5]
Definition: testproc.h:60
double btagnv7[7]
Definition: testproc.h:122
double vtxanglenv7[7]
Definition: testproc.h:130
void end()
Definition: testproc.cc:988
double pxjet8[8]
Definition: testproc.h:81
double ntrjetnv7[7]
Definition: testproc.h:128
double pyjetnv8[8]
Definition: testproc.h:137
double bcat[6]
Definition: testproc.h:31
double pxjetnv5[5]
Definition: testproc.h:103
double bcat7[7]
Definition: testproc.h:66
virtual ~VertexAnalysis()
Definition: testproc.h:237
Definition: testproc.h:13
void init(Parameters *param)
Definition: testproc.cc:912
double pxjet5[5]
Definition: testproc.h:59
double bcatnv7[7]
Definition: testproc.h:121
double btagnv4[4]
Definition: testproc.h:89
double btagnv6[6]
Definition: testproc.h:111
const Parameters * getParam(const char *paramname) const
Definition: lcfiplus.h:1056
Definition: lcfiplus.h:980
double ejet7[7]
Definition: testproc.h:69
const vector< const Jet * > JetVec
Definition: lcfiplus.h:80
double pxjetnv7[7]
Definition: testproc.h:125
double pyjet4[4]
Definition: testproc.h:49
double pyjetnv5[5]
Definition: testproc.h:104
double emiss
Definition: testproc.h:29
virtual ~FlavtagReader()
Definition: testproc.h:258
VertexAnalysis()
Definition: testproc.h:236
double bcat8[8]
Definition: testproc.h:77
virtual ~ZHHAlgo()
Definition: testproc.h:146
double vtxanglenv5[5]
Definition: testproc.h:108
double ctagnv5[5]
Definition: testproc.h:101
double pyjetnv4[4]
Definition: testproc.h:93
ClassDef(FlavtagReader, 1)
double pyjetnv7[7]
Definition: testproc.h:126
double pzjet5[5]
Definition: testproc.h:61
double btagnv5[5]
Definition: testproc.h:100
ClassDef(ZHHAlgo, 1)
double bcatnv4[4]
Definition: testproc.h:88
void end()
Definition: testproc.cc:1037
double btag5[5]
Definition: testproc.h:56
double btag8[8]
Definition: testproc.h:78
double vtxanglenv4[4]
Definition: testproc.h:97
void init(Parameters *param)
Definition: testproc.cc:993
double pzjetnv8[8]
Definition: testproc.h:138
double ejetnv7[7]
Definition: testproc.h:124
double pzjetnv7[7]
Definition: testproc.h:127
double ntrjetnv6[6]
Definition: testproc.h:117
double vtxangle5[5]
Definition: testproc.h:64
double ctagnv4[4]
Definition: testproc.h:90
double twovtxprobjet[6]
Definition: testproc.h:39
double ctagnv6[6]
Definition: testproc.h:112
double vtxanglenv8[8]
Definition: testproc.h:141
double twovtxprobjetnv5[5]
Definition: testproc.h:107
double ejet4[4]
Definition: testproc.h:47
ClassDef(VertexAnalysis, 1)
double pyjet7[7]
Definition: testproc.h:71
void process()
Definition: testproc.cc:930
double pxjet[6]
Definition: testproc.h:35
void process()
Definition: testproc.cc:1424
void process()
Definition: testproc.cc:139
void process()
Definition: testproc.cc:420
double twovtxprobjetnv4[4]
Definition: testproc.h:96
double twovtxprobjet7[7]
Definition: testproc.h:74
void process()
Definition: testproc.cc:1009
double ntrjetnv4[4]
Definition: testproc.h:95
double ejet[6]
Definition: testproc.h:34
double mcnc6[6]
Definition: testproc.h:42
double twovtxprobjet5[5]
Definition: testproc.h:63
virtual ~TestAlgoV0()
Definition: testproc.h:299
const vector< const Vertex * > VertexVec
Definition: lcfiplus.h:79
double twovtxprobjetnv6[6]
Definition: testproc.h:118
double ctag5[5]
Definition: testproc.h:57
double vtxangle4[4]
Definition: testproc.h:53
ZHHAlgo()
Definition: testproc.h:145