Skip to content

Commit 0c0f2b9

Browse files
authored
ITS: Vertexer remove unused code (#14508)
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 662f864 commit 0c0f2b9

File tree

2 files changed

+1
-156
lines changed

2 files changed

+1
-156
lines changed

Detectors/ITSMFT/ITS/tracking/include/ITStracking/VertexerTraits.h

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,10 @@ class VertexerTraits
7373
virtual void computeVertices(const int iteration = 0);
7474
virtual void adoptTimeFrame(TimeFrame7* tf) noexcept { mTimeFrame = tf; }
7575
virtual void updateVertexingParameters(const std::vector<VertexingParameters>& vrtPar, const TimeFrameGPUParameters& gpuTfPar);
76+
7677
// truth tracking
7778
void addTruthSeedingVertices();
7879

79-
void computeVerticesInRof(int,
80-
gsl::span<const o2::its::Line>&,
81-
bounded_vector<bool>&,
82-
bounded_vector<o2::its::ClusterLines>&,
83-
std::array<float, 2>&,
84-
bounded_vector<Vertex>&,
85-
bounded_vector<int>&,
86-
TimeFrame7*,
87-
bounded_vector<o2::MCCompLabel>*,
88-
const int iteration = 0);
89-
90-
bounded_vector<std::pair<int, int>> selectClusters(const int* indexTable,
91-
const std::array<int, 4>& selectedBinsRect,
92-
const IndexTableUtils& utils);
93-
9480
// utils
9581
auto& getVertexingParameters() { return mVrtParams; }
9682
auto getVertexingParameters() const { return mVrtParams; }

Detectors/ITSMFT/ITS/tracking/src/VertexerTraits.cxx

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,6 @@ void trackletSelectionKernelHost(
144144
}
145145
}
146146

147-
bounded_vector<std::pair<int, int>> VertexerTraits::selectClusters(const int* indexTable,
148-
const std::array<int, 4>& selectedBinsRect,
149-
const IndexTableUtils& utils)
150-
{
151-
bounded_vector<std::pair<int, int>> filteredBins{mMemoryPool.get()};
152-
int phiBinsNum{selectedBinsRect[3] - selectedBinsRect[1] + 1};
153-
if (phiBinsNum < 0) {
154-
phiBinsNum += utils.getNphiBins();
155-
}
156-
filteredBins.reserve(phiBinsNum);
157-
for (int iPhiBin{selectedBinsRect[1]}, iPhiCount{0}; iPhiCount < phiBinsNum;
158-
iPhiBin = ++iPhiBin == utils.getNphiBins() ? 0 : iPhiBin, iPhiCount++) {
159-
const int firstBinIndex{utils.getBinIndex(selectedBinsRect[0], iPhiBin)};
160-
filteredBins.emplace_back(
161-
indexTable[firstBinIndex],
162-
utils.countRowSelectedBins(indexTable, iPhiBin, selectedBinsRect[0], selectedBinsRect[2]));
163-
}
164-
return filteredBins;
165-
}
166-
167147
void VertexerTraits::updateVertexingParameters(const std::vector<VertexingParameters>& vrtPar, const TimeFrameGPUParameters& tfPar)
168148
{
169149
mVrtParams = vrtPar;
@@ -575,127 +555,6 @@ void VertexerTraits::computeVertices(const int iteration)
575555
#endif
576556
}
577557

578-
void VertexerTraits::computeVerticesInRof(int rofId,
579-
gsl::span<const o2::its::Line>& lines,
580-
bounded_vector<bool>& usedLines,
581-
bounded_vector<o2::its::ClusterLines>& clusterLines,
582-
std::array<float, 2>& beamPosXY,
583-
bounded_vector<Vertex>& vertices,
584-
bounded_vector<int>& verticesInRof,
585-
TimeFrame7* tf,
586-
bounded_vector<o2::MCCompLabel>* labels,
587-
const int iteration)
588-
{
589-
int foundVertices{0};
590-
auto nsigmaCut{std::min(mVrtParams[iteration].vertNsigmaCut * mVrtParams[iteration].vertNsigmaCut * (mVrtParams[iteration].vertRadiusSigma * mVrtParams[iteration].vertRadiusSigma + mVrtParams[iteration].trackletSigma * mVrtParams[iteration].trackletSigma), 1.98f)};
591-
const int numTracklets{static_cast<int>(lines.size())};
592-
for (int line1{0}; line1 < numTracklets; ++line1) {
593-
if (usedLines[line1]) {
594-
continue;
595-
}
596-
for (int line2{line1 + 1}; line2 < numTracklets; ++line2) {
597-
if (usedLines[line2]) {
598-
continue;
599-
}
600-
auto dca{Line::getDCA(lines[line1], lines[line2])};
601-
if (dca < mVrtParams[iteration].pairCut) {
602-
clusterLines.emplace_back(line1, lines[line1], line2, lines[line2]);
603-
std::array<float, 3> tmpVertex{clusterLines.back().getVertex()};
604-
if (tmpVertex[0] * tmpVertex[0] + tmpVertex[1] * tmpVertex[1] > 4.f) {
605-
clusterLines.pop_back();
606-
break;
607-
}
608-
usedLines[line1] = true;
609-
usedLines[line2] = true;
610-
for (int tracklet3{0}; tracklet3 < numTracklets; ++tracklet3) {
611-
if (usedLines[tracklet3]) {
612-
continue;
613-
}
614-
if (Line::getDistanceFromPoint(lines[tracklet3], tmpVertex) < mVrtParams[iteration].pairCut) {
615-
clusterLines.back().add(tracklet3, lines[tracklet3]);
616-
usedLines[tracklet3] = true;
617-
tmpVertex = clusterLines.back().getVertex();
618-
}
619-
}
620-
break;
621-
}
622-
}
623-
}
624-
625-
if (mVrtParams[iteration].allowSingleContribClusters) {
626-
auto beamLine = Line{{tf->getBeamX(), tf->getBeamY(), -50.f}, {tf->getBeamX(), tf->getBeamY(), 50.f}}; // use beam position as contributor
627-
for (size_t iLine{0}; iLine < numTracklets; ++iLine) {
628-
if (!usedLines[iLine]) {
629-
auto dca = Line::getDCA(lines[iLine], beamLine);
630-
if (dca < mVrtParams[iteration].pairCut) {
631-
clusterLines.emplace_back(iLine, lines[iLine], -1, beamLine); // beamline must be passed as second line argument
632-
}
633-
}
634-
}
635-
}
636-
637-
// Cluster merging
638-
std::sort(clusterLines.begin(), clusterLines.end(), [](ClusterLines& cluster1, ClusterLines& cluster2) { return cluster1.getSize() > cluster2.getSize(); });
639-
size_t nClusters{clusterLines.size()};
640-
for (int iCluster1{0}; iCluster1 < nClusters; ++iCluster1) {
641-
std::array<float, 3> vertex1{clusterLines[iCluster1].getVertex()};
642-
std::array<float, 3> vertex2{};
643-
for (int iCluster2{iCluster1 + 1}; iCluster2 < nClusters; ++iCluster2) {
644-
vertex2 = clusterLines[iCluster2].getVertex();
645-
if (o2::gpu::GPUCommonMath::Abs(vertex1[2] - vertex2[2]) < mVrtParams[iteration].clusterCut) {
646-
float distance{(vertex1[0] - vertex2[0]) * (vertex1[0] - vertex2[0]) +
647-
(vertex1[1] - vertex2[1]) * (vertex1[1] - vertex2[1]) +
648-
(vertex1[2] - vertex2[2]) * (vertex1[2] - vertex2[2])};
649-
if (distance < mVrtParams[iteration].pairCut * mVrtParams[iteration].pairCut) {
650-
for (auto label : clusterLines[iCluster2].getLabels()) {
651-
clusterLines[iCluster1].add(label, lines[label]);
652-
vertex1 = clusterLines[iCluster1].getVertex();
653-
}
654-
clusterLines.erase(clusterLines.begin() + iCluster2);
655-
--iCluster2;
656-
--nClusters;
657-
}
658-
}
659-
}
660-
}
661-
662-
std::sort(clusterLines.begin(), clusterLines.end(),
663-
[](ClusterLines& cluster1, ClusterLines& cluster2) { return cluster1.getSize() > cluster2.getSize(); }); // ensure clusters are ordered by contributors, so that we can cut after the first.
664-
bool atLeastOneFound{false};
665-
for (int iCluster{0}; iCluster < nClusters; ++iCluster) {
666-
bool lowMultCandidate{false};
667-
double beamDistance2{(tf->getBeamX() - clusterLines[iCluster].getVertex()[0]) * (tf->getBeamX() - clusterLines[iCluster].getVertex()[0]) +
668-
(tf->getBeamY() - clusterLines[iCluster].getVertex()[1]) * (tf->getBeamY() - clusterLines[iCluster].getVertex()[1])};
669-
670-
if (atLeastOneFound && (lowMultCandidate = clusterLines[iCluster].getSize() < mVrtParams[iteration].clusterContributorsCut)) { // We might have pile up with nContr > cut.
671-
lowMultCandidate &= (beamDistance2 < mVrtParams[iteration].lowMultBeamDistCut * mVrtParams[iteration].lowMultBeamDistCut);
672-
if (!lowMultCandidate) { // Not the first cluster and not a low multiplicity candidate, we can remove it
673-
clusterLines.erase(clusterLines.begin() + iCluster);
674-
nClusters--;
675-
continue;
676-
}
677-
}
678-
if (beamDistance2 < nsigmaCut && o2::gpu::GPUCommonMath::Abs(clusterLines[iCluster].getVertex()[2]) < mVrtParams[iteration].maxZPositionAllowed) {
679-
atLeastOneFound = true;
680-
++foundVertices;
681-
vertices.emplace_back(o2::math_utils::Point3D<float>(clusterLines[iCluster].getVertex()[0],
682-
clusterLines[iCluster].getVertex()[1],
683-
clusterLines[iCluster].getVertex()[2]),
684-
clusterLines[iCluster].getRMS2(), // Symm matrix. Diagonal: RMS2 components,
685-
// off-diagonal: square mean of projections on planes.
686-
clusterLines[iCluster].getSize(), // Contributors
687-
clusterLines[iCluster].getAvgDistance2()); // In place of chi2
688-
vertices.back().setTimeStamp(clusterLines[iCluster].getROF());
689-
if (labels) {
690-
for (auto& index : clusterLines[iCluster].getLabels()) {
691-
labels->push_back(tf->getLinesLabel(rofId)[index]); // then we can use nContributors from vertices to get the labels
692-
}
693-
}
694-
}
695-
}
696-
verticesInRof.push_back(foundVertices);
697-
}
698-
699558
void VertexerTraits::addTruthSeedingVertices()
700559
{
701560
LOGP(info, "Using truth seeds as vertices; will skip computations");

0 commit comments

Comments
 (0)