CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BasicSingleVertexState.cc
Go to the documentation of this file.
3 
5  : thePos(GlobalPoint(0, 0, 0)), thePosAvailable(false),
6  theErr(AlgebraicSymMatrix33()), theErrAvailable(false),
7  theWeight(AlgebraicSymMatrix33()), theWeightAvailable(false),
8  theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false),
9  valid(false), theWeightInMix(0.)
10 {}
11 
12 
14  const GlobalError & posErr,
15  const double & weightInMix)
16  : thePos(pos), thePosAvailable(true),
17  theErr(posErr), theErrAvailable(true),
18  theWeight(AlgebraicSymMatrix33()), theWeightAvailable(false),
19  theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false),
20  valid(true), theWeightInMix(weightInMix)
21 {}
22 
23 
25  const GlobalWeight & posWeight,
26  const double & weightInMix)
27  : thePos(pos), thePosAvailable(true),
28  theErr(AlgebraicSymMatrix33()), theErrAvailable(false),
29  theWeight(posWeight), theWeightAvailable(true),
30  theWeightTimesPos(AlgebraicVector3()), theWeightTimesPosAvailable(false),
31  valid(true), theWeightInMix(weightInMix)
32 {}
33 
34 
36  const GlobalWeight & posWeight,
37  const double & weightInMix)
38  : thePos(GlobalPoint(0, 0, 0)), thePosAvailable(false),
39  theErr(AlgebraicSymMatrix33()), theErrAvailable(false),
40  theWeight(posWeight), theWeightAvailable(true),
41  theWeightTimesPos(weightTimesPosition), theWeightTimesPosAvailable(true),
42  valid(true), theWeightInMix(weightInMix)
43 {//std::cout <<"BasicSingleVertexState ctor\n";
44 }
45 
47 {
48  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
50  return thePos;
51 }
52 
53 
55 {
56  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
58  return theErr;
59 }
60 
61 
63 {
64  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
66  return theWeight;
67 }
68 
69 
71 {
72  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
74  return theWeightTimesPos;
75 }
76 
77 
79 {
80  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
81  return theWeightInMix;
82 }
83 // RefCountedVertexSeed BasicSingleVertexState::seedWithoutTracks() const
84 // {
85 // RefCountedVertexSeed v = new VertexSeed(position(), error());
86 // return v;
87 // }
88 
89 
90 
92 {
93  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
95  thePos = GlobalPoint(pos[0], pos[1], pos[2]);
96  thePosAvailable = true;
97 }
98 
99 
101 {
102  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
103  int ifail;
104  theErr = weight().matrix().Inverse(ifail);
105  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert weight matrix");
106  theErrAvailable = true;
107 }
108 
109 
111 {
112  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
113  int ifail;
114  theWeight = error().matrix().Inverse(ifail);
115  if (ifail != 0) throw VertexException("BasicSingleVertexState::could not invert error matrix");
116  theWeightAvailable = true;
117 }
118 
119 
121 {
122  if (!valid) throw VertexException("BasicSingleVertexState::invalid");
123  AlgebraicVector3 pos; pos(0) = position().x();
124  pos(1) = position().y(); pos(2) = position().z();
127 }
128 
129 
Common base class.
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
const AlgebraicSymMatrix33 & matrix() const
T y() const
Definition: PV3DBase.h:62
const AlgebraicSymMatrix33 & matrix_new() const
AlgebraicVector3 theWeightTimesPos
GlobalWeight weight() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
GlobalError error() const
T z() const
Definition: PV3DBase.h:63
GlobalPoint position() const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
AlgebraicVector3 weightTimesPosition() const
T x() const
Definition: PV3DBase.h:61