13#include "trg/cdc/NDFinderDefs.h"
14#include "trg/cdc/Clusterizend.h"
21 std::vector<SimpleCluster> candidateClusters;
23 for (
unsigned short quadrant = 0; quadrant < 4; ++quadrant) {
24 for (
unsigned short section = 0; section < 4; ++section) {
30 return candidateClusters;
38 c3index sectionSize = quadrantSize / 4;
40 c3index quadrantStart = quadrant * quadrantSize + quadrantOffset;
41 c3index sectionStart = quadrantStart + section * sectionSize;
42 c3index sectionEnd = sectionStart + sectionSize;
44 return {sectionStart, sectionEnd};
53 if (peakWeight < 10) {
59 candidateClusters.push_back(newCluster);
67 unsigned int peakValue = 0;
70 for (
c3index phiIdx = sectionBounds[0]; phiIdx < sectionBounds[1]; ++phiIdx) {
73 if ((*
m_houghSpace)[omegaIdx][phiIdxMod][cotIdx] > peakValue) {
74 peakValue = (*m_houghSpace)[omegaIdx][phiIdxMod][cotIdx];
75 peakCell = {omegaIdx, phiIdxMod, cotIdx};
80 return {peakCell, peakValue};
86 c3index omegaPeak = peakCell[0];
96 c3index omegaUpperRight = omegaPeak - 1;
97 c3index omegaLowerLeft = omegaPeak + 1;
102 fixedCluster.
appendCell({omegaPeak, phiLeft, cotPeak});
103 fixedCluster.
appendCell({omegaPeak, phiRight, cotPeak});
105 fixedCluster.
appendCell({omegaPeak, phiPeak, cotLower});
108 fixedCluster.
appendCell({omegaPeak, phiPeak, cotUpper});
110 if (omegaUpperRight >= 0) {
111 fixedCluster.
appendCell({omegaUpperRight, phiRight, cotPeak});
114 fixedCluster.
appendCell({omegaLowerLeft, phiLeft, cotPeak});
122 c3index omegaPeak = peakCell[0];
129 for (
c3index omegaIdx = omegaLowerBound; omegaIdx < omegaUpperBound; ++omegaIdx) {
130 c3index phiCell = phiPeak + omegaPeak - omegaIdx;
131 c3index relativePhi = phiCell - phiPeak;
133 if (relativePhi > 0) {
141 }
else if (relativePhi < 0) {
165 for (
c3index phiIdx = bounds.phiLowerBound; phiIdx < bounds.phiUpperBound; ++phiIdx) {
167 (*m_houghSpace)[bounds.omega][phiIdxMod][bounds.cot] = 0;
SimpleCluster createCluster(const cell_index &peakCell)
Creates the surrounding cluster (fixed shape) around the section peak index.
std::vector< SimpleCluster > makeClusters()
Create all the clusters in the Hough space.
std::pair< cell_index, unsigned int > getSectionPeak(const std::array< c3index, 2 > §ionBounds)
Returns the global section peak index and weight.
ClustererParameters m_clustererParams
The struct holding the cluster parameters.
void deletePeakSurroundings(const cell_index &peakCell)
Deletes the surroundings of such a cluster.
void clearHoughSpaceRow(const DeletionBounds &bounds)
Method to delete a omega row for the cluster deletion in deletePeakSurroundings method.
c3array * m_houghSpace
Pointer to the Hough space.
std::array< c3index, 2 > getSectionBounds(const unsigned short quadrant, const unsigned section)
Get the phi bounds of one quadrant section.
void iterateOverSection(const std::array< c3index, 2 > §ionBounds, std::vector< SimpleCluster > &candidateClusters)
Iterate m_clustererParams.iterations times over one section.
void setPeakCell(const cell_index &peakCell)
Set the peak index (found as the section peak) of the cluster.
void setPeakWeight(const unsigned int peakWeight)
Set the weight of the peak cluster cell.
void appendCell(const cell_index &newClusterCell)
Add a track-space cell to the cluster.
c3array::index c3index
index of Hough space 3D array
boost::multi_array< unsigned short, 3 > c3array
The Hough space is a 3D array (omega, phi, cot)
std::array< c3index, 3 > cell_index
The cell index of one Hough space bin.
Abstract base class for different kinds of events.
Struct containing the deletion bounds of a omega row.