CMS 3D CMS Logo

VertexState.h
Go to the documentation of this file.
1 #ifndef RecoVertex_VertexPrimitives_VertexState_H
2 #define RecoVertex_VertexPrimitives_VertexState_H
3 
7 #include <vector>
8 
13 class VertexState final : private BasicVertexState::Proxy {
14 
17  public:
19  VertexState(VertexState const&) = default;
20  VertexState(VertexState &&) = default;
21  VertexState & operator=(const VertexState&) = default;
22  VertexState & operator=(VertexState&&) = default;
23 
24  // template<typename... Args>
25  // VertexState(Args && ...args) :
26  // Base ( new BSVS ( std::forward<Args>(args)...)){}
27 
29  Base(p) {}
30 
31  explicit VertexState(const reco::BeamSpot& beamSpot) :
32  Base ( new BSVS ( GlobalPoint(Basic3DVector<float> (beamSpot.position())),
33  GlobalError(beamSpot.rotatedCovariance3D()), 1.0)) {}
34 
35 
37  const GlobalError & posErr,
38  const double & weightInMix= 1.0) :
39  Base ( new BSVS (pos, posErr, weightInMix)) {}
40 
42  const GlobalWeight & posWeight,
43  const double & weightInMix= 1.0) :
44  Base ( new BSVS (pos, posWeight, weightInMix)) {}
45 
47  const GlobalWeight & posWeight,
48  const double & weightInMix= 1.0) :
49  Base ( new BSVS (weightTimesPosition, posWeight, weightInMix)) {}
50 
51  // with time
52  VertexState(const GlobalPoint & pos, const double time,
53  const GlobalError & posTimeErr,
54  const double & weightInMix = 1.0) :
55  Base ( new BSVS (pos, time, posTimeErr, weightInMix)) {}
56 
57  VertexState(const GlobalPoint & pos, const double time,
58  const GlobalWeight & posTimeWeight,
59  const double & weightInMix = 1.0) :
60  Base ( new BSVS (pos, time, posTimeWeight, weightInMix)) {}
61 
63  const GlobalWeight & posTimeWeight,
64  const double & weightInMix = 1.0) :
65  Base ( new BSVS (weightTimesPosition, posTimeWeight, weightInMix)) {}
66 
67 
68  //3D covariance matrices (backwards compatible)
70  {
71  return data().position();
72  }
73 
75  {
76  return data().error();
77  }
78 
79  // with time, full cov
81  {
82  return data().error4D();
83  }
84 
86  {
87  return data().weight();
88  }
89 
91  {
92  return data().weight4D();
93  }
94 
95  double time() const {
96  return data().time();
97  }
98 
99  double timeError() const {
100  return data().timeError();
101  }
102 
104  {
105  return data().weightTimesPosition();
106  }
107 
109  {
110  return data().weightTimesPosition4D();
111  }
112 
113  double weightInMixture() const
114  {
115  return data().weightInMixture();
116  }
117 
120 // RefCountedVertexSeed seedWithoutTracks() const
121 // {
122 // return data().seedWithoutTracks();
123 // }
124 
125  std::vector<VertexState> components() const
126  {
127  return data().components();
128  }
129 
131  bool isValid() const {return Base::isValid() && data().isValid();}
132 
133  bool is4D() const { return data().is4D(); }
134 
135 };
136 
137 #endif
138 
VertexState(BasicVertexState *p)
Definition: VertexState.h:28
VertexState(const GlobalPoint &pos, const double time, const GlobalError &posTimeErr, const double &weightInMix=1.0)
Definition: VertexState.h:52
VertexState(const reco::BeamSpot &beamSpot)
Definition: VertexState.h:31
GlobalPoint position() const
Definition: VertexState.h:69
GlobalWeight weight4D() const
Definition: VertexState.h:90
VertexState(const AlgebraicVector4 &weightTimesPosition, const GlobalWeight &posTimeWeight, const double &weightInMix=1.0)
Definition: VertexState.h:62
double weightInMixture() const
Definition: VertexState.h:113
AlgebraicVector3 weightTimesPosition() const
Definition: VertexState.h:103
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::vector< VertexState > components() const
Definition: VertexState.h:125
double time() const
Definition: VertexState.h:95
double timeError() const
Definition: VertexState.h:99
VertexState(const GlobalPoint &pos, const double time, const GlobalWeight &posTimeWeight, const double &weightInMix=1.0)
Definition: VertexState.h:57
VertexState(const GlobalPoint &pos, const GlobalWeight &posWeight, const double &weightInMix=1.0)
Definition: VertexState.h:41
ProxyBase< BasicVertexState, CopyUsingClone< BasicVertexState > > Proxy
GlobalWeight weight() const
Definition: VertexState.h:85
GlobalError error4D() const
Definition: VertexState.h:80
const T & data() const
Definition: ProxyBase.h:65
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
Definition: VertexState.h:131
bool isValid() const
Definition: ProxyBase.h:79
AlgebraicVector4 weightTimesPosition4D() const
Definition: VertexState.h:108
bool is4D() const
Definition: VertexState.h:133
GlobalError error() const
Definition: VertexState.h:74
VertexState(const GlobalPoint &pos, const GlobalError &posErr, const double &weightInMix=1.0)
Definition: VertexState.h:36
VertexState & operator=(const VertexState &)=default
ROOT::Math::SVector< double, 4 > AlgebraicVector4
VertexState(const AlgebraicVector3 &weightTimesPosition, const GlobalWeight &posWeight, const double &weightInMix=1.0)
Definition: VertexState.h:46