StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
getCellPosition2015pA.cxx
1 #include <stdio.h>
2 
3 void getCellPosition2015pA(int nstb, int row, int col, float &x1, float &y1, float &x2, float &y2, float &z){
4  const float large_width = 58.0; // large cell width
5  const float small_width = 38.0; // small cell width
6  float x=0.0, y=0.0;
7  switch(nstb)
8  {
9  case 1:
10  x = -24.0 - 25.0 - 58.6 * col;
11  y = 965.5 - 58.5 * row;
12  z = 7208;
13  break;
14  case 2:
15  x = -24.0 - 8.0 + 66.6 + 58.4 * col; //new position May 5 2015
16  y = 965.1 - 58.6 * row;
17  z = 7188;
18  break;
19  case 3:
20  if(row>16.5)
21  {
22  x = -22.0 - 17.7 - 38.2 * col;
23  y = 422.7 - 37.9 * row;
24  z = 7208;
25  }
26  else
27  {
28  x = -22.0 - 17.7 - 38.2 * col;
29  y = 4.75 + 438.9 - 39.0 * row;
30  z = 7204;
31  };
32  break;
33  case 4:
34  x = -22.0 - 8.0 + 60. + 38.4 * col; // new position May 5 2015
35  y = 444. - 38.7 * row;
36  z = 7188;
37  break;
38  };
39 
40  if(nstb<=2)
41  {
42  x1 = x - large_width/2.0;
43  x2 = x + large_width/2.0;
44  y1 = y - large_width/2.0;
45  y2 = y + large_width/2.0;
46  }
47  else
48  {
49  x1 = x - small_width/2.0;
50  x2 = x + small_width/2.0;
51  y1 = y - small_width/2.0;
52  y2 = y + small_width/2.0;
53  };
54 
55  x1/=10.0;
56  y1/=10.0;
57  x2/=10.0;
58  y2/=10.0;
59  z/=10.0;
60  // printf("nstb=%d row=%3d col=%3d xyz=%8.2f %8.2f %8.2f\n",nstb,row,col,x,y,z);
61 }
62