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::TemplatedSecondaryVertex< SV > Class Template Reference

#include <TemplatedSecondaryVertex.h>

Inheritance diagram for reco::TemplatedSecondaryVertex< SV >:

Public Member Functions

template<>
Measurement1D computeDist2d (const Vertex &pv, const VertexCompositePtrCandidate &sv, const GlobalVector &direction, bool withPVError)
 
template<>
Measurement1D computeDist2d (const Vertex &pv, const Vertex &sv, const GlobalVector &direction, bool withPVError)
 
template<>
Measurement1D computeDist3d (const Vertex &pv, const VertexCompositePtrCandidate &sv, const GlobalVector &direction, bool withPVError)
 
template<>
Measurement1D computeDist3d (const Vertex &pv, const Vertex &sv, const GlobalVector &direction, bool withPVError)
 
Measurement1D dist2d () const
 
Measurement1D dist3d () const
 
template<>
 operator reco::Vertex ()
 
 operator reco::Vertex ()
 
 TemplatedSecondaryVertex ()
 
 TemplatedSecondaryVertex (const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError=false)
 
 ~TemplatedSecondaryVertex ()
 

Static Public Member Functions

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

Private Attributes

Measurement1D dist2d_
 
Measurement1D dist3d_
 

Detailed Description

template<class SV>
class reco::TemplatedSecondaryVertex< SV >

Definition at line 11 of file TemplatedSecondaryVertex.h.

Constructor & Destructor Documentation

template<class SV>
reco::TemplatedSecondaryVertex< SV >::TemplatedSecondaryVertex ( )
inline

Definition at line 13 of file TemplatedSecondaryVertex.h.

13 {}
template<class SV>
reco::TemplatedSecondaryVertex< SV >::TemplatedSecondaryVertex ( const reco::Vertex pv,
const SV &  sv,
const GlobalVector direction,
bool  withPVError = false 
)
inline

Definition at line 14 of file TemplatedSecondaryVertex.h.

17  :
18  SV(sv),dist2d_(computeDist2d(pv, sv, direction, withPVError)),dist3d_(computeDist3d(pv, sv, direction, withPVError)) {}
static Measurement1D computeDist3d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
static Measurement1D computeDist2d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
template<class SV>
reco::TemplatedSecondaryVertex< SV >::~TemplatedSecondaryVertex ( )
inline

Definition at line 20 of file TemplatedSecondaryVertex.h.

20 {}

Member Function Documentation

template<class SV>
static Measurement1D reco::TemplatedSecondaryVertex< SV >::computeDist2d ( const reco::Vertex pv,
const SV &  sv,
const GlobalVector direction,
bool  withPVError 
)
static
template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::VertexCompositePtrCandidate >::computeDist2d ( const Vertex pv,
const VertexCompositePtrCandidate sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 31 of file TemplatedSecondaryVertex.cc.

References reco::Vertex::covariance(), alignCSCRings::e, relativeConstraints::error, reco::VertexCompositePtrCandidate::fillVertexCovariance(), reco::Vertex::position(), mathSSE::sqrt(), and reco::LeafCandidate::vertex().

33 {
34  typedef ROOT::Math::SVector<double, 2> SVector2;
35  typedef ROOT::Math::SMatrix<double, 2, 2,
36  ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
37  CovarianceMatrix covariance;
38  sv.fillVertexCovariance(covariance);
39 
40  SMatrixSym2 cov = covariance.Sub<SMatrixSym2>(0, 0);
41  if (withPVError)
42  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
43 
44  SVector2 vector(sv.vertex().X() - pv.position().X(),
45  sv.vertex().Y() - pv.position().Y());
46 
47  double dist = ROOT::Math::Mag(vector);
48  double error = ROOT::Math::Similarity(cov, vector);
49  if (error > 0.0 && dist > 1.0e-9)
50  error = std::sqrt(error) / dist;
51  else
52  error = -1.0;
53 
54  if ((vector[0] * direction.x() +
55  vector[1] * direction.y()) < 0.0)
56  dist = -dist;
57 
58  return Measurement1D(dist, error);
59 }
T y() const
Definition: PV3DBase.h:63
ROOT::Math::SVector< double, 2 > SVector2
Definition: GblPoint.h:29
T sqrt(T t)
Definition: SSEVec.h:18
T x() const
Definition: PV3DBase.h:62
template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist2d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 97 of file TemplatedSecondaryVertex.cc.

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

99 {
100  typedef ROOT::Math::SVector<double, 2> SVector2;
101  typedef ROOT::Math::SMatrix<double, 2, 2,
102  ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
103 
104  SMatrixSym2 cov = sv.covariance().Sub<SMatrixSym2>(0, 0);
105  if (withPVError)
106  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
107 
108  SVector2 vector(sv.position().X() - pv.position().X(),
109  sv.position().Y() - pv.position().Y());
110 
111  double dist = ROOT::Math::Mag(vector);
112  double error = ROOT::Math::Similarity(cov, vector);
113  if (error > 0.0 && dist > 1.0e-9)
114  error = std::sqrt(error) / dist;
115  else
116  error = -1.0;
117 
118  if ((vector[0] * direction.x() +
119  vector[1] * direction.y()) < 0.0)
120  dist = -dist;
121 
122  return Measurement1D(dist, error);
123 }
T y() const
Definition: PV3DBase.h:63
ROOT::Math::SVector< double, 2 > SVector2
Definition: GblPoint.h:29
T sqrt(T t)
Definition: SSEVec.h:18
T x() const
Definition: PV3DBase.h:62
template<class SV>
static Measurement1D reco::TemplatedSecondaryVertex< SV >::computeDist3d ( const reco::Vertex pv,
const SV &  sv,
const GlobalVector direction,
bool  withPVError 
)
static
template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::VertexCompositePtrCandidate >::computeDist3d ( const Vertex pv,
const VertexCompositePtrCandidate sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 62 of file TemplatedSecondaryVertex.cc.

References reco::Vertex::covariance(), alignCSCRings::e, relativeConstraints::error, reco::VertexCompositePtrCandidate::fillVertexCovariance(), reco::Vertex::position(), mathSSE::sqrt(), and reco::LeafCandidate::vertex().

64 {
65  typedef ROOT::Math::SVector<double, 3> SVector3;
66  typedef ROOT::Math::SMatrix<double, 3, 3,
67  ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
68  CovarianceMatrix covariance;
69  sv.fillVertexCovariance(covariance);
70 
71  SMatrixSym3 cov = covariance;
72  if (withPVError)
73  cov += pv.covariance();
74 
75  SVector3 vector(sv.vertex().X() - pv.position().X(),
76  sv.vertex().Y() - pv.position().Y(),
77  sv.vertex().Z() - pv.position().Z());
78 
79  double dist = ROOT::Math::Mag(vector);
80  double error = ROOT::Math::Similarity(cov, vector);
81  if (error > 0.0 && dist > 1.0e-9)
82  error = std::sqrt(error) / dist;
83  else
84  error = -1.0;
85 
86  if ((vector[0] * direction.x() +
87  vector[1] * direction.y() +
88  vector[2] * direction.z()) < 0.0)
89  dist = -dist;
90 
91  return Measurement1D(dist, error);
92 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
T x() const
Definition: PV3DBase.h:62
template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist3d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 126 of file TemplatedSecondaryVertex.cc.

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

128 {
129  typedef ROOT::Math::SVector<double, 3> SVector3;
130  typedef ROOT::Math::SMatrix<double, 3, 3,
131  ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
132 
133  SMatrixSym3 cov = sv.covariance();
134  if (withPVError)
135  cov += pv.covariance();
136 
137  SVector3 vector(sv.position().X() - pv.position().X(),
138  sv.position().Y() - pv.position().Y(),
139  sv.position().Z() - pv.position().Z());
140 
141  double dist = ROOT::Math::Mag(vector);
142  double error = ROOT::Math::Similarity(cov, vector);
143  if (error > 0.0 && dist > 1.0e-9)
144  error = std::sqrt(error) / dist;
145  else
146  error = -1.0;
147 
148  if ((vector[0] * direction.x() +
149  vector[1] * direction.y() +
150  vector[2] * direction.z()) < 0.0)
151  dist = -dist;
152 
153  return Measurement1D(dist, error);
154 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
T x() const
Definition: PV3DBase.h:62
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist2d ( ) const
inline
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist3d ( ) const
inline

Definition at line 17 of file TemplatedSecondaryVertex.cc.

17  {
19 fillVertexCovariance(err);
20 return reco::Vertex(Vertex::Point(vertex()), err, vertexChi2(), vertexNdof(),numberOfSourceCandidatePtrs());
21 }
math::XYZPoint Point
point in the space
Definition: Vertex.h:39
template<class SV>
reco::TemplatedSecondaryVertex< SV >::operator reco::Vertex ( )

Member Data Documentation

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist2d_
private
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist3d_
private