CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
reco::SecondaryVertex Class Reference

#include <SecondaryVertex.h>

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

Public Member Functions

Measurement1D dist2d () const
 
Measurement1D dist3d () const
 
 SecondaryVertex ()
 
 SecondaryVertex (const reco::Vertex &pv, const reco::Vertex &sv, const GlobalVector &direction, bool withPVError=false)
 
 ~SecondaryVertex ()
 
- Public Member Functions inherited from reco::Vertex
void add (const TrackBaseRef &r, float w=1.0)
 add a reference to a Track More...
 
void add (const TrackBaseRef &r, const Track &refTrack, float w=1.0)
 add the original a Track(reference) and the smoothed Track More...
 
double chi2 () const
 chi-squares More...
 
double covariance (int i, int j) const
 (i, j)-th element of error matrix, i, j = 0, ... 2 More...
 
CovarianceMatrix covariance () const
 return SMatrix More...
 
Error error () const
 return SMatrix More...
 
void fill (CovarianceMatrix &v) const
 fill SMatrix More...
 
bool hasRefittedTracks () const
 Checks whether refitted tracks are stored. More...
 
bool isFake () const
 
bool isValid () const
 Tells whether the vertex is valid. More...
 
double ndof () const
 
double normalizedChi2 () const
 chi-squared divided by n.d.o.f. More...
 
unsigned int nTracks (float minWeight=0.5) const
 Returns the number of tracks in the vertex with weight above minWeight. More...
 
TrackBaseRef originalTrack (const Track &refTrack) const
 
math::XYZTLorentzVectorD p4 (float mass=0.13957018, float minWeight=0.5) const
 Returns the four momentum of the sum of the tracks, assuming the given mass for the decay products. More...
 
const Pointposition () const
 position More...
 
Track refittedTrack (const TrackBaseRef &track) const
 
Track refittedTrack (const TrackRef &track) const
 
const std::vector< Track > & refittedTracks () const
 Returns the container of refitted tracks. More...
 
void removeTracks ()
 
trackRef_iterator tracks_begin () const
 first iterator over tracks More...
 
trackRef_iterator tracks_end () const
 last iterator over tracks More...
 
size_t tracksSize () const
 number of tracks More...
 
template<typename TREF >
float trackWeight (const TREF &r) const
 returns the weight with which a Track has contributed to the vertex-fit. More...
 
 Vertex ()
 
 Vertex (const Point &, const Error &)
 Constructor for a fake vertex. More...
 
 Vertex (const Point &, const Error &, double chi2, double ndof, size_t size)
 constructor for a valid vertex, with all data More...
 
double x () const
 x coordinate More...
 
double xError () const
 error on x More...
 
double y () const
 y coordinate More...
 
double yError () const
 error on y More...
 
double z () const
 y coordinate More...
 
double zError () const
 error on z More...
 

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_
 

Additional Inherited Members

- Public Types inherited from reco::Vertex
enum  { dimension = 3 }
 error matrix dimension More...
 
enum  { size = dimension * ( dimension + 1 ) / 2 }
 matix size More...
 
typedef math::Error< dimension >
::type 
CovarianceMatrix
 covariance error matrix (3x3) More...
 
typedef math::Error< dimension >
::type 
Error
 covariance error matrix (3x3) More...
 
typedef unsigned int index
 index type More...
 
typedef math::XYZPoint Point
 point in the space More...
 
typedef std::vector
< TrackBaseRef >
::const_iterator 
trackRef_iterator
 The iteratator for the vector<TrackRef> More...
 

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.

12 {}
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.

16  :
17  reco::Vertex(sv),
18  dist2d_(computeDist2d(pv, sv, direction, withPVError)),
19  dist3d_(computeDist3d(pv, sv, direction, withPVError)) {}
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)
reco::SecondaryVertex::~SecondaryVertex ( )
inline

Definition at line 20 of file SecondaryVertex.h.

20 {}

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().

18 {
19  typedef ROOT::Math::SVector<double, 2> SVector2;
20  typedef ROOT::Math::SMatrix<double, 2, 2,
21  ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
22 
23  SMatrixSym2 cov = sv.covariance().Sub<SMatrixSym2>(0, 0);
24  if (withPVError)
25  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
26 
27  SVector2 vector(sv.position().X() - pv.position().X(),
28  sv.position().Y() - pv.position().Y());
29 
30  double dist = ROOT::Math::Mag(vector);
31  double error = ROOT::Math::Similarity(cov, vector);
32  if (error > 0.0 && dist > 1.0e-9)
33  error = std::sqrt(error) / dist;
34  else
35  error = -1.0;
36 
37  if ((vector[0] * direction.x() +
38  vector[1] * direction.y()) < 0.0)
39  dist = -dist;
40 
41  return Measurement1D(dist, error);
42 }
T y() const
Definition: PV3DBase.h:63
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:123
const Point & position() const
position
Definition: Vertex.h:106
T sqrt(T t)
Definition: SSEVec.h:48
Error error() const
return SMatrix
Definition: Vertex.h:129
T x() const
Definition: PV3DBase.h:62
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 CaloRecoTauDiscriminationByFlightPathSignificance::vertexSignificance(), and PFRecoTauDiscriminationByFlightPathSignificance::vertexSignificance().

47 {
48  typedef ROOT::Math::SVector<double, 3> SVector3;
49  typedef ROOT::Math::SMatrix<double, 3, 3,
50  ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
51 
52  SMatrixSym3 cov = sv.covariance();
53  if (withPVError)
54  cov += pv.covariance();
55 
56  SVector3 vector(sv.position().X() - pv.position().X(),
57  sv.position().Y() - pv.position().Y(),
58  sv.position().Z() - pv.position().Z());
59 
60  double dist = ROOT::Math::Mag(vector);
61  double error = ROOT::Math::Similarity(cov, vector);
62  if (error > 0.0 && dist > 1.0e-9)
63  error = std::sqrt(error) / dist;
64  else
65  error = -1.0;
66 
67  if ((vector[0] * direction.x() +
68  vector[1] * direction.y() +
69  vector[2] * direction.z()) < 0.0)
70  dist = -dist;
71 
72  return Measurement1D(dist, error);
73 }
T y() const
Definition: PV3DBase.h:63
double covariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
Definition: Vertex.h:123
const Point & position() const
position
Definition: Vertex.h:106
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Error error() const
return SMatrix
Definition: Vertex.h:129
T x() const
Definition: PV3DBase.h:62
Measurement1D reco::SecondaryVertex::dist2d ( ) const
inline
Measurement1D reco::SecondaryVertex::dist3d ( ) const
inline

Member Data Documentation

Measurement1D reco::SecondaryVertex::dist2d_
private

Definition at line 33 of file SecondaryVertex.h.

Referenced by dist2d().

Measurement1D reco::SecondaryVertex::dist3d_
private

Definition at line 34 of file SecondaryVertex.h.

Referenced by dist3d().