9 template <
unsigned int N>
12 const std::vector<RefCountedVertexTrack> & tks,
14 : theVertexState(pos, posErr),
15 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
16 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
23 template <
unsigned int N>
26 const std::vector<RefCountedVertexTrack> & tks,
28 : theVertexState(pos, posWeight),
29 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
30 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
36 template <
unsigned int N>
39 const std::vector<RefCountedVertexTrack> & tks,
41 : theVertexState(weightTimesPosition, posWeight),
42 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
43 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
47 template <
unsigned int N>
49 const std::vector<RefCountedVertexTrack> & tks,
51 : theVertexState(aVertexState),
52 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
53 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
58 template <
unsigned int N>
60 const std::vector<RefCountedVertexTrack> & tks,
63 : theVertexState(aVertexState),
64 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
65 theTracks(tks), theCovMap(covMap), theCovMapAvailable(
true),
71 template <
unsigned int N>
74 const std::vector<RefCountedVertexTrack> & tks,
76 : theVertexState(aVertexState), theChiSquared(totalChiSq),
77 theNDF(0), theNDFAvailable(
false), theTracks(tks),
78 theCovMapAvailable(
false), thePriorVertexState(priorVertexState),
83 template <
unsigned int N>
88 const std::vector<RefCountedVertexTrack> & tks,
90 : theVertexState(pos, posErr),
91 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
92 theTracks(tks), theCovMapAvailable(
false),
93 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true)
98 template <
unsigned int N>
103 const std::vector<RefCountedVertexTrack> & tks,
105 : theVertexState(pos, posWeight),
106 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
107 theTracks(tks), theCovMapAvailable(
false),
108 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true)
113 template <
unsigned int N>
118 const std::vector<RefCountedVertexTrack> & tks,
120 : theVertexState(weightTimesPosition, posWeight),
121 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
122 theTracks(tks), theCovMapAvailable(
false),
123 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true)
127 template <
unsigned int N>
130 const std::vector<RefCountedVertexTrack> & tks,
133 : theVertexState(aVertexState), theChiSquared(totalChiSq),
134 theNDF(0), theNDFAvailable(
false), theTracks(tks),
135 theCovMap(covMap), theCovMapAvailable(
true),
136 thePriorVertexState(priorVertexState), withPrior(
true), theValid(
true)
141 template <
unsigned int N>
143 : theChiSquared(-1), theNDF(0), theNDFAvailable(
false), theTracks(),
148 template <
unsigned int N>
151 return theVertexState.position();
155 template <
unsigned int N>
158 return theVertexState.error();
162 template <
unsigned int N>
165 return theVertexState.weight();
169 template <
unsigned int N>
172 return theVertexState.weightTimesPosition();
176 template <
unsigned int N>
179 if (!theNDFAvailable) computeNDF();
184 template <
unsigned int N>
188 for (
typename std::vector<RefCountedVertexTrack>::const_iterator itk = theTracks.begin();
189 itk != theTracks.end(); ++itk) {
190 theNDF += (**itk).weight();
193 if (!withPrior) theNDF -= 3.;
194 theNDFAvailable =
true;
198 template <
unsigned int N>
203 if (!tkToTkCovarianceIsAvailable()) {
204 throw VertexException(
"CachingVertex::TkTkCovariance requested before been calculated");
219 typename TrackToTrackMap::const_iterator it = theCovMap.find(tr1);
220 if (it != theCovMap.end()) {
222 typename TrackMap::const_iterator nit = tm.find(tr2);
223 if (nit != tm.end()) {
224 if (transp)
return( ROOT::Math::Transpose(nit->second) );
225 else return( nit->second);
228 throw VertexException(
"CachingVertex::requested TkTkCovariance does not exist");
232 throw VertexException(
"CachingVertex::requested TkTkCovariance does not exist");
237 template <
unsigned int N>
243 typedef std::map<reco::TransientTrack, float> TransientTrackToFloatMap;
246 std::vector<reco::TransientTrack> ttVect;
247 ttVect.reserve(theTracks.size());
248 std::vector<reco::TransientTrack> refTTVect;
249 TransientTrackToFloatMap theWeightMap;
253 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i = theTracks.begin();
254 i != theTracks.end(); ++
i) {
259 ttVect.push_back(t1);
261 theWeightMap[t1] = (**i).weight();
264 if (theCovMapAvailable) {
265 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
j = (
i+1);
266 j != theTracks.end(); ++
j) {
268 ttCovMap[t1][
t2] = tkToTkCovariance(*
i, *
j);
271 if ((**i).refittedStateAvailable()) {
272 refTTVect.push_back( (**i).refittedState()->transientTrack()) ;
277 tv =
TransientVertex(priorVertexState(), vertexState(), ttVect, totalChiSquared(), degreesOfFreedom());
279 tv =
TransientVertex(vertexState(), ttVect, totalChiSquared(), degreesOfFreedom());
TrackToTrackMap theCovMap
std::map< reco::TransientTrack, TTmap > TTtoTTmap
auto const T2 &decltype(t1.eta()) t2
AlgebraicVector3 weightTimesPosition() const
GlobalWeight weight() const
ROOT::Math::SVector< double, 3 > AlgebraicVector3
std::map< RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap
float degreesOfFreedom() const
AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, const RefCountedVertexTrack t2) const
GlobalPoint position() const
ROOT::Math::SMatrix< double, N-2, N-2, ROOT::Math::MatRepStd< double, N-2, N-2 > > AlgebraicMatrixMM
std::vector< reco::TransientTrack > const & refittedTracks() const
volatile std::atomic< bool > shutdown_flag false
GlobalError error() const
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
TransientTrackToFloatMap weightMap() const