StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEpdGeom.cxx
1 /*************************************
2  * \author Mike Lisa
3  * \date 4 Jan 2018
4  *
5  * \description:
6  * class defining geometrical aspects of an EPD Tile
7  * (position of center, RandomPointOnTile(), etc.)
8  *
9  * The user may pass the PP/TT/EW _or_ the uniqueID to
10  * most functions. No option to pass StEpdHit object,
11  * because we want to avoid StObject-dependence.
12  *************************************/
13 
14 #include "StEpdGeom.h"
15 #include "TRandom.h"
16 #include "TRandom3.h"
17 #include "TMath.h"
18 
19 ClassImp(StEpdGeom)
20 
21 
22 StEpdGeom::StEpdGeom() : mPP(0), mTT(0), mEW(0){
23  if ( gRandom ) {
24  pRan = (TRandom3*)gRandom;
25  }
26  else {
27  pRan = new TRandom3();
28  pRan -> SetSeed();
29  }
30  InitializeGeometry();
31 }
32 
33 StEpdGeom::~StEpdGeom(){
34  if ( pRan && pRan != gRandom ) delete pRan;
35 }
36 
37 void StEpdGeom::InitializeGeometry(){
38 
39  // First, save the phi values of the centers of all tiles.
40  // I am aware that this is a bit wasteful, since all the even (or odd) numbered
41  // tiles of a given position all have the same phi. But you'll go nuts otherwise.
42  // Better to waste a little memory than to get confused.
43  double DeltaPhiSS = 30.0*TMath::Pi()/180.0; // 30 degree supersectors
44  int EW=0; // East
45  for (int PP=1; PP<13; PP++){
46  double phiSS = TMath::Pi()/2.0 - (PP-0.5)*DeltaPhiSS;
47  if (phiSS<0.0) phiSS += 2.0*TMath::Pi();
48  mPhiCenter[PP-1][0][EW] = phiSS;
49  for (int TT=2; TT<32; TT+=2){ // EVENS
50  mPhiCenter[PP-1][TT-1][EW] = phiSS - DeltaPhiSS/4.0;
51  }
52  for (int TT=3; TT<32; TT+=2){ // ODDS
53  mPhiCenter[PP-1][TT-1][EW] = phiSS + DeltaPhiSS/4.0;
54  }
55  }
56  EW=1; // West
57  for (int PP=1; PP<13; PP++){
58  double phiSS = TMath::Pi()/2.0 + (PP-0.5)*DeltaPhiSS;
59  if (phiSS>2.0*TMath::Pi()) phiSS -= 2.0*TMath::Pi();
60  mPhiCenter[PP-1][0][EW] = phiSS;
61  for (int TT=2; TT<32; TT+=2){ // EVENS
62  mPhiCenter[PP-1][TT-1][EW] = phiSS + DeltaPhiSS/4.0;
63  }
64  for (int TT=3; TT<32; TT+=2){ // ODDS
65  mPhiCenter[PP-1][TT-1][EW] = phiSS - DeltaPhiSS/4.0;
66  }
67  }
68 
69  // Now the inner, outer, and average radius of a _ROW_
70  double RowHeight[16]={4.4, 4.4, 4.4, 5.53, 5.53, 5.53,
71  5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53};
72  double Rminimum = 4.6; // the distance from beamline to the inner edge of tile 1
73  mRmin[0] = Rminimum; // row 1 (tiles 1)
74  for (int irow=1; irow<16; irow++){
75  mRmin[irow]=mRmin[irow-1]+RowHeight[irow-1];
76  mRmax[irow-1]=mRmin[irow];
77  }
78  mRmax[15]=mRmin[15]+RowHeight[15];
79  for (int irow=0; irow<16; irow++){
80  mRave[irow] = 0.5*(mRmin[irow]+mRmax[irow]);
81  }
82 }
83 
84 
85 
86 void StEpdGeom::SetPpTtEw(short uniqueID){
87  mPP = std::abs(uniqueID/100);
88  mTT = std::abs(uniqueID % 100);
89  mEW = (uniqueID>0)?+1:-1;
90 }
91 
92 double StEpdGeom::GetZwheel(){
93  const double z_EPD = 375.0; // EPD is 375 cm away from center of TPC in z-direction
94  return z_EPD*mEW;
95 }
96 
97 // double StEpdGeom::GetPhiCenter(){
98 // double phiCenter;
99 // double DeltaPhiSS = 30.0*TMath::Pi()/180.0; // 30 degree supersectors
100 // if (mEW<0){ // east
101 // double phiSS = TMath::Pi()/2.0 - (mPP-0.5)*DeltaPhiSS;
102 // if (phiSS<0.0) phiSS += 2.0*TMath::Pi();
103 // if (1 == mTT){phiCenter = phiSS;} // tile 1
104 // else{
105 // if (0 == mTT%2){phiCenter = phiSS - DeltaPhiSS/4.0;}
106 // else {phiCenter = phiSS + DeltaPhiSS/4.0;}
107 // }
108 // }
109 // else{ // west
110 // double phiSS = TMath::Pi()/2.0 + (mPP-0.5)*DeltaPhiSS;
111 // if (phiSS>2.0*TMath::Pi()) phiSS -= 2.0*TMath::Pi();
112 // if (1==mTT){phiCenter = phiSS;} // tile 1
113 // else{
114 // if (0 == mTT%2){phiCenter = phiSS + DeltaPhiSS/4.0;}
115 // else {phiCenter = phiSS - DeltaPhiSS/4.0;}
116 // }
117 // }
118 // return phiCenter;
119 // }
120 
121 // void StEpdGeom::GetRminRmax(double *Rmin, double *Rmax){
122 // double RowHeight[16]={4.4, 4.4, 4.4, 5.53, 5.53, 5.53,
123 // 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53, 5.53};
124 // double Rminimum = 4.6; // the distance from beamline to the inner edge of tile 1
125 // double Rlimit[17];
126 // Rlimit[0] = Rminimum;
127 // for (int iRow=0; iRow<16; iRow++){
128 // Rlimit[iRow+1] = Rlimit[iRow] + RowHeight[iRow];
129 // }
130 // int Row = this->Row();
131 // *Rmin = Rlimit[Row-1];
132 // *Rmax = Rlimit[Row];
133 // }
134 
135 //------------------------------------------------
136 short StEpdGeom::Row(short uniqueID){
137  SetPpTtEw(uniqueID);
138  return this->Row();
139 }
140 short StEpdGeom::Row(short PP, short TT, short EW){
141  mPP = PP;
142  mTT = TT;
143  mEW = EW;
144  return this->Row();
145 }
146 short StEpdGeom::Row(){
147  return mTT/2 + 1;
148 }
149 
150 //------------------------------------------------
151 TVector3 StEpdGeom::TileCenter(short uniqueID){
152  SetPpTtEw(uniqueID);
153  return this->TileCenter();
154 }
155 TVector3 StEpdGeom::TileCenter(short PP, short TT, short EW){
156  mPP = PP;
157  mTT = TT;
158  mEW = EW;
159  return this->TileCenter();
160 }
161 TVector3 StEpdGeom::TileCenter(){
162  // double Rmin,Rmax;
163  // GetRminRmax(&Rmin,&Rmax);
164  double ZZ = this->GetZwheel();
165  TVector3 cent(mRave[this->Row()-1],0.0,ZZ);
166  // cent.SetXYZ(0.5*(Rmin+Rmax),0.0,ZZ);
167  // cent.RotateZ(this->GetPhiCenter());
168  int ew = (mEW>0)?1:0;
169  cent.RotateZ(mPhiCenter[mPP-1][mTT-1][ew]);
170  return cent;
171 }
172 
173 //-----------------------------------------------------
174 TVector3 StEpdGeom::RandomPointOnTile(short uniqueID){
175  SetPpTtEw(uniqueID);
176  return this->RandomPointOnTile();
177 }
178 TVector3 StEpdGeom::RandomPointOnTile(short PP, short TT, short EW){
179  mPP = PP;
180  mTT = TT;
181  mEW = EW;
182  return this->RandomPointOnTile();
183 }
184 TVector3 StEpdGeom::RandomPointOnTile(){
185 
186  double GapWidth = 0.08; // one half of the glue gap width
187  double Aparam = 2.0*tan(7.5*TMath::Pi()/180.0);
188  double Bparam = -2.0*GapWidth;
189 
190  double ZZ = this->GetZwheel();
191  short RR=this->Row();
192  double Rmin = mRmin[RR-1];
193  double Rmax = mRmax[RR-1];
194  // GetRminRmax(&Rmin,&Rmax);
195  double Xmin = Rmin + GapWidth;
196  double Xmax = Rmax - GapWidth;
197  if (1==RR) Xmin -= 2.0*GapWidth; // no glue on the "inside" of tile 1
198  if (16==RR) Xmax += GapWidth; // no glue on "outside" of TT30,31
199 
200  // the reason for this next command is that Tile 01 is a pain in the neck.
201  // I didn't figure out an easy way to get a random point inside the pentagon,
202  // so I make the outer radius a little too big. Then I get a point, and if
203  // it doesn't fit in the tile, I try again until it's finally there.
204  if (1==RR) Xmax += GapWidth;
205 
206  double A = Aparam;
207  if (1==RR) A*= 2.0;
208 
209  double gamma = 0.5*A*pow(Xmin,2)+Bparam*Xmin;
210  double alpha = 0.5*A*pow(Xmax,2)+Bparam*Xmax-gamma;
211 
212  double q = pRan->Rndm();
213  double XX = (sqrt(pow(Bparam,2)+2.0*A*(alpha*q+gamma)) - Bparam)/A;
214  q = pRan->Rndm();
215  double DeltaY = A*XX+Bparam;
216  double YY = (q-0.5)*DeltaY;
217 
218  TVector3 Point(XX,YY,ZZ);
219  // Point.RotateZ(this->GetPhiCenter());
220  int ew = (mEW>0)?1:0;
221  Point.RotateZ(mPhiCenter[mPP-1][mTT-1][ew]);
222 
223 
224  // if this is Tile 01, there's the possibility that the point does
225  // not fit into the tile after all, so check and if it doesn't
226  // then try again.
227  // Recursion == Awesomeness.
228  if (1==RR){
229  if (!(this->IsInTile(Point.X(),Point.Y()))) return this->RandomPointOnTile();}
230 
231  return Point;
232 }
233 
234 //----------------------------------------------------
235 void StEpdGeom::GetCorners(short uniqueID,
236  int* nCorners, double* x, double* y){
237  SetPpTtEw(uniqueID);
238  GetCorners(nCorners,x,y);
239 }
240 void StEpdGeom::GetCorners(short position, short tilenumber, short eastwest,
241  int* nCorners, double* x, double* y){
242  mPP = position;
243  mTT = tilenumber;
244  mEW = eastwest;
245  GetCorners(nCorners,x,y);
246 }
247 void StEpdGeom::GetCorners(int* nCorners, double* xc, double* yc){
248  double x[5];
249  double y[5];
250  // we provde the user five corners. For tiles 2-31, the fifth "corner" is junk.
251  // only tile 1 is a pentagon
252  double OpeningAngle = 7.5*TMath::Pi()/180.0;
253  double GapWidth = 0.08; // gap between tiles / 2
254  short RR = this->Row();
255  // double Rmin,Rmax;
256  double Rmin=mRmin[RR-1];
257  double Rmax=mRmax[RR-1];
258  // GetRminRmax(&Rmin,&Rmax);
259  if (1==RR){
260  *nCorners=5;
261  double xtmp[3], ytmp[3];
262  xtmp[0] = Rmin; ytmp[0] = +Rmin*tan(OpeningAngle);
263  xtmp[1] = Rmax; ytmp[1] = +Rmax*tan(OpeningAngle);
264  xtmp[2] = Rmax; ytmp[2] = -Rmax*tan(OpeningAngle);
265  for (int ic=0; ic<3; ic++){
266  x[ic] = xtmp[ic]*cos(OpeningAngle) - ytmp[ic]*sin(OpeningAngle);
267  y[ic] = +xtmp[ic]*sin(OpeningAngle) + ytmp[ic]*cos(OpeningAngle);
268  }
269  y[0] -= GapWidth;
270  y[1] -= GapWidth;
271  x[1] -= GapWidth;
272  x[2] -= GapWidth;
273  x[3] = x[1]; y[3] = -y[1];
274  x[4] = x[0]; y[4] = -y[0];
275  }
276  else{
277  *nCorners=4;
278  x[0] = Rmin + GapWidth; y[0] = +Rmin*tan(OpeningAngle) - GapWidth;
279  x[1] = Rmax - GapWidth; y[1] = +Rmax*tan(OpeningAngle) - GapWidth;
280  x[2] = Rmax - GapWidth; y[2] = -Rmax*tan(OpeningAngle) + GapWidth;
281  x[3] = Rmin + GapWidth; y[3] = -Rmin*tan(OpeningAngle) + GapWidth;
282  x[4] = -999; y[4] = -999; // unused for TT!=1
283 
284  if (16==RR){ // there is no glue "outside" TT30,31
285  x[1] += GapWidth;
286  x[2] += GapWidth;
287  }
288  }
289  // double phi = this->GetPhiCenter();
290  int ew=(mEW>0)?1:0;
291  double phi = mPhiCenter[mPP-1][mTT-1][ew];
292  for (int icorn=0; icorn<(*nCorners); icorn++){
293  xc[icorn] = +x[icorn]*cos(phi) - y[icorn]*sin(phi);
294  yc[icorn] = +x[icorn]*sin(phi) + y[icorn]*cos(phi);
295  }
296 }
297 
298 //---------------------------------------------------------------------
299 bool StEpdGeom::IsInTile(short uniqueID,
300  double x, double y){
301  SetPpTtEw(uniqueID);
302  return this->IsInTile(x,y);
303 }
304 bool StEpdGeom::IsInTile(short position, short tilenumber, short eastwest,
305  double x, double y){
306  mPP = position;
307  mTT = tilenumber;
308  mEW = eastwest;
309  return this->IsInTile(x,y);
310 }
311 bool StEpdGeom::IsInTile(double x, double y){
312  double PolygonX[6];
313  double PolygonY[6];
314  int numberOfCorners;
315  this->GetCorners(&numberOfCorners,PolygonX,PolygonY);
316  PolygonX[numberOfCorners] = PolygonX[0]; PolygonY[numberOfCorners] = PolygonY[0];
317  return TMath::IsInside(x,y,numberOfCorners+1,PolygonX,PolygonY);
318 }
319 
320 
321 //-------------------------------------------------------------------
322 
323 void StEpdGeom::GetOverlappingBbcTiles(short uniqueID,
324  int* nOverlappingBbcTiles, short* BbcTileIDs){
325  SetPpTtEw(uniqueID);
326  GetOverlappingBbcTiles(nOverlappingBbcTiles,BbcTileIDs);
327 }
328 
329 void StEpdGeom::GetOverlappingBbcTiles(short position, short tilenumber, short eastwest,
330  int* nOverlappingBbcTiles, short* BbcTileIDs){
331  mPP = position;
332  mTT = tilenumber;
333  mEW = eastwest;
334  GetOverlappingBbcTiles(nOverlappingBbcTiles,BbcTileIDs);
335 }
336 void StEpdGeom::GetOverlappingBbcTiles(int* nOverlappingBbcTiles, short* BbcTileIDs){
337  if (mTT>9){ // only tiles 1-9 overlap with inner BBC
338  nOverlappingBbcTiles=0;
339  return;
340  }
341  if (mEW<=0){ // East
342  *nOverlappingBbcTiles = mEastNumberOfOverlappingBbcTiles[mPP-1][mTT-1];
343  for (int i=0; i<*nOverlappingBbcTiles; i++){
344  BbcTileIDs[i] = mEastBbcTilesWhichOverlap[mPP-1][mTT-1][i];
345  }
346  for (int i=*nOverlappingBbcTiles; i<10; i++){
347  BbcTileIDs[i] = 0;
348  }
349  }
350  else{ // West
351  *nOverlappingBbcTiles = mWestNumberOfOverlappingBbcTiles[mPP-1][mTT-1];
352  for (int i=0; i<*nOverlappingBbcTiles; i++){
353  BbcTileIDs[i] = mWestBbcTilesWhichOverlap[mPP-1][mTT-1][i];
354  }
355  for (int i=*nOverlappingBbcTiles; i<10; i++){
356  BbcTileIDs[i] = 0;
357  }
358  }
359 
360 }
361 
362 
363 
364 // EastNumberOfOverlappingBbcTiles[PP-1][TT-1]; gives the number of BBC tiles that overlap
365 short StEpdGeom::mEastNumberOfOverlappingBbcTiles[12][9] = {
366  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 1
367  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 2
368  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 3
369  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 4
370  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 5
371  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 6
372  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 7
373  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 8
374  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 9
375  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 10
376  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 11
377  { 1, 1, 2, 3, 1, 2, 2, 1, 0} // PP= 12
378 };
379 
380 // EastBbcTilesWhichOverlap[PP-1][TT-1][j] gives the BBC tile ID of the jth overlapping BBC tile
381 short StEpdGeom::mEastBbcTilesWhichOverlap[12][9][3] = {
382  { { -1, 0, 0}, // PP = 1 TT = 1
383  { -1, -7, 0}, // PP = 1 TT = 2
384  { -1, 0, 0}, // PP = 1 TT = 3
385  { -7, 0, 0}, // PP = 1 TT = 4
386  { -1, -7, -8}, // PP = 1 TT = 5
387  { -7, -8, 0}, // PP = 1 TT = 6
388  { -7, -8, 0}, // PP = 1 TT = 7
389  { 0, 0, 0}, // PP = 1 TT = 8
390  { -8, 0, 0} // PP = 1 TT = 9
391  },
392  { { -6, 0, 0}, // PP = 2 TT = 1
393  { -6, 0, 0}, // PP = 2 TT = 2
394  { -6, -7, 0}, // PP = 2 TT = 3
395  { -6, -7, -18}, // PP = 2 TT = 4
396  { -7, 0, 0}, // PP = 2 TT = 5
397  { -7, -18, 0}, // PP = 2 TT = 6
398  { -7, -18, 0}, // PP = 2 TT = 7
399  { -18, 0, 0}, // PP = 2 TT = 8
400  { 0, 0, 0} // PP = 2 TT = 9
401  },
402  { { -6, 0, 0}, // PP = 3 TT = 1
403  { -6, -17, 0}, // PP = 3 TT = 2
404  { -6, 0, 0}, // PP = 3 TT = 3
405  { -17, 0, 0}, // PP = 3 TT = 4
406  { -6, -17, -18}, // PP = 3 TT = 5
407  { -17, -18, 0}, // PP = 3 TT = 6
408  { -17, -18, 0}, // PP = 3 TT = 7
409  { 0, 0, 0}, // PP = 3 TT = 8
410  { -18, 0, 0} // PP = 3 TT = 9
411  },
412  { { -5, 0, 0}, // PP = 4 TT = 1
413  { -5, 0, 0}, // PP = 4 TT = 2
414  { -5, -17, 0}, // PP = 4 TT = 3
415  { -5, -16, -17}, // PP = 4 TT = 4
416  { -17, 0, 0}, // PP = 4 TT = 5
417  { -16, -17, 0}, // PP = 4 TT = 6
418  { -16, -17, 0}, // PP = 4 TT = 7
419  { -16, 0, 0}, // PP = 4 TT = 8
420  { 0, 0, 0} // PP = 4 TT = 9
421  },
422  { { -5, 0, 0}, // PP = 5 TT = 1
423  { -5, -15, 0}, // PP = 5 TT = 2
424  { -5, 0, 0}, // PP = 5 TT = 3
425  { -15, 0, 0}, // PP = 5 TT = 4
426  { -5, -15, -16}, // PP = 5 TT = 5
427  { -15, -16, 0}, // PP = 5 TT = 6
428  { -15, -16, 0}, // PP = 5 TT = 7
429  { 0, 0, 0}, // PP = 5 TT = 8
430  { -16, 0, 0} // PP = 5 TT = 9
431  },
432  { { -4, 0, 0}, // PP = 6 TT = 1
433  { -4, 0, 0}, // PP = 6 TT = 2
434  { -4, -15, 0}, // PP = 6 TT = 3
435  { -4, -14, -15}, // PP = 6 TT = 4
436  { -15, 0, 0}, // PP = 6 TT = 5
437  { -14, -15, 0}, // PP = 6 TT = 6
438  { -14, -15, 0}, // PP = 6 TT = 7
439  { -14, 0, 0}, // PP = 6 TT = 8
440  { 0, 0, 0} // PP = 6 TT = 9
441  },
442  { { -4, 0, 0}, // PP = 7 TT = 1
443  { -4, -13, 0}, // PP = 7 TT = 2
444  { -4, 0, 0}, // PP = 7 TT = 3
445  { -13, 0, 0}, // PP = 7 TT = 4
446  { -4, -13, -14}, // PP = 7 TT = 5
447  { -13, -14, 0}, // PP = 7 TT = 6
448  { -13, -14, 0}, // PP = 7 TT = 7
449  { 0, 0, 0}, // PP = 7 TT = 8
450  { -14, 0, 0} // PP = 7 TT = 9
451  },
452  { { -3, 0, 0}, // PP = 8 TT = 1
453  { -3, 0, 0}, // PP = 8 TT = 2
454  { -3, -13, 0}, // PP = 8 TT = 3
455  { -3, -12, -13}, // PP = 8 TT = 4
456  { -13, 0, 0}, // PP = 8 TT = 5
457  { -12, -13, 0}, // PP = 8 TT = 6
458  { -12, -13, 0}, // PP = 8 TT = 7
459  { -12, 0, 0}, // PP = 8 TT = 8
460  { 0, 0, 0} // PP = 8 TT = 9
461  },
462  { { -3, 0, 0}, // PP = 9 TT = 1
463  { -3, -11, 0}, // PP = 9 TT = 2
464  { -3, 0, 0}, // PP = 9 TT = 3
465  { -11, 0, 0}, // PP = 9 TT = 4
466  { -3, -11, -12}, // PP = 9 TT = 5
467  { -11, -12, 0}, // PP = 9 TT = 6
468  { -11, -12, 0}, // PP = 9 TT = 7
469  { 0, 0, 0}, // PP = 9 TT = 8
470  { -12, 0, 0} // PP = 9 TT = 9
471  },
472  { { -2, 0, 0}, // PP = 10 TT = 1
473  { -2, 0, 0}, // PP = 10 TT = 2
474  { -2, -11, 0}, // PP = 10 TT = 3
475  { -2, -10, -11}, // PP = 10 TT = 4
476  { -11, 0, 0}, // PP = 10 TT = 5
477  { -10, -11, 0}, // PP = 10 TT = 6
478  { -10, -11, 0}, // PP = 10 TT = 7
479  { -10, 0, 0}, // PP = 10 TT = 8
480  { 0, 0, 0} // PP = 10 TT = 9
481  },
482  { { -2, 0, 0}, // PP = 11 TT = 1
483  { -2, -9, 0}, // PP = 11 TT = 2
484  { -2, 0, 0}, // PP = 11 TT = 3
485  { -9, 0, 0}, // PP = 11 TT = 4
486  { -2, -9, -10}, // PP = 11 TT = 5
487  { -9, -10, 0}, // PP = 11 TT = 6
488  { -9, -10, 0}, // PP = 11 TT = 7
489  { 0, 0, 0}, // PP = 11 TT = 8
490  { -10, 0, 0} // PP = 11 TT = 9
491  },
492  { { -1, 0, 0}, // PP = 12 TT = 1
493  { -1, 0, 0}, // PP = 12 TT = 2
494  { -1, -9, 0}, // PP = 12 TT = 3
495  { -1, -8, -9}, // PP = 12 TT = 4
496  { -9, 0, 0}, // PP = 12 TT = 5
497  { -8, -9, 0}, // PP = 12 TT = 6
498  { -8, -9, 0}, // PP = 12 TT = 7
499  { -8, 0, 0}, // PP = 12 TT = 8
500  { 0, 0, 0} // PP = 12 TT = 9
501  }
502 };
503 
504 // WestNumberOfOverlappingBbcTiles[PP-1][TT-1]; gives the number of BBC tiles that overlap
505 short StEpdGeom::mWestNumberOfOverlappingBbcTiles[12][9] = {
506  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 1
507  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 2
508  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 3
509  { 1, 1, 2, 3, 1, 1, 2, 1, 0}, // PP= 4
510  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 5
511  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 6
512  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 7
513  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 8
514  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 9
515  { 1, 1, 2, 3, 1, 2, 2, 1, 0}, // PP= 10
516  { 1, 2, 1, 1, 3, 2, 2, 0, 1}, // PP= 11
517  { 1, 1, 2, 3, 1, 2, 2, 1, 0} // PP= 12
518 };
519 
520 // WestBbcTilesWhichOverlap[PP-1][TT-1][j] gives the BBC tile ID of the jth overlapping BBC tile
521 short StEpdGeom::mWestBbcTilesWhichOverlap[12][9][3] = {
522  { { 1, 0, 0}, // PP = 1 TT = 1
523  { 1, 7, 0}, // PP = 1 TT = 2
524  { 1, 0, 0}, // PP = 1 TT = 3
525  { 7, 0, 0}, // PP = 1 TT = 4
526  { 1, 7, 8}, // PP = 1 TT = 5
527  { 7, 8, 0}, // PP = 1 TT = 6
528  { 7, 8, 0}, // PP = 1 TT = 7
529  { 0, 0, 0}, // PP = 1 TT = 8
530  { 8, 0, 0} // PP = 1 TT = 9
531  },
532  { { 6, 0, 0}, // PP = 2 TT = 1
533  { 6, 0, 0}, // PP = 2 TT = 2
534  { 6, 7, 0}, // PP = 2 TT = 3
535  { 6, 7, 18}, // PP = 2 TT = 4
536  { 7, 0, 0}, // PP = 2 TT = 5
537  { 7, 18, 0}, // PP = 2 TT = 6
538  { 7, 18, 0}, // PP = 2 TT = 7
539  { 18, 0, 0}, // PP = 2 TT = 8
540  { 0, 0, 0} // PP = 2 TT = 9
541  },
542  { { 6, 0, 0}, // PP = 3 TT = 1
543  { 6, 17, 0}, // PP = 3 TT = 2
544  { 6, 0, 0}, // PP = 3 TT = 3
545  { 17, 0, 0}, // PP = 3 TT = 4
546  { 6, 17, 18}, // PP = 3 TT = 5
547  { 17, 18, 0}, // PP = 3 TT = 6
548  { 17, 18, 0}, // PP = 3 TT = 7
549  { 0, 0, 0}, // PP = 3 TT = 8
550  { 18, 0, 0} // PP = 3 TT = 9
551  },
552  { { 5, 0, 0}, // PP = 4 TT = 1
553  { 5, 0, 0}, // PP = 4 TT = 2
554  { 5, 17, 0}, // PP = 4 TT = 3
555  { 5, 16, 17}, // PP = 4 TT = 4
556  { 17, 0, 0}, // PP = 4 TT = 5
557  { 16, 0, 0}, // PP = 4 TT = 6
558  { 16, 17, 0}, // PP = 4 TT = 7
559  { 16, 0, 0}, // PP = 4 TT = 8
560  { 0, 0, 0} // PP = 4 TT = 9
561  },
562  { { 5, 0, 0}, // PP = 5 TT = 1
563  { 5, 15, 0}, // PP = 5 TT = 2
564  { 5, 0, 0}, // PP = 5 TT = 3
565  { 15, 0, 0}, // PP = 5 TT = 4
566  { 5, 15, 16}, // PP = 5 TT = 5
567  { 15, 16, 0}, // PP = 5 TT = 6
568  { 15, 16, 0}, // PP = 5 TT = 7
569  { 0, 0, 0}, // PP = 5 TT = 8
570  { 16, 0, 0} // PP = 5 TT = 9
571  },
572  { { 4, 0, 0}, // PP = 6 TT = 1
573  { 4, 0, 0}, // PP = 6 TT = 2
574  { 4, 15, 0}, // PP = 6 TT = 3
575  { 4, 14, 15}, // PP = 6 TT = 4
576  { 15, 0, 0}, // PP = 6 TT = 5
577  { 14, 15, 0}, // PP = 6 TT = 6
578  { 14, 15, 0}, // PP = 6 TT = 7
579  { 14, 0, 0}, // PP = 6 TT = 8
580  { 0, 0, 0} // PP = 6 TT = 9
581  },
582  { { 4, 0, 0}, // PP = 7 TT = 1
583  { 4, 13, 0}, // PP = 7 TT = 2
584  { 4, 0, 0}, // PP = 7 TT = 3
585  { 13, 0, 0}, // PP = 7 TT = 4
586  { 4, 13, 14}, // PP = 7 TT = 5
587  { 13, 14, 0}, // PP = 7 TT = 6
588  { 13, 14, 0}, // PP = 7 TT = 7
589  { 0, 0, 0}, // PP = 7 TT = 8
590  { 14, 0, 0} // PP = 7 TT = 9
591  },
592  { { 3, 0, 0}, // PP = 8 TT = 1
593  { 3, 0, 0}, // PP = 8 TT = 2
594  { 3, 13, 0}, // PP = 8 TT = 3
595  { 3, 12, 13}, // PP = 8 TT = 4
596  { 13, 0, 0}, // PP = 8 TT = 5
597  { 12, 13, 0}, // PP = 8 TT = 6
598  { 12, 13, 0}, // PP = 8 TT = 7
599  { 12, 0, 0}, // PP = 8 TT = 8
600  { 0, 0, 0} // PP = 8 TT = 9
601  },
602  { { 3, 0, 0}, // PP = 9 TT = 1
603  { 3, 11, 0}, // PP = 9 TT = 2
604  { 3, 0, 0}, // PP = 9 TT = 3
605  { 11, 0, 0}, // PP = 9 TT = 4
606  { 3, 11, 12}, // PP = 9 TT = 5
607  { 11, 12, 0}, // PP = 9 TT = 6
608  { 11, 12, 0}, // PP = 9 TT = 7
609  { 0, 0, 0}, // PP = 9 TT = 8
610  { 12, 0, 0} // PP = 9 TT = 9
611  },
612  { { 2, 0, 0}, // PP = 10 TT = 1
613  { 2, 0, 0}, // PP = 10 TT = 2
614  { 2, 11, 0}, // PP = 10 TT = 3
615  { 2, 10, 11}, // PP = 10 TT = 4
616  { 11, 0, 0}, // PP = 10 TT = 5
617  { 10, 11, 0}, // PP = 10 TT = 6
618  { 10, 11, 0}, // PP = 10 TT = 7
619  { 10, 0, 0}, // PP = 10 TT = 8
620  { 0, 0, 0} // PP = 10 TT = 9
621  },
622  { { 2, 0, 0}, // PP = 11 TT = 1
623  { 2, 9, 0}, // PP = 11 TT = 2
624  { 2, 0, 0}, // PP = 11 TT = 3
625  { 9, 0, 0}, // PP = 11 TT = 4
626  { 2, 9, 10}, // PP = 11 TT = 5
627  { 9, 10, 0}, // PP = 11 TT = 6
628  { 9, 10, 0}, // PP = 11 TT = 7
629  { 0, 0, 0}, // PP = 11 TT = 8
630  { 10, 0, 0} // PP = 11 TT = 9
631  },
632  { { 1, 0, 0}, // PP = 12 TT = 1
633  { 1, 0, 0}, // PP = 12 TT = 2
634  { 1, 9, 0}, // PP = 12 TT = 3
635  { 1, 8, 9}, // PP = 12 TT = 4
636  { 9, 0, 0}, // PP = 12 TT = 5
637  { 8, 9, 0}, // PP = 12 TT = 6
638  { 8, 9, 0}, // PP = 12 TT = 7
639  { 8, 0, 0}, // PP = 12 TT = 8
640  { 0, 0, 0} // PP = 12 TT = 9
641  }
642 };
643 
644 
645 
646 
Definition: T.h:18