CMS 3D CMS Logo

TransientVertex.h
Go to the documentation of this file.
1 #ifndef _Vtx_TransientVertex_H_
2 #define _Vtx_TransientVertex_H_
3 
11 
12 #include <vector>
13 #include <map>
14 
18 class TransientVertex {//: public reco::Vertex {
19 
20 public:
21 
22  typedef std::map<reco::TransientTrack, float> TransientTrackToFloatMap;
23 
27 
35  const std::vector<reco::TransientTrack> & tracks, float chi2);
36  TransientVertex(const GlobalPoint & pos, const double time,
37  const GlobalError & posError,
38  const std::vector<reco::TransientTrack> & tracks, float chi2);
39 
46  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
47  TransientVertex(const GlobalPoint & pos, const double time, const GlobalError & posError,
48  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
49 
56  TransientVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
57  const GlobalPoint & pos, const GlobalError & posError,
58  const std::vector<reco::TransientTrack> & tracks, float chi2);
59  TransientVertex(const GlobalPoint & priorPos, const double priorTime, const GlobalError & priorErr,
60  const GlobalPoint & pos, const double time, const GlobalError & posError,
61  const std::vector<reco::TransientTrack> & tracks, float chi2);
62 
68  TransientVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
69  const GlobalPoint & pos, const GlobalError & posError,
70  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
71  TransientVertex(const GlobalPoint & priorPos, const double priorTime, const GlobalError & priorErr,
72  const GlobalPoint & pos, const double time, const GlobalError & posError,
73  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
74 
80  TransientVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
81  const double priorTime, const double priorTimeErr,
82  const GlobalPoint & pos, const GlobalError & posError,
83  const double time, const double timeErr,
84  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
85 
92  TransientVertex(const VertexState & state,
93  const std::vector<reco::TransientTrack> & tracks, float chi2);
94 
100  TransientVertex(const VertexState & state,
101  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
102 
110  const VertexState & state,
111  const std::vector<reco::TransientTrack> & tracks, float chi2);
112 
119  const VertexState & state,
120  const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf);
121 
122 
123 // /** Constructor defining the RecVertex by its 3D position
124 // * and position uncertainty, its associated tracks, its chi-squared
125 // * and its number of degrees of freedom, and the track weights.
126 // * The ndf can be a float.
127 // */
128 // TransientVertex(const VertexState & state,
129 // const std::vector<reco::TransientTrack> & tracks, float chi2, float ndf,
130 // const reco::TransientTrackToFloatMap & weightMap);
131 
132 
135  VertexState const & vertexState() const { return theVertexState; }
140  double time() const { return theVertexState.time(); }
141  double timeError() const { return theVertexState.timeError(); }
142  double priorTime() const { return thePriorVertexState.time(); }
143  double priorTimeError() const { return thePriorVertexState.timeError(); }
144  bool hasPrior() const { return withPrior; }
145 
146 // /** Implements method of abstract Vertex.
147 // * Returns track pointer container by value
148 // */
149 // Vertex::TrackPtrContainer tracks() const;
150 
151  float totalChiSquared() const { return theChi2; }
152  float normalisedChiSquared() const {
153  return totalChiSquared() / degreesOfFreedom();
154  }
155  float degreesOfFreedom() const { return theNDF; }
156 
160  bool isValid() const {
161  return vertexValid;
162  }
163 
167  std::vector<reco::TransientTrack> const & originalTracks() const {
168  return theOriginalTracks;
169  }
170 
171 
176  bool hasRefittedTracks() const { return withRefittedTracks; }
177 
178 
182  std::vector<reco::TransientTrack> const & refittedTracks() const {
183  return theRefittedTracks;
184  }
185 
192 
198 
199 
202  void refittedTracks(const std::vector<reco::TransientTrack> & refittedTracks);
203 
207  bool hasTrackWeight() const { return theWeightMapIsAvailable; }
208 
209 
217  float trackWeight(const reco::TransientTrack & track) const;
218 
219  TransientTrackToFloatMap weightMap() const { return theWeightMap; }
220 
221  void weightMap(const TransientTrackToFloatMap & theMap);
222 
227 
234  const reco::TransientTrack& t2) const;
235  void tkToTkCovariance(const TTtoTTmap &covMap);
236 
237  operator reco::Vertex() const;
238  operator reco::VertexCompositePtrCandidate() const;
239 
240 private:
241 
242 
245 
246 // void addTracks(const std::vector<reco::TransientTrack> & tracks);
247 
248  std::vector<reco::TransientTrack> theOriginalTracks;
249  std::vector<reco::TransientTrack> theRefittedTracks;
250 
251 
252  float theChi2;
253  float theNDF;
258  TransientTrackToFloatMap theWeightMap;
259 
260 };
261 
262 #endif
GlobalError positionError() const
double priorTime() const
GlobalError priorError() const
float totalChiSquared() const
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
bool hasRefittedTracks() const
std::map< reco::TransientTrack, TTmap > TTtoTTmap
Definition: TTtoTTmap.h:12
GlobalPoint position() const
Definition: VertexState.h:69
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
float normalisedChiSquared() const
VertexState thePriorVertexState
std::vector< reco::TransientTrack > const & originalTracks() const
auto const T2 &decltype(t1.eta()) t2
Definition: deltaR.h:16
float degreesOfFreedom() const
TransientTrackToFloatMap theWeightMap
GlobalPoint position() const
bool hasPrior() const
double time() const
Definition: VertexState.h:95
double timeError() const
Definition: VertexState.h:99
double priorTimeError() const
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
GlobalError error4D() const
Definition: VertexState.h:80
bool hasTrackWeight() const
reco::TransientTrack originalTrack(const reco::TransientTrack &refTrack) const
double time() const
double timeError() const
VertexState theVertexState
bool is4D() const
Definition: VertexState.h:133
GlobalError error() const
Definition: VertexState.h:74
GlobalPoint priorPosition() const
std::vector< reco::TransientTrack > const & refittedTracks() const
std::vector< reco::TransientTrack > theRefittedTracks
VertexState const & vertexState() const
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
bool isValid() const
TransientTrackToFloatMap weightMap() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
bool tkToTkCovarianceIsAvailable() const