1 |
tboccali |
1.1 |
#ifndef VHBBCANDIDATETOOLS_H
|
2 |
|
|
#define VHBBCANDIDATETOOLS_H
|
3 |
|
|
|
4 |
|
|
#include "VHbbAnalysis/HbbAnalyzer/interface/VHbbCandidate.h"
|
5 |
|
|
|
6 |
|
|
class VbbCandidateTools {
|
7 |
|
|
public:
|
8 |
|
|
float deltaPhi(float in2, float in1){
|
9 |
|
|
float dphi = in2-i1;
|
10 |
|
|
if ( dphi > M_PI ) {
|
11 |
|
|
dphi -= 2.0*M_PI;
|
12 |
|
|
} else if ( dphi <= -M_PI ) {
|
13 |
|
|
dphi += 2.0*M_PI;
|
14 |
|
|
}
|
15 |
|
|
return dphi;
|
16 |
|
|
}
|
17 |
|
|
|
18 |
|
|
VHbbCandidate getHZmumuCandidate(const VHbbCandidate & in, bool & ok){
|
19 |
|
|
ok = false;
|
20 |
|
|
VHbbCandidate temp=in;
|
21 |
|
|
if (temp.V.muons.size()!=2) return in ;
|
22 |
|
|
temp.V.fourMomentum = temp.V.muons.muons[0].fourMomentum+temp.V.muons.muons[1].fourMomentum;
|
23 |
|
|
temp.fourMomentum = temp.V.fourMomentum+ temp.H.fourMomentum;
|
24 |
|
|
|
25 |
tboccali |
1.2 |
if (temp.V.muons.muons[0].fourMomentum.Pt()<20 || temp.V.muons.muons[1].fourMomentum.Pt()<20 ) return in;
|
26 |
|
|
|
27 |
tboccali |
1.1 |
if (temp.V.Pt()<150 ) return in;
|
28 |
|
|
if (temp.H.Pt()<150) return in;
|
29 |
|
|
if (temp.H.firstJet().csv< 0.9) return in;
|
30 |
|
|
if (temp.H.secondJet().csv<0.5) return in;
|
31 |
|
|
if (deltaPhi(temp.V.Phi(),temp.H.Phi())<2.7) return in;
|
32 |
|
|
if (temp.V.FourMomentum.Mass()<75 || temp.V.FourMomentum.Mass()>105) return in;
|
33 |
|
|
if (temp.additionalJets.size()>0) return in;
|
34 |
|
|
// if (std::Abs(deltaTheta) ????
|
35 |
|
|
ok = true;
|
36 |
|
|
return temp;
|
37 |
|
|
}
|
38 |
|
|
VHbbCandidate getHZeeCandidate(const VHbbCandidate & in, bool & ok){
|
39 |
|
|
ok = false;
|
40 |
|
|
VHbbCandidate temp=in;
|
41 |
|
|
if (temp.V.electrons.size()!=2) return in ;
|
42 |
|
|
temp.V.fourMomentum = temp.V.electrons[0].fourMomentum+temp.V.electrons[1].fourMomentum;
|
43 |
|
|
temp.fourMomentum = temp.V.fourMomentum+ temp.H.fourMomentum;
|
44 |
|
|
|
45 |
|
|
//
|
46 |
|
|
// i need to ask VBTF and pt NEEDS ADJUSTING!!!!!
|
47 |
|
|
//
|
48 |
|
|
if (temp.V.electrons[0].fourMomentum.Pt()<20 ||temp.V.electrons[1].fourMomentum.Pt()<20 ) return in;
|
49 |
|
|
if (temp.V.electrons[0].id95r < -100000 ||temp.V.electrons[1].id95r < -100000) return in;
|
50 |
|
|
|
51 |
|
|
if (temp.V.Pt()<150 ) return in;
|
52 |
|
|
if (temp.H.Pt()<150) return in;
|
53 |
|
|
if (temp.H.firstJet().csv< 0.9) return in;
|
54 |
|
|
if (temp.H.secondJet().csv<0.5) return in;
|
55 |
|
|
if (deltaPhi(temp.V.Phi(),temp.H.Phi())<2.7) return in;
|
56 |
|
|
if (temp.V.FourMomentum.Mass()<75 || temp.V.FourMomentum.Mass()>105) return in;
|
57 |
|
|
if (temp.additionalJets.size()>0) return in;
|
58 |
|
|
// if (std::Abs(deltaTheta) ????
|
59 |
|
|
ok = true;
|
60 |
|
|
return temp;
|
61 |
|
|
}
|
62 |
|
|
VHbbCandidate getHZnnCandidate(const VHbbCandidate & in, bool & ok){
|
63 |
|
|
ok = false;
|
64 |
|
|
VHbbCandidate temp=in;
|
65 |
|
|
if (temp.V.mets.size()!=1) return in;
|
66 |
|
|
temp.V.fourMomentum = temp.V.mets[0].fourMomentum;
|
67 |
|
|
temp.fourMomentum = temp.V.fourMomentum+temp.H.fourMomentum;
|
68 |
|
|
|
69 |
|
|
if (temp.V.mets[0].metSig<5) return in;
|
70 |
|
|
if (temp.V.mets[0].sumEt<150) return in;
|
71 |
|
|
if (temp.H.fourMomentum.Pt()<150)return in;
|
72 |
|
|
if (temp.H.firstJet().csv< 0.9) return in;
|
73 |
|
|
if (temp.H.secondJet().csv<0.5) return in;
|
74 |
|
|
if (deltaPhi(temp.V.Phi(),temp.H.Phi())<2.95) return in;
|
75 |
|
|
if (temp.V.electrons.size()>0 || temp.V.muons.size()>0 ) return in;
|
76 |
|
|
if (temp.additionalJets.size()>0) return in;
|
77 |
|
|
// if (std::Abs(deltaTheta) ????
|
78 |
|
|
|
79 |
|
|
ok = true;
|
80 |
|
|
return temp;
|
81 |
|
|
}
|
82 |
|
|
|
83 |
|
|
VHbbCandidate getHWmunCandidate(const VHbbCandidate & in, bool & ok){
|
84 |
|
|
ok = false;
|
85 |
|
|
VHbbCandidate temp=in;
|
86 |
|
|
if (temp.V.muons.size()!=1) return in ;
|
87 |
|
|
//
|
88 |
|
|
// not clear to me, where is MET? it is not used????
|
89 |
|
|
//
|
90 |
|
|
return in;
|
91 |
|
|
}
|
92 |
|
|
|
93 |
|
|
VHbbCandidate getHWenCandidate(const VHbbCandidate & in, bool & ok){
|
94 |
|
|
ok = false;
|
95 |
|
|
VHbbCandidate temp=in;
|
96 |
|
|
if (temp.V.electrons.size()!=1) return in ;
|
97 |
|
|
//
|
98 |
|
|
// not clear to me, where is MET? it is not used????
|
99 |
|
|
//
|
100 |
|
|
return in;
|
101 |
|
|
}
|
102 |
|
|
|
103 |
|
|
};
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
#endif
|
108 |
|
|
|
109 |
|
|
|