|
ATLAS Offline Software
|
Go to the documentation of this file.
27 std::vector<double>&
he)
29 constexpr
double PTTOCURVATURE = -0.301;
32 he[1] = PTTOCURVATURE * trkP->
charge() / trkP->
pt();
34 if (trkP->
phi0() > 0.)
37 he[4] = TMath::TwoPi() + trkP->
phi0();
41 he[3] = trkP->
d0() +
c1 * pvtx->
y() -
s1 * pvtx->
x();
45 he[2] = trkP->
z0() -
c1 * pvtx->
x() -
s1 * pvtx->
y() + pvtx->
z();
57 declareInterface<DerivationFramework::IAugmentationTool>(
this);
62 "pTCut",
m_elepTCut = 9
e3,
"minimum pT for an electron to be studied");
64 m_idCut =
"DFCommonElectronsLHLoose",
65 "minimal quality for an electron to be studied");
68 "nSiCut",
m_nSiCut = 7,
"minimum number of Si hits in the other track");
70 "dzsinTCut",
m_dzCut = 0.5,
"max dz sinTheta between ele and other tracks");
76 "minimum radius to be classified as external conversion");
80 "maximal mass at vertex to be classified as external conversion");
83 "maximal mass at primary vertex to be classified as gamma*");
96 m_drv = baseName +
".DFCommonSimpleConvRadius";
97 m_dphiv = baseName +
".DFCommonSimpleConvPhi";
98 m_dmee = baseName +
".DFCommonSimpleMee";
99 m_dmeeVtx = baseName +
".DFCommonSimpleMeeAtVtx";
100 m_dsep = baseName +
".DFCommonSimpleSeparation";
101 m_dambi = baseName +
".DFCommonAddAmbiguity";
102 m_dtrv = baseName +
".DFCommonProdTrueRadius";
103 m_dtpv = baseName +
".DFCommonProdTruePhi";
104 m_dtzv = baseName +
".DFCommonProdTrueZ";
116 return StatusCode::SUCCESS;
121 : drv (
tool.m_drv, ctx),
122 dphiv (
tool.m_dphiv, ctx),
123 dmee (
tool.m_dmee, ctx),
124 dmeeVtx (
tool.m_dmeeVtx, ctx),
125 dsep (
tool.m_dsep, ctx),
126 dambi (
tool.m_dambi, ctx),
127 dtrv (
tool.m_dtrv, ctx),
128 dtpv (
tool.m_dtpv, ctx),
129 dtzv (
tool.m_dtzv, ctx)
136 const EventContext& ctx = Gaudi::Hive::currentContext();
147 for (
const auto*
vertex : *vtxC) {
163 return StatusCode::FAILURE;
166 ATH_MSG_DEBUG(
"No primary vertex found. Setting default values.");
169 dh.dphiv(*iele) = -1;
171 dh.dmeeVtx(*iele) = -1;
173 dh.dambi(*iele) = -1;
178 return StatusCode::SUCCESS;
189 std::set<const xAOD::TrackParticle*> alreadyStored;
190 std::set<const xAOD::TrackParticle*> eleIDtpStored, eleGSFtpStored;
192 std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(
195 for (
const auto* ele : *eleC) {
206 eleGSFtpStored.insert(eleGSFtp);
210 eleIDtpStored.insert(eleIDtp);
213 for (
const auto*
tp : *idtpC) {
217 closeByTracks->push_back(
tp);
218 alreadyStored.insert(
tp);
223 if (alreadyStored.find(
tp) != alreadyStored.end())
231 double dR = eleIDtp->
p4().DeltaR(
tp->p4());
232 double dz = std::abs(eleIDtp->
z0() -
tp->z0()) *
sin(eleIDtp->
theta());
233 if (dR >= 0.3 || dz >=
m_dzCut)
240 alreadyStored.insert(
tp);
242 closeByTracks->push_back(
tp);
246 if (closeByTracks->empty())
247 return StatusCode::SUCCESS;
255 << idtpC->
size() <<
" , number of selected close-by tracks "
256 << closeByTracks->size() <<
" , number of GSF tracks "
258 for (
const auto* trk : eleIDtpStored)
260 << trk <<
" pt = " << trk->pt() * 1
e-3
261 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
263 for (
const auto* trk : eleGSFtpStored)
265 << trk <<
" pt = " << trk->pt() * 1
e-3
266 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
270 << trk <<
" pt = " << trk->pt() * 1
e-3
271 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
275 for (
const auto* ele : *eleC) {
284 ATH_MSG_ERROR(
"Cannot decorate the electron with the simple info");
285 return StatusCode::FAILURE;
290 return StatusCode::SUCCESS;
315 <<
" phi = " << ele->
phi() <<
" GSF trk ptr = "
316 << eleGSFtrkP <<
" ID trk ptr " << eleIDtrkP);
321 double tpvr = -1, tpvp = 9e9, tpvz = 9e9;
323 truthEl->
prodVtx() !=
nullptr) {
328 dh.dtrv(*ele) = tpvr;
329 dh.dtpv(*ele) = tpvp;
330 dh.dtzv(*ele) = tpvz;
336 double detaMin = 9e9;
339 if (
tp->charge() * eletrkP->
charge() > 0)
343 double dR = eletrkP->
p4().DeltaR(
tp->p4());
344 double dz = std::abs(eletrkP->
z0() -
tp->z0()) *
sin(eletrkP->
theta());
345 if (dR >= 0.3 || dz >= m_dzCut)
348 double deta = std::abs(eletrkP->
eta() -
tp->eta());
349 if (deta < detaMin) {
358 double meeAtVtx = -1.;
360 bool goodConv =
false;
366 ep4.SetPtEtaPhiM(eletrkP->
pt(), eletrkP->
eta(), eletrkP->
phi(), 0.511);
370 op4.SetPtEtaPhiM(otrkP->
pt(), otrkP->
eta(), otrkP->
phi(), 0.511);
373 mee = (ep4 + op4).M();
374 op4.SetPhi(eletrkP->
phi());
375 meeAtVtx = (ep4 + op4).M();
378 std::vector<double> helix1, helix2;
381 helix(eletrkP, pvtx, helix1);
382 helix(otrkP, pvtx, helix2);
385 if (helix1[4] < helix2[4])
386 beta = TMath::PiOver2() - helix1[4];
388 beta = TMath::PiOver2() - helix2[4];
390 double phi1(helix1[4] +
beta);
391 if (phi1 > TMath::TwoPi())
392 phi1 -= TMath::TwoPi();
394 phi1 += TMath::TwoPi();
396 double phi2(helix2[4] +
beta);
397 if (phi2 > TMath::TwoPi())
398 phi2 -= TMath::TwoPi();
400 phi2 += TMath::TwoPi();
403 double r1 = 1 / (2. * std::abs(helix1[1]));
408 double rcenter1(helix1[3] / charge1 + r1);
409 double phicenter1(phi1 + TMath::PiOver2() * charge1);
411 double x1 = rcenter1 *
cos(phicenter1);
412 double y1 = rcenter1 *
sin(phicenter1);
415 double r2 = 1 / (2. * std::abs(helix2[1]));
420 double rcenter2(helix2[3] / charge2 + r2);
421 double phicenter2(phi2 + TMath::PiOver2() * charge2);
423 double x2 = rcenter2 *
cos(phicenter2);
424 double y2 = rcenter2 *
sin(phicenter2);
428 if (dx < 1e-9 && dx > 0.)
430 if (
dx > -1
e-9 &&
dx < 0.)
432 double slope((
y1 -
y2) /
dx);
433 double b(
y1 - slope *
x1);
437 double separation =
d - r1 - r2;
447 double temp1 = (cpx1 + cpx2) / 2;
448 double temp2 = slope * temp1 +
b;
452 double dct(helix1[0] - helix2[0]);
455 if (std::abs(separation) < m_sepCut && std::abs(dct) < m_dctCut) {
458 pv = std::atan2(convY, convX);
459 rv = sqrt(convX * convX + convY * convY);
460 if (convX *
cos(eletrkP->
phi()) + convY *
sin(eletrkP->
phi()) < 0)
469 dh.dmeeVtx(*ele) = meeAtVtx;
471 if (goodConv &&
rv > m_rvECCut && meeAtVtx < m_meeAtVtxECCut)
474 if (mee < m_meeICCut)
479 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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float z0() const
Returns the parameter.
bool msgLvl(const MSG::Level lvl) const
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.
const std::string & key() const
Return the StoreGate ID for the referenced object.
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 .)