 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef XAOD_TRACKPARTICLEXAODHELPERS_H
9 #define XAOD_TRACKPARTICLEXAODHELPERS_H
18 namespace TrackingHelpers {
38 double sigma_d0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[0] );
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);
82 double sigma_d0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[0] +
d0UncertaintyBeamSpot2(
tp->phi(),beam_sigma_x, beam_sigma_y, beam_sigma_xy) );
112 double z0 =
tp->z0() +
tp->vz();
113 double sigma_z0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[1] );
129 double z0 =
tp->z0() +
tp->vz() - vx->
z();
131 double sigma_z0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[1] );
145 if (
tp->definingParametersCovMatrixDiagVec()[0]>0.) {
157 if (
tp->definingParametersCovMatrixDiagVec()[1] > 0. ) {
169 if ( (
tp->definingParametersCovMatrixDiagVec()[0] > 0. )
170 && (
tp->definingParametersCovMatrixDiagVec()[1] > 0. ) ) {
188 return std::abs(
sqr(vx->
x())+
sqr(vx->
y())) < max_pv_dxy_sqr *
tp->definingParametersCovMatrixDiagVec()[0];
200 return sqr(beam_sigma_x)+
sqr(beam_sigma_y)>=2*std::abs(beam_sigma_xy);
239 double pt =
tp->pt();
240 double diff_qp = -
pt / std::abs(
tp->qOverP());
242 double diff_theta =
pt /
tan(
tp->theta() );
250 auto cov =
tp->definingParametersCovMatrix();
257 double pt_err2 = diff_qp * (diff_qp *
cov(4, 4) + diff_theta *
cov(3, 4) ) +
sqr(diff_theta) *
cov(3, 3);
274 if (std::abs(
tp->qOverP())>0.) {
285 #endif // XAOD_TRACKPARTICLEXAODHELPERS_H
float x() const
Returns the x position.
double pTErr(const xAOD::TrackParticle *tp)
compute the uncertainty of pt.
bool hasValidCovZ0(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a valid z0 uncertainty.
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
bool hasValidCovD0andZ0(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a valid d0 and z0 uncertainty.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
bool hasValidCov(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a covariance matrix of the defining parameter...
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 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...
bool checkBeamSpotSigma(double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
check that the beamspot covariance matrix is valid
bool hasValidCovQoverP(const xAOD::TrackParticle *tp)
return true if the covariance matrix of the defining parameters is set, has enough elements and the q...
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 pTErr2Unsafe(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.
double pTErr2(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.
float z() const
Returns the z position.
bool hasValidCovD0(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a valid d0 uncertainty.
double z0significanceUnsafe(const xAOD::TrackParticle *tp)
Unsafe version of z0significance.
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.
double sqr(double a)
convenience method to calculate the square of a value.
double pTErrUnsafe(const xAOD::TrackParticle *tp)
compute the uncertainty of pt.
Class describing a Vertex.
double d0significanceUnsafe(const xAOD::TrackParticle *tp)
Unsafe version of d0significance.
float y() const
Returns the y position.
Class describing a TrackParticle.