|
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) );
102 double z0 =
tp->z0() +
tp->vz();
103 double sigma_z0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[1] );
119 double z0 =
tp->z0() +
tp->vz() - vx->
z();
121 double sigma_z0 = std::sqrt(
tp->definingParametersCovMatrixDiagVec()[1] );
135 if (
tp->definingParametersCovMatrixDiagVec()[0]>0.) {
147 if (
tp->definingParametersCovMatrixDiagVec()[1] > 0. ) {
159 if ( (
tp->definingParametersCovMatrixDiagVec()[0] > 0. )
160 && (
tp->definingParametersCovMatrixDiagVec()[1] > 0. ) ) {
178 return std::abs(
sqr(vx->
x())+
sqr(vx->
y())) < max_pv_dxy_sqr *
tp->definingParametersCovMatrixDiagVec()[0];
190 return sqr(beam_sigma_x)+
sqr(beam_sigma_y)>=2*std::abs(beam_sigma_xy);
229 double pt =
tp->pt();
230 double diff_qp = -
pt / std::abs(
tp->qOverP());
232 double diff_theta =
pt /
tan(
tp->theta() );
240 auto cov =
tp->definingParametersCovMatrix();
247 double pt_err2 = diff_qp * (diff_qp *
cov(4, 4) + diff_theta *
cov(3, 4) ) +
sqr(diff_theta) *
cov(3, 3);
264 if (std::abs(
tp->qOverP())>0.) {
275 #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.
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.