 |
ATLAS Offline Software
|
Go to the documentation of this file.
21 std::vector<double>&
he)
23 constexpr
double PTTOCURVATURE = -0.301;
26 he[1] = PTTOCURVATURE * trkP->
charge() / trkP->
pt();
28 if (trkP->
phi0() > 0.)
31 he[4] = TMath::TwoPi() + trkP->
phi0();
35 he[3] = trkP->
d0() +
c1 * pvtx->
y() -
s1 * pvtx->
x();
39 he[2] = trkP->
z0() -
c1 * pvtx->
x() -
s1 * pvtx->
y() + pvtx->
z();
65 return StatusCode::SUCCESS;
70 : drv (
tool.m_drv, ctx),
71 dphiv (
tool.m_dphiv, ctx),
72 dmee (
tool.m_dmee, ctx),
73 dmeeVtx (
tool.m_dmeeVtx, ctx),
74 dsep (
tool.m_dsep, ctx),
75 dambi (
tool.m_dambi, ctx),
76 dtrv (
tool.m_dtrv, ctx),
77 dtpv (
tool.m_dtpv, ctx),
78 dtzv (
tool.m_dtzv, ctx)
95 for (
const auto*
vertex : *vtxC) {
111 return StatusCode::FAILURE;
114 ATH_MSG_DEBUG(
"No primary vertex found. Setting default values.");
117 dh.dphiv(*iele) = -1;
119 dh.dmeeVtx(*iele) = -1;
121 dh.dambi(*iele) = -1;
126 return StatusCode::SUCCESS;
137 std::set<const xAOD::TrackParticle*> alreadyStored;
138 std::set<const xAOD::TrackParticle*> eleIDtpStored, eleGSFtpStored;
140 std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(
143 for (
const auto* ele : *eleC) {
154 eleGSFtpStored.insert(eleGSFtp);
158 eleIDtpStored.insert(eleIDtp);
161 for (
const auto*
tp : *idtpC) {
165 closeByTracks->push_back(
tp);
166 alreadyStored.insert(
tp);
171 if (alreadyStored.find(
tp) != alreadyStored.end())
179 double dR = eleIDtp->
p4().DeltaR(
tp->p4());
180 double dz = std::abs(eleIDtp->
z0() -
tp->z0()) *
sin(eleIDtp->
theta());
181 if (dR >= 0.3 || dz >=
m_dzCut)
188 alreadyStored.insert(
tp);
190 closeByTracks->push_back(
tp);
194 if (closeByTracks->empty())
195 return StatusCode::SUCCESS;
203 << idtpC->
size() <<
" , number of selected close-by tracks "
204 << closeByTracks->size() <<
" , number of GSF tracks "
206 for (
const auto* trk : eleIDtpStored)
208 << trk <<
" pt = " << trk->pt() * 1
e-3
209 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
211 for (
const auto* trk : eleGSFtpStored)
213 << trk <<
" pt = " << trk->pt() * 1
e-3
214 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
218 << trk <<
" pt = " << trk->pt() * 1
e-3
219 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
223 for (
const auto* ele : *eleC) {
232 ATH_MSG_ERROR(
"Cannot decorate the electron with the simple info");
233 return StatusCode::FAILURE;
238 return StatusCode::SUCCESS;
263 <<
" phi = " << ele->
phi() <<
" GSF trk ptr = "
264 << eleGSFtrkP <<
" ID trk ptr " << eleIDtrkP);
269 double tpvr = -1, tpvp = 9e9, tpvz = 9e9;
271 truthEl->
prodVtx() !=
nullptr) {
276 dh.dtrv(*ele) = tpvr;
277 dh.dtpv(*ele) = tpvp;
278 dh.dtzv(*ele) = tpvz;
284 double detaMin = 9e9;
287 if (
tp->charge() * eletrkP->
charge() > 0)
291 double dR = eletrkP->
p4().DeltaR(
tp->p4());
292 double dz = std::abs(eletrkP->
z0() -
tp->z0()) *
sin(eletrkP->
theta());
293 if (dR >= 0.3 || dz >= m_dzCut)
296 double deta = std::abs(eletrkP->
eta() -
tp->eta());
297 if (deta < detaMin) {
306 double meeAtVtx = -1.;
308 bool goodConv =
false;
321 mee = (ep4 + op4).M();
322 op4.SetPhi(eletrkP->
phi());
323 meeAtVtx = (ep4 + op4).M();
326 std::vector<double> helix1, helix2;
329 helix(eletrkP, pvtx, helix1);
330 helix(otrkP, pvtx, helix2);
333 if (helix1[4] < helix2[4])
334 beta = TMath::PiOver2() - helix1[4];
336 beta = TMath::PiOver2() - helix2[4];
338 double phi1(helix1[4] +
beta);
339 if (phi1 > TMath::TwoPi())
340 phi1 -= TMath::TwoPi();
342 phi1 += TMath::TwoPi();
344 double phi2(helix2[4] +
beta);
345 if (phi2 > TMath::TwoPi())
346 phi2 -= TMath::TwoPi();
348 phi2 += TMath::TwoPi();
351 double r1 = 1 / (2. * std::abs(helix1[1]));
356 double rcenter1(helix1[3] / charge1 + r1);
357 double phicenter1(phi1 + TMath::PiOver2() * charge1);
359 double x1 = rcenter1 *
cos(phicenter1);
360 double y1 = rcenter1 *
sin(phicenter1);
363 double r2 = 1 / (2. * std::abs(helix2[1]));
368 double rcenter2(helix2[3] / charge2 + r2);
369 double phicenter2(phi2 + TMath::PiOver2() * charge2);
371 double x2 = rcenter2 *
cos(phicenter2);
372 double y2 = rcenter2 *
sin(phicenter2);
376 if (dx < 1e-9 && dx > 0.)
378 if (
dx > -1
e-9 &&
dx < 0.)
380 double slope((
y1 -
y2) /
dx);
381 double b(
y1 - slope *
x1);
385 double separation =
d - r1 - r2;
395 double temp1 = (cpx1 + cpx2) / 2;
396 double temp2 = slope * temp1 +
b;
400 double dct(helix1[0] - helix2[0]);
403 if (std::abs(separation) < m_sepCut && std::abs(dct) < m_dctCut) {
406 pv = std::atan2(convY, convX);
407 rv = sqrt(convX * convX + convY * convY);
408 if (convX *
cos(eletrkP->
phi()) + convY *
sin(eletrkP->
phi()) < 0)
417 dh.dmeeVtx(*ele) = meeAtVtx;
419 if (goodConv &&
rv > m_rvECCut && meeAtVtx < m_meeAtVtxECCut)
422 if (mee < m_meeICCut)
427 return StatusCode::SUCCESS;
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float x() const
Returns the x position.
float phi() const
Vertex azimuthal angle.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
float charge() const
Returns the charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float z0() const
Returns the parameter.
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Helper class to provide constant type-safe access to aux data.
float d0() const
Returns the parameter.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
::StatusCode StatusCode
StatusCode definition for legacy code.
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Class describing a truth particle in the MC record.
float perp() const
Vertex transverse distance from the beam line.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
float z() const
Returns the z position.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
float phi0() const
Returns the parameter, which has range to .
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
const double he
same in ev
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class describing a Vertex.
DataVector adapter that acts like it holds const pointers.
float z() const
Vertex longitudinal distance along the beam line form the origin.
float y() const
Returns the y position.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Class describing a TrackParticle.
float theta() const
Returns the parameter, which has range 0 to .
size_type size() const noexcept
Returns the number of elements in the collection.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
constexpr double electronMassInMeV
the mass of the electron (in MeV)