ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
float theta() const
Returns the parameter, which has range 0 to .
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float charge() const
Returns the charge.
float matchingMetric(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
float qOverPMatching(const xAOD::TrackParticle *metrack, const xAOD::TrackParticle *idtrack)
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
TrackParticle_v1 TrackParticle
Reference the current persistent version: