CMS 3D CMS Logo

CachingVertex.h
Go to the documentation of this file.
1 #ifndef CachingVertex_H
2 #define CachingVertex_H
3 
7 
10 
13 
14 #include <vector>
15 #include <map>
16 
17 
18 
24 template <unsigned int N>
26 
27 public:
28 
30  typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
31  typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepStd<double,N-2,N-2> > AlgebraicMatrixMM;
32  typedef std::map<RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap;
33  typedef std::map<RefCountedVertexTrack, TrackMap > TrackToTrackMap;
34 
37  // no time
38  CachingVertex(const GlobalPoint & pos, const GlobalError & posErr,
39  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
40 
41  CachingVertex(const GlobalPoint & pos, const GlobalWeight & posWeight,
42  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
43 
45  const GlobalWeight & posWeight,
46  const std::vector<RefCountedVertexTrack> & tks,
47  float totalChiSq);
48 
49  CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
51  const GlobalWeight & posWeight,
52  const std::vector<RefCountedVertexTrack> & tks,
53  float totalChiSq);
54 
55  // with time (tracks must have time as well)
56  CachingVertex(const GlobalPoint & pos, const double time,
57  const GlobalError & posTimeErr,
58  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
59 
60  CachingVertex(const GlobalPoint & pos, const double time,
61  const GlobalWeight & posTimeWeight,
62  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
63 
65  const GlobalWeight & posTimeWeight,
66  const std::vector<RefCountedVertexTrack> & tks,
67  float totalChiSq);
68 
69  CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
71  const GlobalWeight & posWeight,
72  const std::vector<RefCountedVertexTrack> & tks,
73  float totalChiSq);
74 
75  // either time or no time (depends on if the tracks/vertex states have times)
76  CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
77  const GlobalPoint & pos, const GlobalError & posErr,
78  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
79 
80  CachingVertex(const GlobalPoint & priorPos, const double priorTime, const GlobalError & priorErr,
81  const GlobalPoint & pos, const double time, const GlobalError & posErr,
82  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
83 
84  CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
85  const GlobalPoint & pos, const GlobalWeight & posWeight,
86  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
87 
88  CachingVertex(const GlobalPoint & priorPos, const double priorTime, const GlobalError & priorErr,
89  const GlobalPoint & pos, const double time, const GlobalWeight & posWeight,
90  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
91 
92  CachingVertex(const VertexState & aVertexState,
93  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
94 
96  const VertexState & aVertexState,
97  const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
98 
99  CachingVertex(const VertexState & aVertexState,
100  const std::vector<RefCountedVertexTrack> & tks,
101  float totalChiSq, const TrackToTrackMap & covMap);
102 
104  const VertexState & aVertexState,
105  const std::vector<RefCountedVertexTrack> & tks,
106  float totalChiSq, const TrackToTrackMap & covMap);
107 
110  CachingVertex();
111 
114  VertexState const & vertexState() const {return theVertexState;}
116  GlobalPoint position() const;
117  double time() const;
118  GlobalError error() const;
119  GlobalError error4D() const;
120  GlobalWeight weight() const;
121  GlobalWeight weight4D() const;
124  std::vector<RefCountedVertexTrack> tracks() const { return theTracks; }
125  const std::vector<RefCountedVertexTrack> &tracksRef() const { return theTracks; }
127  double priorTime() const { return priorVertexState().time(); }
130  bool hasPrior() const {return withPrior;}
131  bool isValid() const {return theValid;}
132  bool is4D() const { return vertexIs4D; }
133 
136  float totalChiSquared() const { return theChiSquared; }
137  float degreesOfFreedom() const;
138 
141  AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1,
142  const RefCountedVertexTrack t2) const;
144 
145  operator TransientVertex() const;
146 
147 private:
148 
149  void computeNDF() const;
150 
153  mutable float theNDF;
154  mutable bool theNDFAvailable;
155  std::vector<RefCountedVertexTrack> theTracks;
156  TrackToTrackMap theCovMap;
159  bool withPrior;
160 
161  bool theValid;
163 };
164 
165 
166 #endif
bool theCovMapAvailable
std::vector< RefCountedVertexTrack > tracks() const
void computeNDF() const
VertexState thePriorVertexState
VertexState const & vertexState() const
const std::vector< RefCountedVertexTrack > & tracksRef() const
TrackToTrackMap theCovMap
GlobalPoint position() const
Definition: VertexState.h:69
bool is4D() const
GlobalError priorError() const
ReferenceCountingPointer< VertexTrack< N > > RefCountedVertexTrack
Definition: CachingVertex.h:29
GlobalError error4D() const
AlgebraicVector3 weightTimesPosition() const
GlobalWeight weight() const
float totalChiSquared() const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::map< RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap
Definition: CachingVertex.h:32
double time() const
Definition: VertexState.h:95
bool hasPrior() const
float degreesOfFreedom() const
std::vector< RefCountedVertexTrack > theTracks
AlgebraicVector4 weightTimesPosition4D() const
GlobalError error4D() const
Definition: VertexState.h:80
VertexState const & priorVertexState() const
#define N
Definition: blowfish.cc:9
ROOT::Math::SMatrix< double, N, N, ROOT::Math::MatRepSym< double, N > > AlgebraicSymMatrixNN
Definition: CachingVertex.h:30
AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, const RefCountedVertexTrack t2) const
GlobalWeight weight4D() const
bool tkToTkCovarianceIsAvailable() const
GlobalPoint position() const
double priorTime() const
ROOT::Math::SMatrix< double, N-2, N-2, ROOT::Math::MatRepStd< double, N-2, N-2 > > AlgebraicMatrixMM
Definition: CachingVertex.h:31
bool isValid() const
std::map< RefCountedVertexTrack, TrackMap > TrackToTrackMap
Definition: CachingVertex.h:33
GlobalError error() const
Definition: VertexState.h:74
ROOT::Math::SVector< double, 4 > AlgebraicVector4
GlobalError error() const
double time() const
GlobalError priorError4D() const
VertexState theVertexState
GlobalPoint priorPosition() const