 |
ATLAS Offline Software
|
#include <EGElectronAmbiguityTool.h>
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_containerName |
|
SG::ReadHandleKey< xAOD::VertexContainer > | m_VtxContainerName |
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_tpContainerName |
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_tpCName |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_drv { this, "DFCommonSimpleConvRadius", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dphiv { this, "DFCommonSimpleConvPhi", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dmee { this, "DFCommonSimpleMee", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dmeeVtx { this, "DFCommonSimpleMeeAtVtx", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dsep { this, "DFCommonSimpleSeparation", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dambi { this, "DFCommonAddAmbiguity", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtrv { this, "DFCommonProdTrueRadius", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtpv { this, "DFCommonProdTruePhi", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtzv { this, "DFCommonProdTrueZ", "", "" } |
|
bool | m_isMC {} |
|
double | m_elepTCut |
|
std::string | m_idCut |
|
unsigned int | m_nSiCut |
|
double | m_dctCut |
|
double | m_sepCut |
|
double | m_dzCut |
|
double | m_rvECCut |
|
double | m_meeAtVtxECCut |
|
double | m_meeICCut |
|
Definition at line 33 of file EGElectronAmbiguityTool.h.
◆ EGElectronAmbiguityTool()
DerivationFramework::EGElectronAmbiguityTool::EGElectronAmbiguityTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 52 of file EGElectronAmbiguityTool.cxx.
58 declareProperty(
"isMC",
m_isMC);
61 "pTCut",
m_elepTCut = 9
e3,
"minimum pT for an electron to be studied");
62 declareProperty(
"idCut",
63 m_idCut =
"DFCommonElectronsLHLoose",
64 "minimal quality for an electron to be studied");
67 "nSiCut",
m_nSiCut = 7,
"minimum number of Si hits in the other track");
69 "dzsinTCut",
m_dzCut = 0.5,
"max dz sinTheta between ele and other tracks");
70 declareProperty(
"SeparationCut",
m_sepCut = 1.,
"first separation cut");
71 declareProperty(
"DCTCut",
m_dctCut = 0.02,
"second separation cut");
73 declareProperty(
"radiusCut",
75 "minimum radius to be classified as external conversion");
79 "maximal mass at vertex to be classified as external conversion");
80 declareProperty(
"meeCut",
82 "maximal mass at primary vertex to be classified as gamma*");
◆ addBranches()
StatusCode DerivationFramework::EGElectronAmbiguityTool::addBranches |
( |
| ) |
const |
|
finaloverridevirtual |
Definition at line 133 of file EGElectronAmbiguityTool.cxx.
135 const EventContext& ctx = Gaudi::Hive::currentContext();
146 for (
const auto*
vertex : *vtxC) {
162 return StatusCode::FAILURE;
165 ATH_MSG_DEBUG(
"No primary vertex found. Setting default values.");
168 dh.dphiv(*iele) = -1;
170 dh.dmeeVtx(*iele) = -1;
172 dh.dambi(*iele) = -1;
177 return StatusCode::SUCCESS;
179 ATH_MSG_DEBUG(
"Pvx z = " << pvtx->z() <<
", number of electrons "
188 std::set<const xAOD::TrackParticle*> alreadyStored;
189 std::set<const xAOD::TrackParticle*> eleIDtpStored, eleGSFtpStored;
191 std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(
194 for (
const auto* ele : *eleC) {
200 m_idCut.empty() || !aidCut.isAvailable(*ele) || !aidCut(*ele))
205 eleGSFtpStored.insert(eleGSFtp);
209 eleIDtpStored.insert(eleIDtp);
212 for (
const auto*
tp : *idtpC) {
216 closeByTracks->push_back(
tp);
217 alreadyStored.insert(
tp);
222 if (alreadyStored.find(
tp) != alreadyStored.end())
230 double dR = eleIDtp->
p4().DeltaR(
tp->p4());
231 double dz = std::abs(eleIDtp->
z0() -
tp->z0()) *
sin(eleIDtp->
theta());
232 if (dR >= 0.3 || dz >=
m_dzCut)
239 alreadyStored.insert(
tp);
241 closeByTracks->push_back(
tp);
245 if (closeByTracks->empty())
246 return StatusCode::SUCCESS;
254 << idtpC->size() <<
" , number of selected close-by tracks "
255 << closeByTracks->size() <<
" , number of GSF tracks "
257 for (
const auto* trk : eleIDtpStored)
259 << trk <<
" pt = " << trk->pt() * 1
e-3
260 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
262 for (
const auto* trk : eleGSFtpStored)
264 << trk <<
" pt = " << trk->pt() * 1
e-3
265 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
269 << trk <<
" pt = " << trk->pt() * 1
e-3
270 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
274 for (
const auto* ele : *eleC) {
278 m_idCut.empty() || !aidCut.isAvailable(*ele) || !aidCut(*ele))
283 ATH_MSG_ERROR(
"Cannot decorate the electron with the simple info");
284 return StatusCode::FAILURE;
289 return StatusCode::SUCCESS;
◆ decorateSimple()
HelixToCircle Main Track Electron
HelixToCircle Other Electron Conv Track
Definition at line 294 of file EGElectronAmbiguityTool.cxx.
314 <<
" phi = " << ele->
phi() <<
" GSF trk ptr = "
315 << eleGSFtrkP <<
" ID trk ptr " << eleIDtrkP);
320 double tpvr = -1, tpvp = 9e9, tpvz = 9e9;
322 truthEl->
prodVtx() !=
nullptr) {
327 dh.dtrv(*ele) = tpvr;
328 dh.dtpv(*ele) = tpvp;
329 dh.dtzv(*ele) = tpvz;
335 double detaMin = 9e9;
338 if (
tp->charge() * eletrkP->
charge() > 0)
342 double dR = eletrkP->
p4().DeltaR(
tp->p4());
343 double dz = std::abs(eletrkP->
z0() -
tp->z0()) *
sin(eletrkP->
theta());
344 if (dR >= 0.3 || dz >=
m_dzCut)
347 double deta = std::abs(eletrkP->
eta() -
tp->eta());
348 if (deta < detaMin) {
357 double meeAtVtx = -1.;
359 bool goodConv =
false;
365 ep4.SetPtEtaPhiM(eletrkP->
pt(), eletrkP->
eta(), eletrkP->
phi(), 0.511);
369 op4.SetPtEtaPhiM(otrkP->pt(), otrkP->eta(), otrkP->phi(), 0.511);
372 mee = (ep4 + op4).M();
373 op4.SetPhi(eletrkP->
phi());
374 meeAtVtx = (ep4 + op4).M();
377 std::vector<double> helix1, helix2;
380 helix(eletrkP, pvtx, helix1);
381 helix(otrkP, pvtx, helix2);
384 if (helix1[4] < helix2[4])
385 beta = TMath::PiOver2() - helix1[4];
387 beta = TMath::PiOver2() - helix2[4];
389 double phi1(helix1[4] +
beta);
390 if (phi1 > TMath::TwoPi())
391 phi1 -= TMath::TwoPi();
393 phi1 += TMath::TwoPi();
395 double phi2(helix2[4] +
beta);
396 if (phi2 > TMath::TwoPi())
397 phi2 -= TMath::TwoPi();
399 phi2 += TMath::TwoPi();
402 double r1 = 1 / (2. * std::abs(helix1[1]));
407 double rcenter1(helix1[3] / charge1 + r1);
408 double phicenter1(phi1 + TMath::PiOver2() * charge1);
410 double x1 = rcenter1 *
cos(phicenter1);
411 double y1 = rcenter1 *
sin(phicenter1);
414 double r2 = 1 / (2. * std::abs(helix2[1]));
419 double rcenter2(helix2[3] / charge2 + r2);
420 double phicenter2(phi2 + TMath::PiOver2() * charge2);
422 double x2 = rcenter2 *
cos(phicenter2);
423 double y2 = rcenter2 *
sin(phicenter2);
427 if (dx < 1e-9 && dx > 0.)
429 if (
dx > -1
e-9 &&
dx < 0.)
431 double slope((
y1 -
y2) /
dx);
432 double b(
y1 - slope *
x1);
436 double separation =
d -
r1 -
r2;
446 double temp1 = (cpx1 + cpx2) / 2;
447 double temp2 = slope * temp1 +
b;
451 double dct(helix1[0] - helix2[0]);
457 pv = std::atan2(convY, convX);
458 rv = sqrt(convX * convX + convY * convY);
459 if (convX *
cos(eletrkP->
phi()) + convY *
sin(eletrkP->
phi()) < 0)
468 dh.dmeeVtx(*ele) = meeAtVtx;
478 return StatusCode::SUCCESS;
◆ initialize()
StatusCode DerivationFramework::EGElectronAmbiguityTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 86 of file EGElectronAmbiguityTool.cxx.
95 m_drv = baseName +
".DFCommonSimpleConvRadius";
96 m_dphiv = baseName +
".DFCommonSimpleConvPhi";
97 m_dmee = baseName +
".DFCommonSimpleMee";
98 m_dmeeVtx = baseName +
".DFCommonSimpleMeeAtVtx";
99 m_dsep = baseName +
".DFCommonSimpleSeparation";
100 m_dambi = baseName +
".DFCommonAddAmbiguity";
101 m_dtrv = baseName +
".DFCommonProdTrueRadius";
102 m_dtpv = baseName +
".DFCommonProdTruePhi";
103 m_dtzv = baseName +
".DFCommonProdTrueZ";
115 return StatusCode::SUCCESS;
◆ DecorHandles
◆ m_containerName
Initial value:{
this,
"ContainerName",
"Electrons",
"SG key of electron container"
}
Definition at line 45 of file EGElectronAmbiguityTool.h.
◆ m_dambi
◆ m_dctCut
double DerivationFramework::EGElectronAmbiguityTool::m_dctCut |
|
private |
◆ m_dmee
◆ m_dmeeVtx
◆ m_dphiv
◆ m_drv
◆ m_dsep
◆ m_dtpv
◆ m_dtrv
◆ m_dtzv
◆ m_dzCut
double DerivationFramework::EGElectronAmbiguityTool::m_dzCut |
|
private |
◆ m_elepTCut
double DerivationFramework::EGElectronAmbiguityTool::m_elepTCut |
|
private |
◆ m_idCut
std::string DerivationFramework::EGElectronAmbiguityTool::m_idCut |
|
private |
◆ m_isMC
bool DerivationFramework::EGElectronAmbiguityTool::m_isMC {} |
|
private |
◆ m_meeAtVtxECCut
double DerivationFramework::EGElectronAmbiguityTool::m_meeAtVtxECCut |
|
private |
◆ m_meeICCut
double DerivationFramework::EGElectronAmbiguityTool::m_meeICCut |
|
private |
◆ m_nSiCut
unsigned int DerivationFramework::EGElectronAmbiguityTool::m_nSiCut |
|
private |
◆ m_rvECCut
double DerivationFramework::EGElectronAmbiguityTool::m_rvECCut |
|
private |
◆ m_sepCut
double DerivationFramework::EGElectronAmbiguityTool::m_sepCut |
|
private |
◆ m_tpCName
Initial value:{
this,
"tpCName",
"GSFTrackParticles",
"SG key of TrackParticleInputContainer"
}
Definition at line 64 of file EGElectronAmbiguityTool.h.
◆ m_tpContainerName
Initial value:{
this,
"tpContainerName",
"InDetTrackParticles",
"SG key of track particles container"
}
Definition at line 57 of file EGElectronAmbiguityTool.h.
◆ m_VtxContainerName
Initial value:{
this,
"VtxContainerName",
"PrimaryVertices",
"SG key of vertex container"
}
Definition at line 51 of file EGElectronAmbiguityTool.h.
The documentation for this class was generated from the following files:
virtual double pt() const override final
The transverse momentum ( ) of the particle.
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.
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
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.
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.
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
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.
float z() const
Vertex longitudinal distance along the beam line form the origin.
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.
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 .)