FairRoot/PandaRoot
muon_barrel_strip_5.C
Go to the documentation of this file.
2 {
3  TFile *out = TFile::Open("output.root","RECREATE");
4 
5  TGeoManager *geom = new TGeoManager("Assembly", "");
6 
7  Float_t MDT_barrel_long = 390.;
8  Float_t MDT_barrel_short = 362.;
9  Float_t MDT_barrel_short_up;
10  Float_t MDT_barrel_short_down;
11  Float_t MDT_width = 8.34;
12  Float_t MDT_thickness = 1.23;
13  Float_t XSize = 8.06;
14  Float_t YSize = 1.03;
15  Float_t XSize1 = 0.94;
16  Float_t YSize1 = 0.97;
17 
18  TGeoMaterial *mat1 = new TGeoMaterial("vacuum", 1.e-16, 1.e-16, 1.e-16);
19  TGeoMaterial *mat2 = new TGeoMaterial("aluminium", 26.98, 13, 2.7);
20  TGeoMixture *mat3 = new TGeoMixture("air", 3, 0.001205);
21  mat3->DefineElement(0, 39.35, 18, 0.01);
22  mat3->DefineElement(1, 16.00, 8, 0.21);
23  mat3->DefineElement(2, 14.01, 7, 0.78);
24  TGeoMixture *mat4 = new TGeoMixture("MDTMixture", 3, 0.0019);
25  mat4->DefineElement(0, 39.948, 18, 0.476);
26  mat4->DefineElement(1, 12.010, 6, 0.143);
27  mat4->DefineElement(2, 15.9994, 8, 0.381);
28  TGeoMixture *mat5 = new TGeoMixture("MDTPlastic", 2, 1.032);
29  mat5->DefineElement(0, 12.01, 6, 9);
30  mat5->DefineElement(1, 1.008, 1, 10);
31  TGeoMaterial *mat6 = new TGeoMaterial("iron", 55.847, 26, 7.87);
32  TGeoMixture *mat7 = new TGeoMixture("G10", 4, 1.7);
33  mat7->DefineElement(0, 12.01, 6, .259);
34  mat7->DefineElement(1, 1.008, 1, .288);
35  mat7->DefineElement(2, 16, 8, .248);
36  mat7->DefineElement(3, 28.09, 14, .205);
37 
38 
39  TGeoMedium *med1 = new TGeoMedium("vacuum", 1, mat1);
40  TGeoMedium *med2 = new TGeoMedium("aluminium", 2, mat2);
41  TGeoMedium *med3 = new TGeoMedium("Air", 3, mat3);
42  TGeoMedium *med4 = new TGeoMedium("MDTMixture", 4, mat4);
43  TGeoMedium *med5 = new TGeoMedium("MDTPlastic", 5, mat5);
44  TGeoMedium *med6 = new TGeoMedium("iron", 6, mat6);
45  TGeoMedium *med7 = new TGeoMedium("G10", 7, mat7);
46 
47  TGeoVolume *top = new TGeoVolumeAssembly("top");
48  TGeoVolume *MdtOct0 = new TGeoVolumeAssembly("MdtBarrelOct0");
49  TGeoVolume *MdtOct2 = new TGeoVolumeAssembly("MdtBarrelOct2");
50  TGeoVolume *MdtOct6 = new TGeoVolumeAssembly("MdtBarrelOct6");
51 
52  TGeoVolume *mnk[14], *mnk1[14], *mnk2[14], *mnk3[6], *mnk4[6], *mnk5[18];
53  TGeoVolume *tube[16][3], *tube_en_l0[44][3], *tube_en_l2[68][3], *tube_en_l3[68][3], *tube_en_l4[68][3],
54  *tube_en_l5[68][3], *tube_en_l6[72][3], *tube_fw[3][3];
55 
56  for(int i=0;i<14;i++) {
57  mnk[i] = new TGeoVolumeAssembly(Form("MdtBarrelOct0Layer%d",i));
58  mnk1[i] = new TGeoVolumeAssembly(Form("MdtBarrelOct2Layer%d",i));
59  mnk2[i] = new TGeoVolumeAssembly(Form("MdtBarrelOct6Layer%d",i));
60  }
61 
62  for(int i=0;i<7;i++) {
63  mnk3[i] = new TGeoVolumeAssembly(Form("MdtEndcapLayer%d",i));
64  }
65 
66  for(int i=0;i<4;i++) {
67  mnk4[i] = new TGeoVolumeAssembly(Form("MdtMFLayer%d",i));
68  }
69 
70  for(int i=0;i<18;i++) {
71  mnk5[i] = new TGeoVolumeAssembly(Form("MdtForwardLayer%d",i));
72  }
73 
74 
75  TGeoRotation *rot0 = new TGeoRotation();
76  rot0->RotateZ(-90);
77  rot0->RegisterYourself();
78  TGeoRotation *rot1 = new TGeoRotation();
79  rot1->RotateZ(-45);
80  rot1->RegisterYourself();
81  TGeoRotation *rot2 = new TGeoRotation();
82  rot2->RotateZ(0);
83  rot2->RegisterYourself();
84  TGeoRotation *rot3 = new TGeoRotation();
85  rot3->RotateZ(45);
86  rot3->RegisterYourself();
87  TGeoRotation *rot4 = new TGeoRotation();
88  rot4->RotateZ(90);
89  rot4->RegisterYourself();
90  TGeoRotation *rot5 = new TGeoRotation();
91  rot5->RotateZ(135);
92  rot5->RegisterYourself();
93  TGeoRotation *rot6 = new TGeoRotation();
94  rot6->RotateZ(180);
95  rot6->RegisterYourself();
96  TGeoRotation *rot7 = new TGeoRotation();
97  rot7->RotateZ(225);
98  rot7->RegisterYourself();
99 
100 
101  geom->SetTopVolume(top);
102 
103  TGeoVolume *pCombi = new TGeoVolumeAssembly("MdtBarrel");
104  TGeoVolume *pCombi1 = new TGeoVolumeAssembly("MdtEndcap");
105  TGeoVolume *pCombi2 = new TGeoVolumeAssembly("MdtMF");
106  TGeoVolume *pCombi3 = new TGeoVolumeAssembly("MdtForward");
107  float pos_x, pos_y, pos_z, zl, slotpos_x;
108  float slotpos_y = -0.03;
109 
110  TGeoRotation *rr1 = new TGeoRotation();
111  rr1->RotateZ(0);
112  rr1->RotateY(0);
113  rr1->RotateX(90);
114  rr1->SetName("rr1");
115  rr1->RegisterYourself();
116 
117  TGeoRotation *rr0 = new TGeoRotation();
118  rr0->RotateZ(90);
119  rr0->RotateY(90);
120  rr0->SetName("rr0");
121  rr0->RegisterYourself();
122 
123  float mm[14][3] = { 53.05,0,0,-57.95,0,0,-56.965,-31.45,45.05,59.438,33.938,-42.562,-61.92,-36.42,48.58,
124  64.4,38.9,-46.1,-66.89,-41.39,52.11,69.38,43.88,-49.62,-71.86,-46.36,55.64,74.35,48.85,
125  -61.65,-76.83,-51.33,59.17,79.32,53.82,-65.18,-81.8,-56.3,62.7,84.29,58.79,-68.71 };
126 
127  int mm1[14][3] = { 14,0,0,14,0,0,14,2,12,14,2,12,15,2,13,16,2,13,16,2,14,17,2,14,
128  17,2,15,18,2,16,19,2,16,19,2,17,20,2,17,20,2,18};
129 
133  float tube_len[16] = { 390, 362, 158.5, 172.5, 68.55, 45.0, 217.5, 127.5, 212.5, 121.5, 165.5,
134  179.5, 89.5, 75.5, 217.5, 127.5 };
136  for(int i=0; i<16; i++) {
137  tube[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len[i]/2);
138  tube[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len[i]/2);
139  for(int j = 0; j < 8; j++){
140  float slotpos_x = (-3.5 + 1.*j);
141  tube[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",1,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len[i]/2);
142  tube[i][1]->AddNode(tube[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
143  }
144  tube[i][0]->AddNode(tube[i][1],1);
145  }
146 
148  TGeoTranslation* tr[14][5];
149  float limx[14][4] = {0.,0.,0.,0.,0.,0.,0.,0., 50.7, -46.7, 50.7, -46.7, 46.6, -50.8, 46.6, -50.8, 55., -50.7, 55., -50.7, 55.2, -55., 55.2, -55.,
150  59.2, -55.1, 59.2, -55.1, 59.2, -59.2, 59.2, -59.2, 63.5, -59.2, 63.5, -59.2,, 63.6, -67.8, 63.6, -67.8, 68, -67.8, 68, -67.8,
151  68, -72, 68, -72, 72.1, -72, 72.1, -72, 72.3, -76.3, 72.3, -76.3};
152  float limz[3][4] = {0,0,0,0,0,0,0,0, 188, 188, -188, -188 };
153 
154  for(int i=0; i<14; i++) {
155  for(int j=0; j<4; j++) {
156  if(i<2) {tr[i][j] = new TGeoTranslation(limx[i][j], 0, 0); }
157  else {tr[i][j] = new TGeoTranslation(limx[i][j], 0, limz[2][j]);}
158  tr[i][j]->SetName(Form("tr%dL%d",j,i));
159  tr[i][j]->RegisterYourself();
160  }
161  }
162 
163  TGeoBBox *L[8], *al_L[8];
164  for(int i=2; i<9 ; i++){
165  L[i] = new TGeoBBox(Form("L%d",i), ((12+i)*8.5-0.6)/2, 0.075, MDT_barrel_long/2);
166  al_L[i] = new TGeoBBox(Form("al_L%d",i),((12+i)*8.5-0.6)/2, 0.0175, MDT_barrel_long/2);
167  }
168 
169  TGeoBBox* L_1 = new TGeoBBox("L_1",8.5, 0.08, 7.05);
170  TGeoBBox* L_2 = new TGeoBBox("L_2",13, 0.08, 7.05);
171  TGeoBBox* al_L_1 = new TGeoBBox("al_L_1",8.5, 0.018, 7.05);
172  TGeoBBox* al_L_2 = new TGeoBBox("al_L_2",13, 0.018, 7.05);
173 
174  TGeoVolume *G10[16], *ST[16];
175  TGeoCompositeShape *CG10[16], *CST[16];
176  float ppos[14] = {-2.5,-2.5,-1.7,4.3,-2.4,0.6,-3.1,1.5,-3.7,2.2,-0.4,2.9,-1.0,3.4};
177 
178  char longb[250];
179  char longb1[250];
180  int qqq[12][13]={2,1,0,2,2,1,2,1,2,2,2,3,2,
181  2,2,0,3,1,1,3,2,2,3,1,3,3,
182  3,1,0,4,2,1,4,1,2,4,2,3,4,
183  4,2,0,5,2,1,5,2,2,5,2,3,5,
184  4,1,0,6,2,1,6,1,2,6,2,3,6,
185  5,2,0,7,2,1,7,2,2,7,2,3,7,
186  5,1,0,8,2,1,8,1,2,8,2,3,8,
187  6,2,0,9,1,1,9,2,2,9,1,3,9,
188  7,2,0,10,2,1,10,2,2,10,2,3,10,
189  7,2,0,11,1,1,11,2,2,11,1,3,11,
190  8,2,0,12,2,1,12,2,2,12,2,3,12,
191  8,2,0,13,1,1,13,2,2,13,1,3,13};
192 
193  for(int i=2; i<14; i++){
194  sprintf(longb,"L%d-(L_%d:tr%dL%d+L_%d:tr%dL%d+L_%d:tr%dL%d+L_%d:tr%dL%d)",
195  qqq[i-2][0],qqq[i-2][1],qqq[i-2][2],qqq[i-2][3],qqq[i-2][4],qqq[i-2][5],qqq[i-2][6],qqq[i-2][7],qqq[i-2][8],
196  qqq[i-2][9],qqq[i-2][10],qqq[i-2][11],qqq[i-2][12]);
197 
198  sprintf(longb1,"L%d-(L_%d:tr%dL%d+L_%d:tr%dL%d+L_%d:tr%dL%d+L_%d:tr%dL%d)",
199  qqq[i-2][0],qqq[i-2][1],qqq[i-2][2],qqq[i-2][3],qqq[i-2][4],qqq[i-2][5],qqq[i-2][6],qqq[i-2][7],qqq[i-2][8],
200  qqq[i-2][9],qqq[i-2][10],qqq[i-2][11],qqq[i-2][12]);
201 
202  CG10[i] = new TGeoCompositeShape(longb);
203  CST[i] = new TGeoCompositeShape(longb1);
204  G10[i] = new TGeoVolume(Form("GP%d_%d_B",i,0), CG10[i], med7);
205  ST[i] = new TGeoVolume(Form("ST%d_%d_B",i,0), CST[i], med7);
206  }
207 
209  TGeoBBox* L01 = new TGeoBBox("L0",58.9, 0.075, MDT_barrel_short/2);
210  TGeoBBox* al_L0_1 = new TGeoBBox("al_L0_1",58.9, 0.0175, MDT_barrel_short/2);
211  TGeoBBox* al_L0_2 = new TGeoBBox("al_L0_2",58.9, 0.0175, MDT_barrel_short/2);
212 
213  G10[1] = new TGeoVolume("GP01_0",L01, gGeoManager->GetMedium("G10"));
214  ST[0] = new TGeoVolume("ST0_0",al_L0_1, gGeoManager->GetMedium("aluminium"));
215  ST[1] = new TGeoVolume("ST1_0",al_L0_2, gGeoManager->GetMedium("aluminium"));
217 
218  for(int ii = 0; ii < 14; ii++){
219  if(ii == 0) { ST[ii]->SetLineColor(kBlue); }
220  else {
221  G10[ii]->SetLineColor(kRed);
222  ST[ii]->SetLineColor(kBlue);
223  }
224  }
225  int fl;
226 // MDT%ds%dl%db%dw%d -> MDT + 1/2/3/4 (Barrel/Endcap/MF/FS) + octant# + layer# + box# + wire#
229  fl=1;
230  pos_z = 45.;
231  pos_y = 155.715;
232  for(int ii = 0; ii < 14; ii++){ // Layer#
233  int yy = (ii%2);
234  for(int i = 0; i < mm1[ii][0]; i++){ //Number of MDT in Layer
235  if(ii>1) {
236  pos_y = 155.715+(ii-2)*6;
237 
238  if(i <= mm1[ii][1]) { pos_x = mm[ii][0] + (-1)**ii*8.5*i;
239  name(tube[1][0],fl,0,ii,(-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1),0);
240  mnk[ii]->AddNode(tube[1][0], (-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1), new TGeoTranslation(pos_x,pos_y,pos_z));
241  }
242 
243  if(i > mm1[ii][1] && i < mm1[ii][2]) { pos_x = mm[ii][1] + (-1)**ii*8.5*(i-mm1[ii][1]-1);
244  name(tube[0][0],fl,0,ii,(-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1),0);
245  mnk[ii]->AddNode(tube[0][0], (-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1), new TGeoTranslation(pos_x,pos_y,pos_z));}
246 
247  if(i >= mm1[ii][2]) { pos_x = mm[ii][2] + (-1)**ii*8.5*(i-mm1[ii][2]);
248  name(tube[1][0],fl,0,ii,(-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1),0);
249  mnk[ii]->AddNode(tube[1][0], (-1)**ii*(mm1[ii][0]-i-1)+(ii%2)*(mm1[ii][0]-1), new TGeoTranslation(pos_x,pos_y,pos_z));}
250  } else {
251  pos_y = (147 - MDT_thickness/2 - (MDT_thickness + 0.5)*(ii-1));
252  pos_x = (mm[ii][0] - (-1)**ii*i*8.5);
253  name(tube[1][0],fl,0,ii,(-1)**(ii+1)*(mm1[ii][0]-i-1)+(mm1[ii][0]-1)*((ii+1)%2),0);
254  mnk[ii]->AddNode(tube[1][0], (-1)**(ii+1)*(mm1[ii][0]-i-1)+(mm1[ii][0]-1)*((ii+1)%2), new TGeoTranslation(pos_x,pos_y,pos_z));
255  }
256  }
257 
258  if(ii >= 2) {
259  mnk[ii]->AddNode(G10[ii], ii, new TGeoTranslation(ppos[ii], (pos_y+MDT_thickness/2+0.1), pos_z));
260  mnk[ii]->AddNode(ST[ii], ii, new TGeoTranslation(ppos[ii], (pos_y+MDT_thickness/2+0.1+0.0930), pos_z));
261  MdtOct0->AddNode(mnk[ii], ii);
262  }
263 
264  if(ii == 1) {
265  mnk[ii]->AddNode(ST[ii], ii, new TGeoTranslation(-2.5, (147.25 +0.0930), pos_z));
266  MdtOct0->AddNode(mnk[ii], ii);
267  }
268 
269  if(ii == 0) {
270  mnk[ii]->AddNode(ST[ii], ii, new TGeoTranslation(-2.5, (147.25 -0.0930), pos_z));
271  mnk[ii]->AddNode(G10[ii], ii, new TGeoTranslation(-2.5, 147.25, pos_z));
272  MdtOct0->AddNode(mnk[ii], ii);
273  }
274  }
275 
277 
279  for(int i = 0; i < 26; i++){
280  pos_y = 155.715;
281  if(i>=0 && i<2) { pos_z = 146.75; pos_x = (53.55 - 8.5*i); name(tube[2][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
282  if(i>=2 && i<11) { pos_z = 153.75; pos_x = (36.55 - 8.5*(i-2)); name(tube[3][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
283  if(i>=11 && i<14) { pos_z = 146.75; pos_x = (-39.95 - 8.5*(i-11)); name(tube[2][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
284  if(i>=14 && i<18) { pos_z = (-101.75); pos_x = (-56.95 + 8.5*(i-14)); name(tube[4][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
285  if(i>=18 && i<22) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-18)); name(tube[5][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
286  if(i>=22) { pos_z = (-101.75); pos_x = (31.45 + 8.5*(i-22)); name(tube[4][0],fl,2,2,i,0); mnk1[2]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
287  }
288 
289  for(int i = 0; i < 24; i++){
290  pos_y = 161.715;
291  if(i>=0 && i<1) { pos_z = 45; pos_x = (59.348 - 8.5*i); name(tube[1][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
292  if(i>=1 && i<3) { pos_z = 146.75; pos_x = (50.938 - 8.5*(i-1)); name(tube[2][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
293  if(i>=3 && i<12) { pos_z = 153.75; pos_x = (33.938 - 8.5*(i-3)); name(tube[3][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
294  if(i>=12 && i<13) { pos_z = 146.75; pos_x = (-42.562 - 8.5*(i-12)); name(tube[2][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
295  if(i>=13 && i<14) { pos_z = 45; pos_x = (-59.438 - 8.5*(i-13)); name(tube[1][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
296  if(i>=14 && i<17) { pos_z = (-101.75); pos_x = (-50.938 + 8.5*(i-14)); name(tube[4][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
297  if(i>=17 && i<21) { pos_z = (-90.); pos_x = (-10.75 + 8.5*(i-17)); name(tube[5][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
298  if(i>=21) { pos_z = (-101.75); pos_x = (33.938 + 8.5*(i-21)); name(tube[4][0],fl,2,3,i,0); mnk1[3]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
299  }
300 
301  for(int i = 0; i < 27; i++){
302  pos_y = 167.715;
303  if(i>=0 && i<1) { pos_z = 45; pos_x = (61.92 - 8.5*i); name(tube[1][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
304  if(i>=1 && i<2) { pos_z = 146.75; pos_x = (48.58 - 8.5*(i-1)); name(tube[2][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
305  if(i>=2 && i<12) { pos_z = 153.75; pos_x = (40.08 - 8.5*(i-2)); name(tube[3][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
306  if(i>=12 && i<14) { pos_z = 146.75; pos_x = (-44.92 - 8.5*(i-12)); name(tube[2][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
307  if(i>=14 && i<15) { pos_z = 45; pos_x = (-61.92 - 8.5*(i-14)); name(tube[1][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
308  if(i>=15 && i<19) { pos_z = (-101.75); pos_x = (-53.42 + 8.5*(i-15)); name(tube[4][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
309  if(i>=19 && i<23) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-19)); name(tube[5][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
310  if(i>=23) { pos_z = (-101.75); pos_x = (27.92 + 8.5*(i-23)); name(tube[4][0],fl,2,4,i,0); mnk1[4]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
311  }
312 
313  for(int i = 0; i < 28; i++){
314  pos_y = 173.715;
315  if(i>=0 && i<1) { pos_z = 45; pos_x = (64.40 - 8.5*i); name(tube[1][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
316  if(i>=1 && i<3) { pos_z = 146.75; pos_x = (55.90 - 8.5*(i-1)); name(tube[2][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
317  if(i>=3 && i<13) { pos_z = 153.75; pos_x = (38.90 - 8.5*(i-3)); name(tube[3][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
318  if(i>=13 && i<15) { pos_z = 146.75; pos_x = (-46.10 - 8.5*(i-13)); name(tube[2][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
319  if(i>=15 && i<16) { pos_z = 45; pos_x = (-64.40 - 8.5*(i-15)); name(tube[1][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
320  if(i>=16 && i<20) { pos_z = (-101.75); pos_x = (-55.90 + 8.5*(i-16)); name(tube[4][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
321  if(i>=20 && i<24) { pos_z = (-90); pos_x = (-10.75 + 8.5*(i-20)); name(tube[5][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
322  if(i>=24) { pos_z = (-101.75); pos_x = (30.40 + 8.5*(i-24)); name(tube[4][0],fl,2,5,i,0); mnk1[5]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
323  }
324 
325  for(int i = 0; i < 26; i++){
326  pos_y = 179.715;
327  if(i>=0 && i<2) { pos_z = 45; pos_x = (66.89 - 8.5*i); name(tube[1][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
328  if(i>=2 && i<13) { pos_z = 153.75; pos_x = (43.61 - 8.5*(i-2)); name(tube[3][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
329  if(i>=13 && i<14){ pos_z = (146.75); pos_x = (-49.89 - 8.5*(i-13)); name(tube[2][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
330  if(i>=14 && i<16) { pos_z = 45; pos_x = (-58.39 - 8.5*(i-14)); name(tube[1][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
331  if(i>=16 && i<19) { pos_z = (-101.75); pos_x = (-49.89 + 8.5*(i-16)); name(tube[4][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
332  if(i>=19 && i<23) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-19)); name(tube[5][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
333  if(i>=23) { pos_z = (-101.75); pos_x = (32.89 + 8.5*(i-23)); name(tube[4][0],fl,2,6,i,0); mnk1[6]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
334  }
335 
336  for(int i = 0; i < 29; i++){
337  pos_y = 185.715;
338  if(i>=0 && i<2) { pos_z = 45; pos_x = (69.38 - 8.5*i); name(tube[1][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
339  if(i>=2 && i<3) { pos_z = 146.75; pos_x = (52.38 - 8.5*(i-2)); name(tube[2][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
340  if(i>=3 && i<=13){ pos_z = 153.75; pos_x = (43.88 - 8.5*(i-3)); name(tube[3][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
341  if(i>=14 && i<15) { pos_z = 146.75; pos_x = (-49.62 - 8.5*(i-14)); name(tube[2][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
342  if(i>=15 && i<17) { pos_z = 45; pos_x = (-60.88 - 8.5*(i-15)); name(tube[1][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
343  if(i>=17 && i<21) { pos_z = (-101.75); pos_x = (-52.38 + 8.5*(i-17)); name(tube[4][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
344  if(i>=21 && i<25) { pos_z = (-90); pos_x = (-10.75 + 8.5*(i-21)); name(tube[5][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
345  if(i>=25) { pos_z = (-101.75); pos_x = (26.88 + 8.5*(i-25)); name(tube[4][0],fl,2,7,i,0); mnk1[7]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
346  }
347 
348  for(int i = 0; i < 29; i++){
349  pos_y = 191.715;
350  if(i>=0 && i<2) { pos_z = 45; pos_x = (71.86 - 8.5*i); name(tube[1][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
351  if(i>=2 && i<14) { pos_z = 153.75; pos_x = (47.14 - 8.5*(i-2)); name(tube[3][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
352  if(i>=14 && i<15) { pos_z = 146.75; pos_x = (-54.86 - 8.5*(i-14)); name(tube[2][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[2][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
353  if(i>=15 && i<17) { pos_z = 45; pos_x = (-63.36 - 8.5*(i-15)); name(tube[1][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
354  if(i>=17 && i<21) { pos_z = (-101.75); pos_x = (-54.86 + 8.5*(i-17)); name(tube[4][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
355  if(i>=21 && i<25) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-21)); name(tube[5][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
356  if(i>=25) { pos_z = (-101.75); pos_x = (29.36 + 8.5*(i-25)); name(tube[4][0],fl,2,8,i,0); mnk1[8]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
357  }
358 
359  for(int i = 0; i < 28; i++){
360  pos_y = 197.715;
361  if(i>=0 && i<3) { pos_z = 45; pos_x = (74.35 - 8.5*i); name(tube[1][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
362  if(i>=3 && i<15) { pos_z = 153.75; pos_x = (48.85 - 8.5*(i-3)); name(tube[3][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
363  if(i>=15 && i<18) { pos_z = 45; pos_x = (-57.35 - 8.5*(i-15)); name(tube[1][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
364  if(i>=18 && i<21) { pos_z = (-101.75); pos_x = (-48.85 + 8.5*(i-18)); name(tube[4][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
365  if(i>=21 && i<25) { pos_z = (-90); pos_x = (-10.75 + 8.5*(i-21)); name(tube[5][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
366  if(i>=25) { pos_z = (-101.75); pos_x = (31.85 + 8.5*(i-25)); name(tube[4][0],fl,2,9,i,0); mnk1[9]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
367  }
368 
369  for(int i = 0; i < 29; i++){
370  pos_y = 203.715;
371  if(i>=0 && i<3) { pos_z = 45; pos_x = (76.83 - 8.5*i); name(tube[1][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
372  if(i>=3 && i<16) { pos_z = 153.75; pos_x = (50.67 - 8.5*(i-3)); name(tube[3][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
373  if(i>=16 && i<19) { pos_z = 45; pos_x = (-59.83 - 8.5*(i-16)); name(tube[1][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
374  if(i>=19 && i<22) { pos_z = (-101.75); pos_x = (-51.33 + 8.5*(i-19)); name(tube[4][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
375  if(i>=22 && i<26) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-22)); name(tube[5][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
376  if(i>=26) { pos_z = (-101.75); pos_x = (34.33 + 8.5*(i-26)); name(tube[4][0],fl,2,10,i,0); mnk1[10]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
377  }
378 
379  for(int i = 0; i < 29; i++){
380  pos_y = 209.715;
381  if(i>=0 && i<3) { pos_z = 45; pos_x = (79.32 - 8.5*i); name(tube[1][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
382  if(i>=3 && i<16) { pos_z = 153.75; pos_x = (53.82 - 8.5*(i-3)); name(tube[3][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
383  if(i>=16 && i<19) { pos_z = 45; pos_x = (-62.32 - 8.5*(i-16)); name(tube[1][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
384  if(i>=19 && i<23) { pos_z = (-101.75); pos_x = (-53.82 + 8.5*(i-19)); name(tube[4][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
385  if(i>=23 && i<27) { pos_z = (-90); pos_x = (-10.75 + 8.5*(i-23)); name(tube[5][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
386  if(i>=27) { pos_z = (-101.75); pos_x = (28.32 + 8.5*(i-27)); name(tube[4][0],fl,2,11,i,0); mnk1[11]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
387  }
388 
389  for(int i = 0; i < 32; i++){
390  pos_y = 215.715;
391  if(i>=0 && i<3) { pos_z = 45; pos_x = (81.80 - 8.5*i); name(tube[1][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
392  if(i>=3 && i<17) { pos_z = 153.75; pos_x = (54.20 - 8.5*(i-3)); name(tube[3][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
393  if(i>=17 && i<20) { pos_z = 45; pos_x = (-64.80 - 8.5*(i-17)); name(tube[1][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
394  if(i>=20 && i<24) { pos_z = (-101.75); pos_x = (-56.30 + 8.5*(i-20)); name(tube[4][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
395  if(i>=24 && i<28) { pos_z = (-90); pos_x = (-14.75 + 8.5*(i-24)); name(tube[5][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
396  if(i>=28) { pos_z = (-101.75); pos_x = (30.80 + 8.5*(i-28)); name(tube[4][0],fl,2,12,i,0); mnk1[12]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
397  }
398 
399  for(int i = 0; i < 32; i++){
400  pos_y = 221.715;
401  if(i>=0 && i<3) { pos_z = 45; pos_x = (84.29 - 8.5*i); name(tube[1][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
402  if(i>=3 && i<17) { pos_z = 153.75; pos_x = (58.79 - 8.5*(i-3)); name(tube[3][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[3][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
403  if(i>=17 && i<20) { pos_z = 45; pos_x = (-67.29 - 8.5*(i-17)); name(tube[1][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
404  if(i>=20 && i<24) { pos_z = (-101.75); pos_x = (-58.79 + 8.5*(i-20)); name(tube[4][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
405  if(i>=24 && i<28) { pos_z = (-90); pos_x = (-10.75 + 8.5*(i-24)); name(tube[5][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[5][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
406  if(i>=28) { pos_z = (-101.75); pos_x = (33.29 + 8.5*(i-28)); name(tube[4][0],fl,2,13,i,0); mnk1[13]->AddNode(tube[4][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
407  }
408 
411 
412  for(int ii = 0; ii < 2; ii++){
413  for(int i = 0; i < 16; i++){
414  pos_y = (149.-2.-MDT_thickness/2-(MDT_thickness + 0.5)*(ii-1));
415  if(ii == 0) {
416  if(i < 14) { pos_x = (53.05 - i*8.5); }
417  if(i >= 14) { pos_x = (53.05 - (i-8)*8.5); }
418  } else {
419  if(i < 14) { pos_x = (-57.95 + i*8.5); }
420  if(i >= 14) { pos_x = (-57.95 + (i-8)*8.5); }
421  }
422 
423  if((i<6 || i>=8) && i<14 ) { pos_z = 45.; name(tube[1][0],fl,2,ii,i,0); mnk1[ii]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
424  if(i>=6 && i<8) { pos_z = 117.55; name(tube[6][0],fl,2,ii,i,0); mnk1[ii]->AddNode(tube[6][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
425  if(i>=14) { pos_z = (-72.6); name(tube[7][0],fl,2,ii,i,0); mnk1[ii]->AddNode(tube[7][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
426  }
427  }
429 
431  TGeoBBox* L_3 = new TGeoBBox("L_3",18.4, 0.08, 7.05);
432  TGeoBBox* al_L_3 = new TGeoBBox("al_L_3",18.4, 0.018, 7.05);
433 
434  int qqq1[12][6]={3,0,2,2,1,2, // L_3:tr0L2+L_2:tr1L2
435  3,0,3,3,1,3, // L_3:tr0L3+L_3:tr1L3
436  3,0,4,3,1,4, // L_3:tr0L4+L_3:tr1L4
437  3,0,5,3,1,5, 3,0,6,3,1,6, 3,0,7,3,1,7,
438  3,0,8,3,1,8, 3,0,9,3,1,9, 3,0,10,3,1,10,
439  3,0,11,3,1,11, 3,0,12,3,1,12, 3,0,13,3,1,13};
440 
441  TGeoTranslation* trs[14][5];
442  float limx1[12][2] = {61.0,-46.3, 55.9,-56.2, 61.9,-59.0, 61.4,-59.7,
443  65.9,-63.5, 66.4,-63.4, 69.4,-68.6, 71.4,-67.2,
444  72.8,-73.8, 76.2,-70.8, 76.2,-78.8, 81.2, -74.};
445 
446  for(int i=0; i<12; i++) {
447  for(int j=0; j<2; j++) {
448  trs[i][j] = new TGeoTranslation(limx1[i][j], 0, 181);
449  trs[i][j]->SetName(Form("trs%dL%d",j,i+2));
450  trs[i][j]->RegisterYourself();
451  }
452  }
453 
454  TGeoBBox *K[14], *al_K[14], *K_h[14], *al_K_h[14];
455  TGeoTranslation* trr[15];
456  trr_h = new TGeoTranslation(0, 0, -52);
457  trr_h->SetName(Form("trr_h"));
458  trr_h->RegisterYourself();
459 
460  float ln[12] = {14.,15,15.5,16,16.8,17.2,18,18.5,19,19.7,20.2,20.9};
461  float ln2[12] = {14.2,13,13.6,14.2,12.8,13.4,13.9,12.6,13.1,13.8,14.2,14.8};
462  char llongb[250];
463  char llongb1[250];
464  float ppos1[12] = {-2.1, 0.2, 0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0};
465  TGeoVolume *G10_2[16], *ST_2[16];
466  TGeoCompositeShape *CG10_2[16], *CST_2[16];
467 
468  for(int i=2; i<14; i++){
469  K[i] = new TGeoBBox(Form("K%d",i), (ln[i-2]*8.5-0.6)/2, 0.075, (390-14)/2);
470  K_h[i] = new TGeoBBox(Form("K_h%d",i), (ln2[i-2]*8.5/2), 0.125, 15.9*8.5/2);
471  al_K[i] = new TGeoBBox(Form("al_K%d",i), (ln[i-2]*8.5-0.6)/2, 0.0175, (390-14)/2);
472  al_K_h[i] = new TGeoBBox(Form("al_K_h%d",i), (ln2[i-2]*8.5/2), 0.04, 15.9*8.5/2);
473 
474  sprintf(llongb,"K%d-K_h%d:trr_h-L_%d:trs%dL%d-L_%d:trs%dL%d",i,i,qqq1[i-2][0],qqq1[i-2][1],qqq1[i-2][2],qqq1[i-2][3],qqq1[i-2][4],qqq1[i-2][5]);
475  sprintf(llongb1,"K%d-K_h%d:trr_h-L_%d:trs%dL%d-L_%d:trs%dL%d",i,i,qqq1[i-2][0],qqq1[i-2][1],qqq1[i-2][2],qqq1[i-2][3],qqq1[i-2][4],qqq1[i-2][5]);
476 
477  CG10_2[i] = new TGeoCompositeShape(llongb);
478  G10_2[i] = new TGeoVolume(Form("GP%d_%d_B",i,2), CG10_2[i], med7);
479  G10_2[i]->SetLineColor(kRed);
480  CST_2[i] = new TGeoCompositeShape(llongb1);
481  ST_2[i] = new TGeoVolume(Form("ST%d_%d_B",i,2), CST_2[i], med7);
482  ST_2[i]->SetLineColor(kBlue);
483  mnk1[i]->AddNode(G10_2[i], 1, new TGeoTranslation(ppos1[i-2], 156.43+6*(i-2), 52));
484  mnk1[i]->AddNode(ST_2[i], 1, new TGeoTranslation(ppos1[i-2], 156.43+6*(i-2)+0.093, 52));
485  }
486 
488  K[0] = new TGeoBBox(Form("K%d",0), 118.4/2, 0.15/2, MDT_barrel_short/2);
489  al_K[0] = new TGeoBBox(Form("al_K%d",0), 118.4/2, 0.035/2, MDT_barrel_short/2);
490  TGeoBBox* K_h0 = new TGeoBBox("K_h0", 8.5,0.125,8.5);
491  TGeoBBox* al_K_h0 = new TGeoBBox("al_K_h0", 8.5,0.04, 8.5);
492  trrr = new TGeoTranslation(0, 0, -45);
493  trrr->SetName("trrr");
494  trrr->RegisterYourself();
495  CG10_2[0] = new TGeoCompositeShape("K0-K_h0:trrr");
496  CST_2[0] = new TGeoCompositeShape("al_K0-K_h0:trrr");
497  CST_2[1] = new TGeoCompositeShape("al_K0-al_K_h0:trrr");
498  G10_2[0] = new TGeoVolume(Form("GP%d_%d_B",0,2), CG10_2[0], med7);
499  ST_2[0] = new TGeoVolume(Form("ST%d_%d_B",0,2), CST_2[0], med7);
500  ST_2[1] = new TGeoVolume(Form("ST%d_%d_B",1,2), CST_2[1], med7);
501  G10_2[0]->SetLineColor(kRed);
502  ST_2[0]->SetLineColor(kBlue);
503  ST_2[1]->SetLineColor(kBlue);
504 
505  mnk1[0]->AddNode(G10_2[0], 1, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2)), 45.));
506  mnk1[0]->AddNode(ST_2[0], 0, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2) -0.0930), 45));
507  mnk1[1]->AddNode(ST_2[1], 1, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2) +0.0930), 45));
508 
509  for(int i = 0; i < 14; i++) {MdtOct2->AddNode(mnk1[i], i);}
511 
512 
514  for(int i = 0; i < 20; i++){
515  pos_y = 155.715;
516  if(i>=0 && i<=1) { pos_z = 45; pos_x = (56.95 - 8.5*i); name(tube[1][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
517  if(i>=2 && i<=3) { pos_z = 45; pos_x = (39.95 - 8.5*(i-2)); name(tube[0][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
518  if(i>=4 && i<=9) { pos_z = 133.75; pos_x = (19.55 - 8.5*(i-4)); name(tube[8][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[8][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
519  if(i>=10 && i<=11) { pos_z = 45; pos_x = (-31.45 - 8.5*(i-10)); name(tube[0][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
520  if(i>=12 && i<=13) { pos_z = 45; pos_x = (-48.45 - 8.5*(i-12)); name(tube[1][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
521  if(i>=14) { pos_z = -89.25; pos_x = (-22.95 + 8.5*(i-14)); name(tube[9][0],fl,6,2,i,0); mnk2[2]->AddNode(tube[9][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
522  }
523 
524  for(int i = 0; i < 20; i++){
525  pos_y = 161.715;
526  if(i>=0 && i<=1) { pos_z = 45; pos_x = (59.438 - 8.5*i); name(tube[1][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
527  if(i>=2 && i<=4) { pos_z = 45; pos_x = (42.438 - 8.5*(i-2)); name(tube[0][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
528  if(i>=5 && i<=9) { pos_z = 133.75; pos_x = (16.938 - 8.5*(i-5)); name(tube[8][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[8][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
529  if(i>=10 && i<=12) { pos_z = 45; pos_x = (-25.438 - 8.5*(i-10)); name(tube[0][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
530  if(i>=13 && i<=14) { pos_z = 45; pos_x = (-50.938 - 8.5*(i-13)); name(tube[1][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
531  if(i>=15) { pos_z = -89.25; pos_x = (-17.062 + 8.5*(i-15)); name(tube[9][0],fl,6,3,i,0); mnk2[3]->AddNode(tube[9][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
532  }
533 
534  for(int i = 0; i < 20; i++){
535  pos_y = 167.715;
536  if(i>=0 && i<=1) { pos_z = 45; pos_x = (61.92 - 8.5*i); name(tube[1][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
537  if(i>=2 && i<=4) { pos_z = 45; pos_x = (44.92 - 8.5*(i-2)); name(tube[0][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
538  if(i>=5 && i<=9) { pos_z = 133.75; pos_x = (14.858 - 8.5*(i-5)); name(tube[8][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[8][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
539  if(i>=10 && i<=12) { pos_z = 45; pos_x = (-27.92 - 8.5*(i-10)); name(tube[0][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
540  if(i>=13 && i<=14) { pos_z = 45; pos_x = (-53.42 - 8.5*(i-13)); name(tube[1][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
541  if(i>=15) { pos_z = -89.25; pos_x = (-19.42 + 8.5*(i-15)); name(tube[9][0],fl,6,4,i,0); mnk2[4]->AddNode(tube[9][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
542  }
543 
544  for(int i = 0; i < 22; i++){
545  pos_y = 173.715;
546  if(i>=0 && i<=1) { pos_z = 45; pos_x = (64.40 - 8.5*i); name(tube[1][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
547  if(i>=2 && i<=4) { pos_z = 45; pos_x = (47.40 - 8.5*(i-2)); name(tube[0][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
548  if(i>=5 && i<=10) { pos_z = 133.75; pos_x = (21.90 - 8.5*(i-5)); name(tube[8][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[8][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
549  if(i>=11 && i<=13) { pos_z = 45; pos_x = (-30.40 - 8.5*(i-11)); name(tube[0][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
550  if(i>=14 && i<=15) { pos_z = 45; pos_x = (-55.90 - 8.5*(i-14)); name(tube[1][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
551  if(i>=16) { pos_z = -89.25; pos_x = (-20.60 + 8.5*(i-16)); name(tube[9][0],fl,6,5,i,0); mnk2[5]->AddNode(tube[9][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
552  }
553 
554  for(int i = 0; i < 28; i++){
555  pos_y = 179.715;
556  if(i>=0 && i<=1) { pos_z = 45; pos_x = (66.89 - 8.5*i); name(tube[1][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
557  if(i>=2 && i<3) { pos_z = 143.25; pos_x = (49.89 - 8.5*(i-2)); name(tube[10][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[10][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
558  if(i>=3 && i<=13) { pos_z = 150.25; pos_x = (41.39 - 8.5*(i-3)); name(tube[11][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
559  if(i>=14 && i<=15) { pos_z = 45; pos_x = (-58.39 - 8.5*(i-14)); name(tube[1][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
560  if(i>=16 && i<=26) { pos_z = -105.2; pos_x = (-43.61 + 8.5*(i-16)); name(tube[12][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
561  if(i>=27) { pos_z = -98.2; pos_x = (49.89 + 8.5*(i-27)); name(tube[13][0],fl,6,6,i,0); mnk2[6]->AddNode(tube[13][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
562  }
563 
564  for(int i = 0; i < 30; i++){
565  pos_y = 185.715;
566  if(i>=0 && i<=1) { pos_z = 45; pos_x = (69.38 - 8.5*i); name(tube[1][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
567  if(i>=2 && i<3) { pos_z = 143.25; pos_x = (52.38 - 8.5*(i-2)); name(tube[10][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[10][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
568  if(i>=3 && i<=13) { pos_z = 150.25; pos_x = (43.88 - 8.5*(i-3)); name(tube[11][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
569  if(i>=14 && i<15) { pos_z = 143.25; pos_x = (-49.62 - 8.5*(i-14)); name(tube[10][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[10][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
570  if(i>=15 && i<=16){ pos_z = 45.; pos_x = (-60.88 - 8.5*(i-15)); name(tube[1][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
571  if(i>=17 && i<18) { pos_z = -98.2; pos_x = (-49.62 + 8.5*(i-17)); name(tube[13][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[13][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
572  if(i>=18 && i<=28) { pos_z = -105.2; pos_x = (-41.12 + 8.5*(i-18)); name(tube[12][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
573  if(i>=29) { pos_z = -98.2; pos_x = (52.38 + 8.5*(i-29)); name(tube[13][0],fl,6,7,i,0); mnk2[7]->AddNode(tube[13][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
574  }
575 
576  for(int i = 0; i < 28; i++){
577  pos_y = 191.715;
578  if(i>=0 && i<=2) { pos_z = 45; pos_x = (71.18 - 8.5*i); name(tube[1][0],fl,6,8,i,0); mnk2[8]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
579  if(i>=3 && i<=13) { pos_z = 150.25; pos_x = (38.64 - 8.5*(i-3)); name(tube[11][0],fl,6,8,i,0); mnk2[8]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
580  if(i>=14 && i<=16) { pos_z = 45.; pos_x = (-54.86 - 8.5*(i-14)); name(tube[1][0],fl,6,8,i,0); mnk2[8]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
581  if(i>=17) { pos_z = -105.2; pos_x = (-46.36 + 8.5*(i-17)); name(tube[12][0],fl,6,8,i,0); mnk2[8]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
582  }
583 
584  for(int i = 0; i < 30; i++){
585  pos_y = 197.715;
586  if(i>=0 && i<=2) { pos_z = 45; pos_x = (74.35 - 8.5*i); name(tube[1][0],fl,6,9,i,0); mnk2[9]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
587  if(i>=3 && i<=14) { pos_z = 150.25; pos_x = (48.85 - 8.5*(i-3)); name(tube[11][0],fl,6,9,i,0); mnk2[9]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
588  if(i>=15 && i<=17) { pos_z = 45.; pos_x = (-57.35 - 8.5*(i-15)); name(tube[1][0],fl,6,9,i,0); mnk2[9]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
589  if(i>=18) { pos_z = -105.2; pos_x = (-44.65 + 8.5*(i-18)); name(tube[12][0],fl,6,9,i,0); mnk2[9]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
590  }
591 
592  for(int i = 0; i < 32; i++){
593  pos_y = 203.715;
594  if(i>=0 && i<=2) { pos_z = 45; pos_x = (76.83 - 8.5*i); name(tube[1][0],fl,6,10,i,0); mnk2[10]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
595  if(i>=3 && i<=15) { pos_z = 150.25; pos_x = (50.67 - 8.5*(i-3)); name(tube[11][0],fl,6,10,i,0); mnk2[10]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
596  if(i>=16 && i<=18) { pos_z = 45.; pos_x = (-59.83 - 8.5*(i-16)); name(tube[1][0],fl,6,10,i,0); mnk2[10]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
597  if(i>=19) { pos_z = -105.2; pos_x = (-51.33 + 8.5*(i-19)); name(tube[12][0],fl,6,10,i,0); mnk2[10]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
598  }
599 
600  for(int i = 0; i < 32; i++){
601  pos_y = 209.715;
602  if(i>=0 && i<=2) { pos_z = 45; pos_x = (79.32 - 8.5*i); name(tube[1][0],fl,6,11,i,0); mnk2[11]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
603  if(i>=3 && i<=15) { pos_z = 150.25; pos_x = (53.82 - 8.5*(i-3)); name(tube[11][0],fl,6,11,i,0); mnk2[11]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
604  if(i>=16 && i<=18) { pos_z = 45.; pos_x = (-62.32 - 8.5*(i-16)); name(tube[1][0],fl,6,11,i,0); mnk2[11]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
605  if(i>=19) { pos_z = -105.2; pos_x = (-48.18 + 8.5*(i-19)); name(tube[12][0],fl,6,11,i,0); mnk2[11]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
606  }
607 
608  for(int i = 0; i < 34; i++){
609  pos_y = 215.715;
610  if(i>=0 && i<=2) { pos_z = 45; pos_x = (81.80 - 8.5*i); name(tube[1][0],fl,6,12,i,0); mnk2[12]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
611  if(i>=3 && i<=16) { pos_z = 150.25; pos_x = (54.20 - 8.5*(i-3)); name(tube[11][0],fl,6,12,i,0); mnk2[12]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
612  if(i>=17 && i<=19) { pos_z = 45.; pos_x = (-64.80 - 8.5*(i-17)); name(tube[1][0],fl,6,12,i,0); mnk2[12]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
613  if(i>=20) { pos_z = -105.2; pos_x = (-56.30 + 8.5*(i-20)); name(tube[12][0],fl,6,12,i,0); mnk2[12]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
614  }
615 
616 // for(int i = 0; i < 34; i++){
617  for(int i = 0; i < 32; i++){
618  pos_y = 221.715;
619  if(i>=0 && i<=2) { pos_z = 45; pos_x = (84.29 - 8.5*i); name(tube[1][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
620  if(i>=3 && i<4) { pos_z = 45; pos_x = (58.79 - 8.5*(i-3)); name(tube[0][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
621  if(i>=4 && i<=15) { pos_z = 150.25; pos_x = (50.29 - 8.5*(i-4)); name(tube[11][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[11][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
622  if(i>=16 && i<17) { pos_z = 45.; pos_x = (-58.79 - 8.5*(i-16)); name(tube[0][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[0][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
623  if(i>=17 && i<=19) { pos_z = 45.; pos_x = (-67.29 - 8.5*(i-17)); name(tube[1][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
624  if(i>=20) { pos_z = -105.2; pos_x = (-50.29 + 8.5*(i-20)); name(tube[12][0],fl,6,13,i,0); mnk2[13]->AddNode(tube[12][0], i, new TGeoTranslation(pos_x,pos_y,pos_z));}
625  }
626 
628  float lln[12] = {14.4,15,15.5,16,16.8,17.2,18,18.5,19,19.7,20.2,20.9};
629  float lln2[12] = {6.5,5.1,5.7,6.2,12.9,13.4,11.8,12.6,13.1,13.8,14.3,12.7};
630  float ppos1[12] = {-0.2, 0.2, 0.2, 0, 0, 0, 0, 0, 0, 0, 0, 0};
631 
632  TGeoTranslation* trr[15];
633  ttrr_h = new TGeoTranslation(0, 0, -46);
634  ttrr_h->SetName(Form("ttrr_h"));
635  ttrr_h->RegisterYourself();
636 
637  TGeoBBox *KK[14], *al_KK[14], *KK_h[14], *al_KK_h[14];
638  TGeoTranslation* trss[14][5];
639  float limx2[12][4] = {62.8,-62,62.8,-62,
640  64.2,-64.4,64.2,-64.4,
641  66.9,-67,66.9,-67,
642  69.4,-69.4,69.4,-69.4,
643  64.5,-66.4,64.5,-66.4,
644  65.5,-64,65.5,-64,
645  61.5,-68.4,61.5,-68.4,
646  70.7,-67.1,70.7,-67.1,
647  72.7,-73.6,72.7,-73.6,
648  75.8,-70.8,75.8,-70.8,
649  76.2,-78.5,76.2,-78.5,
650  82.2,-80.9,82.2,-80.9};
651 
652  float limz2[1][4] = {188, 188, -188, -188};
653  for(int i=0; i<12; i++) {
654  for(int j=0; j<4; j++) {
655  trss[i][j] = new TGeoTranslation(limx2[i][j], 0, limz2[0][j]);
656  trss[i][j]->SetName(Form("trss%dL%d",j,i+2));
657  trss[i][j]->RegisterYourself();
658  }
659  }
660 
661  TGeoVolume *G10_6[16], *ST_6[16];
662  TGeoCompositeShape *CG10_6[16], *CST_6[16];
663 
664  float sll = 0;
665  for(int i=2; i<14; i++){
666  KK[i] = new TGeoBBox(Form("KK%d",i), (lln[i-2]*8.5-0.6)/2, 0.075, 390/2);
667  al_KK[i] = new TGeoBBox(Form("al_KK%d",i), (lln[i-2]*8.5-0.6)/2, 0.0175, 390/2);
668  if(i>1 && i<6) { sll=6.6*8.5/2; }
669  else { sll = 14.2*8.5/2; }
670  KK_h[i] = new TGeoBBox(Form("KK_h%d",i), (lln2[i-2]*8.5/2), 0.125, sll);
671  al_KK_h[i] = new TGeoBBox(Form("al_KK_h%d",i), (lln2[i-2]*8.5/2), 0.04, sll);
672 
673  sprintf(llongb,"KK%d-KK_h%d:ttrr_h-L_3:trss0L%d-L_3:trss1L%d-L_3:trss2L%d-L_3:trss3L%d", i,i,i,i,i,i);
674  sprintf(llongb1,"al_KK%d-al_KK_h%d:ttrr_h-L_3:trss0L%d-L_3:trss1L%d-L_3:trss2L%d-L_3:trss3L%d", i,i,i,i,i,i);
675 
676  CG10_6[i] = new TGeoCompositeShape(llongb);
677  G10_6[i] = new TGeoVolume(Form("GP%d_%d_B",i,6), CG10_6[i], med7);
678  G10_6[i]->SetLineColor(kRed);
679  CST_6[i] = new TGeoCompositeShape(llongb1);
680  ST_6[i] = new TGeoVolume(Form("ST%d_%d_B",i,6), CST_6[i], med7);
681  ST_6[i]->SetLineColor(kBlue);
682  mnk2[i]->AddNode(G10_6[i], i, new TGeoTranslation(ppos1[i-2], 156.43+6*(i-2), 45));
683  mnk2[i]->AddNode(ST_6[i], i, new TGeoTranslation(ppos1[i-2], 156.43+6*(i-2)+0.093, 45));
684  }
685 
687 
690  for(int ii = 0; ii < 2; ii++){
691  for(int i = 0; i < 16; i++){
692  pos_y = (149.-2.-MDT_thickness/2-(MDT_thickness + 0.5)*(ii-1));
693  if(ii == 0) {
694  if(i < 14) { pos_x = (53.05 - i*8.5); }
695  if(i >= 14) { pos_x = (53.05 - (i-8)*8.5); }
696  } else {
697  if(i < 14) { pos_x = (-61.7 + 8.5/2 +i*8.5 - 0.5); }
698  if(i >= 14) { pos_x = (-61.7 + 8.5/2 +(i-8)*8.5 - 0.5); }
699  }
700 
701  if((i<6 || i>=8) && i<14 ) { pos_z = 45.; name(tube[1][0],fl,6,ii,i,0); mnk2[ii]->AddNode(tube[1][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
702  if(i>=6 && i<8) { pos_z = 117.55; name(tube[6][0],fl,6,ii,i,0); mnk2[ii]->AddNode(tube[6][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
703  if(i>=14) { pos_z = (-72.6); name(tube[7][0],fl,6,ii,i,0); mnk2[ii]->AddNode(tube[7][0], i, new TGeoTranslation(pos_x,pos_y,pos_z)); }
704  }
705  }
706 
707 
709  K[0] = new TGeoBBox(Form("K%d",0), 118.4/2, 0.15/2, MDT_barrel_short/2);
710  al_K[0] = new TGeoBBox(Form("al_K%d",0), 118.4/2, 0.035/2, MDT_barrel_short/2);
711  TGeoBBox* K_h0 = new TGeoBBox("K_h0", 8.5,0.125,8.5);
712  TGeoBBox* al_K_h0 = new TGeoBBox("al_K_h0", 8.5,0.04, 8.5);
713  trrr = new TGeoTranslation(0, 0, -45);
714  trrr->SetName("trrr");
715  trrr->RegisterYourself();
716  CG10_6[0] = new TGeoCompositeShape("K0-K_h0:trrr");
717  CST_6[0] = new TGeoCompositeShape("al_K0-K_h0:trrr");
718  CST_6[1] = new TGeoCompositeShape("al_K0-al_K_h0:trrr");
719  G10_6[0] = new TGeoVolume(Form("GP%d_%d_B",0,6), CG10_6[0], med7);
720  ST_6[0] = new TGeoVolume(Form("ST%d_%d_B",0,6), CST_6[0], med7);
721  ST_6[1] = new TGeoVolume(Form("ST%d_%d_B",1,6), CST_6[1], med7);
722  G10_6[0]->SetLineColor(kRed);
723  ST_6[0]->SetLineColor(kBlue);
724  ST_6[1]->SetLineColor(kBlue);
725 
726  mnk2[0]->AddNode(G10_2[0], 1, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2)), 45.));
727  mnk2[0]->AddNode(ST_2[0], 0, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2) -0.0930), 45));
728  mnk2[1]->AddNode(ST_2[1], 1, new TGeoTranslation(-2.5, (149. - 2. - MDT_thickness + (MDT_thickness+0.5/2) +0.0930), 45));
730 
731 
732  for(int i = 0; i < 14; i++) MdtOct6->AddNode(mnk2[i], i);
733 
735 
741 
742 /*
743  float tube_len_en_l0[44] = {109,126,143,160,177,194,211,228,245,262,102,102,102,102,102,102,102,102,102,102,102,102,
744  262,245,228,211,194,177,160,143,126,109,102,102,102,102,102,102,102,102,102,102,102,102};
745 
746  float tube_len_en_l2[68] = {171.8,232,223.5,215,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,
747  171.8,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,
748  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
749  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5};
750 
751  float tube_len_en_l3[68] = {171.8,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,
752  171.8,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,
753  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
754  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5};
755 
756  float tube_len_en_l4[68] = {171.8,212,203.5,195,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
757  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
758  171.8,212,203.5,195,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
759  171.8,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5};
760 
761  float tube_len_en_l5[68] = {142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
762  142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,
763  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,
764  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5};
765 
766  float tube_len_en_l6[72] = {142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,73,
767  142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,73,
768  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,93,
769  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,93};
770 */
771 
772  float tube_len_en_l0[36] = {121.5,154.6,171.6,188.6,205.6,222.6,74.1,74.1,74.1,74.1,74.1,74.1,74.1,74.1,74.1,74.1,74.1,74.1,
773  222.6,205.6,188.6,171.6,154.6,121.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5,89.5};
774 
775  float tube_len_en_l2[68] = {164.8,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,137,128.5,120,111.5,103,94.5,
776  164.8,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,137,128.5,120,111.5,103,94.5,
777  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
778  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5};
779 
780  float tube_len_en_l3[68] = {164.8,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,137,128.5,120,111.5,103,94.5,
781  164.8,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,137,128.5,120,111.5,103,94.5,
782  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
783  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5};
784 
785  float tube_len_en_l4[68] = {164.8,205,196.5,188,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
786  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
787  164.8,205,196.5,188,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
788  164.8,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5};
789 
790  float tube_len_en_l5[68] = {135,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
791  135,205,196.5,185,176.5,168,159.5,151,142.5,134,125.5,117,108.5,100,91.5,83,74.5,
792  135,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,134,128.5,120,111.5,103,94.5,
793  135,225,216.5,205,196.5,188,179.5,171,162.5,154,145.5,134,128.5,120,111.5,103,94.5};
794 
795  float tube_len_en_l6[72] = {142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,73,
796  142,212,203.5,192,183.5,175,166.5,158,149.5,141,132.5,124,115.5,107,98.5,90,81.5,73,
797  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,93,
798  142,232,223.5,212,203.5,195,186.5,178,169.5,161,152.5,144,135.5,127,118.5,110,101.5,93};
799 
800  for(int i=0; i<36; i++) {
801  tube_en_l0[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l0[i]/2);
802  tube_en_l0[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l0[i]/2);
803  for(int j = 0; j < 8; j++){
804  float slotpos_x = (-3.5 + 1.*j);
805  tube_en_l0[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l0[i]/2);
806  tube_en_l0[i][1]->AddNode(tube_en_l0[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
807  tube_en_l0[i][1]->SetLineColor(kBlue);
808  tube_en_l0[i][2]->SetLineColor(kBlue);
809  }
810  tube_en_l0[i][0]->AddNode(tube_en_l0[i][1],1);
811  tube_en_l0[i][0]->SetLineColor(kBlue);
812  }
813 
814  for(int i=0; i<68; i++) {
815  tube_en_l2[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l2[i]/2);
816  tube_en_l2[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l2[i]/2);
817  tube_en_l3[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l3[i]/2);
818  tube_en_l3[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l3[i]/2);
819  tube_en_l4[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l4[i]/2);
820  tube_en_l4[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l4[i]/2);
821  tube_en_l5[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l5[i]/2);
822  tube_en_l5[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l5[i]/2);
823  for(int j = 0; j < 8; j++){
824  float slotpos_x = (-3.5 + 1.*j);
825  tube_en_l2[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l2[i]/2);
826  tube_en_l2[i][1]->AddNode(tube_en_l2[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
827  tube_en_l3[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l3[i]/2);
828  tube_en_l3[i][1]->AddNode(tube_en_l3[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
829  tube_en_l4[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l4[i]/2);
830  tube_en_l4[i][1]->AddNode(tube_en_l4[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
831  tube_en_l5[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l5[i]/2);
832  tube_en_l5[i][1]->AddNode(tube_en_l5[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
833 
834  tube_en_l2[i][1]->SetLineColor(kBlue);
835  tube_en_l2[i][2]->SetLineColor(kBlue);
836  tube_en_l3[i][1]->SetLineColor(kBlue);
837  tube_en_l3[i][2]->SetLineColor(kBlue);
838  tube_en_l4[i][1]->SetLineColor(kBlue);
839  tube_en_l4[i][2]->SetLineColor(kBlue);
840  tube_en_l5[i][1]->SetLineColor(kBlue);
841  tube_en_l5[i][2]->SetLineColor(kBlue);
842  }
843  tube_en_l2[i][0]->AddNode(tube_en_l2[i][1],1);
844  tube_en_l3[i][0]->AddNode(tube_en_l3[i][1],1);
845  tube_en_l4[i][0]->AddNode(tube_en_l4[i][1],1);
846  tube_en_l5[i][0]->AddNode(tube_en_l5[i][1],1);
847 
848  tube_en_l2[i][0]->SetLineColor(kBlue);
849  tube_en_l3[i][0]->SetLineColor(kBlue);
850  tube_en_l4[i][0]->SetLineColor(kBlue);
851  tube_en_l5[i][0]->SetLineColor(kBlue);
852  }
853 
854  for(int i=0; i<72; i++) {
855  tube_en_l6[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_en_l6[i]/2);
856  tube_en_l6[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_en_l6[i]/2);
857  for(int j = 0; j < 8; j++){
858  float slotpos_x = (-3.5 + 1.*j);
859  tube_en_l6[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",2,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_en_l6[i]/2);
860  tube_en_l6[i][1]->AddNode(tube_en_l6[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
861  }
862  tube_en_l6[i][0]->AddNode(tube_en_l6[i][1],1);
863  }
864 
865  TGeoRotation *rrr0 = new TGeoRotation();
866 // rrr0->RotateZ(90);
867 // rrr0->RotateY(-90);
868  rrr0->RotateZ(90);
869  rrr0->RotateY(90);
870  rrr0->RegisterYourself();
871 
872  TGeoRotation *rrr1 = new TGeoRotation();
873  rrr1->RotateX(90);
874  rrr1->RegisterYourself();
875 
876  TGeoRotation *rrr2 = new TGeoRotation();
877  rrr2->RotateX(90);
878  rrr2->RotateY(180);
879  rrr2->RegisterYourself();
880 
882  pos_z = 255.215;
883  for(int l = 0; l < 2; l++) {
884  for(int i = 0; i < 53; i++) {
885 
886  if(i<=12) { pos_y=(-10.75-i*8.5);}
887  if(i>=13 && i<26) { pos_y=(-13.75-i*8.5.);}
888  if(i>=26 && i<39) { pos_y=(0.75+(i-26)*8.5);}
889  if(i>=39) { pos_y=(3.75+(i-26)*8.5);}
890 
891  if(i<3) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l2[l*34][0],2,l,2,25-i,0);
892  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0));}
893  if(i>=3 && i<11) { pos_x=(-1)**l*(10*l+116.5-1.5-3.5); name(tube_en_l2[1+l*34][0],2,l,2,25-i,0);
894  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[1+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
895  if(i==11) { pos_x=(-1)**l*(10*l+112.25-(i-11)*8.5/2-1.5-3.5); name(tube_en_l2[i-9+l*34][0],2,l,2,25-i,0);
896  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[i-9+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
897  if(i>=12 && i<26) { pos_x=(-1)**l*(10*l+110.75-(i-11)*8.5/2-1.5-3.5); name(tube_en_l2[i-9+l*34][0],2,l,2,25-i,0);
898  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[i-9+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
899  if(i>=26 && i<30) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l2[17+l*34][0],2,l,2,i,0);
900  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[17+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
901  if(i>=30 && i<=37) { pos_x=(-1)**l*(10*l+116.5-1.5-3.5); name(tube_en_l2[18+l*34][0],2,l,2,i,0);
902  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[18+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
903  if(i==38) { pos_x=(-1)**l*(10*l+112.25-(i-38)*8.5/2-1.5-3.5); name(tube_en_l2[19+l*34][0],2,l,2,i,0);
904  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[19+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
905  if(i>38) { pos_x=(-1)**l*(10*l+110.75-(i-38)*8.5/2-1.5-3.5); name(tube_en_l2[i-19+l*34][0],2,l,2,i,0);
906  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[2]->AddNode(tube_en_l2[i-19+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
907 
908  }
909  }
910 
914  pos_z = 255.215+9;
915  for(int l = 0; l < 2; l++) {
916  for(int i = 0; i < 53; i++) {
917 
918  if(i<=12) { pos_y=(2.25-i*8.5);}
919  if(i>=13 && i<27) { pos_y=(-0.75-i*8.5.);}
920  if(i>=27 && i<40) { pos_y=(13.75+(i-27)*8.5);}
921  if(i>=40) { pos_y=(16.75+(i-27)*8.5);}
922 
923  if(i<4) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l3[l*34][0],2,l,3,26-i,0);
924  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
925  if(i>=4 && i<12) { pos_x=(-1)**l*(10*l+116.5-1.5-3.5); name(tube_en_l3[1+l*34][0],2,l,3,26-i,0);
926  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[1+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
927  if(i==12 || i ==13){ pos_x=(-1)**l*(10*l+112.25-(i-12)*8.5/2-1.5-3.5); name(tube_en_l3[(i-10)+l*34][0],2,l,3,26-i,0);
928  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[(i-10)+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
929  if(i>=14 && i<27) { pos_x=(-1)**l*(10*l+110.75-(i-12)*8.5/2-1.5-3.5); name(tube_en_l3[(i-10)+l*34][0],2,l,3,26-i,0);
930  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[(i-10)+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
931  if(i>=27 && i<30) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l3[17+l*34][0],2,l,3,i,0);
932  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[17+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
933  if(i>=30 && i<38) { pos_x=(-1)**l*(10*l+116.5-1.5-3.5); name(tube_en_l3[18+l*34][0],2,l,3,i,0);
934  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[18+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
935  if(i==38) { pos_x=(-1)**l*(10*l+112.25-(i-38)*8.5/2-1.5-3.5); name(tube_en_l3[(i-19)+l*34][0],2,l,3,i,0);
936  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[(i-19)+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
937  if(i>=39 ) { pos_x=(-1)**l*(10*l+110.75-(i-38)*8.5/2-1.5-3.5); name(tube_en_l3[(i-19)+l*34][0],2,l,3,i,0);
938  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[3]->AddNode(tube_en_l3[(i-19)+l*34][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
939 
940  }
941  }
942 
944  pos_z = 255.215+18;
945  for(int l = 0; l < 2; l++) {
946  for(int i = 0; i < 53; i++) {
947 
948  if(i<=12) { pos_y=(-10.75-i*8.5);}
949  if(i>=13 && i<26) { pos_y=(-13.75-i*8.5.);}
950  if(i>=26 && i<39) { pos_y=(0.75+(i-26)*8.5);}
951  if(i>= 39) { pos_y=(3.75+(i-26)*8.5);}
952 
953  if(i<3) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l4[34*l][0],2,l,4,25-i,0);
954  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0));}
955  if(i>=3 && i<11) { pos_x=(-1)**l*(126.5-1.5-3.5); name(tube_en_l4[1+34*l][0],2,l,4,25-i,0);
956  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[1+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0));}
957  if(i==11 || i==12) { pos_x=(-1)**l*(122.25-(i-11)*8.5/2-1.5-3.5); name(tube_en_l4[(i-9)+34*l][0],2,l,4,25-i,0);
958  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[(i-9)+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0));}
959  if(i>=13 && i<26) { pos_x=(-1)**l*(120.75-(i-11)*8.5/2-1.5-3.5); name(tube_en_l4[(i-9)+34*l][0],2,l,4,25-i,0);
960  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[(i-9)+l*34][0],25-i,new TGeoCombiTrans(*tr0, *rrr0));}
961  if(i>=26 && i<30) { pos_x=(-1)**l*(146.6-1.5-3.5); name(tube_en_l4[17+34*l][0],2,l,4,i,0);
962  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[17+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
963  if(i>=30 && i<38) { pos_x=(-1)**l*(126.5-1.5-3.5); name(tube_en_l4[18+34*l][0],2,l,4,i,0);
964  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[18+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
965  if(i==38) { pos_x=(-1)**l*(122.25-(i-38)*8.5/2-1.5-3.5); name(tube_en_l4[19+34*l][0],2,l,4,i,0);
966  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[19+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
967  if(i>38) { pos_x=(-1)**l*(120.75-(i-38)*8.5/2-1.5-3.5); name(tube_en_l4[(i-19)+34*l][0],2,l,4,i,0);
968  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[4]->AddNode(tube_en_l4[(i-19)+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
969 
970  }
971  }
972 
975  pos_z = (255.215+27);
976  for(int l = 0; l < 2; l++) {
977  for(int i = 0; i < 53; i++) {
978 
979  if(i<=12) { pos_y=(2.25-i*8.5);}
980  if(i>=13 && i<27) { pos_y=(-0.75-i*8.5.);}
981  if(i>=27 && i<40) { pos_y=(13.75+(i-27)*8.5);}
982  if(i>=40) { pos_y=(16.75+(i-27)*8.5);}
983 
984  if(i<8) { pos_x=(-1)**l*(161.5-1.5-3.5); name(tube_en_l5[l*34][0],2,l,5,26-i,0);
985  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0));}
986  if(i>=8 && i<12) { pos_x=(-1)**l*(-10*l+126.5-1.5-3.5); name(tube_en_l5[1+l*34][0],2,l,5,26-i,0);
987  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[1+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0));}
988  if(i==12) { pos_x=(-1)**l*(-10*l+122.25-(i-12)*8.5/2-1.5-3.5); name(tube_en_l5[2+l*34][0],2,l,5,26-i,0);
989  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[2+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0));}
990  if(i>=13 && i<27) { pos_x=(-1)**l*(-10*l+120.75-(i-12)*8.5/2-1.5-3.5); name(tube_en_l5[(i-10)+l*34][0],2,l,5,26-i,0);
991  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[(i-10)+l*34][0],26-i,new TGeoCombiTrans(*tr0, *rrr0));}
992  if(i>=27 && i<34) { pos_x=(-1)**l*(161.5-1.5-3.5); name(tube_en_l5[17+l*34][0],2,l,5,i,0);
993  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[17+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
994  if(i>=34 && i<38) { pos_x=(-1)**l*(-10*l+126.5-1.5-3.5); name(tube_en_l5[18+l*34][0],2,l,5,i,0);
995  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[18+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
996  if(i==38) { pos_x=(-1)**l*(-10*l+122.25-(i-38)*8.5/2-1.5-3.5); name(tube_en_l5[(i-19)+l*34][0],2,l,5,i,0);
997  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[(i-19)+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
998  if(i>=39) { pos_x=(-1)**l*(-10*l+120.75-(i-38)*8.5/2-1.5-3.5); name(tube_en_l5[(i-19)+l*34][0],2,l,5,i,0);
999  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[5]->AddNode(tube_en_l5[(i-19)+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
1000 
1001  }
1002  }
1003 
1006  pos_z = (255.215+36);
1007  for(int l = 0; l < 2; l++) {
1008  for(int i = 0; i < 53; i++) {
1009 
1010  if(i<=12) { pos_y=(-10.75-i*8.5); }
1011  if(i>=13 && i<26) { pos_y=(-13.75-i*8.5.); }
1012  if(i>=26 && i<39) { pos_y=(0.75+(i-26)*8.5); }
1013  if(i>=39) { pos_y=(3.75+(i-26)*8.5); }
1014 
1015  if(i<8) { pos_x=(-1)**l*(161.5-1.5-3.5); name(tube_en_l5[l*34][0],2,l,6,25-i,0);
1016  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[l*34][0], 25-i,new TGeoCombiTrans(*tr0, *rrr0));}
1017  if(i>=8 && i<12) { pos_x=(-1)**l*(-10*l+126.5-1.5-3.5); name(tube_en_l5[1+l*34][0],2,l,6,25-i,0);
1018  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[1+l*34][0], 25-i,new TGeoCombiTrans(*tr0, *rrr0));}
1019  if(i==12) { pos_x=(-1)**l*(-10*l+122.25-(i-12)*8.5/2-1.5-3.5); name(tube_en_l5[2+l*34][0],2,l,6,25-i,0);
1020  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[2+l*34][0], 25-i,new TGeoCombiTrans(*tr0, *rrr0));}
1021  if(i>=13 && i<26) { pos_x=(-1)**l*(-10*l+120.75-(i-12)*8.5/2-1.5-3.5); name(tube_en_l5[(i-10)+l*34][0],2,l,6,25-i,0);
1022  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[(i-10)+l*34][0], 25-i,new TGeoCombiTrans(*tr0, *rrr0));}
1023 
1024  if(i>=26 && i<34) { pos_x=(-1)**l*(161.5-1.5-3.5); name(tube_en_l5[17+l*34][0],2,l,6,i,0);
1025  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[17+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
1026  if(i>=34 && i<=37) { pos_x=(-1)**l*(-10*l+126.5-1.5-3.5); name(tube_en_l5[18+l*34][0],2,l,6,i,0);
1027  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[18+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
1028  if(i==38) { pos_x=(-1)**l*(-10*l+122.25-(i-38)*8.5/2-1.5-3.5); name(tube_en_l5[(i-19)+l*34][0],2,l,6,i,0);
1029  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[(i-19)+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
1030  if(i>=39) { pos_x=(-1)**l*(-10*l+120.75-(i-38)*8.5/2-1.5-3.5); name(tube_en_l5[(i-19)+l*34][0],2,l,6,i,0);
1031  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk3[6]->AddNode(tube_en_l5[(i-19)+l*34][0], i,new TGeoCombiTrans(*tr0, *rrr0));}
1032 
1033  }
1034  }
1035 
1037 
1038  for(int l = 0; l < 2; l++) {
1039  for(int i = 0; i < 36; i++) {
1040  pos_z =243.5+MDT_thickness/2+3*l;
1041  if(i<1) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l); pos_y=(-5+10); name(tube_en_l0[i][0],2,0,l,i,0);}
1042  if(i>=1 && i<6) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l+8.5*i); pos_y=(-17.8/2+10/2); name(tube_en_l0[i][0],2,0,l,i,0);}
1043  if(i>=6 && i<18) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l+8.5*i); pos_y=(26+6+74.1/2); name(tube_en_l0[i][0],2,0,l,i,0);}
1044  if(i>=18 && i<23) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l+8.5*i); pos_y=(-17.8/2+10/2); name(tube_en_l0[i][0],2,0,l,i,0);}
1045  if(i==23) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l+8.5*i); pos_y=(-5+10); name(tube_en_l0[i][0],2,0,l,i,0);}
1046  if(i>23 && i<36) { pos_x=(-12*8.5 + 8.5/2 -0.25*(-1)**l+8.5*(i-18)); pos_y=(-26-6-(111.5-22)/2); name(tube_en_l0[i][0],2,0,l,i,0);}
1047 
1048  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z);
1049  if(l==0) mnk3[0]->AddNode(tube_en_l0[i][0], i, new TGeoCombiTrans(*tr0, *rrr2));
1050  if(l==1) mnk3[1]->AddNode(tube_en_l0[i][0], i, new TGeoCombiTrans(*tr0, *rrr1));
1051  }
1052  }
1054 
1056  float ttr[22][3] = {0,0,0, -9.8,0,0, 0,-5,0, 0,-118.5,0, 0,108.4,0, 0,5.4,0, 0,-108.1,0, 0,118.8,0, 0,3.7,0, 0,-109.8,0, 0,117.1,0, 10.1,0,0,
1057  0,-2,0, 0,4,0, 0,8,0, 0,122,0, 0,-106,0, 10.5,0,0, 0,121.2,0, -122.6,0,0, 122.6,0,0, 0,120,0};
1058 
1059  TGeoRotation *rot = new TGeoRotation();
1060  rot->RotateZ(22.5);
1061  rot->SetName("rot");
1062  rot->RegisterYourself();
1063 
1064  TGeoTranslation *trans[22];
1065  for(int i=0; i<22; i++) {
1066  trans[i] = new TGeoTranslation(ttr[i][0], ttr[i][1], ttr[i][2] );
1067  trans[i]->SetName(Form("trans%d",i));
1068  trans[i]->RegisterYourself();
1069  }
1070 
1071  TGeoTranslation *trans_l0;
1072  trans_l0 = new TGeoTranslation(0, -3.4, 0);
1073  trans_l0->SetName(Form("trans_l%d",0));
1074  trans_l0->RegisterYourself();
1075 
1076  TGeoCombiTrans *combl0 = new TGeoCombiTrans(*trans_l0, *rot);
1077  combl0->SetName("combl0");
1078  combl0->RegisterYourself();
1079 
1080 
1081  TGeoCombiTrans *comb0 = new TGeoCombiTrans(*trans[0], *rot);
1082  comb0->SetName("comb0");
1083  comb0->RegisterYourself();
1084 
1085  TGeoCombiTrans *comb1 = new TGeoCombiTrans(*trans[13], *rot);
1086  comb1->SetName("comb1");
1087  comb1->RegisterYourself();
1088 
1089  TGeoVolume *G10_endcap[6], *ST_endcap[6];
1090 
1091  TGeoBBox* bar1 = new TGeoBBox("bar1", 10.5, 240, 0.175);
1092  TGeoBBox* bar2 = new TGeoBBox("bar2", 231, 1.8, 0.175);
1093  TGeoBBox* bar3 = new TGeoBBox("bar3", 219, 1.8, 0.175);
1094  TGeoBBox* bar4 = new TGeoBBox("bar4", 20.5, 232, 0.175);
1095  TGeoBBox* bar5 = new TGeoBBox("bar5", 200., 10, 0.175);
1096 
1097  TGeoPgon *ppgon_l0 = new TGeoPgon("ppg_l0", 0., 360., 8, 2);
1098 // ppgon_l0->DefineSection(0, 0, 0, 127.);
1099 // ppgon_l0->DefineSection(1, 0.15, 0, 127.);
1100  ppgon_l0->DefineSection(0, 0, 0, 120.);
1101  ppgon_l0->DefineSection(1, 0.15, 0, 120.);
1102  TGeoVolume *ppgon1_l0 = new TGeoVolume("ppgon1_l0", ppgon_l0, med7);
1103 // TGeoVolume *hhole_l0 = geom->MakeBox("hhole_l0", med1, 48, 30, 0.16);
1104  TGeoVolume *hhole_l0 = geom->MakeBox("hhole_l0", med1, 51, 32, 0.16);
1105 
1106  TGeoPgon *ppgon_al_l0 = new TGeoPgon("ppg_al_l0", 0., 360., 8, 2);
1107 // ppgon_al_l0->DefineSection(0, 0, 0, 127.);
1108 // ppgon_al_l0->DefineSection(1, 0.035, 0, 127.);
1109  ppgon_al_l0->DefineSection(0, 0, 0, 120.);
1110  ppgon_al_l0->DefineSection(1, 0.035, 0, 120.);
1111  TGeoVolume *ppgon1_al_l0 = new TGeoVolume("ppgon1_al_l0", ppgon_al_l0, med2);
1112 
1113  TGeoPgon *ppgon_l2 = new TGeoPgon("ppg_l2", 0., 360., 8, 2);
1114 // ppgon_l2->DefineSection(0, 0, 0, 228.);
1115 // ppgon_l2->DefineSection(1, 0.15, 0, 228.);
1116  ppgon_l2->DefineSection(0, 0, 0, 224.);
1117  ppgon_l2->DefineSection(1, 0.15, 0, 224.);
1118  TGeoVolume *ppgon1_l2 = new TGeoVolume("ppgon1_l2", ppgon_l2, med7);
1119  TGeoVolume *hhole_l2 = geom->MakeBox("hhole_l2", med1, 60.75, 31.9, 0.16);
1120 
1121  TGeoPgon *ppgon_al_l2 = new TGeoPgon("ppg_al_l2", 0., 360., 8, 2);
1122 // ppgon_al_l2->DefineSection(0, 0, 0, 228.);
1123 // ppgon_al_l2->DefineSection(1, 0.035, 0, 228.);
1124  ppgon_al_l2->DefineSection(0, 0, 0, 224.);
1125  ppgon_al_l2->DefineSection(1, 0.035, 0, 224.);
1126  TGeoVolume *ppgon1_al_l2 = new TGeoVolume("ppgon1_al_l2", ppgon_al_l2, med2);
1127 
1128  TGeoVolume *hhole_l5 = geom->MakeBox("hhole_l5", med1, 90.5, 65.0, 0.16);
1129  TGeoVolume *hhole_l6 = geom->MakeBox("hhole_l6", med1, 90.5, 70.5, 0.16);
1130  TGeoVolume *hhole_l7 = geom->MakeBox("hhole_l7", med1, 90.5, 57.5, 0.16);
1131  TGeoVolume *hhole_l8 = geom->MakeBox("hhole_l8", med1, 90.5, 56.5, 0.16);
1132 
1133  TGeoCompositeShape *LEndcap[7], *MEndcap[7];
1134 
1137 // TGeoCompositeShape *L0_endcap = new TGeoCompositeShape("(ppg_l0:comb0 - hhole_l0:trans0)");
1138 // TGeoCompositeShape *L0_endcap_al = new TGeoCompositeShape("(ppg_al_l0:comb0 - hhole_l0:trans0)");
1139  TGeoCompositeShape *L0_endcap = new TGeoCompositeShape("(ppg_l0:combl0 - hhole_l0:trans0 - bar4:trans19 - bar4:trans20 - bar5:trans21)");
1140  TGeoCompositeShape *L0_endcap_al = new TGeoCompositeShape("(ppg_al_l0:combl0 - hhole_l0:trans0 - bar4:trans19 - bar4:trans20 - bar5:trans21)");
1141 
1142  G10_endcap[0] = new TGeoVolume("GP0_E", L0_endcap, med7);
1143  ST_endcap[0] = new TGeoVolume("ST0_E", L0_endcap_al, med2);
1144  ST_endcap[1] = new TGeoVolume("ST1_E", L0_endcap_al, med2);
1145 
1146 
1148  char longbuffer[250];
1149  char longbuffer1[250];
1150 
1151  int qq[5][10]={2,0,1,1,2,2,3,3,3,4,
1152  2,0,1,1,2,5,3,6,3,7,
1153  2,0,4,0,2,2,3,3,3,4,
1154  5,0,1,11,2,8,3,9,3,10,
1155  6,2,1,11,2,2,3,3,3,4};
1156  for(int i=2; i<7; i++){
1157  sprintf(longbuffer,"ppg_l2:comb0 - hhole_l%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d",
1158  qq[i-2][0],qq[i-2][1],qq[i-2][2],qq[i-2][3],qq[i-2][4],qq[i-2][5],qq[i-2][6],qq[i-2][7],qq[i-2][8],qq[i-2][9]);
1159  sprintf(longbuffer1,"ppg_al_l2:comb0 - hhole_l%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d",
1160  qq[i-2][0],qq[i-2][1],qq[i-2][2],qq[i-2][3],qq[i-2][4],qq[i-2][5],qq[i-2][6],qq[i-2][7],qq[i-2][8],qq[i-2][9]);
1161 
1162  LEndcap[i] = new TGeoCompositeShape(longbuffer);
1163  MEndcap[i] = new TGeoCompositeShape(longbuffer1);
1164  G10_endcap[i] = new TGeoVolume(Form("GP%d_E",i), LEndcap[i], med7);
1165  ST_endcap[i] = new TGeoVolume(Form("ST%d_E",i), MEndcap[i], med7);
1166  }
1167  for(int ii = 0; ii < 7; ii++){
1168  if(ii == 1) { ST_endcap[ii]->SetLineColor(kGreen); }
1169  else {
1170  G10_endcap[ii]->SetLineColor(kRed);
1171  ST_endcap[ii]->SetLineColor(kGreen);
1172  }
1173  }
1174 
1177  pos_z = 329.715; // 2960+4*60+3*30+4.5+12.3/2=330.065
1178  for(int l = 0; l < 2; l++) {
1179  for(int i = 0; i < 53; i++) {
1180 
1181  if(i <= 12) { pos_y=(2.25-i*8.5); }
1182  if(i >= 13 && i < 27) { pos_y=(-0.75-i*8.5.); }
1183  if(i >= 27 && i <= 39) { pos_y=(13.75+(i-27)*8.5); }
1184  if(i >= 40) { pos_y=(16.75+(i-27)*8.5); }
1185 
1186  if(i<7) { pos_x=(-1)**l*161.5; name(tube_en_l6[l*36][0],3,l,3,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1187  if(i>=7 && i<=10) { pos_x=(-1)**l*(-10*l+126.5); name(tube_en_l6[1+l*36][0],3,l,3,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[1+l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1188  if(i==11) { pos_x=(-1)**l*(-10*l+122.25-(i-11)*8.5/2); name(tube_en_l6[2+l*36][0],3,l,3,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[2++l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1189  if(i>=12 && i<=26) { pos_x=(-1)**l*(-10*l+120.75-(i-11)*8.5/2); name(tube_en_l6[(i-9)+l*36][0],3,l,3,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[(i-9)+l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1190 
1191  if(i>=27 && i<=32) { pos_x=(-1)**l*161.5; name(tube_en_l6[18+l*36][0],3,l,3,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[18+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1192  if(i>=33 && i<=36) { pos_x=(-1)**l*(-10.*l+126.5); name(tube_en_l6[19+l*36][0],3,l,3,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[19+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1193  if(i==37 || i==38) { pos_x=(-1)**l*(-10.*l+122.25-(i-37)*8.5/2); name(tube_en_l6[(i-17)+l*36][0],3,l,3,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[(i-17)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1194  if(i>=39) { pos_x=(-1)**l*(-10.*l+120.75-(i-37)*8.5/2); name(tube_en_l6[(i-17)+l*36][0],3,l,3,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[3]->AddNode(tube_en_l6[(i-17)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1195  }
1196  }
1197 
1199  pos_z = 320.715;
1200  for(int l = 0; l < 2; l++) {
1201  for(int i = 0; i < 53; i++) {
1202 
1203  if(i<=12) { pos_y=(-10.75-i*8.5); }
1204  if(i>=13 && i<26) { pos_y=(-13.75-i*8.5.); }
1205  if(i>=26 && i<=38) { pos_y=(0.75+(i-26)*8.5); }
1206  if(i>=39) { pos_y=(3.75+(i-26)*8.5); }
1207 
1208  if(i<6) { pos_x=(-1)**l*161.5; name(tube_en_l6[l*36][0],3,l,2,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1209  if(i>=6 && i<=9) { pos_x=(-1)**l*(-10*l+126.5); name(tube_en_l6[1+l*36][0],3,l,2,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[1+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1210  if(i==10) { pos_x=(-1)**l*(-10*l+122.25-(i-10)*8.5/2); name(tube_en_l6[2+l*36][0],3,l,2,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[2+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1211  if(i>=11 && i<26) { pos_x=(-1)**l*(-10*l+120.75-(i-10)*8.5/2); name(tube_en_l6[(i-8)+l*36][0],3,l,2,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[(i-8)+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1212  if(i>=26 && i<=32) { pos_x=(-1)**l*161.5; name(tube_en_l6[18+l*36][0],3,l,2,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[18+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1213  if(i>=33 && i<=37) { pos_x=(-1)**l*(-10.*l+126.5); name(tube_en_l6[19+l*36][0],3,l,2,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[19+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1214  if(i==38 || i==39) { pos_x=(-1)**l*(-10.*l+122.25-(i-38)*8.5/2); name(tube_en_l6[(i-18)+l*36][0],3,l,2,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[(i-18)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1215  if(i>=40) { pos_x=(-1)**l*(-10.*l+120.75-(i-38)*8.5/2); name(tube_en_l6[(i-18)+l*36][0],3,l,2,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[2]->AddNode(tube_en_l6[(i-18)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1216  }
1217  }
1218 
1220  pos_z = 311.715;
1221  for(int l = 0; l < 2; l++) {
1222  for(int i = 0; i < 53; i++) {
1223 
1224  if(i<=12) { pos_y=(2.25-i*8.5); }
1225  if(i>=13 && i<27) { pos_y=(-0.75-i*8.5.); }
1226  if(i>=27 && i<=39) { pos_y=(13.75+(i-27)*8.5); }
1227  if(i>=40) { pos_y=(16.75+(i-27)*8.5); }
1228 
1229  if(i<7) { pos_x=(-1)**(l+1)*161.5; name(tube_en_l6[l*36][0],3,(1-l),1,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1230  if(i>=7 && i<=10) { pos_x=(-1)**(l+1)*(-10*l+126.5); name(tube_en_l6[1+l*36][0],3,(1-l),1,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[1+l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1231  if(i==11) { pos_x=(-1)**(l+1)*(-10*l+122.25-(i-11)*8.5/2); name(tube_en_l6[2+l*36][0],3,(1-l),1,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[2+l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1232  if(i>=12 && i<=26) { pos_x=(-1)**(l+1)*(-10*l+120.75-(i-11)*8.5/2); name(tube_en_l6[(i-9)+l*36][0],3,(1-l),1,26-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[(i-9)+l*36][0],26-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1233  if(i>=27 && i<=32) { pos_x=(-1)**(l+1)*161.5; name(tube_en_l6[18+l*36][0],3,(1-l),1,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[18+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1234  if(i>=33 && i<=36) { pos_x=(-1)**(l+1)*(-10.*l+126.5); name(tube_en_l6[19+l*36][0],3,(1-l),1,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[19+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1235  if(i==37 || i==38) { pos_x=(-1)**(l+1)*(-10.*l+122.25-(i-37)*8.5/2); name(tube_en_l6[(i-17)+l*36][0],3,(1-l),1,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[(i-17)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1236  if(i>=39) { pos_x=(-1)**(l+1)*(-10.*l+120.75-(i-37)*8.5/2); name(tube_en_l6[(i-17)+l*36][0],3,(1-l),1,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[1]->AddNode(tube_en_l6[(i-17)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1237 
1238  }
1239  }
1240 
1242  pos_z = 302.715;
1243  for(int l = 0; l < 2; l++) {
1244  for(int i = 0; i < 53; i++) {
1245 
1246  if(i<=12) { pos_y=(-10.75-i*8.5); }
1247  if(i>=13 && i<26) { pos_y=(-13.75-i*8.5.); }
1248  if(i>=26 && i<=38) { pos_y=(-0.75+(i-26)*8.5); }
1249  if(i>=39) { pos_y=(3.75+(i-26)*8.5); }
1250 
1251  if(i<6) { pos_x=(-1)**(l+1)*161.5; name(tube_en_l6[l*36][0],3,(1-l),0,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1252  if(i>=6 && i<=9) { pos_x=(-1)**(l+1)*(-10*l+126.5); name(tube_en_l6[1+l*36][0],3,(1-l),0,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[1+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1253  if(i==10) { pos_x=(-1)**(l+1)*(-10*l+122.25-(i-10)*8.5/2); name(tube_en_l6[2+l*36][0],3,(1-l),0,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[2+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1254  if(i>=11 && i<26) { pos_x=(-1)**(l+1)*(-10*l+120.75-(i-10)*8.5/2); name(tube_en_l6[(i-8)+l*36][0],3,(1-l),0,25-i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[(i-8)+l*36][0],25-i,new TGeoCombiTrans(*tr0, *rrr0)); }
1255  if(i>=26 && i<=32) { pos_x=(-1)**(l+1)*161.5; name(tube_en_l6[18+l*36][0],3,(1-l),0,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[18+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1256  if(i>=33 && i<=37) { pos_x=(-1)**(l+1)*(-10.*l+126.5); name(tube_en_l6[19+l*36][0],3,(1-l),0,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[19+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1257  if(i==38 || i==39) { pos_x=(-1)**(l+1)*(-10.*l+122.25-(i-38)*8.5/2); name(tube_en_l6[(i-18)+l*36][0],3,(1-l),0,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[(i-18)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1258  if(i>=40) { pos_x=(-1)**(l+1)*(-10.*l+120.75-(i-38)*8.5/2); name(tube_en_l6[(i-18)+l*36][0],3,(1-l),0,i,0); TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z); mnk4[0]->AddNode(tube_en_l6[(i-18)+l*36][0],i,new TGeoCombiTrans(*tr0, *rrr0)); }
1259  }
1260  }
1261 
1264  TGeoVolume *fmf[4];
1265  TGeoTranslation *ftr[4];
1266 
1267  TGeoPgon *pgon = new TGeoPgon("pg", 0., 360., 8, 2);
1268  pgon->DefineSection(0, 0, 0, 240);
1269  pgon->DefineSection(1, 6, 0, 240);
1270 
1271  TGeoVolume *pgon1 = new TGeoVolume("pgon1", pgon, med6);
1272  TGeoVolume *hole = geom->MakeBox("hole", med1, 77, 52, 7.5);
1273 
1274  TGeoCompositeShape *cs = new TGeoCompositeShape("ccs", "(pg:comb0 - hole:trans0)");
1275 
1276  for(int i=0; i<4; i++) {
1277  fmf[i] = new TGeoVolume(Form("FeMFLayer%d",i), cs, med6);
1278  ftr[i] = new TGeoTranslation(0,0,296+9*i);
1279  ftr[i]->SetName("ftr%d");
1280  ftr[i]->RegisterYourself();
1281  }
1284  TGeoVolume *G10_mf[4], *ST_mf[4];
1285  TGeoCompositeShape *G10mf[4], *STmf[4];
1286  char longbb[250];
1287  char longbb1[250];
1288 
1289  int qq2[4][11]={0,7,12,1,1,2,2,3,4,3,3,
1290  1,7,12,1,1,2,2,3,4,3,3,
1291  0,8,0,1,17,2,2,3,4,4,3,
1292  1,8,8,1,17,2,14,3,18,3,16};
1293 
1294  for(int i=0; i<4; i++){
1295  sprintf(longbb,"ppg_l2:comb%d - hhole_l%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d",
1296  qq2[i][0],qq2[i][1],qq2[i][2],qq2[i][3],qq2[i][4],qq2[i][5],qq2[i][6],qq2[i][7],qq2[i][8],qq2[i][9],qq2[i][10]);
1297  sprintf(longbb1,"ppg_al_l2:comb%d - hhole_l%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d - bar%d:trans%d",
1298  qq2[i][0],qq2[i][1],qq2[i][2],qq2[i][3],qq2[i][4],qq2[i][5],qq2[i][6],qq2[i][7],qq2[i][8],qq2[i][9],qq2[i][10]);
1299 
1300  G10mf[i] = new TGeoCompositeShape(longbb);
1301  STmf[i] = new TGeoCompositeShape(longbb1);
1302  G10_mf[i] = new TGeoVolume(Form("GP%d_MF",i), G10mf[i], med7);
1303  ST_mf[i] = new TGeoVolume(Form("ST%d_MF",i), STmf[i], med7);
1304  }
1305 
1306  for(int ii = 0; ii <4; ii++){
1307  G10_mf[ii]->SetLineColor(kRed);
1308  ST_mf[ii]->SetLineColor(kBlue);
1309 // mnk4[ii]->AddNode(G10_mf[ii], ii, new TGeoTranslation(0, 0., (302.715+9*ii+MDT_thickness/2+0.1)));
1310 // mnk4[ii]->AddNode(ST_mf[ii], ii, new TGeoTranslation(0, 0, (302.715+9*ii+MDT_thickness/2+0.26)));
1311  }
1313 
1316  char fe[12], hl[12], ffe[12];
1317  TGeoTranslation *frot[16];
1318  TGeoVolume *FeForward[16];
1319 
1320  TGeoVolume *vol = geom->MakeBox("fe", med6, 380/2, 252.5/2, 6/2);
1321  TGeoVolume *vol1 = geom->MakeBox("hl", med1, 30/2, 34/2, 7.5/2);
1322  TGeoTranslation *vv = new TGeoTranslation((15+1.8), 0, 0);
1323  vv->SetName("vv");
1324  vv->RegisterYourself();
1325  TGeoCompositeShape *csq = new TGeoCompositeShape("ffe", "(fe - (hl:vv))");
1326 
1327  int yt=0, kk=0;
1328  for (int i=0; i<16; i++) {
1329  yt=(i%4);
1330  if(yt==0) kk++;
1331  if(i<16) {
1332  frot[i] = new TGeoTranslation(kk*1.45, 0, 873+9*i);
1333  FeForward[i] = new TGeoVolume(Form("FeForwardLayer%d",i),csq,med6);
1334  }
1335  else { frot[i] = new TGeoTranslation(4.35, 0, 866.5-4*(i-16)); }
1336  frot[i]->SetName(Form("frot%d",i));
1337  frot[i]->RegisterYourself();
1338  }
1339 
1340  for(int i=0; i<16; i++) pCombi3->AddNode(FeForward[i], i, frot[i]);
1342 
1343  float tube_len_fw[3] = { 350.5, 135.95, 169.55 };
1344 
1345  for(int i=0; i<3; i++) {
1346  tube_fw[i][0] = geom->MakeBox(Form("BP%d",i), med5, MDT_width/2, MDT_thickness/2, tube_len_fw[i]/2);
1347  tube_fw[i][1] = geom->MakeBox(Form("BA%d",i), med2, XSize/2, YSize/2, tube_len_fw[i]/2);
1348  for(int j = 0; j < 8; j++){
1349  float slotpos_x = (-3.5 + 1.*j);
1350  tube_fw[i][2] = geom->MakeBox(Form("MDT%ds%dl%db%dw%d",4,0,0,0,0), med4, XSize1/2, YSize1/2, tube_len_fw[i]/2);
1351  tube_fw[i][1]->AddNode(tube_fw[i][2], j, new TGeoTranslation(slotpos_x, slotpos_y, 0.));
1352  }
1353  tube_fw[i][0]->AddNode(tube_fw[i][1],1);
1354  }
1355 
1356  int dd,dd1;
1357  for(int l = 0; l < 18; l++){ // layer#
1358  for(int i = 0; i < 32; i++){ //MDT# in layer
1359  dd = (l/4); dd1=(l%2);
1360  if(l<16) { pos_z = (876.1 + MDT_thickness/2 + l*9); }
1361  else { pos_z = (870 - 0.1 - MDT_thickness/2 - (l-16)*(MDT_thickness+0.45)); dd=0; }
1362 
1363  if((i<12 || i>15) && i<28) { pos_x = 1.45*dd; pos_y = (-114.75+8.5*i+0.5*dd1); name(tube_fw[0][0],4,0,l,i,0);
1364  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z);
1365  mnk5[l]->AddNode(tube_fw[0][0], i, new TGeoCombiTrans(*tr0, *rr0));}
1366  if(i>=12 && i<=15) { pos_x = (107.275+1.45*dd); pos_y = (-12.75+8.5*(i-12)+0.5*dd1); name(tube_fw[1][0],4,0,l,i,0);
1367  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z);
1368  mnk5[l]->AddNode(tube_fw[1][0], i, new TGeoCombiTrans(*tr0,*rr0));}
1369  if(i>=28) { pos_x = (-90.475+1.45*dd); pos_y = (-12.75+8.5*(i-28)+0.5*dd1); name(tube_fw[2][0],4,0,l,i,0);
1370  TGeoTranslation *tr0 = new TGeoTranslation(pos_x, pos_y, pos_z);
1371  mnk5[l]->AddNode(tube_fw[2][0], i, new TGeoCombiTrans(*tr0,*rr0));}
1372  }
1373  }
1374 
1375 // for(int i=16; i<18; i++) {
1376  for(int i=0; i<18; i++) {
1377  if(i<16) { pCombi3->AddNode(mnk5[i], i+2); }
1378  else { pCombi3->AddNode(mnk5[i], 17-i); }
1379  }
1381  TGeoVolume *G10_fs[18], *ST_fs[18];
1382  TGeoCompositeShape *G10fs[18], *STfs[18];
1383  TGeoTranslation *fsrot[18], *fsrot1[18];
1384  char longbbs[250];
1385  char longbbs1[250];
1386 
1387  TGeoVolume *vols = geom->MakeBox("shl", med7, 351.2/2, 238/2, 0.15/2);
1388  TGeoVolume *vols1 = geom->MakeBox("shl1", med7, 44.8/2, 34/2, 0.25/2);
1389  TGeoVolume *vols2 = geom->MakeBox("shl2", med2, 351.2/2, 238/2, 0.035/2);
1390  TGeoVolume *vols3 = geom->MakeBox("shl3", med2, 44.8/2, 34/2, 0.055/2);
1391  TGeoTranslation *vv1 = new TGeoTranslation(17.7, 0, 0);
1392  vv1->SetName("vv1");
1393  vv1->RegisterYourself();
1394 
1395  kk=0;
1396  for(int i=0; i<17; i++) {
1397  yt=(i%4);
1398  if(yt==0) kk++;
1399  sprintf(longbbs,"shl - shl1:vv1",i);
1400  sprintf(longbbs1,"shl2 - shl3:vv1",i);
1401  G10fs[i] = new TGeoCompositeShape(longbbs);
1402  STfs[i] = new TGeoCompositeShape(longbbs1);
1403 
1404  if(i<16) {
1405  fsrot[i] = new TGeoTranslation(kk*1.45-2, 0, 873+3+1.23+0.1+9*i);
1406  fsrot1[i] = new TGeoTranslation(kk*1.45-2, 0, 873+3+1.23+0.26+9*i);
1407  G10_fs[i] = new TGeoVolume(Form("GP%d_FS",i+2), G10fs[i], med7);
1408  ST_fs[i] = new TGeoVolume(Form("ST%d_FS",i+2), STfs[i], med7);
1409  } else {
1410  fsrot[i] = new TGeoTranslation(-2, 0, 873-3-1.23-0.1-0.26);
1411  fsrot1[i] = new TGeoTranslation(-2, 0, 873-3-1.23-0.1-0.16);
1412 // fsrot1[i] = new TGeoTranslation(-2, 0, 873-3-1.23-0.1-0.360); 0 ->17
1413 // G10_fs[i] = new TGeoVolume(Form("GP%d_FS",17-i), G10fs[i], med7);
1414  ST_fs[i] = new TGeoVolume(Form("ST%d_FS",17-i), STfs[i], med7);
1415  }
1416 
1417  ST_fs[i]->SetLineColor(kBlue);
1418 // G10_fs[i]->SetLineColor(kRed);
1419  }
1420 
1421  for(int i=0; i<17; i++) {
1422  if(i<16) { pCombi3->AddNode(G10_fs[i], i+2, fsrot[i]); pCombi3->AddNode(ST_fs[i], i+2, fsrot1[i]); }
1423  else { pCombi3->AddNode(G10_fs[i], 17-i, fsrot[i]); pCombi3->AddNode(ST_fs[i], 17-i, fsrot1[i]); }
1424  }
1425 
1427 
1428 
1430  pCombi->AddNode(MdtOct0, 0, new TGeoCombiTrans(0., 0., 0., rot0));
1431  pCombi->AddNode(MdtOct0, 1, new TGeoCombiTrans(0., 0., 0., rot1));
1432  pCombi->AddNode(MdtOct2, 2, new TGeoCombiTrans(0., 0., 0., rot2));
1433  pCombi->AddNode(MdtOct0, 3, new TGeoCombiTrans(0., 0., 0., rot3));
1434  pCombi->AddNode(MdtOct0, 4, new TGeoCombiTrans(0., 0., 0., rot4));
1435  pCombi->AddNode(MdtOct0, 5, new TGeoCombiTrans(0., 0., 0., rot5));
1436  pCombi->AddNode(MdtOct6, 6, new TGeoCombiTrans(0., 0., 0., rot6));
1437  pCombi->AddNode(MdtOct0, 7, new TGeoCombiTrans(0., 0., 0., rot7));
1438 
1439 
1442  pCombi1->AddNode(mnk3[0], 1);
1443  pCombi1->AddNode(mnk3[1], 2);
1444  pCombi1->AddNode(mnk3[2], 3);
1445  pCombi1->AddNode(mnk3[3], 4);
1446  pCombi1->AddNode(mnk3[4], 5);
1447  pCombi1->AddNode(mnk3[5], 6);
1448  pCombi1->AddNode(mnk3[6], 7);
1451  for(int i = 0; i < 7; i++){
1452  if(i==0) {
1453  pCombi1->AddNode(ST_endcap[i], i, new TGeoTranslation(0, 0, 245.657));
1454  pCombi1->AddNode(G10_endcap[i], i, new TGeoTranslation(0, 0, 245.695));
1455  }
1456  if(i==1){pCombi1->AddNode(ST_endcap[i], 0, new TGeoTranslation(0, 0, 245.848)); }
1457  if(i>1){
1458  pCombi1->AddNode(G10_endcap[i], i, new TGeoTranslation(0, 0., (255.215 + 9*(i-2) +MDT_thickness/2+0.1)));
1459  pCombi1->AddNode(ST_endcap[i], i, new TGeoTranslation(0, 0, (255.215 + 9*(i-2) + MDT_thickness/2+0.26)));
1460  }
1461  }
1463 
1466  pCombi2->AddNode(mnk4[0], 1);
1467  pCombi2->AddNode(mnk4[1], 2);
1468  pCombi2->AddNode(mnk4[2], 3);
1469  pCombi2->AddNode(mnk4[3], 4);
1471  for(int i = 0; i < 4; i++){
1472  pCombi2->AddNode(ST_mf[i], i, new TGeoTranslation(0, 0, 302.715+9*i+0.715));
1473  pCombi2->AddNode(G10_mf[i], i, new TGeoTranslation(0, 0, 302.715+9*i+0.875));
1474  }
1476  pCombi2->AddNode(fmf[0], 1, ftr[0]);
1477  pCombi2->AddNode(fmf[1], 2, ftr[1]);
1478  pCombi2->AddNode(fmf[2], 3, ftr[2]);
1479  pCombi2->AddNode(fmf[3], 4, ftr[3]);
1482 
1483 
1484 // top->AddNode(pCombi, 0);
1485  top->AddNode(pCombi1, 0);
1486 // top->AddNode(pCombi2, 0);
1487 // top->AddNode(pCombi3, 0);
1488 
1489  top->Write();
1490 
1491  geom->CloseGeometry();
1492  geom->SetVisLevel(50);
1493  geom->SetVisOption(1);
1494  top->Draw();
1495 
1496 // gGeoManager->Export("muon_TS_barrel.root");
1497 // gGeoManager->Export("muon_TS_endcap.root");
1498 // gGeoManager->Export("muon_MF.root");
1499 // gGeoManager->Export("muon_FS.root");
1500  return 0;
1501 }
1502 
1503 int name(TGeoVolume* &vol, int n1, int n2, int n3, int n4, int n5)
1504 {
1505 
1506 // MDT%ds%dl%db%dw%d -> MDT + 1/2/3/4 (Barrel/Endcap/MF/FS) + octant# + layer# + box# + wire#
1507  TObjArray* nodes = vol->GetNodes();
1508  vol->SetName(Form("BP%ds%dl%db%dw%d",n1,n2,n3,n4,n5));
1509  return 0;
1510 }
Int_t i
Definition: run_full.C:25
TGeoManager * gGeoManager
TGeoVolume * top
TGeoRotation * rot4
TGeoRotation * rot1
TGeoTranslation * trans
TCut ppos
Definition: plot_dirc.C:24
int muon_barrel_strip_5bis()
TGeoRotation rot2
TFile * out
Definition: reco_muo.C:20
TString name
Double_t const mm
int fe
Definition: anaLmdDigi.C:67
TGeoRotation rot
TGeoRotation rot3