double Radius[28] = {10.7219, 12.0797, 13.7802, 15.1447, 16.9320, 18.30869813, 20.5213, 21.90097, 23.8544, 25.236196, 27.1876, 28.5712003, 31.379, 32.7577, 34.4343, 35.8128, 37.4446, 38.8313455, 40.5368, 41.924684, 43.6152, 45.0037619, 46.6850, 48.0735610, 50.3747, 51.7597, 53.3631, 54.7464 }; double NStraws[28] = {42., 42., 54., 54., 66., 66., 80., 80., 93., 93., 106., 106., 123., 123., 135., 135., 146., 146., 158., 158., 170., 170., 182., 182., 197., 197., 209., 209.}; double Phi0[28] = {0.0, 4.285714, 2.18133, 5.51466, 0.0, 2.75088647, -0.923, 1.327019, 0.0, 1.93541375, -0.5041, 1.19368158378, -0.59503, 0.86857, 0.38671, 1.72001, 0.8330, 2.0661524692, -0.3295, 0.80948540, 0.4285, 1.487313845, -0.6665, 0.32239322559, -0.60612, 0.30760, 0.34281, 1.20403}; double StrawPos[28][2][300]; int Straw2Board[28][210][3]; int Board2Straw[9][25][25][2]; int ROC2Board[4][14][3][2]; int ADC2STRAW[4][20][72][2]; void initROC2Board(){ ROC2Board[0][0][0][0] = 0; ROC2Board[0][0][0][1] = 0; ROC2Board[0][0][1][0] = 1; ROC2Board[0][0][1][1] = 0; ROC2Board[0][0][2][0] = 2; ROC2Board[0][0][2][1] = 0; ROC2Board[0][1][0][0] = 3; ROC2Board[0][1][0][1] = 0; ROC2Board[0][1][1][0] = 4; ROC2Board[0][1][1][1] = 0; ROC2Board[0][1][2][0] = 5; ROC2Board[0][1][2][1] = 0; ROC2Board[0][2][0][0] = 6; ROC2Board[0][2][0][1] = 0; ROC2Board[0][2][1][0] = 7; ROC2Board[0][2][1][1] = 0; ROC2Board[0][2][2][0] = 8; ROC2Board[0][2][2][1] = 0; ROC2Board[0][3][0][0] = 3; ROC2Board[0][3][0][1] = 1; ROC2Board[0][3][1][0] = 4; ROC2Board[0][3][1][1] = 1; ROC2Board[0][3][2][0] = 5; ROC2Board[0][3][2][1] = 1; ROC2Board[0][4][0][0] = 6; ROC2Board[0][4][0][1] = 1; ROC2Board[0][4][1][0] = 7; ROC2Board[0][4][1][1] = 1; ROC2Board[0][4][2][0] = 8; ROC2Board[0][4][2][1] = 1; ROC2Board[0][5][0][0] = 0; ROC2Board[0][5][0][1] = 1; ROC2Board[0][5][1][0] = 1; ROC2Board[0][5][1][1] = 1; ROC2Board[0][5][2][0] = 2; ROC2Board[0][5][2][1] = 1; ROC2Board[0][6][0][0] = 3; ROC2Board[0][6][0][1] = 2; ROC2Board[0][6][1][0] = 4; ROC2Board[0][6][1][1] = 2; ROC2Board[0][6][2][0] = 5; ROC2Board[0][6][2][1] = 2; ROC2Board[0][7][0][0] = 6; ROC2Board[0][7][0][1] = 2; ROC2Board[0][7][1][0] = 7; ROC2Board[0][7][1][1] = 2; ROC2Board[0][7][2][0] = 8; ROC2Board[0][7][2][1] = 2; ROC2Board[0][8][0][0] = 6; ROC2Board[0][8][0][1] = 3; ROC2Board[0][8][1][0] = 7; ROC2Board[0][8][1][1] = 3; ROC2Board[0][8][2][0] = 8; ROC2Board[0][8][2][1] = 3; ROC2Board[0][9][0][0] = 6; ROC2Board[0][9][0][1] = 4; ROC2Board[0][9][1][0] = 7; ROC2Board[0][9][1][1] = 4; ROC2Board[0][9][2][0] = 8; ROC2Board[0][9][2][1] = 4; ROC2Board[0][10][0][0] = 1; ROC2Board[0][10][0][1] = 2; ROC2Board[0][10][1][0] = 3; ROC2Board[0][10][1][1] = 3; ROC2Board[0][10][2][0] = 5; ROC2Board[0][10][2][1] = 3; ROC2Board[0][11][0][0] = 4; ROC2Board[0][11][0][1] = 3; ROC2Board[0][11][1][0] = 5; ROC2Board[0][11][1][1] = 4; ROC2Board[0][11][2][0] = 8; ROC2Board[0][11][2][1] = 5; ROC2Board[0][12][0][0] = 6; ROC2Board[0][12][0][1] = 5; ROC2Board[0][12][1][0] = 7; ROC2Board[0][12][1][1] = 5; ROC2Board[0][12][2][0] = 8; ROC2Board[0][12][2][1] = 6; //++++++++++++++++++++++++++++++++++++++ ROC2Board[1][0][0][0] = 0; ROC2Board[1][0][0][1] = 7; ROC2Board[1][0][1][0] = 2; ROC2Board[1][0][1][1] = 10; ROC2Board[1][0][2][0] = 4; ROC2Board[1][0][2][1] = 16; ROC2Board[1][1][0][0] = 7; ROC2Board[1][1][0][1] = 23; ROC2Board[1][1][1][0] = 8; ROC2Board[1][1][1][1] = 25; ROC2Board[1][1][2][0] = 9999; // not used ROC2Board[1][1][2][1] = 9999; ROC2Board[1][2][0][0] = 3; ROC2Board[1][2][0][1] = 13; ROC2Board[1][2][1][0] = 5; ROC2Board[1][2][1][1] = 18; ROC2Board[1][2][2][0] = 6; ROC2Board[1][2][2][1] = 20; ROC2Board[1][3][0][0] = 4; ROC2Board[1][3][0][1] = 15; ROC2Board[1][3][1][0] = 7; ROC2Board[1][3][1][1] = 22; ROC2Board[1][3][2][0] = 8; ROC2Board[1][3][2][1] = 24; ROC2Board[1][4][0][0] = 1; ROC2Board[1][4][0][1] = 8; ROC2Board[1][4][1][0] = 2; ROC2Board[1][4][1][1] = 9; ROC2Board[1][4][2][0] = 5; ROC2Board[1][4][2][1] = 17; ROC2Board[1][5][0][0] = 6; ROC2Board[1][5][0][1] = 19; ROC2Board[1][5][1][0] = 7; ROC2Board[1][5][1][1] = 21; ROC2Board[1][5][2][0] = 8; ROC2Board[1][5][2][1] = 23; ROC2Board[1][6][0][0] = 3; ROC2Board[1][6][0][1] = 12; ROC2Board[1][6][1][0] = 4; ROC2Board[1][6][1][1] = 14; ROC2Board[1][6][2][0] = 5; ROC2Board[1][6][2][1] = 16; ROC2Board[1][7][0][0] = 6; ROC2Board[1][7][0][1] = 18; ROC2Board[1][7][1][0] = 7; ROC2Board[1][7][1][1] = 20; ROC2Board[1][7][2][0] = 8; ROC2Board[1][7][2][1] = 22; ROC2Board[1][8][0][0] = 0; ROC2Board[1][8][0][1] = 6; ROC2Board[1][8][1][0] = 1; ROC2Board[1][8][1][1] = 7; ROC2Board[1][8][2][0] = 2; ROC2Board[1][8][2][1] = 8; ROC2Board[1][9][0][0] = 3; ROC2Board[1][9][0][1] = 11; ROC2Board[1][9][1][0] = 4; ROC2Board[1][9][1][1] = 13; ROC2Board[1][9][2][0] = 5; ROC2Board[1][9][2][1] = 15; ROC2Board[1][10][0][0] = 6; ROC2Board[1][10][0][1] = 17; ROC2Board[1][10][1][0] = 7; ROC2Board[1][10][1][1] = 19; ROC2Board[1][10][2][0] = 8; ROC2Board[1][10][2][1] = 21; ROC2Board[1][11][0][0] = 6; ROC2Board[1][11][0][1] = 16; ROC2Board[1][11][1][0] = 7; ROC2Board[1][11][1][1] = 18; ROC2Board[1][11][2][0] = 8; ROC2Board[1][11][2][1] = 20; //++++++++++++++++++++++++++++++ ROC2Board[2][0][0][0] = 0; ROC2Board[2][0][0][1] = 3; ROC2Board[2][0][1][0] = 1; ROC2Board[2][0][1][1] = 4; ROC2Board[2][0][2][0] = 2; ROC2Board[2][0][2][1] = 4; ROC2Board[2][1][0][0] = 3; ROC2Board[2][1][0][1] = 6; ROC2Board[2][1][1][0] = 4; ROC2Board[2][1][1][1] = 7; ROC2Board[2][1][2][0] = 5; ROC2Board[2][1][2][1] = 9; ROC2Board[2][2][0][0] = 6; ROC2Board[2][2][0][1] = 10; ROC2Board[2][2][1][0] = 7; ROC2Board[2][2][1][1] = 11; ROC2Board[2][2][2][0] = 8; ROC2Board[2][2][2][1] = 12; ROC2Board[2][3][0][0] = 6; ROC2Board[2][3][0][1] = 9; ROC2Board[2][3][1][0] = 7; ROC2Board[2][3][1][1] = 10; ROC2Board[2][3][2][0] = 8; ROC2Board[2][3][2][1] = 11; ROC2Board[2][4][0][0] = 5; ROC2Board[2][4][0][1] = 8; ROC2Board[2][4][1][0] = 7; ROC2Board[2][4][1][1] = 9; ROC2Board[2][4][2][0] = 8; ROC2Board[2][4][2][1] = 10; ROC2Board[2][5][0][0] = 3; ROC2Board[2][5][0][1] = 5; ROC2Board[2][5][1][0] = 4; ROC2Board[2][5][1][1] = 6; ROC2Board[2][5][2][0] = 5; ROC2Board[2][5][2][1] = 7; ROC2Board[2][6][0][0] = 6; ROC2Board[2][6][0][1] = 8; ROC2Board[2][6][1][0] = 7; ROC2Board[2][6][1][1] = 8; ROC2Board[2][6][2][0] = 8; ROC2Board[2][6][2][1] = 9; ROC2Board[2][7][0][0] = 2; ROC2Board[2][7][0][1] = 4; ROC2Board[2][7][1][0] = 4; ROC2Board[2][7][1][1] = 5; ROC2Board[2][7][2][0] = 6; ROC2Board[2][7][2][1] = 7; ROC2Board[2][8][0][0] = 5; ROC2Board[2][8][0][1] = 6; ROC2Board[2][8][1][0] = 7; ROC2Board[2][8][1][1] = 7; ROC2Board[2][8][2][0] = 8; ROC2Board[2][8][2][1] = 8; ROC2Board[2][9][0][0] = 0; ROC2Board[2][9][0][1] = 2; ROC2Board[2][9][1][0] = 1; ROC2Board[2][9][1][1] = 3; ROC2Board[2][9][2][0] = 2; ROC2Board[2][9][2][1] = 2; ROC2Board[2][10][0][0] = 3; ROC2Board[2][10][0][1] = 4; ROC2Board[2][10][1][0] = 4; ROC2Board[2][10][1][1] = 4; ROC2Board[2][10][2][0] = 5; ROC2Board[2][10][2][1] = 5; ROC2Board[2][11][0][0] = 6; ROC2Board[2][11][0][1] = 6; ROC2Board[2][11][1][0] = 7; ROC2Board[2][11][1][1] = 6; ROC2Board[2][11][2][0] = 8; ROC2Board[2][11][2][1] = 7; //+++++++++++++++++++++++++++++ ROC2Board[3][0][0][0] = 0; ROC2Board[3][0][0][1] = 4; ROC2Board[3][0][1][0] = 1; ROC2Board[3][0][1][1] = 5; ROC2Board[3][0][2][0] = 2; ROC2Board[3][0][2][1] = 5; ROC2Board[3][1][0][0] = 3; ROC2Board[3][1][0][1] = 7; ROC2Board[3][1][1][0] = 4; ROC2Board[3][1][1][1] = 8; ROC2Board[3][1][2][0] = 5; ROC2Board[3][1][2][1] = 10; ROC2Board[3][2][0][0] = 6; ROC2Board[3][2][0][1] = 11; ROC2Board[3][2][1][0] = 7; ROC2Board[3][2][1][1] = 12; ROC2Board[3][2][2][0] = 8; ROC2Board[3][2][2][1] = 13; ROC2Board[3][3][0][0] = 3; ROC2Board[3][3][0][1] = 8; ROC2Board[3][3][1][0] = 4; ROC2Board[3][3][1][1] = 9; ROC2Board[3][3][2][0] = 5; ROC2Board[3][3][2][1] = 11; ROC2Board[3][4][0][0] = 6; ROC2Board[3][4][0][1] = 12; ROC2Board[3][4][1][0] = 7; ROC2Board[3][4][1][1] = 13; ROC2Board[3][4][2][0] = 8; ROC2Board[3][4][2][1] = 14; ROC2Board[3][5][0][0] = 2; ROC2Board[3][5][0][1] = 6; ROC2Board[3][5][1][0] = 3; ROC2Board[3][5][1][1] = 9; ROC2Board[3][5][2][0] = 4; ROC2Board[3][5][2][1] = 10; ROC2Board[3][6][0][0] = 6; ROC2Board[3][6][0][1] = 13; ROC2Board[3][6][1][0] = 7; ROC2Board[3][6][1][1] = 15; ROC2Board[3][6][2][0] = 8; ROC2Board[3][6][2][1] = 15; ROC2Board[3][7][0][0] = 5; ROC2Board[3][7][0][1] = 12; ROC2Board[3][7][1][0] = 7; ROC2Board[3][7][1][1] = 15; ROC2Board[3][7][2][0] = 8; ROC2Board[3][7][2][1] = 16; ROC2Board[3][8][0][0] = 5; ROC2Board[3][8][0][1] = 13; ROC2Board[3][8][1][0] = 6; ROC2Board[3][8][1][1] = 14; ROC2Board[3][8][2][0] = 8; ROC2Board[3][8][2][1] = 17; ROC2Board[3][9][0][0] = 5; ROC2Board[3][9][0][1] = 11; ROC2Board[3][9][1][0] = 7; ROC2Board[3][9][1][1] = 16; ROC2Board[3][9][2][0] = 8; ROC2Board[3][9][2][1] = 18; ROC2Board[3][10][0][0] = 0; ROC2Board[3][10][0][1] = 5; ROC2Board[3][10][1][0] = 1; ROC2Board[3][10][1][1] = 6; ROC2Board[3][10][2][0] = 2; ROC2Board[3][10][2][1] = 7; ROC2Board[3][11][0][0] = 3; ROC2Board[3][11][0][1] = 10; ROC2Board[3][11][1][0] = 4; ROC2Board[3][11][1][1] = 12; ROC2Board[3][11][2][0] = 5; ROC2Board[3][11][2][1] = 14; ROC2Board[3][12][0][0] = 6; ROC2Board[3][12][0][1] = 15; ROC2Board[3][12][1][0] = 7; ROC2Board[3][12][1][1] = 17; ROC2Board[3][12][2][0] = 8; ROC2Board[3][12][2][1] = 19; }