22 #ifndef LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_ 23 #define LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_ 46 double x()
const {
return _col; }
48 pixelHit(
int idVal,
double colVal,
double rowVal)
86 pixelHits.push_back(hit);
104 clusterReady =
false;
116 double _col1, _col2, _row1, _row2;
117 for (
size_t i = 0;
i < this->pixelHits.size();
i++) {
118 _col1 = this->pixelHits[
i]._col;
119 _row1 = this->pixelHits[
i]._row;
120 for (
size_t j = 0; j < other.
pixelHits.size(); j++) {
124 if ((_col2 - _col1) * (_col2 - _col1) + (_row2 - _row1) * (_row2 - _row1) < 2.25) {
144 for (
size_t i = 0;
i < pixelHits.size();
i++) {
145 centerCol += pixelHits[
i]._col;
146 centerRow += pixelHits[
i]._row;
148 centerCol /= pixelHits.size();
149 centerRow /= pixelHits.size();
152 if (pixelHits.size() == 1) {
155 for (
size_t i = 0;
i < pixelHits.size();
i++) {
156 for (
size_t j =
i + 1; j < pixelHits.size(); j++) {
157 double deltax = (pixelHits[
i]._col - pixelHits[j]._col);
164 double deltay = (pixelHits[
i]._row - pixelHits[j]._row);
171 tempDistance =
sqrt(deltax * deltax + deltay * deltay);
172 clusterSize =
max(clusterSize, tempDistance);
181 for (
size_t i = 0;
i < pixelHits.size();
i++) {
182 cout <<
"pixelHit x:" << pixelHits[
i]._col <<
", y:" << pixelHits[
i]._row <<
" on sensor " << pixelHits[
i]._sensorId <<
"\n";
187 cout <<
"clusterCenter x:" << centerCol <<
", y:" << centerRow <<
" on sensor " << _sensorId <<
", contains " << pixelHits.size() <<
" pixels and is " << clusterSize
188 <<
" 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 ©)