CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Types
GsfVertexWeightCalculator Class Reference

#include <GsfVertexWeightCalculator.h>

Public Types

typedef ReferenceCountingPointer< LinearizedTrackState< 5 > > RefCountedLinearizedTrackState
 

Public Member Functions

double calculate (const VertexState &oldVertex, const RefCountedLinearizedTrackState track, double cov) const
 

Private Types

typedef LinearizedTrackState< 5 >::AlgebraicMatrixN3 AlgebraicMatrixN3
 
typedef LinearizedTrackState< 5 >::AlgebraicMatrixNM AlgebraicMatrixNM
 
typedef LinearizedTrackState< 5 >::AlgebraicSymMatrixNN AlgebraicSymMatrixNN
 
typedef LinearizedTrackState< 5 >::AlgebraicVectorN AlgebraicVectorN
 

Detailed Description

Calulates the (non-normalised) weight of a component the new mixture of vertices for the Gaussian Sum vertex filter. (c.f. Th.Speer & R. Fruewirth, Comp.Phys.Comm 174, 935 (2006) )

Definition at line 14 of file GsfVertexWeightCalculator.h.

Member Typedef Documentation

◆ AlgebraicMatrixN3

Definition at line 28 of file GsfVertexWeightCalculator.h.

◆ AlgebraicMatrixNM

Definition at line 29 of file GsfVertexWeightCalculator.h.

◆ AlgebraicSymMatrixNN

Definition at line 30 of file GsfVertexWeightCalculator.h.

◆ AlgebraicVectorN

Definition at line 27 of file GsfVertexWeightCalculator.h.

◆ RefCountedLinearizedTrackState

Definition at line 16 of file GsfVertexWeightCalculator.h.

Member Function Documentation

◆ calculate()

double GsfVertexWeightCalculator::calculate ( const VertexState oldVertex,
const RefCountedLinearizedTrackState  track,
double  cov 
) const

Method to calculate the weight A negative weight is returned in case of error.

Definition at line 7 of file GsfVertexWeightCalculator.cc.

9  {
10  double previousWeight = oldVertex.weightInMixture() * track->weightInMixture();
11  // Jacobians
12  const AlgebraicMatrixN3& a = track->positionJacobian();
13  const AlgebraicMatrixNM& b = track->momentumJacobian();
14 
15  //track information
16  AlgebraicVectorN trackParameters = track->predictedStateParameters();
17  AlgebraicSymMatrixNN trackParametersError = track->predictedStateError();
18  //vertex information
19  AlgebraicSymMatrix33 oldVertexError = oldVertex.error().matrix();
20  //Vertex position
21  GlobalPoint oldVertexPosition = oldVertex.position();
22  AlgebraicVector3 oldVertexCoord;
23  oldVertexCoord[0] = oldVertexPosition.x();
24  oldVertexCoord[1] = oldVertexPosition.y();
25  oldVertexCoord[2] = oldVertexPosition.z();
26 
27  // prior momentum information
28  AlgebraicVector3 priorMomentum = track->predictedStateMomentumParameters();
29 
30  AlgebraicSymMatrix33 priorMomentumCov;
31  priorMomentumCov(0, 0) = 1.0E-9;
32  priorMomentumCov(1, 1) = 1.0E-6;
33  priorMomentumCov(2, 2) = 1.0E-6;
34  priorMomentumCov *= cov;
35 
36  AlgebraicVectorN diff = trackParameters - track->constantTerm() - a * oldVertexCoord - b * priorMomentum;
37  track->checkParameters(diff);
38  AlgebraicSymMatrixNN sigmaM =
39  trackParametersError + ROOT::Math::Similarity(a, oldVertexError) + ROOT::Math::Similarity(b, priorMomentumCov);
40 
41  double sigmaDet;
42  sigmaM.Det(sigmaDet);
43  int ifail = !sigmaM.Invert();
44  if (ifail != 0) {
45  edm::LogWarning("GsfVertexWeightCalculator") << "S matrix inversion failed";
46  return -1.;
47  }
48 
49  double chi = ROOT::Math::Similarity(diff, sigmaM);
50  ; //SigmaM is now inverted !!!
51  double weight = pow(2. * M_PI, -0.5 * 5) * sqrt(1. / sigmaDet) * exp(-0.5 * chi);
52 
53  if (edm::isNotFinite(weight) || sigmaDet <= 0.) {
54  edm::LogWarning("GsfVertexWeightCalculator") << "Weight is NaN";
55  return -1.;
56  }
57 
58  return weight * previousWeight;
59 }

References a, b, change_name::diff, VertexState::error(), JetChargeProducer_cfi::exp, edm::isNotFinite(), M_PI, GlobalErrorBase< T, ErrorWeightType >::matrix(), VertexState::position(), funct::pow(), mathSSE::sqrt(), HLT_FULL_cff::track, VertexState::weightInMixture(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by GsfVertexUpdator::createNewComponent(), and GsfVertexSmoother::createNewComponent().

change_name.diff
diff
Definition: change_name.py:13
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
edm::isNotFinite
constexpr bool isNotFinite(T x)
Definition: isFinite.h:9
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GlobalErrorBase::matrix
const AlgebraicSymMatrix33 matrix() const
Definition: GlobalErrorBase.h:121
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
GsfVertexWeightCalculator::AlgebraicMatrixN3
LinearizedTrackState< 5 >::AlgebraicMatrixN3 AlgebraicMatrixN3
Definition: GsfVertexWeightCalculator.h:28
VertexState::weightInMixture
double weightInMixture() const
Definition: VertexState.h:81
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
VertexState::error
GlobalError error() const
Definition: VertexState.h:64
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GsfVertexWeightCalculator::AlgebraicSymMatrixNN
LinearizedTrackState< 5 >::AlgebraicSymMatrixNN AlgebraicSymMatrixNN
Definition: GsfVertexWeightCalculator.h:30
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
VertexState::position
GlobalPoint position() const
Definition: VertexState.h:62
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
GsfVertexWeightCalculator::AlgebraicVectorN
LinearizedTrackState< 5 >::AlgebraicVectorN AlgebraicVectorN
Definition: GsfVertexWeightCalculator.h:27
GsfVertexWeightCalculator::AlgebraicMatrixNM
LinearizedTrackState< 5 >::AlgebraicMatrixNM AlgebraicMatrixNM
Definition: GsfVertexWeightCalculator.h:29
weight
Definition: weight.py:1