31 const std::vector<CorrMETData>& fCorrections,
40 const std::vector<CorrMETData>& fCorrections,
42 return MET (fSumEt, fCorrections, fP4, fMet.
vertex ());
51 std::vector<T>* v_corMET)
53 T uncorMETObj = v_uncorMET.front();
55 double corMETX = uncorMETObj.px();
56 double corMETY = uncorMETObj.py();
61 double sumMuDepEx = 0.;
62 double sumMuDepEy = 0.;
63 double sumMuDepEt = 0.;
65 for(
unsigned int i = 0;
i < inputMuons.
size(); ++
i)
69 if(muCorrData.
type() == 0)
continue;
71 float deltax = muCorrData.
corrX();
72 float deltay = muCorrData.
corrY();
82 sumMuDepEt +=
sqrt(deltax*deltax + deltay*deltay);
83 corMETX = corMETX - mup4.px() + deltax;
84 corMETY = corMETY - mup4.py() + deltay;
89 delta.
mex = sumMuDepEx - sumMuPx;
90 delta.
mey = sumMuDepEy - sumMuPy;
91 delta.
sumet = sumMuPt - sumMuDepEt;
93 std::vector<CorrMETData> corrections = uncorMETObj.mEtCorr();
94 corrections.push_back(delta);
96 T result = makeMET(uncorMETObj, uncorMETObj.sumEt() + delta.
sumet, corrections, correctedMET4vector);
97 v_corMET->push_back(result);
107 double& deltax,
double& deltay,
111 bool useAverage =
false;
118 if(sumPt > 3 || sumEtEcal + sumEtHcal > 5) useAverage =
true;
136 if(useTrackAssociatorPositions) {
153 for(vector<const CaloTower*>::const_iterator it = towers.begin();
154 it != towers.end(); it++) {
156 muMETInfo.
ecalE += (*it)->emEnergy();
157 muMETInfo.
hcalE += (*it)->hadEnergy();
159 muMETInfo.
hoE +=(*it)->outerEnergy();
186 correctMETforMuon(deltax, deltay, Bfield, inputMuon->
charge(),
187 mup4, inputMuon->
vertex(),
197 double mu_p = muonP4.P();
198 double mu_pt = muonP4.Pt();
199 double mu_phi = muonP4.Phi();
200 double mu_eta = muonP4.Eta();
201 double mu_vz = muonVertex.z()/100.;
202 double mu_pz = muonP4.Pz();
205 double hcalPhi, hcalTheta;
206 double hoPhi, hoTheta;
213 ecalPhi = muonMETInfo.
ecalPos.Phi();
214 ecalTheta = muonMETInfo.
ecalPos.Theta();
215 hcalPhi = muonMETInfo.
hcalPos.Phi();
216 hcalTheta = muonMETInfo.
hcalPos.Theta();
217 hoPhi = muonMETInfo.
hoPos.Phi();
218 hoTheta = muonMETInfo.
hoPos.Theta();
229 double rEcal = 1.290;
232 if(
abs(mu_eta) > 0.3) rHo = 4.07;
234 double zFaceEcal = 3.209;
235 if(mu_eta < 0 ) zFaceEcal = -1*zFaceEcal;
237 double zFaceHcal = 3.88;
238 if(mu_eta < 0 ) zFaceHcal = -1*zFaceHcal;
242 double bendr = mu_pt*1000/(300*bfield);
244 double tb_ecal = TMath::ACos(1-rEcal*rEcal/(2*bendr*bendr));
245 double tb_hcal = TMath::ACos(1-rHcal*rHcal/(2*bendr*bendr));
246 double tb_ho = TMath::ACos(1-rHo*rHo/(2*bendr*bendr));
247 double xEcal,yEcal,zEcal;
248 double xHcal,yHcal,zHcal;
252 if(fabs(mu_pz*bendr*tb_ecal/mu_pt+mu_vz) < fabs(zFaceEcal) && rEcal < 2*bendr) {
253 xEcal = bendr*(TMath::Sin(tb_ecal+mu_phi)-TMath::Sin(mu_phi));
254 yEcal = bendr*(-TMath::Cos(tb_ecal+mu_phi)+TMath::Cos(mu_phi));
255 zEcal = bendr*tb_ecal*mu_pz/mu_pt + mu_vz;
258 double te_ecal = (fabs(zFaceEcal) - mu_vz)*mu_pt/(bendr*mu_pz);
259 xEcal = bendr*(TMath::Sin(te_ecal+mu_phi) - TMath::Sin(mu_phi));
260 yEcal = bendr*(-TMath::Cos(te_ecal+mu_phi) + TMath::Cos(mu_phi));
261 zEcal = fabs(zFaceEcal);
263 double te_ecal = -(fabs(zFaceEcal) + mu_vz)*mu_pt/(bendr*mu_pz);
264 xEcal = bendr*(TMath::Sin(te_ecal+mu_phi) - TMath::Sin(mu_phi));
265 yEcal = bendr*(-TMath::Cos(te_ecal+mu_phi) + TMath::Cos(mu_phi));
266 zEcal = -fabs(zFaceEcal);
271 if(fabs(mu_pz*bendr*tb_hcal/mu_pt+mu_vz) < fabs(zFaceHcal) && rEcal < 2*bendr) {
272 xHcal = bendr*(TMath::Sin(tb_hcal+mu_phi)-TMath::Sin(mu_phi));
273 yHcal = bendr*(-TMath::Cos(tb_hcal+mu_phi)+TMath::Cos(mu_phi));
274 zHcal = bendr*tb_hcal*mu_pz/mu_pt + mu_vz;
277 double te_hcal = (fabs(zFaceHcal) - mu_vz)*mu_pt/(bendr*mu_pz);
278 xHcal = bendr*(TMath::Sin(te_hcal+mu_phi) - TMath::Sin(mu_phi));
279 yHcal = bendr*(-TMath::Cos(te_hcal+mu_phi) + TMath::Cos(mu_phi));
280 zHcal = fabs(zFaceHcal);
282 double te_hcal = -(fabs(zFaceHcal) + mu_vz)*mu_pt/(bendr*mu_pz);
283 xHcal = bendr*(TMath::Sin(te_hcal+mu_phi) - TMath::Sin(mu_phi));
284 yHcal = bendr*(-TMath::Cos(te_hcal+mu_phi) + TMath::Cos(mu_phi));
285 zHcal = -fabs(zFaceHcal);
290 xHo = bendr*(TMath::Sin(tb_ho+mu_phi)-TMath::Sin(mu_phi));
291 yHo = bendr*(-TMath::Cos(tb_ho+mu_phi)+TMath::Cos(mu_phi));
292 zHo = bendr*tb_ho*mu_pz/mu_pt + mu_vz;
294 ecalTheta = TMath::ACos(zEcal/
sqrt(
pow(xEcal,2) +
pow(yEcal,2)+
pow(zEcal,2)));
295 ecalPhi = atan2(yEcal,xEcal);
296 hcalTheta = TMath::ACos(zHcal/
sqrt(
pow(xHcal,2) +
pow(yHcal,2)+
pow(zHcal,2)));
297 hcalPhi = atan2(yHcal,xHcal);
298 hoTheta = TMath::ACos(zHo/
sqrt(
pow(xHo,2) +
pow(yHo,2)+
pow(zHo,2)));
299 hoPhi = atan2(yHo,xHo);
309 double dphi = mu_phi -
ecalPhi;
312 ecalPhi = mu_phi - fabs(dphi);
315 ecalPhi = -1*temp*ecalPhi/fabs(ecalPhi);
319 dphi = mu_phi - hcalPhi;
322 hcalPhi = mu_phi - fabs(dphi);
325 hcalPhi = -1*temp*hcalPhi/fabs(hcalPhi);
329 dphi = mu_phi - hoPhi;
332 hoPhi = mu_phi - fabs(dphi);
335 hoPhi = -1*temp*hoPhi/fabs(hoPhi);
344 double mu_Ex = muonMETInfo.
ecalE*
sin(ecalTheta)*
cos(ecalPhi)
346 + muonMETInfo.
hoE*
sin(hoTheta)*
cos(hoPhi);
347 double mu_Ey = muonMETInfo.
ecalE*
sin(ecalTheta)*
sin(ecalPhi)
349 + muonMETInfo.
hoE*
sin(hoTheta)*
sin(hoPhi);
361 double dEdx_normalization = -(11.4 + 0.96*fabs(
log(50*2.8)) + 0.033*50*(1.0 -
pow(50, -0.33)) )*1
e-3;
362 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;
366 if(muonMETInfo.
useHO) {
368 if(fabs(mu_eta) < 0.2)
369 temp = 2.75*(1-0.00003*mu_p);
370 if(fabs(mu_eta) > 0.2 && fabs(mu_eta) < 1.0)
371 temp = (2.38+0.0144*fabs(mu_eta))*(1-0.0003*mu_p);
372 if(fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
373 temp = 7.413-5.12*fabs(mu_eta);
374 if(fabs(mu_eta) > 1.3)
375 temp = 2.084-0.743*fabs(mu_eta);
377 if(fabs(mu_eta) < 1.0)
378 temp = 2.33*(1-0.0004*mu_p);
379 if(fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
380 temp = (7.413-5.12*fabs(mu_eta))*(1-0.0003*mu_p);
381 if(fabs(mu_eta) > 1.3)
382 temp = 2.084-0.743*fabs(mu_eta);
385 double dep = temp*dEdx_normalization/dEdx_numerator;
386 if(dep < 0.5) dep = 0;
388 if(fabs(mu_eta) < 1.3) {
389 deltax += dep*
cos((ecalPhi+hcalPhi+hoPhi)/3);
390 deltay += dep*
sin((ecalPhi+hcalPhi+hoPhi)/3);
392 deltax += dep*
cos( (ecalPhi+hcalPhi)/2);
393 deltay += dep*
cos( (ecalPhi+hcalPhi)/2);
406 MuonMETAlgo_run(inputMuons, vm_muCorrData, uncorMET, corMET);
415 MuonMETAlgo_run(inputMuons, vm_muCorrData, uncorMET, corMET);
math::XYZPoint trkGlobPosAtHO
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
int charge() const final
electric charge
math::XYZPoint trkGlobPosAtHcal
bool isTrackerMuon() const override
RefToBase< value_type > refAt(size_type i) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
SpecificCaloMETData getSpecific() const
bool isGlobalMuon() const override
Cos< T >::type cos(const T &t)
const Point & vertex() const override
vertex position (overwritten by PF...)
Abs< T >::type abs(const T &t)
math::XYZTLorentzVector LorentzVector
const LorentzVector & p4() const final
four-momentum Lorentz vector
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
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
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
useTrackAssociatorPositions