ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::TrackingHelpers Namespace Reference

Functions

void checkTPAndDefiningParamCov (const xAOD::TrackParticle *tp)
void checkTPAndDefiningParamCovDiag (const xAOD::TrackParticle *tp)
double d0significance (const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
double sqr (double a)
 convenience method to calculate the square of a value.
double d0significance (const xAOD::TrackParticle *tp)
 Get the impact parameter significance of a track particle in the r-phi plane.
double d0significanceUnsafe (const xAOD::TrackParticle *tp)
 Unsafe version of d0significance.
double d0UncertaintyBeamSpot2 (double track_phi0, double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
 calculate the squared d0 uncertainty component due to the size of the beam spot.
double d0significance (const xAOD::TrackParticle *tp, double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
 Get the impact parameter significance of a track particle in the r-phi plane where the d0 uncertainty takes the finite beamspot width into account.
double d0significanceUnsafe (const xAOD::TrackParticle *tp, double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
 Unsafe version of d0significance with beam spot uncertainty.
double z0significance (const xAOD::TrackParticle *tp, const xAOD::Vertex *vx=NULL)
 Get the impact parameter significance of a track particle in the z direction.
double z0sinthetasignificance (const xAOD::TrackParticle *tp, const xAOD::Vertex *vx=NULL)
 Get the impact parameter significance of a track particle in the z direction, including the sin(theta) projection.
double z0significanceUnsafe (const xAOD::TrackParticle *tp)
 Unsafe version of z0significance.
double z0significanceUnsafe (const xAOD::TrackParticle *tp, const xAOD::Vertex *vx)
 Unsafe version of z0significance, which uses z0 relative to a given primary vertex.
bool hasValidCov (const xAOD::TrackParticle *tp)
 Check whether the given track particle is valid and has a covariance matrix of the defining parameters.
bool hasValidCovD0 (const xAOD::TrackParticle *tp)
 Check whether the given track particle is valid and has a valid d0 uncertainty.
bool hasValidCovZ0 (const xAOD::TrackParticle *tp)
 Check whether the given track particle is valid and has a valid z0 uncertainty.
bool hasValidCovD0andZ0 (const xAOD::TrackParticle *tp)
 Check whether the given track particle is valid and has a valid d0 and z0 uncertainty.
bool checkPVReference (const xAOD::TrackParticle *tp, const xAOD::Vertex *vx, const double max_pv_dxy_sqr=0.5 *0.5)
 test whether the given primary vertex has a significant displacement in r-phi wrt.
bool checkBeamSpotSigma (double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
 check that the beamspot covariance matrix is valid
double pTErr2 (const xAOD::TrackParticle *tp)
 compute the uncertainty of pt squared.
double pTErr (const xAOD::TrackParticle *tp)
 compute the uncertainty of pt.
double pTErr2Unsafe (const xAOD::TrackParticle *tp)
 compute the uncertainty of pt squared.
double pTErrUnsafe (const xAOD::TrackParticle *tp)
 compute the uncertainty of pt.
bool hasValidCovQoverP (const xAOD::TrackParticle *tp)
 return true if the covariance matrix of the defining parameters is set, has enough elements and the q/p is valid

Function Documentation

◆ checkBeamSpotSigma()

bool xAOD::TrackingHelpers::checkBeamSpotSigma ( double beam_sigma_x,
double beam_sigma_y,
double beam_sigma_xy )
inline

check that the beamspot covariance matrix is valid

Parameters
beam_sigma_xthe width of the beamspot in the x-direction e.g. IBeamCondSvc:: beamSigma(0).
beam_sigma_ythe width of the beamspot in the y-direction e.g. IBeamCondSvc:: beamSigma(1).
beam_sigma_xythe beamspot xy correlation e.g. IBeamCondSvc:: beamSigmaXY.
Returns
true if the beamspot covariance matrix is valid.

Definition at line 199 of file TrackParticlexAODHelpers.h.

199 {
200 return sqr(beam_sigma_x)+sqr(beam_sigma_y)>=2*std::abs(beam_sigma_xy);
201 }
#define sqr(t)

◆ checkPVReference()

bool xAOD::TrackingHelpers::checkPVReference ( const xAOD::TrackParticle * tp,
const xAOD::Vertex * vx,
const double max_pv_dxy_sqr = 0.5*0.5 )
inline

test whether the given primary vertex has a significant displacement in r-phi wrt.

d0 uncertainty.

Parameters
tppointer to a track particle.
vxpointer to a vertex.
max_pv_dxy_sqrmaximum deviation of the primary vertex in units of the d0 uncertainty squared.
Returns
true if the given primary vertex has no significant displacement in r-phi wrt. d0 uncertainty. The method will also return false if the track particle or vertex are invalid or if the track particle does not have a valid d0 uncertainty.

Definition at line 186 of file TrackParticlexAODHelpers.h.

186 {
187 if (hasValidCovD0(tp) && vx) {
188 return std::abs( sqr(vx->x())+ sqr(vx->y())) < max_pv_dxy_sqr * tp->definingParametersCovMatrixDiagVec()[0];
189 }
190 return false;
191 }
float y() const
Returns the y position.
float x() const
Returns the x position.
bool hasValidCovD0(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a valid d0 uncertainty.
double sqr(double a)
convenience method to calculate the square of a value.

◆ checkTPAndDefiningParamCov()

void xAOD::TrackingHelpers::checkTPAndDefiningParamCov ( const xAOD::TrackParticle * tp)

Definition at line 13 of file TrackParticlexAODHelpers.cxx.

13 {
14 if (!tp) {
15 throw std::runtime_error("Invalid TrackParticle pointer.");
16 }
17 SG::AuxElement::ConstAccessor< std::vector<float> > accDiag( "definingParametersCovMatrixDiag" );
18 SG::AuxElement::ConstAccessor< std::vector<float> > accOffDiag( "definingParametersCovMatrixOffDiag" );
19 if( !(accDiag.isAvailable( *tp ) && accOffDiag.isAvailable( *tp )) ) {
20 throw std::runtime_error("TrackParticle without covariance matrix for the defining parameters.");
21 }
22 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:569

◆ checkTPAndDefiningParamCovDiag()

void xAOD::TrackingHelpers::checkTPAndDefiningParamCovDiag ( const xAOD::TrackParticle * tp)

Definition at line 24 of file TrackParticlexAODHelpers.cxx.

24 {
25 if (!tp) {
26 throw std::runtime_error("Invalid TrackParticle pointer.");
27 }
28 SG::AuxElement::ConstAccessor< std::vector<float> > accDiag( "definingParametersCovMatrixDiag" );
29 if( !(accDiag.isAvailable( *tp )) ) {
30 throw std::runtime_error("TrackParticle without diagonal covariance matrix elements for the defining parameters.");
31 }
32 }

◆ d0significance() [1/3]

double xAOD::TrackingHelpers::d0significance ( const xAOD::TrackParticle * tp)

Get the impact parameter significance of a track particle in the r-phi plane.

Returns
the impact parameter significance of the track particle.
Exceptions
thismethod may throw an exception in case the uncertainty is zero or the covariance matrix does not exist. The impact parameter and uncertainty are those stored in the track particle. Will perform input (tp, cov) validity checks.

Definition at line 54 of file TrackParticlexAODHelpers.cxx.

54 {
55 return d0significance(tp,0.);
56 }
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)

◆ d0significance() [2/3]

double xAOD::TrackingHelpers::d0significance ( const xAOD::TrackParticle * tp,
double beam_sigma_x,
double beam_sigma_y,
double beam_sigma_xy )

Get the impact parameter significance of a track particle in the r-phi plane where the d0 uncertainty takes the finite beamspot width into account.

Parameters
beam_sigma_xthe width of the beamspot in the x-direction e.g. IBeamCondSvc:: beamSigma(0).
beam_sigma_ythe width of the beamspot in the y-direction e.g. IBeamCondSvc:: beamSigma(1).
beam_sigma_xythe beamspot xy correlation e.g. IBeamCondSvc:: beamSigmaXY.
Returns
the impact parameter significance of the track particle where the d0 uncertainty takes the finite beamspot width into account.
Exceptions
thismethod may throw an exception in case the uncertainty is zero or the covariance matrix does not exist or the beamspot covariance matrix is invalid. The impact parameter and uncertainty are those stored in the track particle. Will perform input (tp, cov) validity checks.

Definition at line 58 of file TrackParticlexAODHelpers.cxx.

58 {
59 if (!checkBeamSpotSigma(beam_sigma_x, beam_sigma_y, beam_sigma_xy)) {
60 throw std::runtime_error("Beamspot covariance matrix is invalid.");
61 }
62 return d0significance(tp,d0UncertaintyBeamSpot2(tp->phi(),beam_sigma_x, beam_sigma_y, beam_sigma_xy));
63 }
double d0UncertaintyBeamSpot2(double track_phi0, double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
calculate the squared d0 uncertainty component due to the size of the beam spot.
bool checkBeamSpotSigma(double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
check that the beamspot covariance matrix is valid

◆ d0significance() [3/3]

double xAOD::TrackingHelpers::d0significance ( const xAOD::TrackParticle * tp,
double d0_uncert_beam_spot_2 )
inline

Definition at line 42 of file TrackParticlexAODHelpers.cxx.

42 {
44 double d0 = tp->d0();
45 // elements in definingParametersCovMatrixDiagVec should be : sigma_d0^2, sigma_z0^2
46 double sigma_d0 = tp->definingParametersCovMatrixDiagVec().at(0);
47 if (sigma_d0<=0.) {
48 throw std::runtime_error("TrackParticle with zero or negative d0 uncertainty.");
49 }
50 return d0/sqrt(sigma_d0+d0_uncert_beam_spot_2);
51 }
void checkTPAndDefiningParamCovDiag(const xAOD::TrackParticle *tp)

◆ d0significanceUnsafe() [1/2]

double xAOD::TrackingHelpers::d0significanceUnsafe ( const xAOD::TrackParticle * tp)
inline

Unsafe version of d0significance.

Returns
the impact parameter significance of the track particle or an undefined value In case the covariance matrix does not exist or the uncertainty is zero, this method will return an undefined value. In case the track particle does not exist the behaviour is undefined (segmentation fault or random return value). To validated the inputs use hasValidCovD0, hasValidCovD0andZ0, or checkPVReference.

Definition at line 35 of file TrackParticlexAODHelpers.h.

35 {
36 double d0 = tp->d0();
37 // elements in definingParametersCovMatrixDiagVec should be : sigma_d0^2, sigma_z0^2
38 double sigma_d0 = std::sqrt( tp->definingParametersCovMatrixDiagVec()[0] );
39 return d0/sigma_d0;
40 }

◆ d0significanceUnsafe() [2/2]

double xAOD::TrackingHelpers::d0significanceUnsafe ( const xAOD::TrackParticle * tp,
double beam_sigma_x,
double beam_sigma_y,
double beam_sigma_xy )
inline

Unsafe version of d0significance with beam spot uncertainty.

Parameters
tppointer to a track particle.
beam_sigma_xthe width of the beamspot in the x-direction e.g. IBeamCondSvc:: beamSigma(0).
beam_sigma_ythe width of the beamspot in the y-direction e.g. IBeamCondSvc:: beamSigma(1).
beam_sigma_xythe beamspot xy correlation e.g. IBeamCondSvc:: beamSigmaXY.
Returns
the impact parameter significance of the track particle where the d0 uncertainty takes the finite beamspot width into account, or an undefined value In case the covariance matrix does not exist or the uncertainty is zero, this method will return an undefined value. In case the track particle does not exist the behaviour is undefined (segmentation fault or random return value). To validated the inputs use hasValidCovD0, hasValidCovD0andZ0, or checkPVReference or checkBeamSpotSigma.

Definition at line 80 of file TrackParticlexAODHelpers.h.

80 {
81 double d0 = tp->d0();
82 double sigma_d0 = std::sqrt( tp->definingParametersCovMatrixDiagVec()[0] + d0UncertaintyBeamSpot2(tp->phi(),beam_sigma_x, beam_sigma_y, beam_sigma_xy) );
83 return d0/sigma_d0;
84 }

◆ d0UncertaintyBeamSpot2()

double xAOD::TrackingHelpers::d0UncertaintyBeamSpot2 ( double track_phi0,
double beam_sigma_x,
double beam_sigma_y,
double beam_sigma_xy )
inline

calculate the squared d0 uncertainty component due to the size of the beam spot.

Parameters
track_phi0the phi angle of the track particle at the perigee wrt. the average beamspot position.
beam_sigma_xthe width of the beamspot in the x-direction e.g. IBeamCondSvc:: beamSigma(0).
beam_sigma_ythe width of the beamspot in the y-direction e.g. IBeamCondSvc:: beamSigma(1).
beam_sigma_xythe beamspot xy correlation e.g. IBeamCondSvc:: beamSigmaXY.
Returns
the squared d0 uncertainty component due to the size of the beam spot.

Definition at line 49 of file TrackParticlexAODHelpers.h.

49 {
50 double sin_phi = sin(track_phi0);
51 double cos_phi = cos(track_phi0);
52 double d0_uncert2= sin_phi * ( sin_phi * sqr(beam_sigma_x)
53 -cos_phi * beam_sigma_xy)
54 +cos_phi * ( cos_phi * sqr(beam_sigma_y)
55 -sin_phi * beam_sigma_xy);
56 return d0_uncert2;
57 }

◆ hasValidCov()

bool xAOD::TrackingHelpers::hasValidCov ( const xAOD::TrackParticle * tp)

Check whether the given track particle is valid and has a covariance matrix of the defining parameters.

Returns
true if the track particle is valid and has a covariance matrix of the defining parameters.

Definition at line 35 of file TrackParticlexAODHelpers.cxx.

35 {
36 if (!tp) return false;
37 if( tp->definingParametersCovMatrixFilled() != xAOD::FullCovMatrixAvailable ) return false;
38 return true;
39 }
static const xAOD::ParametersCovMatrixFilled_t FullCovMatrixAvailable
Object representing a fully available covariance matrix.

◆ hasValidCovD0()

bool xAOD::TrackingHelpers::hasValidCovD0 ( const xAOD::TrackParticle * tp)
inline

Check whether the given track particle is valid and has a valid d0 uncertainty.

Returns
true if the track particle is valid, has a covariance matrix, and a valid d0 uncertainty.

Definition at line 143 of file TrackParticlexAODHelpers.h.

143 {
144 if (hasValidCov(tp)) {
145 if (tp->definingParametersCovMatrixDiagVec()[0]>0.) {
146 return true;
147 }
148 }
149 return false;
150 }
bool hasValidCov(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a covariance matrix of the defining parameter...

◆ hasValidCovD0andZ0()

bool xAOD::TrackingHelpers::hasValidCovD0andZ0 ( const xAOD::TrackParticle * tp)
inline

Check whether the given track particle is valid and has a valid d0 and z0 uncertainty.

Returns
true if the track particle is valid, has a covariance matrix, and a valid d0 and z0 uncertainty.

Definition at line 167 of file TrackParticlexAODHelpers.h.

167 {
168 if (hasValidCov(tp)) {
169 if ( ( tp->definingParametersCovMatrixDiagVec()[0] > 0. )
170 && ( tp->definingParametersCovMatrixDiagVec()[1] > 0. ) ) {
171 return true;
172 }
173 }
174 return false;
175 }

◆ hasValidCovQoverP()

bool xAOD::TrackingHelpers::hasValidCovQoverP ( const xAOD::TrackParticle * tp)
inline

return true if the covariance matrix of the defining parameters is set, has enough elements and the q/p is valid

Todo
also check theta ?

Definition at line 272 of file TrackParticlexAODHelpers.h.

272 {
273 if (hasValidCov(tp)) {
274 if (std::abs(tp->qOverP())>0.) {
275 return true;
276 }
277 }
278 return false;
279 }

◆ hasValidCovZ0()

bool xAOD::TrackingHelpers::hasValidCovZ0 ( const xAOD::TrackParticle * tp)
inline

Check whether the given track particle is valid and has a valid z0 uncertainty.

Returns
true if the track particle is valid, has a covariance matrix, and a valid z0 uncertainty.

Definition at line 155 of file TrackParticlexAODHelpers.h.

155 {
156 if (hasValidCov(tp)) {
157 if ( tp->definingParametersCovMatrixDiagVec()[1] > 0. ) {
158 return true;
159 }
160 }
161 return false;
162 }

◆ pTErr()

double xAOD::TrackingHelpers::pTErr ( const xAOD::TrackParticle * tp)
inline

compute the uncertainty of pt.

Parameters
tpa pointer to a track particle.
Exceptions
willthrow an exception if the track particle is not valid, no covariance matrix of the defining parameters is set or the covariance matrix has wrong dimension.

Definition at line 212 of file TrackParticlexAODHelpers.h.

212 {
213 return sqrt( pTErr2(tp) );
214 }
double pTErr2(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.

◆ pTErr2()

double xAOD::TrackingHelpers::pTErr2 ( const xAOD::TrackParticle * tp)

compute the uncertainty of pt squared.

Parameters
tpa pointer to a track particle.
Exceptions
willthrow an exception if the track particle is not valid, no covariance matrix of the defining parameters is set or the covariance matrix has wrong dimension.

Definition at line 100 of file TrackParticlexAODHelpers.cxx.

100 {
102 if (!hasValidCovQoverP(tp)) {
103 throw std::runtime_error("TrackParticle without covariance matrix for defining parameters or the covariance matrix is wrong dimensionality.");
104 }
105 if (std::abs(tp->qOverP())<0) {
106 throw std::runtime_error("q/p is zero");
107 }
108 return pTErr2Unsafe(tp);
109 }
bool hasValidCovQoverP(const xAOD::TrackParticle *tp)
return true if the covariance matrix of the defining parameters is set, has enough elements and the q...
void checkTPAndDefiningParamCov(const xAOD::TrackParticle *tp)
double pTErr2Unsafe(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.

◆ pTErr2Unsafe()

double xAOD::TrackingHelpers::pTErr2Unsafe ( const xAOD::TrackParticle * tp)
inline

compute the uncertainty of pt squared.

Parameters
tpa valid pointer to a track particle for which the defining parameters covariance matrix is set and valid undefined behaviour if tp is invalid or no valid covariance matrix is set for the defining parameters.

Definition at line 221 of file TrackParticlexAODHelpers.h.

221 {
222
223 // / d \2 / d \2 d d
224 // pt_err^2 =| ------ (pt) *sigma_q/p | + | -------- pt * sigma_theta | + ----- pt ------- pt * sigma_theta_qp
225 // \ d q/p / \ d theta / d qp d theta
226
227 // d / d pt 2 d pt \ / d pt \2
228 // = ------ (pt) * | ----- sigma_q/p + ------- * sigma_theta_qp | + | ------- * sigma_theta |
229 // d q/p \ d q/p d theta / \ d theta /
230
231 // d pt
232 // ------ pt = - -------------
233 // d q/p fabs(qOverP)
234
235 // d pt
236 // ------- pt = -----------
237 // d theta tan(theta)
238
239 double pt = tp->pt();
240 double diff_qp = - pt / std::abs(tp->qOverP());
241
242 double diff_theta = pt / tan( tp->theta() );
243
244 // since 1/tan (thata) defined for all floats 0..M_PI, don't have to protect :
245 //
246 // double diff_theta = ( std::abs(tp->theta()-M_PI_2) > std::numeric_limits<float>::epsilon() * 2
247 // ? pt / tan( tp->theta() )
248 // : 0 )
249
250 auto cov = tp->definingParametersCovMatrix();
251 // elements in definingParametersCovMatrix should be : 0: sigma_d0^2,
252 // 1: sigma_d0_z0, sigma_z0^2,
253 // 3: sigma_d0_phi, sigma_z0_phi, sigma_phi^2
254 // 6: sigma_d0_th, sigma_z0_th, sigma_phi_th, sigma_th^2
255 // 10: sigma_d0_qp, sigma_z0_qp, sigma_phi_qp, sigma_th_qp, sigma_qp^2
256
257 double pt_err2 = diff_qp * (diff_qp * cov(4, 4) + diff_theta * cov(3, 4) ) + sqr(diff_theta) * cov(3, 3);
258 return pt_err2;
259 }
setRcore setEtHad setFside pt

◆ pTErrUnsafe()

double xAOD::TrackingHelpers::pTErrUnsafe ( const xAOD::TrackParticle * tp)
inline

compute the uncertainty of pt.

Parameters
tpa valid pointer to a track particle for which the defining parameters covariance matrix is set and valid undefined behaviour if tp is invalid or no valid covariance matrix is set for the defining parameters.

Definition at line 265 of file TrackParticlexAODHelpers.h.

265 {
266 return sqrt(pTErr2Unsafe(tp));
267 }

◆ sqr()

double xAOD::TrackingHelpers::sqr ( double a)
inline

convenience method to calculate the square of a value.

Definition at line 21 of file TrackParticlexAODHelpers.h.

21{ return a*a; }
static Double_t a

◆ z0significance()

double xAOD::TrackingHelpers::z0significance ( const xAOD::TrackParticle * tp,
const xAOD::Vertex * vx = NULL )

Get the impact parameter significance of a track particle in the z direction.

Parameters
tpa pointer to a track particle.
vxa pointer to a primary vertex with respect to which z0 is expressed or NULL.
Returns
the impact parameter significance of the track particle.
Exceptions
thismethod may throw an exception in case the uncertainty is zero or the covariance matrix does not exist. The impact parameter and uncertainty are those stored in the track particle. Will perform input (tp, cov) validity checks. If the given vertex results from a fit which includes the track particle tp, then this z0 impact parameter significance will be biased.

Definition at line 65 of file TrackParticlexAODHelpers.cxx.

65 {
67 double z0 = tp->z0() + tp->vz();
68 if (vx) {
69 if (!checkPVReference(tp,vx)) {
70 throw std::runtime_error("Given primary vertex does not fulfil the requirements i.e. does not exist, or is too far away from the beam axis.");
71 }
72 z0 -= vx->z();
73 }
74 // elements in definingParametersCovMatrixVec should be : sigma_d0^2, sigma_z0^2
75 double sigma_z0 = tp->definingParametersCovMatrixDiagVec().at(1);
76 if (sigma_z0<=0.) {
77 throw std::runtime_error("TrackParticle with zero or negative z0 uncertainty.");
78 }
79 return z0/sqrt(sigma_z0);
80 }
float z() const
Returns the z position.
bool checkPVReference(const xAOD::TrackParticle *tp, const xAOD::Vertex *vx, const double max_pv_dxy_sqr=0.5 *0.5)
test whether the given primary vertex has a significant displacement in r-phi wrt.

◆ z0significanceUnsafe() [1/2]

double xAOD::TrackingHelpers::z0significanceUnsafe ( const xAOD::TrackParticle * tp)
inline

Unsafe version of z0significance.

Returns
the impact parameter significance of the track particle or an undefined value In case the covariance matrix does not exist or the uncertainty is zero or smaller, this method will return an undefined value. In case the track particle does not exist the behaviour is undefined (segmentation fault or random return value).

Definition at line 111 of file TrackParticlexAODHelpers.h.

111 {
112 double z0 = tp->z0() + tp->vz();
113 double sigma_z0 = std::sqrt( tp->definingParametersCovMatrixDiagVec()[1] );
114 return z0/sigma_z0;
115 }

◆ z0significanceUnsafe() [2/2]

double xAOD::TrackingHelpers::z0significanceUnsafe ( const xAOD::TrackParticle * tp,
const xAOD::Vertex * vx )
inline

Unsafe version of z0significance, which uses z0 relative to a given primary vertex.

Parameters
tpa valid pointer to a track particle.
vxa valid pointer to a primary vertex with respect to which z0 is expressed.
Returns
the impact parameter significance of the track particle or an undefined value In case the covariance matrix does not exist or the uncertainty is zero or smaller, this method will return an undefined value. In case the track particle or vertex does not exist the behaviour is undefined (segmentation fault or random return value). To validated the inputs use hasValidCovZ0 or hasValidCovD0andZ0, and checkPVReference. If the given vertex results from a fit which includes the track particle tp, this z0 impact parameter significance will be biased.

Definition at line 127 of file TrackParticlexAODHelpers.h.

127 {
128 // use z0 relative to the given primary vertex.
129 double z0 = tp->z0() + tp->vz() - vx->z();
130
131 double sigma_z0 = std::sqrt( tp->definingParametersCovMatrixDiagVec()[1] );
132 return z0/sigma_z0;
133 }

◆ z0sinthetasignificance()

double xAOD::TrackingHelpers::z0sinthetasignificance ( const xAOD::TrackParticle * tp,
const xAOD::Vertex * vx = NULL )

Get the impact parameter significance of a track particle in the z direction, including the sin(theta) projection.

Parameters
tpa pointer to a track particle.
vxa pointer to a primary vertex with respect to which z0 is expressed or NULL.
Returns
the z0*sin(theta) IP significance of the track particle.
Exceptions
thismethod may throw an exception in case the uncertainty is zero or the covariance matrix does not exist. The impact parameter and uncertainty are those stored in the track particle. Will perform input (tp, cov) validity checks. If the given vertex results from a fit which includes the track particle tp, then this z0*(sintheta) impact parameter significance will be biased.

Definition at line 82 of file TrackParticlexAODHelpers.cxx.

82 {
84 double z0 = tp->z0() + tp->vz();
85 double sintheta = sin(tp->theta());
86 // elements in definingParametersCovMatrixVec should be : sigma_d0^2, sigma_z0^2
87 double sigma_z0 = tp->definingParametersCovMatrixDiagVec().at(1);
88 if (vx) z0 -= vx->z();
89 double costheta = cos(tp->theta());
90 double sigma_theta = tp->definingParametersCovMatrixDiagVec().at(3);
91 double sigma_z0sintheta = sigma_z0 * sintheta * sintheta + z0 * z0 * costheta * costheta * sigma_theta;
92 if (sigma_z0sintheta <= 0.) {
93 throw std::runtime_error("TrackParticle with zero or negative z0sintheta uncertainty.");
94 }
95 sigma_z0sintheta = sqrt(sigma_z0sintheta);
96 return z0 * sintheta / sigma_z0sintheta;
97
98 }