23 : theCaloTowerCollectionToken(
25 theDepositLabel(par.getUntrackedParameter<
string>(
"DepositLabel")),
26 theWeight_E(par.getParameter<double>(
"Weight_E")),
27 theWeight_H(par.getParameter<double>(
"Weight_H")),
28 theThreshold_E(par.getParameter<double>(
"Threshold_E")),
29 theThreshold_H(par.getParameter<double>(
"Threshold_H")),
30 theDR_Veto_E(par.getParameter<double>(
"DR_Veto_E")),
31 theDR_Veto_H(par.getParameter<double>(
"DR_Veto_H")),
32 theDR_Max(par.getParameter<double>(
"DR_Max")),
33 vertexConstraintFlag_XY(par.getParameter<
bool>(
"Vertex_Constraint_XY")),
34 vertexConstraintFlag_Z(par.getParameter<
bool>(
"Vertex_Constraint_Z")) {}
51 TrackCollection::const_iterator
mu;
52 TrackCollection::const_iterator muEnd(
muons.end());
58 for (cal =
towers->begin(); cal != calEnd; ++cal) {
60 double dEta = fabs(
mu->eta() - cal->eta());
68 double etecal = cal->emEt();
69 double eecal = cal->emEnergy();
71 double ethcal = cal->hadEt();
72 double ehcal = cal->hadEnergy();
74 if ((!doEcal) && (!doHcal))
77 DetId calId = cal->id();
95 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
96 <<
" >>> Muon: pt " <<
muon.pt() <<
" eta " <<
muon.eta() <<
" phi " <<
muon.phi();
110 for (cal =
towers->begin(); cal != calEnd; ++cal) {
112 double dEta = fabs(
muon.eta() - cal->eta());
120 double etecal = cal->emEt();
121 double eecal = cal->emEnergy();
123 double ethcal = cal->hadEt();
124 double ehcal = cal->hadEnergy();
126 if ((!doEcal) && (!doHcal))
129 DetId calId = cal->id();
143 dep.addCandEnergy(calodep);
144 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
145 <<
" >>> Calo deposit inside veto (with ECAL): deltar " <<
deltar <<
" calodep " << calodep <<
" ecaldep "
146 << etecal <<
" hcaldep " << ethcal <<
" eta " << cal->eta() <<
" phi " << cal->phi();
152 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
153 <<
" >>> Calo deposit inside veto (no ECAL): deltar " <<
deltar <<
" calodep " <<
theWeight_H * ethcal
154 <<
" eta " << cal->eta() <<
" phi " << cal->phi();
160 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
161 <<
" >>> Deposits belongs to other track: deltar, etecal, ethcal= " <<
deltar <<
", " << etecal <<
", "
172 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
173 <<
" >>> Calo deposit (with ECAL): deltar " <<
deltar <<
" calodep " << calodep <<
" ecaldep " << etecal
174 <<
" hcaldep " << ethcal <<
" eta " << cal->eta() <<
" phi " << cal->phi();
179 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
180 <<
" >>> Calo deposit (no ECAL): deltar " <<
deltar <<
" calodep " <<
theWeight_H * ethcal <<
" eta "
181 << cal->eta() <<
" phi " << cal->phi();
191 double qoverp =
muon.qoverp();
192 double cur = bz *
muon.charge() /
muon.pt();
193 double phi0 =
muon.phi();
194 double dca =
muon.dxy();
209 if (fixVxy && fixVz) {
212 double errd02 =
muon.covariance(
muon.i_dxy,
muon.i_dxy);
213 if (
pow(
muon.dxy(), 2) < 4 * errd02) {
215 cur -=
muon.dxy() *
muon.covariance(
muon.i_dxy,
muon.i_qoverp) / errd02 * (cur / qoverp);
218 double errdsz2 =
muon.covariance(
muon.i_dsz,
muon.i_dsz);
219 if (
pow(
muon.dsz(), 2) < 4 * errdsz2) {
224 double errd02 =
muon.covariance(
muon.i_dxy,
muon.i_dxy);
225 if (
pow(
muon.dxy(), 2) < 4 * errd02) {
227 cur -=
muon.dxy() *
muon.covariance(
muon.i_dxy,
muon.i_qoverp) / errd02 * (cur / qoverp);
233 double errdsz2 =
muon.covariance(
muon.i_dsz,
muon.i_dsz);
234 if (
pow(
muon.dsz(), 2) < 4 * errdsz2) {
237 cur -=
muon.dsz() *
muon.covariance(
muon.i_dsz,
muon.i_qoverp) / errdsz2 * (cur / qoverp);
243 double sphi0 =
sin(phi0);
244 double cphi0 =
cos(phi0);
246 double xsin = endpos.
x() * sphi0 - endpos.
y() * cphi0;
247 double xcos = endpos.
x() * cphi0 + endpos.
y() * sphi0;
248 double fcdca = fabs(1 - cur * dca);
249 double phif = atan2(fcdca * sphi0 - cur * endpos.
x(), fcdca * cphi0 + cur * endpos.
y());
250 double tphif2 =
tan(0.5 * (phif - phi0));
251 double dcaf = dca + xsin + xcos * tphif2;
253 double x = endpos.
x() - dcaf *
sin(phif);
254 double y = endpos.
y() + dcaf *
cos(phif);
256 double deltas = (x -
muon.vx()) * cphi0 + (y -
muon.vy()) * sphi0;
259 deltas = deltas * deltaphi /
sin(deltaphi);
275 if (fabs(
eta) > 1.479)