12 theChi2(0), theNDF(0), vertexValid(
false), withPrior(
false),
13 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
14 withRefittedTracks(
false)
19 const std::vector<TransientTrack> &
tracks,
float chi2) :
20 theVertexState(pos, posError), theOriginalTracks(tracks),
21 theChi2(chi2), theNDF(0), vertexValid(
true), withPrior(
false),
22 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
23 withRefittedTracks(
false)
30 const std::vector<TransientTrack> &
tracks,
float chi2) :
31 theVertexState(pos, time, posTimeError), theOriginalTracks(tracks),
32 theChi2(chi2), theNDF(0), vertexValid(
true), withPrior(
false),
33 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
34 withRefittedTracks(
false)
41 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
42 theVertexState(pos, posError), theOriginalTracks(tracks),
43 theChi2(chi2), theNDF(ndf), vertexValid(
true), withPrior(
false),
44 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
45 withRefittedTracks(
false)
51 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
52 theVertexState(pos, time, posTimeError), theOriginalTracks(tracks),
53 theChi2(chi2), theNDF(ndf), vertexValid(
true), withPrior(
false),
54 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
55 withRefittedTracks(
false)
62 const std::vector<TransientTrack> &
tracks,
float chi2) :
63 thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
64 theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(
true),
65 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
66 withRefittedTracks(
false)
73 const std::vector<TransientTrack> &
tracks,
float chi2) :
74 thePriorVertexState(priorPos, priorTime, priorErr), theVertexState(pos, time, posError),
75 theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(
true),
76 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
77 withRefittedTracks(
false)
85 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
86 thePriorVertexState(priorPos, priorErr), theVertexState(pos, posError),
87 theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(
true),
88 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
89 withRefittedTracks(
false)
95 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
96 thePriorVertexState(priorPos, priorTime, priorErr), theVertexState(pos, time, posError),
97 theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(
true),
98 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
99 withRefittedTracks(
false)
105 const std::vector<TransientTrack> &
tracks,
float chi2) :
106 theVertexState(state), theOriginalTracks(tracks),
107 theChi2(chi2), theNDF(0), vertexValid(
true), withPrior(
false),
108 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
109 withRefittedTracks(
false)
116 const std::vector<TransientTrack> &
tracks,
float chi2,
float ndf) :
117 theVertexState(state), theOriginalTracks(tracks),
118 theChi2(chi2), theNDF(ndf), vertexValid(
true), withPrior(
false),
119 theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
120 withRefittedTracks(
false)
127 const std::vector<TransientTrack> &
tracks,
129 thePriorVertexState(prior), theVertexState(state),
130 theOriginalTracks(tracks), theChi2(chi2), theNDF(0), vertexValid(
true),
131 withPrior(
true), theWeightMapIsAvailable(
false), theCovMapAvailable(
false),
132 withRefittedTracks(
false)
140 const std::vector<TransientTrack> &
tracks,
141 float chi2,
float ndf) :
142 thePriorVertexState(prior), theVertexState(state),
143 theOriginalTracks(tracks), theChi2(chi2), theNDF(ndf), vertexValid(
true),
144 withPrior(
true), theWeightMapIsAvailable(
false),
145 theCovMapAvailable(
false), withRefittedTracks(
false)
158 if (refittedTracks.empty())
159 throw VertexException(
"TransientVertex::refittedTracks: No refitted tracks stored in input container");
177 TransientTrackToFloatMap::const_iterator it =
theWeightMap.find(track);
189 throw VertexException(
"TransientVertex::Track-to-track covariance matrices not available");
200 TTtoTTmap::const_iterator it =
theCovMap.find(*tr1);
202 const TTmap & tm = it->second;
203 TTmap::const_iterator nit = tm.find(*tr2);
204 if (nit != tm.end()) {
205 return( nit->second);
208 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
212 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
221 std::vector<TransientTrack>::const_iterator it =
233 std::vector<TransientTrack>::const_iterator it =
244 if (!isValid())
return Vertex();
248 theVertexState.error4D().matrix4D(),
249 theVertexState.time(),
250 totalChiSquared(), degreesOfFreedom(), theOriginalTracks.size() );
251 for (std::vector<TransientTrack>::const_iterator
i = theOriginalTracks.begin();
252 i != theOriginalTracks.end(); ++
i) {
258 if (withRefittedTracks) {
260 vertex.
add((*i).trackBaseRef(), refittedTrack(*i).track(),
trackWeight ( *
i ) );
271 using namespace reco;
277 vtxCompPtrCand.setChi2AndNdof(totalChiSquared(), degreesOfFreedom());
281 for(std::vector<reco::TransientTrack>::const_iterator
tt = theOriginalTracks.begin();
tt != theOriginalTracks.end(); ++
tt)
288 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
292 vtxCompPtrCand.addDaughter(cptt->
candidate());
297 vtxCompPtrCand.setP4(
p4);
298 return vtxCompPtrCand;
CandidatePtr candidate() const
bool theWeightMapIsAvailable
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
std::map< reco::TransientTrack, TTmap > TTtoTTmap
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::map< reco::TransientTrack, AlgebraicMatrix33 > TTmap
T x() const
Cartesian x coordinate.
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
auto const T2 &decltype(t1.eta()) t2
TransientTrackToFloatMap theWeightMap
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
void add(const TrackBaseRef &r, float w=1.0)
add a reference to a Track
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)
reco::TransientTrack originalTrack(const reco::TransientTrack &refTrack) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static int position[264][3]
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > const & refittedTracks() const
volatile std::atomic< bool > shutdown_flag false
std::vector< reco::TransientTrack > theRefittedTracks
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
TransientTrackToFloatMap weightMap() const
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33