Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion k4Reco/ConformalTracking/components/ConformalTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ void ConformalTracking::extendTracksPerLayer(UniqueKDTracks& conformalTracks, Sh
deltaChi2zs = newchi2zs - chi2zs;
debug() << "-- hit was fitted and has a delta chi2 of " << deltaChi2 << " and delta chi2zs of " << deltaChi2zs
<< endmsg;
tempTrack.remove(tempTrack.m_clusters.size());
tempTrack.remove(tempTrack.m_clusters.size() - 1);
debug() << "-- tempTrack has now " << tempTrack.m_clusters.size() << " hits " << endmsg;

double chi2cut = parameters.m_chi2cut;
Expand Down
9 changes: 7 additions & 2 deletions k4Reco/ConformalTracking/include/KDTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "KDCluster.h"
#include "Parameters.h"

#include <cmath>
#include <memory>
#include <stdexcept>
#include <vector>

class TH2F;
Expand All @@ -50,7 +50,12 @@ class KDTrack {
//--- Functions to add and remove clusters
void add(SKDCluster cluster) { m_clusters.push_back(cluster); }
void insert(SKDCluster cluster) { m_clusters.insert(m_clusters.begin(), cluster); }
void remove(int clusterN) { m_clusters.erase(m_clusters.begin() + clusterN); }
void remove(int clusterN) {
if (clusterN < 0 || clusterN >= static_cast<int>(m_clusters.size())) {
throw std::out_of_range("KDTrack::remove: clusterN out of range");
}
m_clusters.erase(m_clusters.begin() + clusterN);
}

//--- Fit functions
double calculateChi2();
Expand Down
Loading