7 limitComponents (limit)
23 if (prevVtxComponents.empty()) {
25 (
"GsfVertexUpdator::(Previous) Vertex to update has no components");
28 LTC ltComponents = track->linearizedTrack()->components();
29 if (ltComponents.empty()) {
31 (
"GsfVertexUpdator::Track to add to vertex has no components");
34 if ((ltComponents.size()==1) && (prevVtxComponents.size()==1))
37 float trackWeight = track->weight();
39 std::vector<VertexComponent> newVertexComponents;
40 newVertexComponents.reserve(prevVtxComponents.size()*ltComponents.size());
47 for (VSC::iterator vertexCompIter = prevVtxComponents.begin();
48 vertexCompIter != prevVtxComponents.end(); vertexCompIter++ ) {
49 for (LTC::iterator trackCompIter = ltComponents.begin();
50 trackCompIter != ltComponents.end(); trackCompIter++ ) {
51 newVertexComponents.push_back(
61 std::vector<RefCountedVertexTrack> newVertexTracks = oldVertex.
tracks();
62 newVertexTracks.push_back(track);
69 VertexState newVertexState = vertexChi2Pair.first;
78 newVertexState.weightTimesPosition(),
79 newVertexState.weight(), newVertexTracks, chi2);
112 throw VertexException(
"GsfVertexUpdator::sign of -1 not yet implemented.");
121 linTrack, weight, sign);
135 const std::vector<GsfVertexUpdator::VertexComponent> & newVertexComponents)
const
137 VSC vertexComponents;
138 vertexComponents.reserve(newVertexComponents.size());
142 double totalWeight = 0.;
143 double totalChi2 = 0.;
145 for (std::vector<VertexComponent>::const_iterator iter = newVertexComponents.begin();
146 iter != newVertexComponents.end(); iter ++) {
147 totalWeight += iter->second.first;
150 if (totalWeight<DBL_MIN) {
151 edm::LogWarning(
"GsfVertexUpdator") <<
"Updated Vertex has total weight of 0. "
152 <<
"The track is probably very far away.";
156 for (std::vector<VertexComponent>::const_iterator iter = newVertexComponents.begin();
157 iter != newVertexComponents.end(); iter ++) {
158 double weight = iter->second.first/totalWeight;
159 if (iter->second.first>DBL_MIN) {
160 vertexComponents.push_back(VertexState(iter->first.weightTimesPosition(),
161 iter->first.weight(),
weight));
162 totalChi2 += iter->second.second *
weight;
168 if (vertexComponents.empty()){
169 edm::LogWarning(
"GsfVertexUpdator") <<
"No Vertex State left after reweighting.";
std::pair< bool, double > chi2Increment(const VertexState &oldVertex, const VertexState &newVertexState, const RefCountedLinearizedTrackState linearizedTrack, float weight) const
VertexTrack< 5 >::RefCountedLinearizedTrackState RefCountedLinearizedTrackState
CachingVertex< 5 > merge(const CachingVertex< 5 > &vertex) const
GsfVertexWeightCalculator theWeightCalculator
std::vector< VertexState > VSC
VertexState const & vertexState() const
GsfVertexMerger * clone() const
KalmanVertexUpdator< 5 > kalmanVertexUpdator
GlobalError priorError() const
CachingVertex< 5 >::RefCountedVertexTrack RefCountedVertexTrack
std::vector< RefCountedVertexTrack > const & tracks() const
GsfVertexUpdator(bool limit=false, const GsfVertexMerger *merger=0)
float totalChiSquared() const
Abs< T >::type abs(const T &t)
double calculate(const VertexState &oldVertex, const RefCountedLinearizedTrackState track, double cov) const
CachingVertex< 5 > remove(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const
VertexState positionUpdate(const VertexState &oldVertex, const RefCountedLinearizedTrackState linearizedTrack, const float weight, int sign) const
VertexChi2Pair assembleVertexComponents(const std::vector< VertexComponent > &newVertexComponents) const
CachingVertex< 5 > add(const CachingVertex< 5 > &oldVertex, const RefCountedVertexTrack track) const
DeepCopyPointerByClone< GsfVertexMerger > theMerger
VertexComponent createNewComponent(const VertexState &oldVertex, const RefCountedLinearizedTrackState linTrack, float weight, int sign) const
std::pair< VertexState, double > VertexChi2Pair
std::pair< double, double > WeightChi2Pair
CachingVertex< N > add(const CachingVertex< N > &oldVertex, const RefCountedVertexTrack track) const
std::vector< RefCountedLinearizedTrackState > LTC
GlobalPoint priorPosition() const
std::pair< VertexState, WeightChi2Pair > VertexComponent