ATLAS Offline Software
Functions
TrigMuonEFIdtpCommon Namespace Reference

Functions

float qOverPMatching (const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
 
float matchingMetric (const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
 

Function Documentation

◆ matchingMetric()

float TrigMuonEFIdtpCommon::matchingMetric ( const xAOD::TrackParticle metrack,
const xAOD::TrackParticle idtrack 
)

Definition at line 36 of file TrigMuonEFIdtpCommon.cxx.

37 {
38  float qoverp = TrigMuonEFIdtpCommon::qOverPMatching(metrack,idtrack);
39  float dr = xAOD::P4Helpers::deltaR(idtrack,metrack);
40 
41  float metric = dr + std::abs(qoverp);
42 
43  return metric;
44 }

◆ qOverPMatching()

float TrigMuonEFIdtpCommon::qOverPMatching ( const xAOD::TrackParticle metrack,
const xAOD::TrackParticle idtrack 
)

Definition at line 11 of file TrigMuonEFIdtpCommon.cxx.

12 {
13  float qOverPsignif = -10;
14 
15  if( idtrack && metrack ) {
16  float mePt = metrack->pt();
17  float idPt = idtrack->pt();
18  float meSinTheta = sin(metrack->theta());
19  float idSinTheta = sin(idtrack->theta());
20  if( std::abs(meSinTheta) > 1e-5 && std::abs(idSinTheta) > 1e-5 ) {
21  float meP = mePt / meSinTheta;
22  float idP = idPt / idSinTheta;
23  float sigma = std::sqrt( idtrack->definingParametersCovMatrix()(4,4) + metrack->definingParametersCovMatrix()(4,4) );
24  if( std::abs(sigma) > 1e-5 ) {
25  qOverPsignif = std::abs( (metrack->charge() / meP) - (idtrack->charge() / idP) ) / sigma;
26  }
27  }
28  }
29 
30  return qOverPsignif;
31 }
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
TrigMuonEFIdtpCommon::qOverPMatching
float qOverPMatching(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
Definition: TrigMuonEFIdtpCommon.cxx:11
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .