18 theWeightMapIsAvailable(
false),
19 theCovMapAvailable(
false),
20 withRefittedTracks(
false) {}
24 const std::vector<TransientTrack>&
tracks,
26 : theVertexState(pos, posError),
27 theOriginalTracks(tracks),
32 theWeightMapIsAvailable(
false),
33 theCovMapAvailable(
false),
34 withRefittedTracks(
false) {
41 const std::vector<TransientTrack>&
tracks,
43 : theVertexState(pos, time, posTimeError),
44 theOriginalTracks(tracks),
49 theWeightMapIsAvailable(
false),
50 theCovMapAvailable(
false),
51 withRefittedTracks(
false) {
57 const std::vector<TransientTrack>&
tracks,
60 : theVertexState(pos, posError),
61 theOriginalTracks(tracks),
66 theWeightMapIsAvailable(
false),
67 theCovMapAvailable(
false),
68 withRefittedTracks(
false) {}
73 const std::vector<TransientTrack>&
tracks,
76 : theVertexState(pos, time, posTimeError),
77 theOriginalTracks(tracks),
82 theWeightMapIsAvailable(
false),
83 theCovMapAvailable(
false),
84 withRefittedTracks(
false) {}
90 const std::vector<TransientTrack>&
tracks,
92 : thePriorVertexState(priorPos, priorErr),
93 theVertexState(pos, posError),
94 theOriginalTracks(tracks),
99 theWeightMapIsAvailable(
false),
100 theCovMapAvailable(
false),
101 withRefittedTracks(
false) {
106 const double priorTime,
111 const std::vector<TransientTrack>&
tracks,
113 : thePriorVertexState(priorPos, priorTime, priorErr),
114 theVertexState(pos, time, posError),
115 theOriginalTracks(tracks),
120 theWeightMapIsAvailable(
false),
121 theCovMapAvailable(
false),
122 withRefittedTracks(
false) {
130 const std::vector<TransientTrack>&
tracks,
133 : thePriorVertexState(priorPos, priorErr),
134 theVertexState(pos, posError),
135 theOriginalTracks(tracks),
140 theWeightMapIsAvailable(
false),
141 theCovMapAvailable(
false),
142 withRefittedTracks(
false) {}
145 const double priorTime,
150 const std::vector<TransientTrack>&
tracks,
153 : thePriorVertexState(priorPos, priorTime, priorErr),
154 theVertexState(pos, time, posError),
155 theOriginalTracks(tracks),
160 theWeightMapIsAvailable(
false),
161 theCovMapAvailable(
false),
162 withRefittedTracks(
false) {}
165 : theVertexState(state),
166 theOriginalTracks(tracks),
171 theWeightMapIsAvailable(
false),
172 theCovMapAvailable(
false),
173 withRefittedTracks(
false) {
178 const std::vector<TransientTrack>&
tracks,
181 : theVertexState(state),
182 theOriginalTracks(tracks),
187 theWeightMapIsAvailable(
false),
188 theCovMapAvailable(
false),
189 withRefittedTracks(
false) {}
193 const std::vector<TransientTrack>&
tracks,
195 : thePriorVertexState(prior),
196 theVertexState(state),
197 theOriginalTracks(tracks),
202 theWeightMapIsAvailable(
false),
203 theCovMapAvailable(
false),
204 withRefittedTracks(
false) {
210 const std::vector<TransientTrack>&
tracks,
213 : thePriorVertexState(prior),
214 theVertexState(state),
215 theOriginalTracks(tracks),
220 theWeightMapIsAvailable(
false),
221 theCovMapAvailable(
false),
222 withRefittedTracks(
false) {}
230 if (refittedTracks.empty())
231 throw VertexException(
"TransientVertex::refittedTracks: No refitted tracks stored in input container");
243 std::vector<TransientTrack>::const_iterator foundTrack =
247 TransientTrackToFloatMap::const_iterator it =
theWeightMap.find(track);
256 throw VertexException(
"TransientVertex::Track-to-track covariance matrices not available");
267 TTtoTTmap::const_iterator it =
theCovMap.find(*tr1);
269 const TTmap& tm = it->second;
270 TTmap::const_iterator nit = tm.find(*tr2);
271 if (nit != tm.end()) {
272 return (nit->second);
274 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
277 throw VertexException(
"TransientVertex::requested Track-to-track covariance matrix does not exist");
308 theVertexState.error4D().matrix4D(),
309 theVertexState.time(),
312 theOriginalTracks.size());
313 for (std::vector<TransientTrack>::const_iterator
i = theOriginalTracks.begin();
i != theOriginalTracks.end(); ++
i) {
319 if (withRefittedTracks) {
320 vertex.
add((*i).trackBaseRef(), refittedTrack(*i).track(),
trackWeight(*
i));
330 using namespace reco;
336 vtxCompPtrCand.
setTime(vertexState().time());
337 vtxCompPtrCand.setCovariance(vertexState().error4D().matrix4D());
338 vtxCompPtrCand.setChi2AndNdof(totalChiSquared(), degreesOfFreedom());
342 for (std::vector<reco::TransientTrack>::const_iterator
tt = theOriginalTracks.begin();
tt != theOriginalTracks.end();
349 edm::LogError(
"DynamicCastingFailed") <<
"Casting of TransientTrack to CandidatePtrTransientTrack failed!";
352 vtxCompPtrCand.addDaughter(cptt->
candidate());
357 vtxCompPtrCand.setP4(p4);
358 return vtxCompPtrCand;
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
const bool isValid(const Frame &aFrame, const FrameQuality &aQuality, const uint16_t aExpectedPos)
CandidatePtr candidate() const override
bool theWeightMapIsAvailable
std::map< reco::TransientTrack, float > TransientTrackToFloatMap
void add(Ref const &r, float w=1.0)
add a reference to a Track
auto const & tracks
cannot be loose
Log< level::Error, false > LogError
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
void setTime(double time)
reco::TransientTrack refittedTrack(const reco::TransientTrack &track) const
TransientTrackToFloatMap theWeightMap
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > theOriginalTracks
float trackWeight(const reco::TransientTrack &track) const
reco::TransientTrack originalTrack(const reco::TransientTrack &refTrack) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
static int position[264][3]
math::XYZPoint Point
point in the space
std::vector< reco::TransientTrack > const & refittedTracks() const
std::vector< reco::TransientTrack > theRefittedTracks
AlgebraicMatrix33 tkToTkCovariance(const reco::TransientTrack &t1, const reco::TransientTrack &t2) const
TransientTrackToFloatMap weightMap() const
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)