38 |
|
TVector3 n1(H1); |
39 |
|
TVector3 n2(H2); |
40 |
|
|
41 |
< |
float det= n1.Px() * n2.Py() - n2.Px() * n1.Py(); |
41 |
> |
double det= n1.Px() * n2.Py() - n2.Px() * n1.Py(); |
42 |
|
|
43 |
|
H1.SetMag( ( - n2.Py() * V.Px() + n2.Px() * V.Py() ) / (sin(n1.Theta()) *det ) ); |
44 |
|
H2.SetMag( ( + n1.Py() * V.Px() - n1.Px() * V.Py() ) / (sin(n2.Theta()) *det ) ); |
45 |
|
|
46 |
< |
float mass=TMath::Sqrt( TMath::Power( (H1.Mag()+H2.Mag()),2 ) - TMath::Power(( ( H1+H2 ).Mag()),2) ); |
46 |
> |
double mass=TMath::Sqrt( TMath::Power( (H1.Mag()+H2.Mag()),2 ) - TMath::Power(( ( H1+H2 ).Mag()),2) ); |
47 |
|
|
48 |
|
return mass; |
49 |
|
|
91 |
|
else |
92 |
|
b1 = m2.BoostVector(); |
93 |
|
|
94 |
< |
float cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag()); |
94 |
> |
double cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag()); |
95 |
|
return(cosTheta); |
96 |
|
} |
97 |
|
|
114 |
|
else |
115 |
|
b1 = m2.BoostVector(); |
116 |
|
|
117 |
< |
float cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag()); |
117 |
> |
double cosTheta = b1.Dot(msum.BoostVector()) / (b1.Mag()*msum.BoostVector().Mag()); |
118 |
|
return(cosTheta); |
119 |
|
} |
120 |
|
|
121 |
+ |
double metCorSysShift(double met, double metphi, int Nvtx, int EVENT_run) |
122 |
+ |
{ |
123 |
+ |
double metx = met * cos(metphi); |
124 |
+ |
double mety = met * sin(metphi); |
125 |
+ |
double px = 0.0, py = 0.0; |
126 |
+ |
if (EVENT_run!=1) { |
127 |
+ |
//pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_data |
128 |
+ |
px = +1.68804e-01 + 3.37139e-01*Nvtx; |
129 |
+ |
py = -1.72555e-01 - 1.79594e-01*Nvtx; |
130 |
+ |
} else { |
131 |
+ |
//pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_mc |
132 |
+ |
px = +2.22335e-02 - 6.59183e-02*Nvtx; |
133 |
+ |
py = +1.52720e-01 - 1.28052e-01*Nvtx; |
134 |
+ |
} |
135 |
+ |
metx -= px; |
136 |
+ |
mety -= py; |
137 |
+ |
return std::sqrt(metx*metx + mety*mety); |
138 |
+ |
} |
139 |
+ |
|
140 |
+ |
double metphiCorSysShift(double met, double metphi, int Nvtx, int EVENT_run) |
141 |
+ |
{ |
142 |
+ |
double metx = met * cos(metphi); |
143 |
+ |
double mety = met * sin(metphi); |
144 |
+ |
double px = 0.0, py = 0.0; |
145 |
+ |
if (EVENT_run!=1) { |
146 |
+ |
|
147 |
+ |
//pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_data |
148 |
+ |
px = +1.68804e-01 + 3.37139e-01*Nvtx; |
149 |
+ |
py = -1.72555e-01 - 1.79594e-01*Nvtx; |
150 |
+ |
} else { |
151 |
+ |
//pfMEtSysShiftCorrParameters_2012runAplusBvsNvtx_mc |
152 |
+ |
px = +2.22335e-02 - 6.59183e-02*Nvtx; |
153 |
+ |
py = +1.52720e-01 - 1.28052e-01*Nvtx; |
154 |
+ |
} |
155 |
+ |
metx -= px; |
156 |
+ |
mety -= py; |
157 |
+ |
if (metx == 0.0 && mety == 0.0) |
158 |
+ |
return 0.0; |
159 |
+ |
|
160 |
+ |
double phi1 = std::atan2(mety,metx); |
161 |
+ |
double phi2 = std::atan2(mety,metx)-2.0*M_PI; |
162 |
+ |
if (std::abs(phi1-metphi) < std::abs(phi2-metphi)+0.5*M_PI) |
163 |
+ |
return phi1; |
164 |
+ |
else |
165 |
+ |
return phi2; |
166 |
+ |
} |
167 |
|
|
168 |
+ |
double resolutionBias(double eta) |
169 |
+ |
{ |
170 |
+ |
// return 0;//Nominal! |
171 |
+ |
if(eta< 1.1) return 0.05; |
172 |
+ |
if(eta< 2.5) return 0.10; |
173 |
+ |
if(eta< 5) return 0.30; |
174 |
+ |
return 0; |
175 |
+ |
} |
176 |
+ |
|
177 |
+ |
double evalJERBias( double ptreco, double ptgen, double eta1){ |
178 |
+ |
double eta = fabs(eta1); |
179 |
+ |
double cor =1; |
180 |
+ |
if ((fabs(ptreco - ptgen)/ ptreco)<0.5) { //Limit the effect to the core |
181 |
+ |
cor = (ptreco +resolutionBias(eta) *(ptreco-ptgen))/ptreco; |
182 |
+ |
} |
183 |
+ |
return ptreco*cor; |
184 |
+ |
} |
185 |
+ |
|
186 |
+ |
double evalEt( double pt, double eta, double phi, double e){ |
187 |
+ |
TLorentzVector j; |
188 |
+ |
j.SetPtEtaPhiE(pt,eta,phi, e ); |
189 |
+ |
return j.Et(); |
190 |
+ |
|
191 |
+ |
} |
192 |
+ |
|
193 |
+ |
double evalMt( double pt, double eta, double phi, double e){ |
194 |
+ |
TLorentzVector j; |
195 |
+ |
j.SetPtEtaPhiE(pt,eta,phi, e ); |
196 |
+ |
return j.Mt(); |
197 |
+ |
|
198 |
+ |
} |
199 |
|
|
200 |
|
} |
201 |
|
|