CMS 3D CMS Logo

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 computeDist1d (const Vertex &pv, const VertexCompositePtrCandidate &sv, const GlobalVector &direction, bool withPVError)
 
template<>
Measurement1D computeDist1d (const Vertex &pv, const Vertex &sv, const GlobalVector &direction, bool withPVError)
 
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 dist1d () const
 
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 computeDist1d (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)
 
static Measurement1D computeDist3d (const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
 

Private Attributes

Measurement1D dist1d_
 
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),dist1d_(computeDist1d(pv, sv, direction, withPVError)),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)
static Measurement1D computeDist1d(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 {} //NOLINT

Member Function Documentation

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

Definition at line 30 of file TemplatedSecondaryVertex.cc.

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

32 {
33  typedef ROOT::Math::SVector<double, 3> SVector1;
34  typedef ROOT::Math::SMatrix<double, 3, 3,
35  ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
36  CovarianceMatrix covariance;
37  sv.fillVertexCovariance(covariance);
38  SMatrixSym1 cov = covariance;
39  if (withPVError)
40  cov += pv.covariance();
41  SVector1 vector(0,0,sv.vertex().Z() - pv.position().Z());
42 
43  double dist = ROOT::Math::Mag(vector);
44  double error = ROOT::Math::Similarity(cov, vector);
45  if (error > 0.0 && dist > 1.0e-9)
46  error = std::sqrt(error) / dist;
47  else
48  error = -1.0;
49  if ((vector[0] * direction.x() +
50  vector[1] * direction.y() +
51  vector[2] * direction.z()) < 0.0)
52  dist = -dist;
53  return Measurement1D(dist, error);
54 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
def pv(vc)
Definition: MetAnalyzer.py:7
T x() const
Definition: PV3DBase.h:62
template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist1d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 122 of file TemplatedSecondaryVertex.cc.

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

124 {
125  typedef ROOT::Math::SVector<double, 3> SVector1;
126  typedef ROOT::Math::SMatrix<double, 3, 3,
127  ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
128 
129  SMatrixSym1 cov = sv.covariance();
130  if (withPVError)
131  cov += pv.covariance();
132 
133  SVector1 vector(0.0,0.0,sv.position().Z() - pv.position().Z());
134 
135  double dist = ROOT::Math::Mag(vector);
136  double error = ROOT::Math::Similarity(cov, vector);
137  if (error > 0.0 && dist > 1.0e-9)
138  error = std::sqrt(error) / dist;
139  else
140  error = -1.0;
141 
142  if ((vector[0] * direction.x() +
143  vector[1] * direction.y() +
144  vector[2] * direction.z()) < 0.0)
145  dist = -dist;
146 
147  return Measurement1D(dist, error);
148 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
def pv(vc)
Definition: MetAnalyzer.py:7
T x() const
Definition: PV3DBase.h:62
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 58 of file TemplatedSecondaryVertex.cc.

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

60 {
61  typedef ROOT::Math::SVector<double, 2> SVector2;
62  typedef ROOT::Math::SMatrix<double, 2, 2,
63  ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
64  CovarianceMatrix covariance;
65  sv.fillVertexCovariance(covariance);
66 
67  SMatrixSym2 cov = covariance.Sub<SMatrixSym2>(0, 0);
68  if (withPVError)
69  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
70 
71  SVector2 vector(sv.vertex().X() - pv.position().X(),
72  sv.vertex().Y() - pv.position().Y());
73  double dist = ROOT::Math::Mag(vector);
74  double error = ROOT::Math::Similarity(cov, vector);
75  if (error > 0.0 && dist > 1.0e-9)
76  error = std::sqrt(error) / dist;
77  else
78  error = -1.0;
79 
80  if ((vector[0] * direction.x() +
81  vector[1] * direction.y()) < 0.0)
82  dist = -dist;
83 
84  return Measurement1D(dist, error);
85 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
def pv(vc)
Definition: MetAnalyzer.py:7
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 153 of file TemplatedSecondaryVertex.cc.

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

155 {
156  typedef ROOT::Math::SVector<double, 2> SVector2;
157  typedef ROOT::Math::SMatrix<double, 2, 2,
158  ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
159 
160  SMatrixSym2 cov = sv.covariance().Sub<SMatrixSym2>(0, 0);
161  if (withPVError)
162  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
163 
164  SVector2 vector(sv.position().X() - pv.position().X(),
165  sv.position().Y() - pv.position().Y());
166 
167  double dist = ROOT::Math::Mag(vector);
168  double error = ROOT::Math::Similarity(cov, vector);
169  if (error > 0.0 && dist > 1.0e-9)
170  error = std::sqrt(error) / dist;
171  else
172  error = -1.0;
173 
174  if ((vector[0] * direction.x() +
175  vector[1] * direction.y()) < 0.0)
176  dist = -dist;
177 
178  return Measurement1D(dist, error);
179 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
def pv(vc)
Definition: MetAnalyzer.py:7
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 88 of file TemplatedSecondaryVertex.cc.

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

90 {
91  typedef ROOT::Math::SVector<double, 3> SVector3;
92  typedef ROOT::Math::SMatrix<double, 3, 3,
93  ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
94  CovarianceMatrix covariance;
95  sv.fillVertexCovariance(covariance);
96 
97  SMatrixSym3 cov = covariance;
98  if (withPVError)
99  cov += pv.covariance();
100 
101  SVector3 vector(sv.vertex().X() - pv.position().X(),
102  sv.vertex().Y() - pv.position().Y(),
103  sv.vertex().Z() - pv.position().Z());
104 
105  double dist = ROOT::Math::Mag(vector);
106  double error = ROOT::Math::Similarity(cov, vector);
107  if (error > 0.0 && dist > 1.0e-9)
108  error = std::sqrt(error) / dist;
109  else
110  error = -1.0;
111 
112  if ((vector[0] * direction.x() +
113  vector[1] * direction.y() +
114  vector[2] * direction.z()) < 0.0)
115  dist = -dist;
116 
117  return Measurement1D(dist, error);
118 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
def pv(vc)
Definition: MetAnalyzer.py:7
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 182 of file TemplatedSecondaryVertex.cc.

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

184 {
185  typedef ROOT::Math::SVector<double, 3> SVector3;
186  typedef ROOT::Math::SMatrix<double, 3, 3,
187  ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
188 
189  SMatrixSym3 cov = sv.covariance();
190  if (withPVError)
191  cov += pv.covariance();
192 
193  SVector3 vector(sv.position().X() - pv.position().X(),
194  sv.position().Y() - pv.position().Y(),
195  sv.position().Z() - pv.position().Z());
196 
197  double dist = ROOT::Math::Mag(vector);
198  double error = ROOT::Math::Similarity(cov, vector);
199  if (error > 0.0 && dist > 1.0e-9)
200  error = std::sqrt(error) / dist;
201  else
202  error = -1.0;
203 
204  if ((vector[0] * direction.x() +
205  vector[1] * direction.y() +
206  vector[2] * direction.z()) < 0.0)
207  dist = -dist;
208 
209  return Measurement1D(dist, error);
210 }
T y() const
Definition: PV3DBase.h:63
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
def pv(vc)
Definition: MetAnalyzer.py:7
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
T x() const
Definition: PV3DBase.h:62
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist1d ( ) const
inline
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.

References MuonTCMETValueMapProducer_cff::vertexNdof.

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 >::dist1d_
private
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist2d_
private
template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist3d_
private