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

◆ TemplatedSecondaryVertex() [1/2]

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

Definition at line 13 of file TemplatedSecondaryVertex.h.

13 {}

◆ TemplatedSecondaryVertex() [2/2]

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.

18  : SV(sv),
19  dist1d_(computeDist1d(pv, sv, direction, withPVError)),
20  dist2d_(computeDist2d(pv, sv, direction, withPVError)),
21  dist3d_(computeDist3d(pv, sv, direction, withPVError)) {}

◆ ~TemplatedSecondaryVertex()

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

Definition at line 23 of file TemplatedSecondaryVertex.h.

23 {} //NOLINT

Member Function Documentation

◆ computeDist1d() [1/3]

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

◆ computeDist1d() [2/3]

template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist1d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 105 of file TemplatedSecondaryVertex.cc.

108  {
109  typedef ROOT::Math::SVector<double, 3> SVector1;
110  typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
111 
112  SMatrixSym1 cov = sv.covariance();
113  if (withPVError)
114  cov += pv.covariance();
115 
116  SVector1 vector(0.0, 0.0, sv.position().Z() - pv.position().Z());
117 
118  double dist = ROOT::Math::Mag(vector);
119  double error = ROOT::Math::Similarity(cov, vector);
120  if (error > 0.0 && dist > 1.0e-9)
121  error = std::sqrt(error) / dist;
122  else
123  error = -1.0;
124 
125  if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
126  dist = -dist;
127 
128  return Measurement1D(dist, error);
129  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ computeDist1d() [3/3]

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

Definition at line 29 of file TemplatedSecondaryVertex.cc.

30  {
31  typedef ROOT::Math::SVector<double, 3> SVector1;
32  typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
33  CovarianceMatrix covariance;
34  sv.fillVertexCovariance(covariance);
35  SMatrixSym1 cov = covariance;
36  if (withPVError)
37  cov += pv.covariance();
38  SVector1 vector(0, 0, sv.vertex().Z() - pv.position().Z());
39 
40  double dist = ROOT::Math::Mag(vector);
41  double error = ROOT::Math::Similarity(cov, vector);
42  if (error > 0.0 && dist > 1.0e-9)
43  error = std::sqrt(error) / dist;
44  else
45  error = -1.0;
46  if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
47  dist = -dist;
48  return Measurement1D(dist, error);
49  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ computeDist2d() [1/3]

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

◆ computeDist2d() [2/3]

template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist2d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 132 of file TemplatedSecondaryVertex.cc.

135  {
136  typedef ROOT::Math::SVector<double, 2> SVector2;
137  typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
138 
139  SMatrixSym2 cov = sv.covariance().Sub<SMatrixSym2>(0, 0);
140  if (withPVError)
141  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
142 
143  SVector2 vector(sv.position().X() - pv.position().X(), sv.position().Y() - pv.position().Y());
144 
145  double dist = ROOT::Math::Mag(vector);
146  double error = ROOT::Math::Similarity(cov, vector);
147  if (error > 0.0 && dist > 1.0e-9)
148  error = std::sqrt(error) / dist;
149  else
150  error = -1.0;
151 
152  if ((vector[0] * direction.x() + vector[1] * direction.y()) < 0.0)
153  dist = -dist;
154 
155  return Measurement1D(dist, error);
156  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ computeDist2d() [3/3]

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

Definition at line 52 of file TemplatedSecondaryVertex.cc.

53  {
54  typedef ROOT::Math::SVector<double, 2> SVector2;
55  typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
56  CovarianceMatrix covariance;
57  sv.fillVertexCovariance(covariance);
58 
59  SMatrixSym2 cov = covariance.Sub<SMatrixSym2>(0, 0);
60  if (withPVError)
61  cov += pv.covariance().Sub<SMatrixSym2>(0, 0);
62 
63  SVector2 vector(sv.vertex().X() - pv.position().X(), sv.vertex().Y() - pv.position().Y());
64  double dist = ROOT::Math::Mag(vector);
65  double error = ROOT::Math::Similarity(cov, vector);
66  if (error > 0.0 && dist > 1.0e-9)
67  error = std::sqrt(error) / dist;
68  else
69  error = -1.0;
70 
71  if ((vector[0] * direction.x() + vector[1] * direction.y()) < 0.0)
72  dist = -dist;
73 
74  return Measurement1D(dist, error);
75  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ computeDist3d() [1/3]

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

◆ computeDist3d() [2/3]

template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::Vertex >::computeDist3d ( const Vertex pv,
const Vertex sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 158 of file TemplatedSecondaryVertex.cc.

161  {
162  typedef ROOT::Math::SVector<double, 3> SVector3;
163  typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
164 
165  SMatrixSym3 cov = sv.covariance();
166  if (withPVError)
167  cov += pv.covariance();
168 
169  SVector3 vector(sv.position().X() - pv.position().X(),
170  sv.position().Y() - pv.position().Y(),
171  sv.position().Z() - pv.position().Z());
172 
173  double dist = ROOT::Math::Mag(vector);
174  double error = ROOT::Math::Similarity(cov, vector);
175  if (error > 0.0 && dist > 1.0e-9)
176  error = std::sqrt(error) / dist;
177  else
178  error = -1.0;
179 
180  if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
181  dist = -dist;
182 
183  return Measurement1D(dist, error);
184  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ computeDist3d() [3/3]

template<>
Measurement1D reco::TemplatedSecondaryVertex< reco::VertexCompositePtrCandidate >::computeDist3d ( const Vertex pv,
const VertexCompositePtrCandidate sv,
const GlobalVector direction,
bool  withPVError 
)

Definition at line 77 of file TemplatedSecondaryVertex.cc.

78  {
79  typedef ROOT::Math::SVector<double, 3> SVector3;
80  typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
81  CovarianceMatrix covariance;
82  sv.fillVertexCovariance(covariance);
83 
84  SMatrixSym3 cov = covariance;
85  if (withPVError)
86  cov += pv.covariance();
87 
89  sv.vertex().X() - pv.position().X(), sv.vertex().Y() - pv.position().Y(), sv.vertex().Z() - pv.position().Z());
90 
91  double dist = ROOT::Math::Mag(vector);
92  double error = ROOT::Math::Similarity(cov, vector);
93  if (error > 0.0 && dist > 1.0e-9)
94  error = std::sqrt(error) / dist;
95  else
96  error = -1.0;
97 
98  if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
99  dist = -dist;
100 
101  return Measurement1D(dist, error);
102  }

References MillePedeFileConverter_cfg::e, relativeConstraints::error, MetAnalyzer::pv(), mathSSE::sqrt(), pfDeepBoostedJetPreprocessParams_cfi::sv, and trackerHitRTTI::vector.

◆ dist1d()

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist1d ( ) const
inline

Definition at line 24 of file TemplatedSecondaryVertex.h.

24 { return dist1d_; }

References reco::TemplatedSecondaryVertex< SV >::dist1d_.

◆ dist2d()

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist2d ( ) const
inline

◆ dist3d()

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist3d ( ) const
inline

◆ operator reco::Vertex() [1/2]

Definition at line 17 of file TemplatedSecondaryVertex.cc.

17  {
19  fillVertexCovariance(err);
20  return reco::Vertex(Vertex::Point(vertex()), err, vertexChi2(), vertexNdof(), numberOfSourceCandidatePtrs());
21  }

References submitPVResolutionJobs::err, bphysicsOniaDQM_cfi::vertex, HltBtagValidation_cff::Vertex, and MuonTCMETValueMapProducer_cff::vertexNdof.

◆ operator reco::Vertex() [2/2]

template<class SV>
reco::TemplatedSecondaryVertex< SV >::operator reco::Vertex ( )

Member Data Documentation

◆ dist1d_

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist1d_
private

◆ dist2d_

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

◆ dist3d_

template<class SV>
Measurement1D reco::TemplatedSecondaryVertex< SV >::dist3d_
private
Measurement1D
Definition: Measurement1D.h:11
reco::TemplatedSecondaryVertex::dist1d_
Measurement1D dist1d_
Definition: TemplatedSecondaryVertex.h:46
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
reco::TemplatedSecondaryVertex::computeDist3d
static Measurement1D computeDist3d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
CovarianceMatrix
Definition: CovarianceMatrix.h:27
relativeConstraints.error
error
Definition: relativeConstraints.py:53
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
reco::TemplatedSecondaryVertex::computeDist2d
static Measurement1D computeDist2d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
SVector3
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
reco::TemplatedSecondaryVertex::dist2d_
Measurement1D dist2d_
Definition: TemplatedSecondaryVertex.h:47
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
nanoDQM_cfi.SV
SV
Definition: nanoDQM_cfi.py:618
MetAnalyzer.pv
def pv(vc)
Definition: MetAnalyzer.py:7
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
reco::TemplatedSecondaryVertex::computeDist1d
static Measurement1D computeDist1d(const reco::Vertex &pv, const SV &sv, const GlobalVector &direction, bool withPVError)
reco::Vertex::Point
math::XYZPoint Point
point in the space
Definition: Vertex.h:40
HltBtagValidation_cff.Vertex
Vertex
Definition: HltBtagValidation_cff.py:32
MuonTCMETValueMapProducer_cff.vertexNdof
vertexNdof
Definition: MuonTCMETValueMapProducer_cff.py:40
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::TemplatedSecondaryVertex::dist3d_
Measurement1D dist3d_
Definition: TemplatedSecondaryVertex.h:48