14 #include <TMathBase.h>
25 , fUseModuleDesign(kFALSE)
51 , fUseModuleDesign(kFALSE)
65 if (ix < 0 || ix >=
fGridNx)
return nullptr;
66 if (iy < 0 || iy >=
fGridNy)
return nullptr;
67 Long64_t iSector =
fGrid[ix][iy];
68 if (iSector == -1)
return nullptr;
84 Double_t mlx =
fSize[0];
85 Double_t msx = mx0 > 0 ? +1 : -1;
86 Double_t mx1 = mx0 - msx * mlx / 2;
87 return Int_t((
x - mx1) / msx /
fGridDx);
94 Double_t mly =
fSize[1];
95 Double_t msy = my0 > 0 ? +1 : -1;
96 Double_t my1 = my0 - msy * mly / 2;
97 return Int_t((
y - my1) / msy /
fGridDy);
105 if (!sector)
return nullptr;
114 if (!nSectors)
return kFALSE;
119 Double_t mlx =
fSize[0];
120 Double_t mly =
fSize[1];
121 Double_t msx = mx0 > 0 ? +1 : -1;
122 Double_t msy = my0 > 0 ? +1 : -1;
123 Double_t mx1 = mx0 - msx * mlx / 2;
124 Double_t my1 = my0 - msy * mly / 2;
129 for (Int_t iSector = 0; iSector < nSectors; iSector++) {
145 for (Int_t ix = 0; ix <
fGridNx; ix++) {
147 for (Int_t iy = 0; iy <
fGridNy; iy++) {
148 Double_t
x = mx1 + msx *
fGridDx * (ix + 1e-3);
149 Double_t
y = my1 + msy *
fGridDy * (iy + 1e-3);
151 for (
int iSector = 0; iSector < nSectors; iSector++) {
167 vector<CbmMuchSectorRectangular*> neighbours;
168 vector<CbmMuchSectorRectangular*>::iterator it;
169 for (Int_t iSector = 0; iSector <
GetNSectors(); iSector++) {
172 Double_t x1 = sector->GetX1() - 1e-3;
173 Double_t x2 = sector->GetX2() + 1e-3;
174 Double_t y1 = sector->GetY1() - 1e-3;
175 Double_t y2 = sector->GetY2() + 1e-3;
180 Double_t ixmin = (ix1 < ix2) ? ix1 : ix2;
181 Double_t ixmax = (ix1 < ix2) ? ix2 : ix1;
182 Double_t iymin = (iy1 < iy2) ? iy1 : iy2;
183 Double_t iymax = (iy1 < iy2) ? iy2 : iy1;
184 if (ixmin < 0) ixmin = 0;
186 if (iymin < 0) iymin = 0;
189 for (Int_t ix = ixmin; ix <= ixmax; ix++) {
190 for (Int_t iy = iymin; iy <= iymax; iy++) {
191 Int_t iSec =
fGrid[ix][iy];
192 if (iSec < 0)
continue;
193 if (iSec == iSector)
continue;
196 it = find(neighbours.begin(), neighbours.end(), sec);
197 if (it == neighbours.end()) neighbours.push_back(sec);
208 vector<CbmMuchPad*>::iterator it;
209 vector<CbmMuchPad*> neighbours;
212 for (Int_t iSector = 0; iSector <
GetNSectors(); iSector++) {
215 if (!sector)
continue;
216 Double_t mindx = sector->
GetPadDx();
217 Double_t mindy = sector->
GetPadDy();
218 vector<CbmMuchSectorRectangular*> neighbourSectors =
220 for (UInt_t iSec = 0; iSec < neighbourSectors.size(); iSec++) {
224 if (dx < mindx) mindx = dx;
225 if (dy < mindy) mindy = dy;
228 for (Int_t iChannel = 0; iChannel < sector->
GetNChannels(); iChannel++) {
231 Double_t x1 = pad->GetX1();
232 Double_t x2 = pad->GetX2();
233 Double_t y1 = pad->GetY1();
234 Double_t y2 = pad->GetY2();
235 for (Double_t
x = x1 - mindx / 2;
x < x2 + mindx / 2 + 1e-3;
x += mindx) {
236 for (Double_t
y = y1 - mindy / 2;
y < y2 + mindy / 2 + 1e-3;
240 if (p == pad)
continue;
241 it = find(neighbours.begin(), neighbours.end(), p);
242 if (it == neighbours.end()) neighbours.push_back(p);
254 Bool_t useModuleDesign =
256 if (!
InitGrid(useModuleDesign))
return kFALSE;
258 for (Int_t iSector = 0; iSector <
GetNSectors(); iSector++) {
261 if (!sector)
continue;