1 |
#ifndef CUTS_H
|
2 |
#define CUTS_H
|
3 |
#include "../../interface/CutsAndHistos.h"
|
4 |
#include "../../interface/ntupleReader.hpp"
|
5 |
#include <TH1F.h>
|
6 |
#include <sstream>
|
7 |
#include "../../interface/samples.hpp"
|
8 |
#include "TKey.h"
|
9 |
|
10 |
#define CSVM 0.679
|
11 |
#define CSVL 0.244
|
12 |
#define CSVT 0.898
|
13 |
#define fA 0.46502
|
14 |
#define fB 0.53498
|
15 |
|
16 |
|
17 |
bool sampleCut(ntupleReader &p, Sample &sample){
|
18 |
|
19 |
bool sampleCut = false;
|
20 |
bool boost = false;
|
21 |
bool isB = false;
|
22 |
if(p.genZpt >= 120)
|
23 |
boost = true;
|
24 |
if(p.eventFlav == 5)
|
25 |
isB = true;
|
26 |
std::string DY("DY");
|
27 |
std::string DYBOOSTED("DYBOOSTED");
|
28 |
if( sample.name == DY && !boost )
|
29 |
sampleCut = true;
|
30 |
else if( sample.name == DYBOOSTED && boost )
|
31 |
sampleCut = true;
|
32 |
else if( sample.name != DY && sample.name != DYBOOSTED )
|
33 |
sampleCut = true;
|
34 |
else sampleCut=false;
|
35 |
|
36 |
return sampleCut;
|
37 |
}
|
38 |
|
39 |
|
40 |
//I collect the weight and the sample information ONLY here in the SignalPreselection
|
41 |
class PreSelectionZee : public CutSample {
|
42 |
std::string name() {return "PreSelZee";};
|
43 |
Bool_t pass(ntupleReader &p ){ return ( p.Vtype == 1 ); }
|
44 |
Bool_t pass(ntupleReader &p, Sample &sample ){
|
45 |
return ( sampleCut(p, sample) == true
|
46 |
&& p.Vtype == 1
|
47 |
&& p.EVENT_json == true
|
48 |
&& p.hbhe == true
|
49 |
&& ( p.triggerFlags[5] || p.triggerFlags[6] ) ); }
|
50 |
double weight(ntupleReader &p, Sample &sample){
|
51 |
if( sample.data )
|
52 |
return 1;
|
53 |
else
|
54 |
return ((fA*p.PUweight+fB*p.PUweight2011B)*p.weightTrig); }
|
55 |
};
|
56 |
|
57 |
|
58 |
class EmptyCut : public PCut
|
59 |
{
|
60 |
public:
|
61 |
EmptyCut():PCut(){}
|
62 |
bool pass(ntupleReader &p) {
|
63 |
return true;
|
64 |
}
|
65 |
virtual std::string name() {return "NoCut_Gt_"+cutValueString(); }
|
66 |
};
|
67 |
|
68 |
class HPtCut : public PCut
|
69 |
{
|
70 |
public:
|
71 |
HPtCut(double ptMin):PCut(ptMin){}
|
72 |
bool pass(ntupleReader &p) {
|
73 |
return ( p.H_pt > m_cut);
|
74 |
}
|
75 |
virtual std::string name() {return "Higgs_Pt_Gt_"+cutValueString(); }
|
76 |
};
|
77 |
|
78 |
class HMassCut : public PCut
|
79 |
{
|
80 |
public:
|
81 |
HMassCut(double massMin):PCut(massMin){}
|
82 |
bool pass(ntupleReader &p) {
|
83 |
return ( p.H_mass > m_cut );
|
84 |
}
|
85 |
virtual std::string name() {return "Higgs_Mass_Gt_"+cutValueString(); }
|
86 |
};
|
87 |
|
88 |
class HMassCutMax : public PCut
|
89 |
{
|
90 |
public:
|
91 |
HMassCutMax(double maxMass ):PCut(maxMass){}
|
92 |
bool pass(ntupleReader &p) {
|
93 |
return ( !(p.H_mass > m_cut) );
|
94 |
}
|
95 |
virtual std::string name() {return "Higgs_Mass_Gt_"+cutValueString(); }
|
96 |
};
|
97 |
|
98 |
|
99 |
class VPtCut : public PCut
|
100 |
{
|
101 |
public:
|
102 |
VPtCut(double ptMin):PCut(ptMin){}
|
103 |
bool pass(ntupleReader &p) {
|
104 |
return ( p.V_pt > m_cut);
|
105 |
}
|
106 |
virtual std::string name() {return "V_Pt_Gt_"+cutValueString(); }
|
107 |
};
|
108 |
|
109 |
class VMassCutMin : public PCut
|
110 |
{
|
111 |
public:
|
112 |
VMassCutMin(double massMin):PCut(massMin){}
|
113 |
bool pass(ntupleReader &p) {
|
114 |
return ( p.V_mass > m_cut );
|
115 |
}
|
116 |
virtual std::string name() {return "V_Mass_Gt_"+cutValueString(); }
|
117 |
};
|
118 |
|
119 |
class VMassCutMax : public PCut
|
120 |
{
|
121 |
public:
|
122 |
VMassCutMax(double massMax):PCut(massMax){}
|
123 |
bool pass(ntupleReader &p) {
|
124 |
return ( p.V_mass < m_cut );
|
125 |
}
|
126 |
virtual std::string name() {return "V_Mass_Gt_"+cutValueString(); }
|
127 |
};
|
128 |
|
129 |
|
130 |
class JetPtCut : public PCut
|
131 |
{
|
132 |
public:
|
133 |
JetPtCut(double ptMin):PCut(ptMin){}
|
134 |
bool pass(ntupleReader &p) {
|
135 |
return ( p.hJet_pt[0] > m_cut
|
136 |
&& p.hJet_pt[1] > m_cut );
|
137 |
}
|
138 |
virtual std::string name() {return "Jet_Pt_Gt_"+cutValueString(); }
|
139 |
};
|
140 |
|
141 |
class JetBtagCut : public PCut
|
142 |
{
|
143 |
public:
|
144 |
JetBtagCut(double btagMin, double btagMax):PCut(btagMin, btagMax){}
|
145 |
bool pass(ntupleReader &p) {
|
146 |
return ( p.hJet_csv[0] > m_cut
|
147 |
&& p.hJet_csv[1] > m_cut
|
148 |
&& ( p.hJet_csv[0] > M_cut
|
149 |
|| p.hJet_csv[1] > M_cut ) );
|
150 |
}
|
151 |
virtual std::string name() {return "Jet_Btag_Gt_"+cutValueString(); }
|
152 |
};
|
153 |
|
154 |
class HVdPhiCut : public PCut
|
155 |
{
|
156 |
public:
|
157 |
HVdPhiCut(double phiMin):PCut(phiMin){}
|
158 |
bool pass(ntupleReader &p) {
|
159 |
return ( TMath::Abs(p.HVdPhi) > m_cut );
|
160 |
}
|
161 |
virtual std::string name() {return "HV_dPhi_Gt_"+cutValueString(); }
|
162 |
};
|
163 |
|
164 |
class JetVeto : public PCut
|
165 |
{
|
166 |
public:
|
167 |
JetVeto(double nJetsMax):PCut(nJetsMax){}
|
168 |
bool pass(ntupleReader &p) {
|
169 |
return ( p.CountAddJets() < m_cut );
|
170 |
}
|
171 |
virtual std::string name() {return "jetVeto_Gt_"+cutValueString(); }
|
172 |
};
|
173 |
|
174 |
|
175 |
|
176 |
#endif
|