32 const std::vector<CorrMETData>& fCorrections,
41 const std::vector<CorrMETData>& fCorrections,
43 return MET (fSumEt, fCorrections, fP4, fMet.
vertex ());
51 std::vector<T>* v_corMET) {
52 T uncorMETObj = v_uncorMET.front();
54 double uncorMETX = uncorMETObj.px();
55 double uncorMETY = uncorMETObj.py();
57 double corMETX = uncorMETX;
58 double corMETY = uncorMETY;
63 double sumMuDepEx = 0.;
64 double sumMuDepEy = 0.;
66 unsigned int nMuons = inputMuons.
size();
67 for(
unsigned int iMu = 0; iMu<nMuons; iMu++) {
71 float deltax = muCorrData.
corrX();
72 float deltay = muCorrData.
corrY();
86 corMETX = corMETX - mup4.px() + deltax;
87 corMETY = corMETY - mup4.py() + deltay;
90 delta.
mex = sumMuDepEx - sumMuPx;
91 delta.
mey = sumMuDepEy - sumMuPy;
92 delta.
sumet =
sqrt(sumMuPx*sumMuPx + sumMuPy*sumMuPy) -
sqrt(sumMuDepEx*sumMuDepEx + sumMuDepEy*sumMuDepEy);
94 std::vector<CorrMETData> corrections = uncorMETObj.mEtCorr();
95 corrections.push_back(delta);
97 T result = makeMET(uncorMETObj, uncorMETObj.sumEt()+delta.
sumet, corrections, correctedMET4vector);
98 v_corMET->push_back(result);
104 bool useTrackAssociatorPositions,
107 double towerEtThreshold,
108 double& deltax,
double& deltay,
112 bool useAverage =
false;
119 if(sumPt > 3 || sumEtEcal + sumEtHcal > 5) useAverage =
true;
126 muMETInfo.
useHO = useHO;
137 if(useTrackAssociatorPositions) {
154 for(vector<const CaloTower*>::const_iterator it = towers.begin();
155 it != towers.end(); it++) {
156 if((*it)->et() < towerEtThreshold)
continue;
157 muMETInfo.
ecalE += (*it)->emEnergy();
158 muMETInfo.
hcalE += (*it)->hadEnergy();
160 muMETInfo.
hoE +=(*it)->outerEnergy();
187 correctMETforMuon(deltax, deltay, Bfield, inputMuon->
charge(),
188 mup4, inputMuon->
vertex(),
198 double mu_p = muonP4.P();
199 double mu_pt = muonP4.Pt();
200 double mu_phi = muonP4.Phi();
201 double mu_eta = muonP4.Eta();
202 double mu_vz = muonVertex.z()/100.;
203 double mu_pz = muonP4.Pz();
205 double ecalPhi, ecalTheta;
206 double hcalPhi, hcalTheta;
207 double hoPhi, hoTheta;
214 ecalPhi = muonMETInfo.
ecalPos.Phi();
215 ecalTheta = muonMETInfo.
ecalPos.Theta();
216 hcalPhi = muonMETInfo.
hcalPos.Phi();
217 hcalTheta = muonMETInfo.
hcalPos.Theta();
218 hoPhi = muonMETInfo.
hoPos.Phi();
219 hoTheta = muonMETInfo.
hoPos.Theta();
230 double rEcal = 1.290;
233 if(
abs(mu_eta) > 0.3) rHo = 4.07;
235 double zFaceEcal = 3.209;
236 if(mu_eta < 0 ) zFaceEcal = -1*zFaceEcal;
238 double zFaceHcal = 3.88;
239 if(mu_eta < 0 ) zFaceHcal = -1*zFaceHcal;
243 double bendr = mu_pt*1000/(300*bfield);
245 double tb_ecal = TMath::ACos(1-rEcal*rEcal/(2*bendr*bendr));
246 double tb_hcal = TMath::ACos(1-rHcal*rHcal/(2*bendr*bendr));
247 double tb_ho = TMath::ACos(1-rHo*rHo/(2*bendr*bendr));
248 double xEcal,yEcal,zEcal;
249 double xHcal,yHcal,zHcal;
253 if(fabs(mu_pz*bendr*tb_ecal/mu_pt+mu_vz) < fabs(zFaceEcal) && rEcal < 2*bendr) {
254 xEcal = bendr*(TMath::Sin(tb_ecal+mu_phi)-TMath::Sin(mu_phi));
255 yEcal = bendr*(-TMath::Cos(tb_ecal+mu_phi)+TMath::Cos(mu_phi));
256 zEcal = bendr*tb_ecal*mu_pz/mu_pt + mu_vz;
259 double te_ecal = (fabs(zFaceEcal) - mu_vz)*mu_pt/(bendr*mu_pz);
260 xEcal = bendr*(TMath::Sin(te_ecal+mu_phi) - TMath::Sin(mu_phi));
261 yEcal = bendr*(-TMath::Cos(te_ecal+mu_phi) + TMath::Cos(mu_phi));
262 zEcal = fabs(zFaceEcal);
264 double te_ecal = -(fabs(zFaceEcal) + mu_vz)*mu_pt/(bendr*mu_pz);
265 xEcal = bendr*(TMath::Sin(te_ecal+mu_phi) - TMath::Sin(mu_phi));
266 yEcal = bendr*(-TMath::Cos(te_ecal+mu_phi) + TMath::Cos(mu_phi));
267 zEcal = -fabs(zFaceEcal);
272 if(fabs(mu_pz*bendr*tb_hcal/mu_pt+mu_vz) < fabs(zFaceHcal) && rEcal < 2*bendr) {
273 xHcal = bendr*(TMath::Sin(tb_hcal+mu_phi)-TMath::Sin(mu_phi));
274 yHcal = bendr*(-TMath::Cos(tb_hcal+mu_phi)+TMath::Cos(mu_phi));
275 zHcal = bendr*tb_hcal*mu_pz/mu_pt + mu_vz;
278 double te_hcal = (fabs(zFaceHcal) - mu_vz)*mu_pt/(bendr*mu_pz);
279 xHcal = bendr*(TMath::Sin(te_hcal+mu_phi) - TMath::Sin(mu_phi));
280 yHcal = bendr*(-TMath::Cos(te_hcal+mu_phi) + TMath::Cos(mu_phi));
281 zHcal = fabs(zFaceHcal);
283 double te_hcal = -(fabs(zFaceHcal) + mu_vz)*mu_pt/(bendr*mu_pz);
284 xHcal = bendr*(TMath::Sin(te_hcal+mu_phi) - TMath::Sin(mu_phi));
285 yHcal = bendr*(-TMath::Cos(te_hcal+mu_phi) + TMath::Cos(mu_phi));
286 zHcal = -fabs(zFaceHcal);
291 xHo = bendr*(TMath::Sin(tb_ho+mu_phi)-TMath::Sin(mu_phi));
292 yHo = bendr*(-TMath::Cos(tb_ho+mu_phi)+TMath::Cos(mu_phi));
293 zHo = bendr*tb_ho*mu_pz/mu_pt + mu_vz;
295 ecalTheta = TMath::ACos(zEcal/
sqrt(
pow(xEcal,2) +
pow(yEcal,2)+
pow(zEcal,2)));
296 ecalPhi = atan2(yEcal,xEcal);
297 hcalTheta = TMath::ACos(zHcal/
sqrt(
pow(xHcal,2) +
pow(yHcal,2)+
pow(zHcal,2)));
298 hcalPhi = atan2(yHcal,xHcal);
299 hoTheta = TMath::ACos(zHo/
sqrt(
pow(xHo,2) +
pow(yHo,2)+
pow(zHo,2)));
300 hoPhi = atan2(yHo,xHo);
303 double r2dEcal =
sqrt(
pow(xEcal,2)+
pow(yEcal,2));
304 double r2dHcal =
sqrt(
pow(xHcal,2)+
pow(yHcal,2));
315 double dphi = mu_phi - ecalPhi;
318 ecalPhi = mu_phi - fabs(dphi);
321 ecalPhi = -1*temp*ecalPhi/fabs(ecalPhi);
323 xEcal = r2dEcal*TMath::Cos(ecalPhi);
324 yEcal = r2dEcal*TMath::Sin(ecalPhi);
327 dphi = mu_phi - hcalPhi;
330 hcalPhi = mu_phi - fabs(dphi);
333 hcalPhi = -1*temp*hcalPhi/fabs(hcalPhi);
335 xHcal = r2dHcal*TMath::Cos(hcalPhi);
336 yHcal = r2dHcal*TMath::Sin(hcalPhi);
340 dphi = mu_phi - hoPhi;
343 hoPhi = mu_phi - fabs(dphi);
346 hoPhi = -1*temp*hoPhi/fabs(hoPhi);
348 xHo = r2dHo*TMath::Cos(hoPhi);
349 yHo = r2dHo*TMath::Sin(hoPhi);
357 double mu_Ex = muonMETInfo.
ecalE*
sin(ecalTheta)*
cos(ecalPhi)
359 + muonMETInfo.
hoE*
sin(hoTheta)*
cos(hoPhi);
360 double mu_Ey = muonMETInfo.
ecalE*
sin(ecalTheta)*
sin(ecalPhi)
362 + muonMETInfo.
hoE*
sin(hoTheta)*
sin(hoPhi);
374 double dEdx_normalization = -(11.4 + 0.96*fabs(
log(50*2.8)) + 0.033*50*(1.0 -
pow(50, -0.33)) )*1
e-3;
375 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;
379 if(muonMETInfo.
useHO) {
381 if(fabs(mu_eta) < 0.2)
382 temp = 2.75*(1-0.00003*mu_p);
383 if(fabs(mu_eta) > 0.2 && fabs(mu_eta) < 1.0)
384 temp = (2.38+0.0144*fabs(mu_eta))*(1-0.0003*mu_p);
385 if(fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
386 temp = 7.413-5.12*fabs(mu_eta);
387 if(fabs(mu_eta) > 1.3)
388 temp = 2.084-0.743*fabs(mu_eta);
390 if(fabs(mu_eta) < 1.0)
391 temp = 2.33*(1-0.0004*mu_p);
392 if(fabs(mu_eta) > 1.0 && fabs(mu_eta) < 1.3)
393 temp = (7.413-5.12*fabs(mu_eta))*(1-0.0003*mu_p);
394 if(fabs(mu_eta) > 1.3)
395 temp = 2.084-0.743*fabs(mu_eta);
398 double dep = temp*dEdx_normalization/dEdx_numerator;
399 if(dep < 0.5) dep = 0;
401 if(fabs(mu_eta) < 1.3) {
402 deltax += dep*
cos((ecalPhi+hcalPhi+hoPhi)/3);
403 deltay += dep*
sin((ecalPhi+hcalPhi+hoPhi)/3);
405 deltax += dep*
cos( (ecalPhi+hcalPhi)/2);
406 deltay += dep*
cos( (ecalPhi+hcalPhi)/2);
418 MuonMETAlgo_run(inputMuons, vm_muCorrData, uncorMET, corMET);
427 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
virtual const Point & vertex() const
vertex position
bool isTrackerMuon() const
Sin< T >::type sin(const T &t)
math::XYZTLorentzVector LorentzVector
bool isGlobalMuon() const
float emS9
energy deposited in 3x3 ECAL crystal shape around central crystal
RefToBase< value_type > refAt(size_type i) const
math::XYZPoint trkGlobPosAtHcal
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
SpecificCaloMETData getSpecific() const
Cos< T >::type cos(const T &t)
virtual int charge() const
electric charge
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.
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
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
math::PtEtaPhiELorentzVectorF LorentzVector
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector