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),
22 template <
unsigned int N>
26 const std::vector<RefCountedVertexTrack> & tks,
28 : theVertexState(pos, time, posTimeErr),
29 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
30 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
37 template <
unsigned int N>
40 const std::vector<RefCountedVertexTrack> & tks,
42 : theVertexState(pos, posWeight),
43 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
44 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
49 template <
unsigned int N>
53 const std::vector<RefCountedVertexTrack> & tks,
55 : theVertexState(pos, time, posTimeWeight),
56 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
57 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
63 template <
unsigned int N>
66 const std::vector<RefCountedVertexTrack> & tks,
68 : theVertexState(weightTimesPosition, posWeight),
69 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
70 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
75 template <
unsigned int N>
78 const std::vector<RefCountedVertexTrack> & tks,
80 : theVertexState(weightTimesPosition, posWeight),
81 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
82 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
86 template <
unsigned int N>
88 const std::vector<RefCountedVertexTrack> & tks,
90 : theVertexState(aVertexState),
91 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
92 theTracks(tks), theCovMapAvailable(
false), withPrior(
false),
94 vertexIs4D( aVertexState.is4D() )
98 template <
unsigned int N>
100 const std::vector<RefCountedVertexTrack> & tks,
103 : theVertexState(aVertexState),
104 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
105 theTracks(tks), theCovMap(covMap), theCovMapAvailable(
true),
107 vertexIs4D( aVertexState.is4D() )
112 template <
unsigned int N>
115 const std::vector<RefCountedVertexTrack> & tks,
117 : theVertexState(aVertexState), theChiSquared(totalChiSq),
118 theNDF(0), theNDFAvailable(
false), theTracks(tks),
119 theCovMapAvailable(
false), thePriorVertexState(priorVertexState),
121 vertexIs4D( priorVertexState.is4D() && aVertexState.is4D() )
125 template <
unsigned int N>
130 const std::vector<RefCountedVertexTrack> & tks,
132 : theVertexState(pos, posErr),
133 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
134 theTracks(tks), theCovMapAvailable(
false),
135 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true), vertexIs4D(
false)
139 template <
unsigned int N>
141 const double priorTime,
146 const std::vector<RefCountedVertexTrack> & tks,
148 : theVertexState(pos, time,posErr),
149 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
150 theTracks(tks), theCovMapAvailable(
false),
151 thePriorVertexState(priorPos, priorTime, priorErr), withPrior(
true),
157 template <
unsigned int N>
162 const std::vector<RefCountedVertexTrack> & tks,
164 : theVertexState(pos, posWeight),
165 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
166 theTracks(tks), theCovMapAvailable(
false),
167 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true), vertexIs4D(
false)
171 template <
unsigned int N>
173 const double priorTime,
178 const std::vector<RefCountedVertexTrack> & tks,
180 : theVertexState(pos, priorTime, posWeight),
181 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
182 theTracks(tks), theCovMapAvailable(
false),
183 thePriorVertexState(priorPos, priorTime, priorErr), withPrior(
true),
189 template <
unsigned int N>
194 const std::vector<RefCountedVertexTrack> & tks,
196 : theVertexState(weightTimesPosition, posWeight),
197 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
198 theTracks(tks), theCovMapAvailable(
false),
199 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true)
203 template <
unsigned int N>
208 const std::vector<RefCountedVertexTrack> & tks,
210 : theVertexState(weightTimesPosition, posWeight),
211 theChiSquared(totalChiSq), theNDF(0), theNDFAvailable(
false),
212 theTracks(tks), theCovMapAvailable(
false),
213 thePriorVertexState(priorPos, priorErr), withPrior(
true), theValid(
true)
217 template <
unsigned int N>
220 const std::vector<RefCountedVertexTrack> & tks,
223 : theVertexState(aVertexState), theChiSquared(totalChiSq),
224 theNDF(0), theNDFAvailable(
false), theTracks(tks),
225 theCovMap(covMap), theCovMapAvailable(
true),
226 thePriorVertexState(priorVertexState), withPrior(
true), theValid(
true),
227 vertexIs4D( priorVertexState.is4D() && aVertexState.is4D() )
232 template <
unsigned int N>
234 : theChiSquared(-1), theNDF(0), theNDFAvailable(
false), theTracks(),
239 template <
unsigned int N>
242 return theVertexState.position();
245 template <
unsigned int N>
248 return theVertexState.time();
251 template <
unsigned int N>
254 return theVertexState.error();
257 template <
unsigned int N>
260 return theVertexState.error4D();
264 template <
unsigned int N>
267 return theVertexState.weight();
270 template <
unsigned int N>
273 return theVertexState.weight4D();
277 template <
unsigned int N>
280 return theVertexState.weightTimesPosition();
283 template <
unsigned int N>
286 return theVertexState.weightTimesPosition4D();
289 template <
unsigned int N>
292 if (!theNDFAvailable) computeNDF();
297 template <
unsigned int N>
301 for (
typename std::vector<RefCountedVertexTrack>::const_iterator itk = theTracks.begin();
302 itk != theTracks.end(); ++itk) {
303 theNDF += (**itk).weight();
306 const double adjust = ( vertexIs4D ? 4 : 3 );
307 if (!withPrior) theNDF -= adjust;
308 theNDFAvailable =
true;
312 template <
unsigned int N>
317 if (!tkToTkCovarianceIsAvailable()) {
318 throw VertexException(
"CachingVertex::TkTkCovariance requested before been calculated");
333 typename TrackToTrackMap::const_iterator it = theCovMap.find(tr1);
334 if (it != theCovMap.end()) {
336 typename TrackMap::const_iterator nit = tm.find(tr2);
337 if (nit != tm.end()) {
338 if (transp)
return( ROOT::Math::Transpose(nit->second) );
339 else return( nit->second);
342 throw VertexException(
"CachingVertex::requested TkTkCovariance does not exist");
346 throw VertexException(
"CachingVertex::requested TkTkCovariance does not exist");
351 template <
unsigned int N>
357 typedef std::map<reco::TransientTrack, float> TransientTrackToFloatMap;
360 std::vector<reco::TransientTrack> ttVect;
361 ttVect.reserve(theTracks.size());
362 std::vector<reco::TransientTrack> refTTVect;
363 TransientTrackToFloatMap theWeightMap;
367 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
i = theTracks.begin();
368 i != theTracks.end(); ++
i) {
373 ttVect.push_back(t1);
375 theWeightMap[t1] = (**i).weight();
378 if (theCovMapAvailable) {
379 for (
typename std::vector<RefCountedVertexTrack>::const_iterator
j = (
i+1);
380 j != theTracks.end(); ++
j) {
382 ttCovMap[t1][
t2] = tkToTkCovariance(*
i, *
j);
385 if ((**i).refittedStateAvailable()) {
386 refTTVect.push_back( (**i).refittedState()->transientTrack()) ;
391 tv =
TransientVertex(priorVertexState(), vertexState(), ttVect, totalChiSquared(), degreesOfFreedom());
393 tv =
TransientVertex(vertexState(), ttVect, totalChiSquared(), degreesOfFreedom());
TrackToTrackMap theCovMap
std::map< reco::TransientTrack, TTmap > TTtoTTmap
GlobalError error4D() const
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
AlgebraicVector4 weightTimesPosition4D() const
AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, const RefCountedVertexTrack t2) const
GlobalWeight weight4D() 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
ROOT::Math::SVector< double, 4 > AlgebraicVector4
GlobalError error() const
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
TransientTrackToFloatMap weightMap() const