24 theDepositLabel(par.getUntrackedParameter<
string>(
"DepositLabel")),
25 theWeight_E(par.getParameter<double>(
"Weight_E")),
26 theWeight_H(par.getParameter<double>(
"Weight_H")),
27 theThreshold_E(par.getParameter<double>(
"Threshold_E")),
28 theThreshold_H(par.getParameter<double>(
"Threshold_H")),
29 theDR_Veto_E(par.getParameter<double>(
"DR_Veto_E")),
30 theDR_Veto_H(par.getParameter<double>(
"DR_Veto_H")),
31 theDR_Max(par.getParameter<double>(
"DR_Max")),
32 vertexConstraintFlag_XY(par.getParameter<
bool>(
"Vertex_Constraint_XY")),
33 vertexConstraintFlag_Z(par.getParameter<
bool>(
"Vertex_Constraint_Z"))
51 TrackCollection::const_iterator
mu;
52 TrackCollection::const_iterator muEnd(muons.end());
57 for ( mu = muons.begin(); mu != muEnd; ++
mu ) {
58 for ( cal = towers->
begin(); cal != calEnd; ++cal ) {
60 double dEta = fabs(mu->eta()-cal->eta());
66 double etecal = cal->emEt();
67 double eecal = cal->emEnergy();
69 double ethcal = cal->hadEt();
70 double ehcal = cal->hadEnergy();
72 if ((!doEcal) && (!doHcal))
continue;
74 DetId calId = cal->id();
92 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
93 <<
" >>> Muon: pt " << muon.
pt()
94 <<
" eta " << muon.
eta()
95 <<
" phi " << muon.
phi();
109 for ( cal = towers->
begin(); cal != calEnd; ++cal ) {
111 double dEta = fabs(muon.
eta()-cal->eta());
117 double etecal = cal->emEt();
118 double eecal = cal->emEnergy();
120 double ethcal = cal->hadEt();
121 double ehcal = cal->hadEnergy();
123 if ((!doEcal) && (!doHcal))
continue;
125 DetId calId = cal->id();
138 dep.addCandEnergy(calodep);
139 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
140 <<
" >>> Calo deposit inside veto (with ECAL): deltar " << deltar
141 <<
" calodep " << calodep
142 <<
" ecaldep " << etecal
143 <<
" hcaldep " << ethcal
144 <<
" eta " << cal->eta()
145 <<
" phi " << cal->phi();
151 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
152 <<
" >>> Calo deposit inside veto (no ECAL): deltar " << deltar
154 <<
" eta " << cal->eta()
155 <<
" phi " << cal->phi();
162 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
163 <<
" >>> Deposits belongs to other track: deltar, etecal, ethcal= " 164 << deltar <<
", " << etecal <<
", " << ethcal;
173 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
174 <<
" >>> Calo deposit (with ECAL): deltar " << deltar
175 <<
" calodep " << calodep
176 <<
" ecaldep " << etecal
177 <<
" hcaldep " << ethcal
178 <<
" eta " << cal->eta()
179 <<
" phi " << cal->phi();
184 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
185 <<
" >>> Calo deposit (no ECAL): deltar " << deltar
187 <<
" eta " << cal->eta()
188 <<
" phi " << cal->phi();
198 double qoverp= muon.
qoverp();
199 double cur = bz*muon.
charge()/muon.
pt();
200 double phi0 = muon.
phi();
201 double dca = muon.
dxy();
203 double dz = muon.
dz();
216 if (fixVxy && fixVz) {
220 if (
pow(muon.
dxy(),2)<4*errd02) {
224 /errd02 * (cur/qoverp);
228 if (
pow(muon.
dsz(),2)<4*errdsz2) {
235 if (
pow(muon.
dxy(),2)<4*errd02) {
239 /errd02 * (cur/qoverp);
243 /errd02 * muon.
p()/muon.
pt();
248 if (
pow(muon.
dsz(),2)<4*errdsz2) {
254 /errdsz2 * (cur/qoverp);
261 double sphi0 =
sin(phi0);
262 double cphi0 =
cos(phi0);
264 double xsin = endpos.
x()*sphi0 - endpos.
y()*cphi0;
265 double xcos = endpos.
x()*cphi0 + endpos.
y()*sphi0;
266 double fcdca = fabs(1-cur*dca);
267 double phif = atan2( fcdca*sphi0-cur*endpos.
x()
268 , fcdca*cphi0+cur*endpos.
y());
269 double tphif2 =
tan(0.5*(phif-phi0));
270 double dcaf = dca + xsin + xcos*tphif2;
272 double x = endpos.
x() - dcaf*
sin(phif);
273 double y = endpos.
y() + dcaf*
cos(phif);
275 double deltas = (x-muon.
vx())*cphi0 + (y-muon.
vy())*sphi0;
277 if (deltaphi!=0) deltas = deltas*deltaphi/
sin(deltaphi);
280 double tantheta =
tan(theta);
282 z += deltas/
tan(theta);
293 if (fabs(eta)>1.479) noise = 0.15;
double qoverp() const
q / p
double p() const
momentum vector magnitude
double eta() const final
momentum pseudorapidity
double theta() const
polar angle
Sin< T >::type sin(const T &t)
Geom::Phi< T > phi() const
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
std::vector< CaloTower >::const_iterator const_iterator
Geom::Theta< T > theta() const
double phi() const
azimuthal angle of momentum vector
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
double eta() const
pseudorapidity of momentum vector
CovarianceMatrix covariance() const
return track covariance matrix
double pt() const
track transverse momentum
Cos< T >::type cos(const T &t)
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Tan< T >::type tan(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
const_iterator end() const
double vy() const
y coordinate of the reference point on track
int charge() const
track electric charge
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Power< A, B >::type pow(const A &a, const B &b)
const_iterator begin() const
double vx() const
x coordinate of the reference point on track