Skip to content

Commit c13e505

Browse files
committed
ITS: Vertexer remove unused code
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 1956185 commit c13e505

2 files changed

Lines changed: 1 addition & 156 deletions

File tree

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
@@ -156,26 +156,6 @@ void trackletSelectionKernelHost(
156156
}
157157
}
158158

159-
bounded_vector<std::pair<int, int>> VertexerTraits::selectClusters(const int* indexTable,
160-
const std::array<int, 4>& selectedBinsRect,
161-
const IndexTableUtils& utils)
162-
{
163-
bounded_vector<std::pair<int, int>> filteredBins{mMemoryPool.get()};
164-
int phiBinsNum{selectedBinsRect[3] - selectedBinsRect[1] + 1};
165-
if (phiBinsNum < 0) {
166-
phiBinsNum += utils.getNphiBins();
167-
}
168-
filteredBins.reserve(phiBinsNum);
169-
for (int iPhiBin{selectedBinsRect[1]}, iPhiCount{0}; iPhiCount < phiBinsNum;
170-
iPhiBin = ++iPhiBin == utils.getNphiBins() ? 0 : iPhiBin, iPhiCount++) {
171-
const int firstBinIndex{utils.getBinIndex(selectedBinsRect[0], iPhiBin)};
172-
filteredBins.emplace_back(
173-
indexTable[firstBinIndex],
174-
utils.countRowSelectedBins(indexTable, iPhiBin, selectedBinsRect[0], selectedBinsRect[2]));
175-
}
176-
return filteredBins;
177-
}
178-
179159
void VertexerTraits::updateVertexingParameters(const std::vector<VertexingParameters>& vrtPar, const TimeFrameGPUParameters& tfPar)
180160
{
181161
mVrtParams = vrtPar;
@@ -608,127 +588,6 @@ void VertexerTraits::computeVertices(const int iteration)
608588
#endif
609589
}
610590

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

0 commit comments

Comments
 (0)