7 |
|
#include "TLorentzVector.h" |
8 |
|
#include "ntupleLoader.hpp" |
9 |
|
|
10 |
+ |
|
11 |
|
class ntupleReader : public ntupleLoader { |
12 |
|
public : |
13 |
|
|
35 |
|
virtual double hJet_CSV( int idx, int sign ); //higgs jet energy correction |
36 |
|
virtual double hJet_pt_jec( int idx, double sign ); //higgs jet energy correction |
37 |
|
virtual double aJet_pt_jec( int idx, double sign ); //addtional jet energy correction |
38 |
+ |
virtual double hJet_e_jec( int idx, double sign ); |
39 |
+ |
virtual double aJet_e_jec( int idx, double sign ); |
40 |
|
virtual TLorentzVector H_jec( double sign ); //higgs candidate jet energy correction |
41 |
|
virtual double hJet_csv_cUP( int idx ); |
42 |
|
virtual double hJet_csv_cDOWN( int idx ); |
128 |
|
return (hJet_jer( idx, sign - GetSign(sign)*1 )).Pt() ; |
129 |
|
} |
130 |
|
double ntupleReader::aJet_PT( int idx, int sign ){ return aJet_pt[idx]*(1 + (sign)*aJet_JECUnc[idx]); } |
131 |
< |
double ntupleReader::hJet_E( int idx, int sign ){ return hJet_e[idx] * hJet_pt[idx]/hJet_PT(idx, sign); } |
132 |
< |
double ntupleReader::aJet_E( int idx, int sign ){ return aJet_e[idx] * aJet_pt[idx]/aJet_PT(idx, sign); } |
131 |
> |
double ntupleReader::hJet_E( int idx, int sign ){ return hJet_e[idx] * hJet_PT(idx, sign)/hJet_pt[idx]; } |
132 |
> |
double ntupleReader::aJet_E( int idx, int sign ){ return aJet_e[idx] * aJet_PT(idx, sign)/aJet_pt[idx]; } |
133 |
|
TLorentzVector ntupleReader::Higgs( int sign ){ |
134 |
|
TLorentzVector j1,j2,H; |
135 |
< |
if( TMath::Abs(sign) < 2 ){ |
136 |
< |
j1.SetPtEtaPhiE( hJet_pt_jec(0,sign), hJet_eta[0], hJet_phi[0], hJet_e[0] ); |
137 |
< |
j2.SetPtEtaPhiE( hJet_pt_jec(1,sign), hJet_eta[1], hJet_phi[1], hJet_e[1] ); |
135 |
< |
return H=j1+j2; |
136 |
< |
} |
137 |
< |
else // +- are for jet energy corrections |
138 |
< |
return H_jer( sign - GetSign(sign)*1 ); |
135 |
> |
j1.SetPtEtaPhiE( hJet_PT(0,sign), hJet_eta[0], hJet_phi[0], hJet_E(0,sign) ); |
136 |
> |
j2.SetPtEtaPhiE( hJet_PT(1,sign), hJet_eta[1], hJet_phi[1], hJet_E(1,sign) ); |
137 |
> |
return H=j1+j2; |
138 |
|
} |
139 |
|
double ntupleReader::hJet_CSV( int idx, int sign ){ |
140 |
< |
if(sign == 1) return (hJet_csvUp[idx]); |
141 |
< |
else if(sign == -1) return (hJet_csvDown[idx]); |
142 |
< |
else if( sign == 2 ) return (hJet_csvFUp[idx]); |
143 |
< |
else if( sign == -2 ) return (hJet_csvFDown[idx]) ; |
144 |
< |
else return (hJet_csv[idx]); |
140 |
> |
//this is not reshaped |
141 |
> |
//else return (hJet_csv[idx]); |
142 |
> |
//this is reshaped using my framework |
143 |
> |
// else return (sh.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csv[idx], hJet_flavour[idx] )); |
144 |
> |
//using Niklas framework the csv not reshaped is called csvOld |
145 |
> |
if( hJet_flavour[0] < 1 ) // stupid check if it is data. In niklas framework there is no csvOld for data. reshaping knows about data for flavour 0 |
146 |
> |
return (reshape.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csv[idx], hJet_flavour[idx] )); |
147 |
> |
else{ //MC |
148 |
> |
if(sign == 1) return (reshape_bTagUp.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csvOld[idx], hJet_flavour[idx] )); |
149 |
> |
else if(sign == -1) return (reshape_bTagDown.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csvOld[idx], hJet_flavour[idx] )); |
150 |
> |
else if( sign == 2 ) return (reshape_misTagUp.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csvOld[idx], hJet_flavour[idx] )); |
151 |
> |
else if( sign == -2 ) return (reshape_misTagDown.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csvOld[idx], hJet_flavour[idx] )); |
152 |
> |
else return (reshape.reshape( hJet_eta[idx], hJet_pt[idx], hJet_csvOld[idx], hJet_flavour[idx] )); |
153 |
> |
} |
154 |
|
} |
155 |
|
|
156 |
|
|
157 |
|
//for jet energy correction variation |
158 |
|
double ntupleReader::hJet_pt_jec( int idx, double sign ){ return hJet_pt[idx]*(1 + (sign)*hJet_JECUnc[idx]); } |
159 |
|
double ntupleReader::aJet_pt_jec( int idx, double sign ){ return aJet_pt[idx]*(1 + (sign)*aJet_JECUnc[idx]); } |
160 |
+ |
|
161 |
+ |
double ntupleReader::hJet_e_jec( int idx, double sign ){ return hJet_e[idx]*(1 + (sign)*hJet_JECUnc[idx]); } |
162 |
+ |
double ntupleReader::aJet_e_jec( int idx, double sign ){ return aJet_e[idx]*(1 + (sign)*aJet_JECUnc[idx]); } |
163 |
+ |
|
164 |
|
TLorentzVector ntupleReader::H_jec( double sign ){ |
165 |
|
TLorentzVector j1,j2,H; |
166 |
< |
j1.SetPtEtaPhiE( hJet_pt_jec(0,sign), hJet_eta[0], hJet_phi[0], hJet_e[0] ); |
167 |
< |
j2.SetPtEtaPhiE( hJet_pt_jec(1,sign), hJet_eta[1], hJet_phi[1], hJet_e[1] ); |
166 |
> |
j1.SetPtEtaPhiE( hJet_pt_jec(0,sign), hJet_eta[0], hJet_phi[0], hJet_e_jec(0,sign) ); |
167 |
> |
j2.SetPtEtaPhiE( hJet_pt_jec(1,sign), hJet_eta[1], hJet_phi[1], hJet_e_jec(1,sign) ); |
168 |
|
return H=j1+j2; |
169 |
|
} |
170 |
|
double ntupleReader::hJet_csv_cUP( int idx ){ return ( hJet_csvUp[idx] ); } |