CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

reco::SecondaryVertex Class Reference

#include <SecondaryVertex.h>

Inheritance diagram for reco::SecondaryVertex:
reco::Vertex

List of all members.

Public Member Functions

Measurement1D dist2d () const
Measurement1D dist3d () const
 SecondaryVertex (const reco::Vertex &pv, const reco::Vertex &sv, const GlobalVector &direction, bool withPVError=false)
 SecondaryVertex ()
 ~SecondaryVertex ()

Static Public Member Functions

static Measurement1D computeDist2d (const reco::Vertex &pv, const reco::Vertex &sv, const GlobalVector &direction, bool withPVError)
static Measurement1D computeDist3d (const reco::Vertex &pv, const reco::Vertex &sv, const GlobalVector &direction, bool withPVError)

Private Attributes

Measurement1D dist2d_
Measurement1D dist3d_

Detailed Description

Definition at line 10 of file SecondaryVertex.h.


Constructor & Destructor Documentation

reco::SecondaryVertex::SecondaryVertex ( ) [inline]

Definition at line 12 of file SecondaryVertex.h.

{}
reco::SecondaryVertex::SecondaryVertex ( const reco::Vertex pv,
const reco::Vertex sv,
const GlobalVector direction,
bool  withPVError = false 
) [inline]

Definition at line 13 of file SecondaryVertex.h.

                                                  :
                reco::Vertex(sv),
                dist2d_(computeDist2d(pv, sv, direction, withPVError)),
                dist3d_(computeDist3d(pv, sv, direction, withPVError)) {}
reco::SecondaryVertex::~SecondaryVertex ( ) [inline]

Definition at line 20 of file SecondaryVertex.h.

{}

Member Function Documentation

Measurement1D SecondaryVertex::computeDist2d ( const reco::Vertex pv,
const reco::Vertex sv,
const GlobalVector direction,
bool  withPVError 
) [static]

Definition at line 16 of file SecondaryVertex.cc.

References reco::Vertex::covariance(), alignCSCRings::e, reco::Vertex::error(), reco::Vertex::position(), and mathSSE::sqrt().

Referenced by PFRecoTauDiscriminationByFlight::discriminate().

{
        typedef ROOT::Math::SVector<double, 2> SVector2;
        typedef ROOT::Math::SMatrix<double, 2, 2,
                        ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;

        SMatrixSym2 cov = sv.covariance().Sub<SMatrixSym2>(0, 0);
        if (withPVError)
                cov += pv.covariance().Sub<SMatrixSym2>(0, 0);

        SVector2 vector(sv.position().X() - pv.position().X(),
                        sv.position().Y() - pv.position().Y());

        double dist = ROOT::Math::Mag(vector);
        double error = ROOT::Math::Similarity(cov, vector);
        if (error > 0.0 && dist > 1.0e-9)
                error = std::sqrt(error) / dist;
        else
                error = -1.0;

        if ((vector[0] * direction.x() +
             vector[1] * direction.y()) < 0.0)
                dist = -dist;

        return Measurement1D(dist, error);
}
Measurement1D SecondaryVertex::computeDist3d ( const reco::Vertex pv,
const reco::Vertex sv,
const GlobalVector direction,
bool  withPVError 
) [static]

Definition at line 45 of file SecondaryVertex.cc.

References reco::Vertex::covariance(), alignCSCRings::e, reco::Vertex::error(), reco::Vertex::position(), and mathSSE::sqrt().

Referenced by PFRecoTauDiscriminationByFlightPathSignificance::vertexSignificance(), and CaloRecoTauDiscriminationByFlightPathSignificance::vertexSignificance().

{
        typedef ROOT::Math::SVector<double, 3> SVector3;
        typedef ROOT::Math::SMatrix<double, 3, 3,
                        ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;

        SMatrixSym3 cov = sv.covariance();
        if (withPVError)
                cov += pv.covariance();

        SVector3 vector(sv.position().X() - pv.position().X(),
                        sv.position().Y() - pv.position().Y(),
                        sv.position().Z() - pv.position().Z());

        double dist = ROOT::Math::Mag(vector);
        double error = ROOT::Math::Similarity(cov, vector);
        if (error > 0.0 && dist > 1.0e-9)
                error = std::sqrt(error) / dist;
        else
                error = -1.0;

        if ((vector[0] * direction.x() +
             vector[1] * direction.y() +
             vector[2] * direction.z()) < 0.0)
                dist = -dist;

        return Measurement1D(dist, error);
}
Measurement1D reco::SecondaryVertex::dist2d ( ) const [inline]
Measurement1D reco::SecondaryVertex::dist3d ( ) const [inline]

Member Data Documentation

Definition at line 33 of file SecondaryVertex.h.

Referenced by dist2d().

Definition at line 34 of file SecondaryVertex.h.

Referenced by dist3d().