10 #ifndef LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_ 11 #define LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_ 34 double x()
const {
return _col; }
36 pixelHit(
int idVal,
double colVal,
double rowVal)
74 pixelHits.push_back(hit);
104 double _col1, _col2, _row1, _row2;
105 for (
size_t i = 0;
i < this->pixelHits.size();
i++) {
106 _col1 = this->pixelHits[
i]._col;
107 _row1 = this->pixelHits[
i]._row;
108 for (
size_t j = 0; j < other.
pixelHits.size(); j++) {
112 if ((_col2 - _col1) * (_col2 - _col1) + (_row2 - _row1) * (_row2 - _row1) < 2.25) {
132 for (
size_t i = 0;
i < pixelHits.size();
i++) {
133 centerCol += pixelHits[
i]._col;
134 centerRow += pixelHits[
i]._row;
136 centerCol /= pixelHits.size();
137 centerRow /= pixelHits.size();
140 if (pixelHits.size() == 1) {
143 for (
size_t i = 0;
i < pixelHits.size();
i++) {
144 for (
size_t j =
i + 1; j < pixelHits.size(); j++) {
145 double deltax = (pixelHits[
i]._col - pixelHits[j]._col);
152 double deltay = (pixelHits[
i]._row - pixelHits[j]._row);
159 tempDistance =
sqrt(deltax * deltax + deltay * deltay);
160 clusterSize =
max(clusterSize, tempDistance);
169 for (
size_t i = 0;
i < pixelHits.size();
i++) {
170 cout <<
"pixelHit x:" << pixelHits[
i]._col <<
", y:" << pixelHits[
i]._row <<
" on sensor " << pixelHits[
i]._sensorId <<
"\n";
175 cout <<
"clusterCenter x:" << centerCol <<
", y:" << centerRow <<
" on sensor " << _sensorId <<
", contains " << pixelHits.size() <<
" pixels and is " << clusterSize
176 <<
" pixels in diameter." pixelHit(int idVal, double colVal, double rowVal)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
pixelCluster(const pixelHit &hit)
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
bool isNeighbour(pixelCluster &other)
vector< pixelHit > pixelHits
void merge(pixelCluster &other)
pixelCluster(const pixelCluster ©)