22 using namespace muonisolation;
27 theDepositLabel(par.getUntrackedParameter<
string>(
"DepositLabel")),
28 theWeight_E(par.getParameter<double>(
"Weight_E")),
29 theWeight_H(par.getParameter<double>(
"Weight_H")),
30 theThreshold_E(par.getParameter<double>(
"Threshold_E")),
31 theThreshold_H(par.getParameter<double>(
"Threshold_H")),
32 theDR_Veto_E(par.getParameter<double>(
"DR_Veto_E")),
33 theDR_Veto_H(par.getParameter<double>(
"DR_Veto_H")),
34 theDR_Max(par.getParameter<double>(
"DR_Max")),
35 vertexConstraintFlag_XY(par.getParameter<bool>(
"Vertex_Constraint_XY")),
36 vertexConstraintFlag_Z(par.getParameter<bool>(
"Vertex_Constraint_Z"))
52 double bz = bField->inInverseGeV(
GlobalPoint(0.,0.,0.)).z();
54 TrackCollection::const_iterator
mu;
55 TrackCollection::const_iterator muEnd(muons.end());
60 for ( mu = muons.begin(); mu != muEnd; ++
mu ) {
61 for ( cal = towers->begin(); cal != calEnd; ++cal ) {
63 double dEta = fabs(mu->eta()-cal->eta());
69 double etecal = cal->emEt();
70 double eecal = cal->emEnergy();
72 double ethcal = cal->hadEt();
73 double ehcal = cal->hadEnergy();
75 if ((!doEcal) && (!doHcal))
continue;
77 DetId calId = cal->id();
95 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
96 <<
" >>> Muon: pt " << muon.
pt()
97 <<
" eta " << muon.
eta()
98 <<
" phi " << muon.
phi();
108 double bz = bField->inInverseGeV(
GlobalPoint(0.,0.,0.)).z();
112 for ( cal = towers->begin(); cal != calEnd; ++cal ) {
114 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))
continue;
128 DetId calId = cal->id();
141 dep.addCandEnergy(calodep);
142 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
143 <<
" >>> Calo deposit inside veto (with ECAL): deltar " << deltar
144 <<
" calodep " << calodep
145 <<
" ecaldep " << etecal
146 <<
" hcaldep " << ethcal
147 <<
" eta " << cal->eta()
148 <<
" phi " << cal->phi();
154 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
155 <<
" >>> Calo deposit inside veto (no ECAL): deltar " << deltar
157 <<
" eta " << cal->eta()
158 <<
" phi " << cal->phi();
165 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
166 <<
" >>> Deposits belongs to other track: deltar, etecal, ethcal= "
167 << deltar <<
", " << etecal <<
", " << ethcal;
176 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
177 <<
" >>> Calo deposit (with ECAL): deltar " << deltar
178 <<
" calodep " << calodep
179 <<
" ecaldep " << etecal
180 <<
" hcaldep " << ethcal
181 <<
" eta " << cal->eta()
182 <<
" phi " << cal->phi();
187 LogDebug(
"Muon|RecoMuon|L2MuonIsolationProducer")
188 <<
" >>> Calo deposit (no ECAL): deltar " << deltar
190 <<
" eta " << cal->eta()
191 <<
" phi " << cal->phi();
201 double qoverp= muon.
qoverp();
202 double cur = bz*muon.
charge()/muon.
pt();
203 double phi0 = muon.
phi();
204 double dca = muon.
dxy();
206 double dz = muon.
dz();
219 if (fixVxy && fixVz) {
223 if (
pow(muon.
dxy(),2)<4*errd02) {
227 /errd02 * (cur/qoverp);
231 if (
pow(muon.
dsz(),2)<4*errdsz2) {
238 if (
pow(muon.
dxy(),2)<4*errd02) {
242 /errd02 * (cur/qoverp);
246 /errd02 * muon.
p()/muon.
pt();
251 if (
pow(muon.
dsz(),2)<4*errdsz2) {
257 /errdsz2 * (cur/qoverp);
264 double sphi0 =
sin(phi0);
265 double cphi0 =
cos(phi0);
267 double xsin = endpos.
x()*sphi0 - endpos.
y()*cphi0;
268 double xcos = endpos.
x()*cphi0 + endpos.
y()*sphi0;
269 double fcdca = fabs(1-cur*dca);
270 double phif = atan2( fcdca*sphi0-cur*endpos.
x()
271 , fcdca*cphi0+cur*endpos.
y());
272 double tphif2 =
tan(0.5*(phif-phi0));
273 double dcaf = dca + xsin + xcos*tphif2;
275 double x = endpos.
x() - dcaf*
sin(phif);
276 double y = endpos.
y() + dcaf*
cos(phif);
278 double deltas = (x-muon.
vx())*cphi0 + (y-muon.
vy())*sphi0;
280 if (deltaphi!=0) deltas = deltas*deltaphi/
sin(deltaphi);
283 double tantheta =
tan(theta);
285 z += deltas/
tan(theta);
296 if (fabs(eta)>1.479) noise = 0.15;
double qoverp() const
q/p
double p() const
momentum vector magnitude
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...
CovarianceMatrix covariance() const
return track covariance matrix
double eta() const
pseudorapidity of momentum vector
double pt() const
track transverse momentum
Cos< T >::type cos(const T &t)
Tan< T >::type tan(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
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...
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)
double vx() const
x coordinate of the reference point on track