30 const std::vector<CorrMETData>& fCorrections,
38 const std::vector<CorrMETData>& fCorrections,
40 return MET(fSumEt, fCorrections, fP4, fMet.
vertex());
48 std::vector<T>* v_corMET) {
49 T uncorMETObj = v_uncorMET.front();
51 double corMETX = uncorMETObj.px();
52 double corMETY = uncorMETObj.py();
57 double sumMuDepEx = 0.;
58 double sumMuDepEy = 0.;
59 double sumMuDepEt = 0.;
61 for (
unsigned int i = 0;
i < inputMuons.
size(); ++
i) {
64 if (muCorrData.
type() == 0)
67 float deltax = muCorrData.
corrX();
68 float deltay = muCorrData.
corrY();
78 sumMuDepEt +=
sqrt(deltax * deltax + deltay * deltay);
79 corMETX = corMETX - mup4.px() + deltax;
80 corMETY = corMETY - mup4.py() + deltay;
84 delta.
mex = sumMuDepEx - sumMuPx;
85 delta.
mey = sumMuDepEy - sumMuPy;
86 delta.
sumet = sumMuPt - sumMuDepEt;
88 std::vector<CorrMETData> corrections = uncorMETObj.mEtCorr();
89 corrections.push_back(delta);
91 T result = makeMET(uncorMETObj, uncorMETObj.sumEt() + delta.
sumet, corrections, correctedMET4vector);
92 v_corMET->push_back(result);
98 bool useTrackAssociatorPositions,
101 double towerEtThreshold,
105 bool useAverage =
false;
112 if (sumPt > 3 || sumEtEcal + sumEtHcal > 5)
130 if (useTrackAssociatorPositions) {
146 for (vector<const CaloTower*>::const_iterator it = towers.begin(); it != towers.end(); it++) {
147 if ((*it)->et() < towerEtThreshold)
149 muMETInfo.
ecalE += (*it)->emEnergy();
150 muMETInfo.
hcalE += (*it)->hadEnergy();
152 muMETInfo.
hoE += (*it)->outerEnergy();
184 correctMETforMuon(deltax, deltay, Bfield, inputMuon->
charge(), mup4, inputMuon->
vertex(), muMETInfo);
195 double mu_p = muonP4.P();
196 double mu_pt = muonP4.Pt();
197 double mu_phi = muonP4.Phi();
198 double mu_eta = muonP4.Eta();
199 double mu_vz = muonVertex.z() / 100.;
200 double mu_pz = muonP4.Pz();
203 double hcalPhi, hcalTheta;
204 double hoPhi, hoTheta;
210 ecalPhi = muonMETInfo.
ecalPos.Phi();
211 ecalTheta = muonMETInfo.
ecalPos.Theta();
212 hcalPhi = muonMETInfo.
hcalPos.Phi();
213 hcalTheta = muonMETInfo.
hcalPos.Theta();
214 hoPhi = muonMETInfo.
hoPos.Phi();
215 hoTheta = muonMETInfo.
hoPos.Theta();
225 double rEcal = 1.290;
228 if (
abs(mu_eta) > 0.3)
231 double zFaceEcal = 3.209;
233 zFaceEcal = -1 * zFaceEcal;
235 double zFaceHcal = 3.88;
237 zFaceHcal = -1 * zFaceHcal;
241 double bendr = mu_pt * 1000 / (300 * bfield);
243 double tb_ecal = TMath::ACos(1 - rEcal * rEcal / (2 * bendr * bendr));
244 double tb_hcal = TMath::ACos(1 - rHcal * rHcal / (2 * bendr * bendr));
245 double tb_ho = TMath::ACos(1 - rHo * rHo / (2 * bendr * bendr));
246 double xEcal, yEcal, zEcal;
247 double xHcal, yHcal, zHcal;
248 double xHo, yHo, zHo;
251 if (fabs(mu_pz * bendr * tb_ecal / mu_pt + mu_vz) < fabs(zFaceEcal) && rEcal < 2 * bendr) {
252 xEcal = bendr * (TMath::Sin(tb_ecal + mu_phi) - TMath::Sin(mu_phi));
253 yEcal = bendr * (-TMath::Cos(tb_ecal + mu_phi) + TMath::Cos(mu_phi));
254 zEcal = bendr * tb_ecal * mu_pz / mu_pt + mu_vz;
257 double te_ecal = (fabs(zFaceEcal) - mu_vz) * mu_pt / (bendr * mu_pz);
258 xEcal = bendr * (TMath::Sin(te_ecal + mu_phi) - TMath::Sin(mu_phi));
259 yEcal = bendr * (-TMath::Cos(te_ecal + mu_phi) + TMath::Cos(mu_phi));
260 zEcal = fabs(zFaceEcal);
262 double te_ecal = -(fabs(zFaceEcal) + mu_vz) * mu_pt / (bendr * mu_pz);
263 xEcal = bendr * (TMath::Sin(te_ecal + mu_phi) - TMath::Sin(mu_phi));
264 yEcal = bendr * (-TMath::Cos(te_ecal + mu_phi) + TMath::Cos(mu_phi));
265 zEcal = -fabs(zFaceEcal);
270 if (fabs(mu_pz * bendr * tb_hcal / mu_pt + mu_vz) < fabs(zFaceHcal) && rEcal < 2 * bendr) {
271 xHcal = bendr * (TMath::Sin(tb_hcal + mu_phi) - TMath::Sin(mu_phi));
272 yHcal = bendr * (-TMath::Cos(tb_hcal + mu_phi) + TMath::Cos(mu_phi));
273 zHcal = bendr * tb_hcal * mu_pz / mu_pt + mu_vz;
276 double te_hcal = (fabs(zFaceHcal) - mu_vz) * mu_pt / (bendr * mu_pz);
277 xHcal = bendr * (TMath::Sin(te_hcal + mu_phi) - TMath::Sin(mu_phi));
278 yHcal = bendr * (-TMath::Cos(te_hcal + mu_phi) + TMath::Cos(mu_phi));
279 zHcal = fabs(zFaceHcal);
281 double te_hcal = -(fabs(zFaceHcal) + mu_vz) * mu_pt / (bendr * mu_pz);
282 xHcal = bendr * (TMath::Sin(te_hcal + mu_phi) - TMath::Sin(mu_phi));
283 yHcal = bendr * (-TMath::Cos(te_hcal + mu_phi) + TMath::Cos(mu_phi));
284 zHcal = -fabs(zFaceHcal);
289 xHo = bendr * (TMath::Sin(tb_ho + mu_phi) - TMath::Sin(mu_phi));
290 yHo = bendr * (-TMath::Cos(tb_ho + mu_phi) + TMath::Cos(mu_phi));
291 zHo = bendr * tb_ho * mu_pz / mu_pt + mu_vz;
293 ecalTheta = TMath::ACos(zEcal /
sqrt(
pow(xEcal, 2) +
pow(yEcal, 2) +
pow(zEcal, 2)));
294 ecalPhi = atan2(yEcal, xEcal);
295 hcalTheta = TMath::ACos(zHcal /
sqrt(
pow(xHcal, 2) +
pow(yHcal, 2) +
pow(zHcal, 2)));
296 hcalPhi = atan2(yHcal, xHcal);
297 hoTheta = TMath::ACos(zHo /
sqrt(
pow(xHo, 2) +
pow(yHo, 2) +
pow(zHo, 2)));
298 hoPhi = atan2(yHo, xHo);
305 if (muonCharge > 0) {
307 double dphi = mu_phi -
ecalPhi;
310 ecalPhi = mu_phi - fabs(dphi);
313 ecalPhi = -1 * temp * ecalPhi / fabs(ecalPhi);
317 dphi = mu_phi - hcalPhi;
320 hcalPhi = mu_phi - fabs(dphi);
323 hcalPhi = -1 * temp * hcalPhi / fabs(hcalPhi);
327 dphi = mu_phi - hoPhi;
330 hoPhi = mu_phi - fabs(dphi);
333 hoPhi = -1 * temp * hoPhi / fabs(hoPhi);
340 double mu_Ex = muonMETInfo.
ecalE *
sin(ecalTheta) *
cos(ecalPhi) +
341 muonMETInfo.
hcalE *
sin(hcalTheta) *
cos(hcalPhi) + muonMETInfo.
hoE *
sin(hoTheta) *
cos(hoPhi);
342 double mu_Ey = muonMETInfo.
ecalE *
sin(ecalTheta) *
sin(ecalPhi) +
343 muonMETInfo.
hcalE *
sin(hcalTheta) *
sin(hcalPhi) + muonMETInfo.
hoE *
sin(hoTheta) *
sin(hoPhi);
355 double dEdx_normalization = -(11.4 + 0.96 * fabs(
log(50 * 2.8)) + 0.033 * 50 * (1.0 -
pow(50, -0.33))) * 1
e-3;
356 double dEdx_numerator = -(11.4 + 0.96 * fabs(
log(mu_p * 2.8)) + 0.033 * mu_p * (1.0 -
pow(mu_p, -0.33))) * 1
e-3;
360 if (muonMETInfo.
useHO) {
362 if (fabs(mu_eta) < 0.2)
363 temp = 2.75 * (1 - 0.00003 * mu_p);
364 if (fabs(mu_eta) > 0.2 && fabs(mu_eta) < 1.0)
365 temp = (2.38 + 0.0144 * fabs(mu_eta)) * (1 - 0.0003 * mu_p);
366 if (fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
367 temp = 7.413 - 5.12 * fabs(mu_eta);
368 if (fabs(mu_eta) > 1.3)
369 temp = 2.084 - 0.743 * fabs(mu_eta);
371 if (fabs(mu_eta) < 1.0)
372 temp = 2.33 * (1 - 0.0004 * mu_p);
373 if (fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
374 temp = (7.413 - 5.12 * fabs(mu_eta)) * (1 - 0.0003 * mu_p);
375 if (fabs(mu_eta) > 1.3)
376 temp = 2.084 - 0.743 * fabs(mu_eta);
379 double dep = temp * dEdx_normalization / dEdx_numerator;
383 if (fabs(mu_eta) < 1.3) {
384 deltax += dep *
cos((ecalPhi + hcalPhi + hoPhi) / 3);
385 deltay += dep *
sin((ecalPhi + hcalPhi + hoPhi) / 3);
387 deltax += dep *
cos((ecalPhi + hcalPhi) / 2);
388 deltay += dep *
cos((ecalPhi + hcalPhi) / 2);
398 MuonMETAlgo_run(inputMuons, vm_muCorrData, uncorMET, corMET);
406 MuonMETAlgo_run(inputMuons, vm_muCorrData, uncorMET, corMET);
math::XYZPoint trkGlobPosAtHO
static std::vector< std::string > checklist log
float sumPt
sum-pt of tracks
std::vector< const CaloTower * > crossedTowers
virtual TrackRef innerTrack() const
Sin< T >::type sin(const T &t)
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
const Point & vertex() const override
vertex position (overwritten by PF...)
bool isTrackerMuon() const override
math::XYZPoint trkGlobPosAtHcal
RefToBase< value_type > refAt(size_type i) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
SpecificCaloMETData getSpecific() const
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
float hoS9
energy deposited in 3x3 HO tower shape around central tower
bool useTkAssociatorPositions
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
MuonEnergy calEnergy() const
get energy deposition information
XYZPointD XYZPoint
point in space with cartesian internal representation
math::XYZPoint trkGlobPosAtEcal
Track position at different parts of the calorimeter.
bool isIsolationValid() const
bool isGlobalMuon() const override
Power< A, B >::type pow(const A &a, const B &b)
float hadS9
energy deposited in 3x3 HCAL tower shape around central tower
const MuonIsolation & isolationR03() const
math::PtEtaPhiELorentzVectorF LorentzVector
int charge() const final
electric charge
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector