15 throw std::runtime_error(
"Invalid TrackParticle pointer.");
20 throw std::runtime_error(
"TrackParticle without covariance matrix for the defining parameters.");
26 throw std::runtime_error(
"Invalid TrackParticle pointer.");
30 throw std::runtime_error(
"TrackParticle without diagonal covariance matrix elements for the defining parameters.");
36 if (!tp)
return false;
46 double sigma_d0 = tp->definingParametersCovMatrixDiagVec().at(0);
48 throw std::runtime_error(
"TrackParticle with zero or negative d0 uncertainty.");
50 return d0/sqrt(sigma_d0+d0_uncert_beam_spot_2);
60 throw std::runtime_error(
"Beamspot covariance matrix is invalid.");
67 double z0 = tp->z0() + tp->vz();
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.");
75 double sigma_z0 = tp->definingParametersCovMatrixDiagVec().at(1);
77 throw std::runtime_error(
"TrackParticle with zero or negative z0 uncertainty.");
79 return z0/sqrt(sigma_z0);
84 double z0 = tp->z0() + tp->vz();
85 double sintheta = sin(tp->theta());
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.");
95 sigma_z0sintheta = sqrt(sigma_z0sintheta);
96 return z0 * sintheta / sigma_z0sintheta;
103 throw std::runtime_error(
"TrackParticle without covariance matrix for defining parameters or the covariance matrix is wrong dimensionality.");
105 if (std::abs(tp->qOverP())<0) {
106 throw std::runtime_error(
"q/p is zero");
Base class for elements of a container that can have aux data.
SG::ConstAccessor< T, ALLOC > ConstAccessor
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
float z() const
Returns the z position.
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 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 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 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...
void checkTPAndDefiningParamCovDiag(const xAOD::TrackParticle *tp)
double pTErr2(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.
bool hasValidCovQoverP(const xAOD::TrackParticle *tp)
return true if the covariance matrix of the defining parameters is set, has enough elements and the q...
bool hasValidCov(const xAOD::TrackParticle *tp)
Check whether the given track particle is valid and has a covariance matrix of the defining parameter...
double d0significance(const xAOD::TrackParticle *tp, double d0_uncert_beam_spot_2)
bool checkBeamSpotSigma(double beam_sigma_x, double beam_sigma_y, double beam_sigma_xy)
check that the beamspot covariance matrix is valid
void checkTPAndDefiningParamCov(const xAOD::TrackParticle *tp)
double pTErr2Unsafe(const xAOD::TrackParticle *tp)
compute the uncertainty of pt squared.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
static const xAOD::ParametersCovMatrixFilled_t FullCovMatrixAvailable
Object representing a fully available covariance matrix.