StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
getCellPosition2017.cxx
1 #include <stdio.h>
2 
3 void getCellPosition2017(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 
8  //FMS Position February 23, 2017
9  //North position unchanged from 2015
10  //South position Dx=-5mm (5 mm north)
11  //from position in 2015. Offset in
12  //program changed from -8 to -13 mm
13  switch(nstb){
14  case 1:
15  x = -25.0 - 58.6 * col;
16  y = 965.5 - 58.5 * row;
17  z = 7208;
18  break;
19  case 2:
20  x = -13.0 + 66.6 + 58.4 * col;
21  y = 965.1 - 58.6 * row;
22  z = 7188;
23  break;
24  case 3:
25  if(row>16.5)
26  {
27  x = -17.7 - 38.2 * col;
28  y = 422.7 - 37.9 * row;
29  z = 7208;
30  }
31  else
32  {
33  x = -17.7 - 38.2 * col;
34  y = 4.75 + 438.9 - 39.0 * row;
35  z = 7204;
36  };
37  break;
38  case 4:
39  x = -13.0 + 60. + 38.4 * col;
40  y = 444. - 38.7 * row;
41  z = 7188;
42  break;
43  };
44 
45  if(nstb<=2)
46  {
47  x1 = x - large_width/2.0;
48  x2 = x + large_width/2.0;
49  y1 = y - large_width/2.0;
50  y2 = y + large_width/2.0;
51  }
52  else
53  {
54  x1 = x - small_width/2.0;
55  x2 = x + small_width/2.0;
56  y1 = y - small_width/2.0;
57  y2 = y + small_width/2.0;
58  };
59 
60  x1/=10.0;
61  y1/=10.0;
62  x2/=10.0;
63  y2/=10.0;
64  z/=10.0;
65  // printf("nstb=%d row=%3d col=%3d xyz=%8.2f %8.2f %8.2f\n",nstb,row,col,x,y,z);
66 }