|
ATLAS Offline Software
|
Go to the documentation of this file.
43 if((!vtx1) || (!vtx2)) {
53 return (vtx2 - vtx1).mag();
59 double significance = -10;
61 Eigen::Matrix<double, 3, 3, 0, 3, 3> PrimCovMtx;
63 if(errorMatrix.empty()) {
64 msg <<
"getNormDist - Error matrix is empty" << std::endl;
68 PrimCovMtx(0,0) =
static_cast<double> (errorMatrix[0]);
69 PrimCovMtx(0,1) =
static_cast<double> (errorMatrix[1]);
70 PrimCovMtx(1,0) =
static_cast<double> (errorMatrix[1]);
71 PrimCovMtx(1,1) =
static_cast<double> (errorMatrix[2]);
72 PrimCovMtx(0,2) =
static_cast<double> (errorMatrix[3]);
73 PrimCovMtx(2,0) =
static_cast<double> (errorMatrix[3]);
74 PrimCovMtx(1,2) =
static_cast<double> (errorMatrix[4]);
75 PrimCovMtx(2,1) =
static_cast<double> (errorMatrix[4]);
76 PrimCovMtx(2,2) =
static_cast<double> (errorMatrix[5]);
78 if(PrimCovMtx.determinant() == 0) {
79 msg <<
"getNormDist - Matrix can not be inversed" << std::endl;
83 Eigen::Matrix<double, 3, 3,0, 3, 3> WgtMtx = PrimCovMtx.inverse();
87 dist[0] = vtxDiff.x();
88 dist[1] = vtxDiff.y();
89 dist[2] = vtxDiff.z();
91 significance = dist.transpose() * WgtMtx * dist;
93 if(significance < 0) {
94 msg <<
"getNormDist - significance is negative" << std::endl;
98 significance = std::sqrt(significance);
113 const double xmax =
h->GetXaxis()->GetXmax();
114 const double xmin =
h->GetXaxis()->GetXmin();
118 x =
h->GetXaxis()->GetBinCenter(
h->GetNbinsX());
120 x =
h->GetXaxis()->GetBinCenter(1);
129 std::stringstream
str;
131 str <<
"xAOD::Vertex pointer = " << vtx<< std::endl;
134 float chisquared = -9999;
135 float numberdof = -9999;
139 msg <<
"printPromptVertexAsStr -- not valid vtx SecondaryVertexIndex!!!" << std::endl;
142 if(!
getVar(vtx, chisquared,
"chiSquared")) {
143 msg <<
"printPromptVertexAsStr -- not valid vtx chiSquared!!!" << std::endl;
146 if(!
getVar(vtx, numberdof,
"numberDoF")) {
147 msg <<
"printPromptVertexAsStr -- not valid vtx numberDoF!!!" << std::endl;
150 str <<
" index " <<
index << std::endl;
151 str <<
" position " << vtx->
position () << std::endl;
152 str <<
" x " << vtx->
x () << std::endl;
153 str <<
" y " << vtx->
y () << std::endl;
154 str <<
" z " << vtx->
z () << std::endl;
155 str <<
" chiSquared " << chisquared << std::endl;
156 str <<
" numberDoF " << numberdof << std::endl;
158 str <<
" covariance.size() = " << vtx->
covariance().size() << std::endl;
159 str <<
" covariance = [";
175 return "vtxAsStr - null pointer";
189 <<
", (x, y, z)=(" << vtx->
x() <<
", " << vtx->
y() <<
", " << vtx->
z() <<
")"
190 <<
", distToPV=" << distToPV
191 <<
", sigToPV=" << sigToPV;
196 std::vector<const xAOD::TrackParticle *> tracks;
204 for(
unsigned i = 0;
i < tracks.size(); ++
i) {
205 str <<
" xAOD::Vertex track[" <<
i <<
"] " <<
trkAsStr(tracks.at(
i)) << endl;
221 std::stringstream
str;
231 return "trkAsStr - null pointer";
236 str <<
"xAOD::TrackParticle - " << trk <<
": pT=" << trk->
pt()
237 <<
", eta=" << trk->
eta()
238 <<
", phi=" << trk->
phi();
248 double realt = watch.RealTime();
249 double cput = watch.CpuTime();
254 const int hours =
static_cast<int>(realt/3600.0);
255 const int min =
static_cast<int>(realt/60.0) - 60*
hours;
257 realt -=
hours * 3600;
260 if (realt < 0) realt = 0;
261 if (cput < 0) cput = 0;
263 const int sec =
static_cast<int>(realt);
265 std::stringstream
str;
267 << setw(2) << setfill(
'0') <<
hours
268 <<
":" << setw(2) << setfill(
'0') <<
min
269 <<
":" << setw(2) << setfill(
'0') << sec
270 <<
" CPU time " << setprecision(3) << fixed << cput;
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float x() const
Returns the x position.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
bool GetAuxVar(const T1 &obj, T2 &value, const std::string &var_name)
double getVertexFitProb(const xAOD::Vertex *vtx)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
bool getVar(T1 &obj, T2 &value, const std::string &var_name)
std::string trkAsStr(const xAOD::TrackParticle *trk)
const Amg::Vector3D & position() const
Returns the 3-pos.
std::string vtxAsStr(const xAOD::Vertex *vtx, bool print_tracks=false)
Class providing the definition of the 4-vector interface.
std::string PrintResetStopWatch(TStopwatch &watch)
int truthType(const U &p)
int truthOrigin(const U &p)
double getNormDist(const Amg::Vector3D &PrimVtx, const Amg::Vector3D &SecVtx, const std::vector< float > &ErrorMatrix, MsgStream &msg)
double getDistance(const xAOD::Vertex *vtx1, const xAOD::Vertex *vtx2)
std::string printPromptVertexAsStr(const xAOD::Vertex *vtx, MsgStream &msg)
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
float z() const
Returns the z position.
std::string truthAsStr(const xAOD::IParticle &particle)
Eigen::Matrix< double, 3, 1 > Vector3D
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
const std::vector< float > & covariance() const
Returns the covariance matrix as a simple vector of values.
float chiSquared() const
Returns the of the vertex fit as float.
Class describing a Vertex.
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
void fillTH1(TH1 *h, double val, double weight=1.0)
float y() const
Returns the y position.
Class describing a TrackParticle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)