-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyAna.h
71 lines (59 loc) · 2 KB
/
MyAna.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef MYANA_h
#define MYANA_h
#include <TROOT.h>
#include <TChain.h>
#include <TFile.h>
#include <cmath>
#include <iostream>
#include <sstream>
#include <set>
#include "AnglesUtil.h"
#include "RootTupleDefs.h"
#include "TLorentzVector.h"
class MyAna : public RootTupleDefs {
public :
MyAna(TTree *_muonstree,TTree *_electronstree, TTree *_jetstree, TTree *_METtree, TTree *_verticestree, TTree *_eventstree, TTree *_HLTtree, TTree *_muonsloosetree, TTree *_electronsloosetree, TTree *_PFparttree, TTree *_MCtree);
~MyAna();
void Loop();
void SetDebugMode(bool debug) { _debug = debug; }
void SetMCmode(bool isMC) { _isMC = isMC; }
void SetTTbarmode(bool isTTbar) { _isTTbar = isTTbar; }
void SetSIGmode(bool isSIG) { _isSIG = isSIG; }
void SetRootName(const std::string& rootName) { _rootName = rootName; }
void SetDoSkim(bool doSkim) { _doSkim = doSkim; }
void SetNevent(int nevent) { _nevt = nevent; }
TLorentzVector* GetP4(TClonesArray* _TClonesArray, int _i) {
return (TLorentzVector*) (*_TClonesArray)[_i];
}
double Pt(double _Px,double _Py) {
return std::sqrt(_Px*_Px+_Py*_Py);
}
double Eta(double _Px,double _Py,double _Pz) {
if (_Pz <0) return (-1)*std::acosh(std::sqrt(_Px*_Px+_Py*_Py+_Pz*_Pz)/(std::sqrt(_Px*_Px+_Py*_Py)));
else return std::acosh(std::sqrt(_Px*_Px+_Py*_Py+_Pz*_Pz)/(std::sqrt(_Px*_Px+_Py*_Py)));
}
double Phi(double _Px,double _Py) {
return kinem::phi(_Py,_Px);
}
private:
TFile* _newfile;
TTree* _newmuonstree;
TTree* _newelectronstree;
TTree* _newjetstree;
TTree* _newMETtree ;
TTree* _newverticestree;
TTree* _neweventstree;
TTree* _newHLTtree;
TTree* _newelectronsloosetree;
TTree* _newmuonsloosetree;
TTree* _newPFparttree;
TTree* _newMCtree;
bool _debug;
bool _isMC;
bool _isTTbar;
bool _isSIG;
std::string _rootName;
bool _doSkim;
int _nevt;
};
#endif