10 #ifndef LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_
11 #define LMD_LMDSENSORALIGNMENT_PNDLMDALIGNSTRUCTS_H_
38 pixelHit(
int idVal,
double colVal,
double rowVal) {
72 pixelHits.push_back(hit);
100 double _col1, _col2, _row1, _row2;
101 for (
size_t i = 0;
i < this->pixelHits.size();
i++) {
102 _col1 = this->pixelHits[
i]._col;
103 _row1 = this->pixelHits[
i]._row;
104 for (
size_t j = 0; j < other.
pixelHits.size(); j++) {
108 if ((_col2 - _col1) * (_col2 - _col1) + (_row2 - _row1) * (_row2 - _row1) < 2.25) {
126 for (
size_t i = 0;
i < pixelHits.size();
i++) {
127 centerCol += pixelHits[
i]._col;
128 centerRow += pixelHits[
i]._row;
130 centerCol /= pixelHits.size();
131 centerRow /= pixelHits.size();
134 if (pixelHits.size() == 1) {
138 for (
size_t i = 0;
i < pixelHits.size();
i++) {
139 for (
size_t j =
i + 1; j < pixelHits.size(); j++) {
140 double deltax = (pixelHits[
i]._col - pixelHits[j]._col);
147 double deltay = (pixelHits[
i]._row - pixelHits[j]._row);
154 tempDistance =
sqrt(deltax * deltax + deltay * deltay);
155 clusterSize =
max(clusterSize, tempDistance);
163 for (
size_t i = 0;
i < pixelHits.size();
i++) {
164 cout <<
"pixelHit x:" << pixelHits[
i]._col <<
", y:" << pixelHits[
i]._row <<
" on sensor "
165 << pixelHits[
i]._sensorId <<
"\n";
169 cout <<
"clusterCenter x:" << centerCol <<
", y:" << centerRow <<
" on sensor " << _sensorId
170 <<
", contains " << pixelHits.size() <<
" pixels and is " << clusterSize
171 <<
" pixels in diameter." <<
"\n";
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)
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
vector< pixelHit > pixelHits
void merge(pixelCluster &other)
pixelCluster(const pixelCluster ©)