18 if (prevVtxComponents.empty()) {
19 throw VertexException(
"GsfVertexUpdator::(Previous) Vertex to update has no components");
22 LTC ltComponents =
track->linearizedTrack()->components();
23 if (ltComponents.empty()) {
24 throw VertexException(
"GsfVertexUpdator::Track to add to vertex has no components");
27 if ((ltComponents.size() == 1) && (prevVtxComponents.size() == 1))
32 std::vector<VertexComponent> newVertexComponents;
33 newVertexComponents.reserve(prevVtxComponents.size() * ltComponents.size());
40 for (VSC::iterator vertexCompIter = prevVtxComponents.begin(); vertexCompIter != prevVtxComponents.end();
42 for (LTC::iterator trackCompIter = ltComponents.begin(); trackCompIter != ltComponents.end(); trackCompIter++) {
45 if (!newVertexComponents.back().first.isValid())
53 std::vector<RefCountedVertexTrack> newVertexTracks = oldVertex.
tracks();
54 newVertexTracks.push_back(
track);
99 throw VertexException(
"GsfVertexUpdator::sign of -1 not yet implemented.");
103 if (weightInMixture < 0.)
122 const std::vector<GsfVertexUpdator::VertexComponent>& newVertexComponents)
const {
123 VSC vertexComponents;
124 vertexComponents.reserve(newVertexComponents.size());
129 double totalChi2 = 0.;
131 for (std::vector<VertexComponent>::const_iterator iter = newVertexComponents.begin();
132 iter != newVertexComponents.end();
138 edm::LogWarning(
"GsfVertexUpdator") <<
"Updated Vertex has total weight of 0. " 139 <<
"The track is probably very far away.";
143 for (std::vector<VertexComponent>::const_iterator iter = newVertexComponents.begin();
144 iter != newVertexComponents.end();
147 if (iter->second.first > DBL_MIN) {
148 vertexComponents.push_back(
VertexState(iter->first.weightTimesPosition(), iter->first.weight(),
weight));
149 totalChi2 += iter->second.second *
weight;
155 if (vertexComponents.empty()) {
156 edm::LogWarning(
"GsfVertexUpdator") <<
"No Vertex State left after reweighting.";
double calculate(const VertexState &oldVertex, const RefCountedLinearizedTrackState track, double cov) const
CachingVertex< 5 > merge(const CachingVertex< 5 > &vertex) const
CachingVertex< 5 > add(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const override
GlobalPoint priorPosition() const
VertexComponent createNewComponent(const VertexState &oldVertex, const RefCountedLinearizedTrackState linTrack, float weight, int sign) const
GsfVertexWeightCalculator theWeightCalculator
VertexState positionUpdate(const VertexState &oldVertex, const RefCountedLinearizedTrackState linearizedTrack, const float weight, int sign) const
std::vector< VertexState > VSC
bool isValid() const
Make the ReferenceCountingProxy method to check validity public.
VertexChi2Pair assembleVertexComponents(const std::vector< VertexComponent > &newVertexComponents) const
VertexState const & vertexState() const
GlobalError priorError() const
CachingVertex< 5 > remove(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const override
KalmanVertexUpdator< 5 > kalmanVertexUpdator
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
float totalChiSquared() const
std::vector< RefCountedVertexTrack > tracks() const
GlobalWeight weight() const
Abs< T >::type abs(const T &t)
std::vector< VertexState > components() const
GsfVertexUpdator(bool limit=false, const GsfVertexMerger *merger=nullptr)
AlgebraicVector3 weightTimesPosition() const
GsfVertexMerger * clone() const
DeepCopyPointerByClone< GsfVertexMerger > theMerger
std::pair< bool, double > chi2Increment(const VertexState &oldVertex, const VertexState &newVertexState, const RefCountedLinearizedTrackState linearizedTrack, float weight) const
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const override
std::pair< VertexState, double > VertexChi2Pair
std::pair< double, double > WeightChi2Pair
Log< level::Warning, false > LogWarning
std::vector< RefCountedLinearizedTrackState > LTC
float trackWeight(const reco::Vertex &sv, const reco::TransientTrack &track)
std::pair< VertexState, WeightChi2Pair > VertexComponent