ATLAS Offline Software
TrigMuonEFIdtpCommon.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "TrigMuonEFIdtpCommon.h"
7 
8 // --------------------------------------------------------------------------------
9 // --------------------------------------------------------------------------------
10 
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 }
32 
33 // --------------------------------------------------------------------------------
34 // --------------------------------------------------------------------------------
35 
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 }
45 
46 // --------------------------------------------------------------------------------
47 // --------------------------------------------------------------------------------
48 
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
xAODP4Helpers.h
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
TrigMuonEFIdtpCommon::qOverPMatching
float qOverPMatching(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
Definition: TrigMuonEFIdtpCommon.cxx:11
TrigMuonEFIdtpCommon.h
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
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TrigMuonEFIdtpCommon::matchingMetric
float matchingMetric(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
Definition: TrigMuonEFIdtpCommon.cxx:36
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .