AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONTriggerGeometryBuilder.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // $Id$
17 
18 //-----------------------------------------------------------------------------
20 // -----------------------------------
21 // MUON Trigger stations geometry
22 // construction class.
23 // Author: Philippe Crochet (LPCCFd)
24 // Support for trigger chambers added April 07 by Enrico Scomparin (INFN To)
25 //-----------------------------------------------------------------------------
26 
27 #include <TVirtualMC.h>
28 #include <TGeoMatrix.h>
29 #include <TArrayI.h>
30 
31 #include "AliLog.h"
32 #include "AliRun.h"
33 
35 #include "AliMUON.h"
36 #include "AliMUONConstants.h"
37 #include "AliMUONGeometryModule.h"
39 #include <iostream>
40 
41 using std::endl;
42 using std::cout;
46 
47 // vertical gap between right and left chambers (kDXZERO*2=4cm)
48 const Float_t AliMUONTriggerGeometryBuilder::fgkDXZERO=2.;
49 // main distances for chamber definition in first plane/first station
50 const Float_t AliMUONTriggerGeometryBuilder::fgkXMIN=34.;
51 const Float_t AliMUONTriggerGeometryBuilder::fgkXMED=51.;
52 const Float_t AliMUONTriggerGeometryBuilder::fgkXMAX=255.;
53 // 090704 fgkXMAX changed from 272 to 255.
54 // (see fig.2-4 & 2-5 of Local Trigger Board PRR)
55 // segmentation updated accordingly
56 const Float_t AliMUONTriggerGeometryBuilder::fgkYMIN=34.;
57 const Float_t AliMUONTriggerGeometryBuilder::fgkYMAX=51.;
58 // inner/outer radius of flange between beam shield. and chambers (1/station)
59 //const Float_t AliMUONTriggerGeometryBuilder::fgkRMIN[2]={50.,50.};
60 //const Float_t AliMUONTriggerGeometryBuilder::fgkRMAX[2]={64.,68.};
61 // z position of the middle of the gas gap in mother vol
62 const Float_t AliMUONTriggerGeometryBuilder::fgkZm=-3.6;
63 const Float_t AliMUONTriggerGeometryBuilder::fgkZp=+3.6;
64 
65 // y positions of vertical supports
66 const Float_t AliMUONTriggerGeometryBuilder::fgkYVSup[4]={61.45,122.45,192.95,236.95};
67 // dimensions of vertical supports
68 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeVSupExt[3]={1.5,1.5,306.+5.};
69 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeVSupInt[3]={1.2,1.2,306.+5.};
70 // transverse dimensions of angular supports
71 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupport1V[3]={0.,1.5,0.1};
72 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupport1H[3]={0.,0.1,1.15}; // z should be 1.4 in the installed set-up
73 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupport2V[3]={0.,3.0,0.1};
74 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupport2H[3]={0.,0.1,1.9};
75 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupportXV[3]={0.,1.25,0.25};
76 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupportXH[3]={0.,0.25,1.5};
77 // transverse dimensions of horizontal cable supports
78 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeSupportCable[3]={0.,2.,3.};
79 // dimensions of gas pipes (inner and outer radius)
80 const Float_t AliMUONTriggerGeometryBuilder::fgkSizeGasPipe[3]={0.2,0.4,0.};
81 // Position of gas pipe with respect to angular support
83 // Small cut on some volumes to avoid extrusion from SC1x
85 
86 //______________________________________________________________________________
88  : AliMUONVGeometryBuilder(16, 4),
89  fMUON(muon),
90  fIdtmed(0),
91  fIdAir(0),
92  fIdAlu1(0),
93  fIdInox(0),
94  fYEnvPsave(0.),
95  fYEnvMsave(0.),
96  fDYsave(0.),
97  fDXsave(0.),
98  fRsupportpipe()
99 {
101  fRsupportpipe.SetAngles(90.,90.,0.);
102 }
103 
104 //______________________________________________________________________________
107  fMUON(0),
108  fIdtmed(0),
109  fIdAir(0),
110  fIdAlu1(0),
111  fIdInox(0),
112  fYEnvPsave(0.),
113  fYEnvMsave(0.),
114  fDYsave(0.),
115  fDXsave(0.),
116  fRsupportpipe()
117 {
119 }
120 
121 //______________________________________________________________________________
123 {
125 }
126 
127 //______________________________________________________________________________
128 TString AliMUONTriggerGeometryBuilder::GetVolumeName(const TString& volume, Int_t icount) const
129 {
130 // Function to generate a short volume name from its long variant
131 
132  if ( volume == "volAlu" ) {
133  char volAlu[5]; // Alu
134  snprintf(volAlu,5,"SC%dA",icount+1);
135  return volAlu;
136  }
137  else if ( volume == "volAluSupportH") {
138  char volAluSupportH[6];
139  snprintf(volAluSupportH,6,"SALH%d",icount+1);
140  return volAluSupportH;
141  }
142  else if ( volume == "volAirSupportH") {
143  char volAirSupportH[6];
144  snprintf(volAirSupportH,6,"SAIH%d",icount+1);
145  return volAirSupportH;
146  }
147  else if ( volume == "volInoxGasPipe") {
148  char volInoxGasPipe[7];
149  snprintf(volInoxGasPipe,7,"SPINO%d",icount+1);
150  return volInoxGasPipe;
151  }
152 
153  AliErrorStream() << "Volume " << volume << " name is not defined." << endl;
154  return "";
155 }
156 
157 //______________________________________________________________________________
158 TString AliMUONTriggerGeometryBuilder::GetVolEnvName(Int_t icount, Int_t ienv) const
159 {
163 
164  TString name = "S";
165  name += icount;
166  if ( ienv < 9 ) {
167  name += "R";
168  name += (ienv + 1);
169  }
170  else {
171  name += "L";
172  name += (ienv - 8) ;
173  }
174  return name;
175 }
176 
177 //______________________________________________________________________________
179  const TString& type1234X,
180  const TString& typeHV,
181  Int_t icount) const
182 {
184 
185  TString name = "SA";
186  name += type1234X;
187  name += typeHV;
188  name += icount+1;
189  return name;
190 }
191 
192 //______________________________________________________________________________
194  const TString& type1234X,
195  const TString& typeHV,
196  const TString& typeABDEF,
197  Int_t icount, Int_t ivol) const
198 {
200 
201  TString name = "S";
202  name += typeHV;
203  name += type1234X;
204  name += icount+1;
205  name += typeABDEF;
206  name += ivol;
207  return name;
208 }
209 
210 //______________________________________________________________________________
212  const TString& type12,
213  const TString& typeABCDEF,
214  Int_t icount, Int_t ivol) const
215 {
217 
218  TString name = "SP";
219  name += type12;
220  name += icount+1;
221  name += typeABCDEF;
222  name += ivol;
223  return name;
224 }
225 
226 //______________________________________________________________________________
228 {
230 
231  Float_t tpar[3];
232  tpar[0]= 0.;
233  tpar[1]= 0.;
234  tpar[2]= 0.;
235  char volBak[5]; // Bakelite
236  char volGaz[5]; // Gas streamer
237  snprintf(volBak,5,"SB%dA",icount+1);
238  snprintf(volGaz,5,"S%dG",icount+11);
239  TVirtualMC::GetMC()->Gsvolu(GetVolumeName("volAlu", icount),"BOX",fIdAlu1,tpar,0); // Al
240  TVirtualMC::GetMC()->Gsvolu(volBak,"BOX",fIdtmed[1107],tpar,0); // Bakelite
241  TVirtualMC::GetMC()->Gsvolu(volGaz,"BOX",fIdtmed[1106],tpar,0); // Gas streamer
242  tpar[0] = -1.;
243  tpar[1] = -1.;
244  tpar[2] = 0.1;
245  TVirtualMC::GetMC()->Gsposp(volGaz,1,volBak,0.,0.,0.,0,"ONLY",tpar,3);
246  tpar[2] = 0.3;
247  TVirtualMC::GetMC()->Gsposp(volBak,1,GetVolumeName("volAlu", icount),0.,0.,0.,0,"ONLY",tpar,3);
248 }
249 
250 //______________________________________________________________________________
251 void AliMUONTriggerGeometryBuilder::BuildRPCSupportsVertical(Int_t& iVolNum, Int_t icount) const
252 {
254 
255  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
256  char volAluSupport[5],volAirSupport[5];
257  snprintf(volAluSupport,5,"SAL%d",icount+1);
258  snprintf(volAirSupport,5,"SAI%d",icount+1);
259  char volEnvSupport[12][7];
260  for(Int_t ii=0;ii<8;ii++){
261  snprintf(volEnvSupport[ii],7,"SEA%dV%d",icount+1,ii);
262  }
263  Float_t tpar[3];
264  tpar[0]= 0.;
265  tpar[1]= 0.;
266  tpar[2]= 0.;
267  TVirtualMC::GetMC()->Gsvolu(volAluSupport,"BOX",fIdAlu1,tpar,0);
268  TVirtualMC::GetMC()->Gsvolu(volAirSupport,"BOX",fIdAir,tpar,0);
269  tpar[0]=fgkSizeVSupInt[0];
270  tpar[1]=fgkSizeVSupInt[1];
271  tpar[2]=-1.;
272  TVirtualMC::GetMC()->Gsposp(volAirSupport,1,volAluSupport,0.,0.,0.,0,"ONLY",tpar,3);
273 
274  TGeoRotation rsupportv;
275  rsupportv.SetAngles(0.,90.,0.);
276  Double_t dpar[3];
277  dpar[0]=fgkSizeVSupExt[0];
278  dpar[1]=fgkSizeVSupExt[1];
279  dpar[2]=fgkSizeVSupExt[2]*zRatio;
280  for(Int_t ii=0;ii<4;ii++){
281  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupport[ii], 0, true,
282  TGeoTranslation(-fgkYVSup[ii]*zRatio,0.,0.),rsupportv);
283  GetEnvelopes(16+icount)
284  ->AddEnvelopeConstituentParam(volAluSupport,volEnvSupport[ii],iVolNum++,3, dpar);
285  }
286  for(Int_t ii=4;ii<8;ii++){
287  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupport[ii], 0, true,
288  TGeoTranslation(fgkYVSup[ii-4]*zRatio,0.,0.),rsupportv);
289  GetEnvelopes(16+icount)
290  ->AddEnvelopeConstituentParam(volAluSupport,volEnvSupport[ii],iVolNum++,3, dpar);
291  }
292 }
293 
294 //______________________________________________________________________________
296 {
298 
299 // RPC supports (horizontal)
300 
301 // supports for cables
302 
303  Float_t tpar[3];
304  tpar[0]= 0.;
305  tpar[1]= 0.;
306  tpar[2]= 0.;
307  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
308  TString volAirSupportH = GetVolumeName("volAirSupportH", icount);
309  TVirtualMC::GetMC()->Gsvolu(volAluSupportH,"BOX",fIdAlu1,tpar,0);
310  TVirtualMC::GetMC()->Gsvolu(volAirSupportH,"BOX",fIdAir,tpar,0);
311  tpar[0]=-1.;
312  tpar[1]=1.9;
313  tpar[2]=2.8;
314  TVirtualMC::GetMC()->Gsposp(volAirSupportH,1,volAluSupportH,0.,0.,0.,0,"ONLY",tpar,3);
315 }
316 
317 //______________________________________________________________________________
319 {
321 
322  Float_t tpar[3];
323  tpar[0]= 0.;
324  tpar[1]= 0.;
325  tpar[2]= 0.;
326  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("1","V",icount),"BOX",fIdAlu1,tpar,0);
327  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("1","H",icount),"BOX",fIdAlu1,tpar,0);
328  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("2","V",icount),"BOX",fIdAlu1,tpar,0);
329  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("2","H",icount),"BOX",fIdAlu1,tpar,0);
330  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("3","V",icount),"BOX",fIdAlu1,tpar,0);
331  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("3","H",icount),"BOX",fIdAlu1,tpar,0);
332  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("4","V",icount),"BOX",fIdAlu1,tpar,0);
333  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("4","H",icount),"BOX",fIdAlu1,tpar,0);
334  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("X","V",icount),"BOX",fIdAlu1,tpar,0);
335  TVirtualMC::GetMC()->Gsvolu(GetVolAluAngSuppName("X","H",icount),"BOX",fIdAlu1,tpar,0);
336 }
337 
338 //______________________________________________________________________________
340 {
342  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
343  Float_t tpar[3];
344  tpar[0]= 0.;
345  tpar[1]= 0.;
346  tpar[2]= 0.;
347  TVirtualMC::GetMC()->Gsvolu(volInoxGasPipe,"TUBE",fIdInox,tpar,0);
348 }
349 
350 //______________________________________________________________________________
351 void AliMUONTriggerGeometryBuilder::BuildChamberTypeA(Int_t& iVolNum, Int_t icount)
352 {
354 
355  Double_t dpar[3];
356  Double_t spar[3];
357  Double_t ppar[3];
358 
359 // chamber type A
360  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
361  Float_t xEnv = (fgkDXZERO+fgkXMED+(fgkXMAX-fgkXMED)/2.)*zRatio;
362  Float_t yEnvM = 0.; // y low position of envelope in chamber
363  Float_t yEnvP = 0.; // y up position of envelope in chamber
364  fYEnvPsave = 0.; // tmp data
365  fYEnvMsave = 0.; // tmp data
366  //Float_t xpos = 0.; // x position of RPC in envelope
367  //Float_t ypos = 0.; // y position of RPC in envelope
368  dpar[2] = 0.4;
369  dpar[0] = ((fgkXMAX-fgkXMED)/2.)*zRatio;
370  dpar[1] = fgkYMIN * zRatio;
371 
372  Int_t detElemId = (10+icount+1)*100;
373  TString volEnv4 = GetVolEnvName(icount, 4);
374  TString volEnv13 = GetVolEnvName(icount, 13);
375  GetEnvelopes(16+icount)->AddEnvelope(volEnv4, detElemId, true,
376  TGeoTranslation(xEnv,yEnvP,fgkZp));
377  detElemId = (10+icount+1)*100+9;
378  GetEnvelopes(16+icount)->AddEnvelope(volEnv13, detElemId, true,
379  TGeoTranslation(-xEnv,yEnvM,fgkZm),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
380 
381  TString volAlu = GetVolumeName("volAlu", icount);
382  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv4,iVolNum++,3, dpar);
383  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv13,iVolNum++,3, dpar);
384 
385 // horizontal cable support chamber type A
386  char volEnvSupportHA[6][8];
387  for(Int_t jj=0;jj<2;jj++){
388  for(Int_t ii=0;ii<6;ii++){
389  if(ii<3)snprintf(volEnvSupportHA[3*jj+ii],8,"SA%dHA%d",icount+1,3*jj+ii);
390  }
391  }
392 
393  spar[0]=((fgkXMAX/2)-fgkYVSup[0]/2.)*zRatio;
394  spar[1]=fgkSizeSupportCable[1];
395  spar[2]=fgkSizeSupportCable[2];
396  Float_t offsetSuppA = ((fgkXMAX-fgkXMED)/2.)*zRatio-(((fgkXMAX/2)-fgkYVSup[0]/2.)*zRatio);
397  for(Int_t in=0;in<3;in++){
398  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHA[in], 0, true,
399  TGeoTranslation(xEnv+offsetSuppA/2.,yEnvP+dpar[1]/2.*(in-1),-(fgkSizeVSupExt[0]+spar[2])));
400  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHA[in+3], 0, true,
401  TGeoTranslation(-(xEnv+offsetSuppA/2.),yEnvM+dpar[1]/2.*(in-1),fgkSizeVSupExt[0]+spar[2]),
402  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
403  }
404  for(Int_t ii=0;ii<6;ii++) {
405  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
406  GetEnvelopes(16+icount)
407  ->AddEnvelopeConstituentParam(volAluSupportH,volEnvSupportHA[ii],iVolNum++,3, spar);
408  }
409 
410  spar[0]=dpar[0];
411  spar[1]=fgkSizeSupport1V[1];
412  spar[2]=fgkSizeSupport1V[2];
413  Float_t sparysave=spar[1];
414  TString volEnvSuppAng1VA0 = GetVolEnvSuppAngName("1", "V", "A", icount, 0);
415  TString volEnvSuppAng1VA1 = GetVolEnvSuppAngName("1", "V", "A", icount, 1);
416 
417  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VA0, 0, true,
418  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]));
419  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VA1, 0, true,
420  TGeoTranslation(-xEnv,yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]),
421  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
422 
423  TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
424  GetEnvelopes(16+icount)
425  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VA0,iVolNum++,3, spar);
426  GetEnvelopes(16+icount)
427  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VA1,iVolNum++,3, spar);
428 
429 // 1 horizontal
430 
431  spar[0]=dpar[0];
432  spar[1]=fgkSizeSupport1H[1];
433  spar[2]=fgkSizeSupport1H[2];
434  TString volEnvSuppAng1HA0 = GetVolEnvSuppAngName("1", "H", "A", icount, 0);
435  TString volEnvSuppAng1HA1 = GetVolEnvSuppAngName("1", "H", "A", icount, 1);
436  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HA0, 0, true,
437  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]));
438  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HA1, 0, true,
439  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])),
440  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
441 
442  TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
443  GetEnvelopes(16+icount)
444  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HA0,iVolNum++,3, spar);
445  GetEnvelopes(16+icount)
446  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HA1,iVolNum++,3, spar);
447 
448 // gas pipe (low)
449  ppar[0]=fgkSizeGasPipe[0];
450  ppar[1]=fgkSizeGasPipe[1];
451  ppar[2]=dpar[0];
452  TString volEnvInoxGasPipe1A0 = GetVolEnvInoxGasPipeName("1", "A", icount, 0);
453  TString volEnvInoxGasPipe1A1 = GetVolEnvInoxGasPipeName("1", "A", icount, 1);
454  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1A0, 0, true,
455  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
456  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1A1, 0, true,
457  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
458  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
459  GetEnvelopes(16+icount)
460  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1A0,iVolNum++,3, ppar);
461  GetEnvelopes(16+icount)
462  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1A1,iVolNum++,3, ppar);
463 
464 // 2 vertical
465 
466  spar[0]=dpar[0];
467  spar[1]=fgkSizeSupport2V[1];
468  spar[2]=fgkSizeSupport2V[2];
469  sparysave=spar[1]+fgkSizeSupport2H[1];
470  TString volEnvSuppAng2VA0 = GetVolEnvSuppAngName("2", "V", "A", icount, 0);
471  TString volEnvSuppAng2VA1 = GetVolEnvSuppAngName("2", "V", "A", icount, 1);
472  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VA0, 0, true,
473  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]));
474  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VA1, 0, true,
475  TGeoTranslation(-xEnv,yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
476  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
477 
478  TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
479  GetEnvelopes(16+icount)
480  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VA0,iVolNum++,3, spar);
481  GetEnvelopes(16+icount)
482  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VA1,iVolNum++,3, spar);
483 
484 // 2 horizontal
485 
486  spar[0]=dpar[0];
487  spar[1]=fgkSizeSupport2H[1];
488  spar[2]=fgkSizeSupport2H[2];
489  TString volEnvSuppAng2HA0 = GetVolEnvSuppAngName("2", "H", "A", icount, 0);
490  TString volEnvSuppAng2HA1 = GetVolEnvSuppAngName("2", "H", "A", icount, 1);
491  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HA0, 0, true,
492  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]));
493  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HA1, 0, true,
494  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])),
495  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
496 
497  TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
498  GetEnvelopes(16+icount)
499  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HA0,iVolNum++,3, spar);
500  GetEnvelopes(16+icount)
501  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HA1,iVolNum++,3, spar);
502 
503 // 3 vertical
504 
505  spar[0]=dpar[0];
506  spar[1]=fgkSizeSupport1V[1];
507  spar[2]=fgkSizeSupport1V[2];
508  sparysave=spar[1];
509  TString volEnvSuppAng3VA0 = GetVolEnvSuppAngName("3", "V", "A", icount, 0);
510  TString volEnvSuppAng3VA1 = GetVolEnvSuppAngName("3", "V", "A", icount, 1);
511  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VA0, 0, true,
512  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]));
513  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VA1, 0, true,
514  TGeoTranslation(-xEnv,yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]),
515  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
516 
517  TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
518  GetEnvelopes(16+icount)
519  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VA0,iVolNum++,3, spar);
520  GetEnvelopes(16+icount)
521  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VA1,iVolNum++,3, spar);
522 
523 // 3 horizontal
524 
525  spar[0]=dpar[0];
526  spar[1]=fgkSizeSupport1H[1];
527  spar[2]=fgkSizeSupport1H[2];
528  TString volEnvSuppAng3HA0 = GetVolEnvSuppAngName("3", "H", "A", icount, 0);
529  TString volEnvSuppAng3HA1 = GetVolEnvSuppAngName("3", "H", "A", icount, 1);
530  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HA0, 0, true,
531  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]));
532  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HA1, 0, true,
533  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])),
534  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
535 
536  TString volAluAngSupport3H = GetVolAluAngSuppName("3", "H", icount);
537  GetEnvelopes(16+icount)
538  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HA0,iVolNum++,3, spar);
539  GetEnvelopes(16+icount)
540  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HA1,iVolNum++,3, spar);
541 
542 // gas pipe (high)
543  ppar[0]=fgkSizeGasPipe[0];
544  ppar[1]=fgkSizeGasPipe[1];
545  ppar[2]=dpar[0];
546  TString volEnvInoxGasPipe2A0 = GetVolEnvInoxGasPipeName("2", "A", icount, 0);
547  TString volEnvInoxGasPipe2A1 = GetVolEnvInoxGasPipeName("2", "A", icount, 1);
548  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2A0, 0, true,
549  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
550  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2A1, 0, true,
551  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
552  GetEnvelopes(16+icount)
553  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2A0,iVolNum++,3, ppar);
554  GetEnvelopes(16+icount)
555  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2A1,iVolNum++,3, ppar);
556 
557 // 4 vertical
558 
559  spar[0]=dpar[0];
560  spar[1]=fgkSizeSupport2V[1];
561  spar[2]=fgkSizeSupport2V[2];
562  sparysave=spar[1]+fgkSizeSupport2H[1];
563  TString volEnvSuppAng4VA0 = GetVolEnvSuppAngName("4", "V", "A", icount, 0);
564  TString volEnvSuppAng4VA1 = GetVolEnvSuppAngName("4", "V", "A", icount, 1);
565  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VA0, 0, true,
566  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]));
567  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VA1, 0, true,
568  TGeoTranslation(-xEnv,yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
569  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
570 
571  TString volAluAngSupport4V = GetVolAluAngSuppName("4", "V", icount);
572  GetEnvelopes(16+icount)
573  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VA0,iVolNum++,3, spar);
574  GetEnvelopes(16+icount)
575  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VA1,iVolNum++,3, spar);
576 
577 // 4 horizontal
578 
579  spar[0]=dpar[0];
580  spar[1]=fgkSizeSupport2H[1];
581  spar[2]=fgkSizeSupport2H[2];
582  TString volEnvSuppAng4HA0 = GetVolEnvSuppAngName("4", "H", "A", icount, 0);
583  TString volEnvSuppAng4HA1 = GetVolEnvSuppAngName("4", "H", "A", icount, 1);
584  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HA0, 0, true,
585  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]));
586  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HA1, 0, true,
587  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])),
588  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
589 
590  TString volAluAngSupport4H = GetVolAluAngSuppName("4", "H", icount);
591  GetEnvelopes(16+icount)
592  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HA0,iVolNum++,3, spar);
593  GetEnvelopes(16+icount)
594  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HA1,iVolNum++,3, spar);
595 
596 // X horizontal
597  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
598  spar[1]=fgkSizeSupportXH[1];
599  spar[2]=fgkSizeSupportXH[2];
600  Float_t sparysavex=spar[1];
601  TString volEnvSuppAngXHA0 = GetVolEnvSuppAngName("X", "H", "A", icount, 0);
602  TString volEnvSuppAngXHA1 = GetVolEnvSuppAngName("X", "H", "A", icount, 1);
603  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHA0, 0, true,
604  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0,
605  fgkSizeVSupExt[0]+spar[2]));
606  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHA1, 0, true,
607  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0,
608  -(fgkSizeVSupExt[0]+spar[2])),
609  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
610 
611  TString volAluAngSupportXH = GetVolAluAngSuppName("X", "H", icount);
612  GetEnvelopes(16+icount)
613  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHA0,iVolNum++,3, spar);
614  GetEnvelopes(16+icount)
615  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHA1,iVolNum++,3, spar);
616 
617 // X vertical
618  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
619  spar[1]=fgkSizeSupportXV[1];
620  spar[2]=fgkSizeSupportXV[2];
621  TString volEnvSuppAngXVA0 = GetVolEnvSuppAngName("X", "V", "A", icount, 0);
622  TString volEnvSuppAngXVA1 = GetVolEnvSuppAngName("X", "V", "A", icount, 1);
623  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVA0, 0, true,
624  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
625  fgkSizeVSupExt[0]+spar[2]));
626  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVA1, 0, true,
627  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
628  -(fgkSizeVSupExt[0]+spar[2])),
629  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
630 
631  TString volAluAngSupportXV = GetVolAluAngSuppName("X", "V", icount);
632  GetEnvelopes(16+icount)
633  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVA0,iVolNum++,3, spar);
634  GetEnvelopes(16+icount)
635  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVA1,iVolNum++,3, spar);
636 
637  // keep values of yEnvP, yEnvM
638  fYEnvPsave = yEnvP;
639  fYEnvMsave = yEnvM;
640 }
641 
642 //______________________________________________________________________________
643 void AliMUONTriggerGeometryBuilder::BuildChamberTypeB(Int_t& iVolNum, Int_t icount)
644 {
645 // ratio of zpos1m/zpos1p and inverse for first plane
646  Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
647  Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
648  Float_t zpm=1./zmp;
649 
650 // chamber type B (plus envelope chambers B & C)
651  Double_t dpar[3];
652  Double_t spar[3];
653  Double_t ppar[3];
654 
655 // chamber type B
656  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
657  Float_t xEnv = (fgkDXZERO+fgkXMAX/2.)*zRatio;
658  Float_t yEnvP = 0;
659  Float_t yEnvM = 0;
660  yEnvP = (fYEnvMsave + fgkYMIN * zRatio ) * zpm + fgkYMIN * zRatio;
661  yEnvM = (fYEnvPsave + fgkYMIN * zRatio ) * zmp + fgkYMIN * zRatio;
662  dpar[0] = ((fgkXMAX-fgkXMIN)/2.) * zRatio;
663  dpar[1] = ((fgkYMAX-fgkYMIN)/2.) * zRatio;
664  dpar[2] = 0.4;
665  fDYsave = dpar[1];
666  fDXsave = dpar[0];
667  Float_t xpos = fgkXMIN/2. * zRatio;
668  Float_t ypos = (fgkYMIN - fgkYMIN/4.) * zRatio;
669  Float_t xpossave = xpos;
670 
671  Int_t detElemId = (10+icount+1)*100+17;
672  TString volEnv3 = GetVolEnvName(icount, 3);
673  TString volEnv5 = GetVolEnvName(icount, 5);
674  TString volEnv12 = GetVolEnvName(icount, 12);
675  TString volEnv14 = GetVolEnvName(icount, 14);
676  TString volAlu = GetVolumeName("volAlu", icount);
677 
678  GetEnvelopes(16+icount)->AddEnvelope(volEnv3, detElemId, true,
679  TGeoTranslation(xEnv,-yEnvM,fgkZm));
680  detElemId = (10+icount+1)*100+1;
681  GetEnvelopes(16+icount)->AddEnvelope(volEnv5, detElemId, true,
682  TGeoTranslation( xEnv, yEnvM,fgkZm));
683  detElemId = (10+icount+1)*100+10;
684  GetEnvelopes(16+icount)->AddEnvelope(volEnv12, detElemId, true,
685  TGeoTranslation(-xEnv,-yEnvP,fgkZp),
686  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
687  detElemId = (10+icount+1)*100+8;
688  GetEnvelopes(16+icount)->AddEnvelope(volEnv14, detElemId, true,
689  TGeoTranslation(-xEnv, yEnvP,fgkZp),
690  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
691 
692  GetEnvelopes(16+icount)
693  ->AddEnvelopeConstituentParam(volAlu,volEnv3,iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
694  GetEnvelopes(16+icount)
695  ->AddEnvelopeConstituentParam(volAlu,volEnv5,iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
696  GetEnvelopes(16+icount)
697  ->AddEnvelopeConstituentParam(volAlu,volEnv12,iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
698  GetEnvelopes(16+icount)
699  ->AddEnvelopeConstituentParam(volAlu,volEnv14,iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
700 
701 // chamber type C (note: same Z than type B)
702  dpar[0] = (fgkXMAX/2)*zRatio;
703  dpar[1] = (fgkYMAX/2)*zRatio;
704  xpos = 0.;
705  ypos = ((fgkYMAX - fgkYMIN)/2.) * zRatio;
706 
707  GetEnvelopes(16+icount)
708  ->AddEnvelopeConstituentParam(volAlu,volEnv3,iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
709  GetEnvelopes(16+icount)
710  ->AddEnvelopeConstituentParam(volAlu,volEnv5,iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
711  GetEnvelopes(16+icount)
712  ->AddEnvelopeConstituentParam(volAlu,volEnv12,iVolNum++,TGeoTranslation(xpos,-ypos,0.),3,dpar);
713  GetEnvelopes(16+icount)
714  ->AddEnvelopeConstituentParam(volAlu,volEnv14,iVolNum++,TGeoTranslation(xpos, ypos,0.),3,dpar);
715 
716 // horizontal cable support chamber type B+C
717 
718  char volEnvSupportHBC[12][8];
719  for(Int_t jj=0;jj<2;jj++){
720  for(Int_t ii=0;ii<6;ii++){
721  snprintf(volEnvSupportHBC[6*jj+ii],8,"SA%dHB%d",icount+1,6*jj+ii);
722  }
723  }
724 
725  spar[0]=dpar[0]-fgkYVSup[0]/2.;
726  spar[1]=fgkSizeSupportCable[1];
727  spar[2]=fgkSizeSupportCable[2];
728  for(Int_t in=0;in<3;in++){
729  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHBC[in], 0, true,
730  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio,-(yEnvM+(fgkYMAX-fgkYMIN/2.*zRatio)/2.*(in-1)),
731  fgkSizeVSupExt[0]+spar[2]));
732  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHBC[in+3], 0, true,
733  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio, yEnvM+(fgkYMAX-fgkYMIN/2.*zRatio)/2.*(in-1),
734  fgkSizeVSupExt[0]+spar[2]));
735  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHBC[in+6], 0, true,
736  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio),-(yEnvP+(fgkYMAX-fgkYMIN/2.*zRatio)/2.*(in-1)),
737  -(fgkSizeVSupExt[0]+spar[2])),
738  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
739  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHBC[in+9], 0, true,
740  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio), yEnvP+(fgkYMAX-fgkYMIN/2.*zRatio)/2.*(in-1),
741  -(fgkSizeVSupExt[0]+spar[2])),
742  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
743  }
744  for(Int_t ii=0;ii<12;ii++) {
745  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
746  GetEnvelopes(16+icount)
747  ->AddEnvelopeConstituentParam(volAluSupportH,volEnvSupportHBC[ii],iVolNum++,3, spar);
748  }
749 
750 // angular supports chamber type B and C
751 // C
752 // 1 vertical
753  spar[0]=dpar[0];
754  spar[1]=fgkSizeSupport1V[1];
755  spar[2]=fgkSizeSupport1V[2];
756  Float_t sparysave=spar[1];
757 
758  TString volEnvSuppAng1VBC0 = GetVolEnvSuppAngName("1", "V", "B", icount, 0);
759  TString volEnvSuppAng1VBC2 = GetVolEnvSuppAngName("1", "V", "B", icount, 2);
760  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VBC0, 0, true,
761  TGeoTranslation(xEnv,-yEnvM-dpar[1]-fDYsave,fgkZm-dpar[2]-spar[2]));
762  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VBC2, 0, true,
763  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-fDYsave,fgkZp+dpar[2]+spar[2]),
764  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
765 
766  TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
767  GetEnvelopes(16+icount)
768  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VBC0,iVolNum++,3, spar);
769  GetEnvelopes(16+icount)
770  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VBC2,iVolNum++,3, spar);
771 
772 // 1 horizontal
773  spar[0]=dpar[0];
774  spar[1]=fgkSizeSupport1H[1];
775  spar[2]=fgkSizeSupport1H[2];
776 
777  TString volEnvSuppAng1HBC0 = GetVolEnvSuppAngName("1", "H", "B", icount, 0);
778  TString volEnvSuppAng1HBC2 = GetVolEnvSuppAngName("1", "H", "B", icount, 2);
779  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HBC0, 0, true,
780  TGeoTranslation(xEnv,-yEnvM-dpar[1]-fDYsave-sparysave,fgkZm-(dpar[2]-spar[2])));
781  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HBC2, 0, true,
782  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-fDYsave-sparysave,fgkZp+dpar[2]-spar[2]),
783  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
784 
785  TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
786  GetEnvelopes(16+icount)
787  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HBC0,iVolNum++,3, spar);
788  GetEnvelopes(16+icount)
789  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HBC2,iVolNum++,3, spar);
790 
791 // gas pipe (low)
792  ppar[0]=fgkSizeGasPipe[0];
793  ppar[1]=fgkSizeGasPipe[1];
794  ppar[2]=dpar[0];
795  TString volEnvInoxGasPipe1BC0 = GetVolEnvInoxGasPipeName("1", "BC", icount, 0);
796  TString volEnvInoxGasPipe1BC2 = GetVolEnvInoxGasPipeName("1", "BC", icount, 2);
797  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1BC0, 0, true,
798  TGeoTranslation(xEnv,-yEnvM-dpar[1]-fDYsave-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
799  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1BC2, 0, true,
800  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-fDYsave-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
801  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
802  GetEnvelopes(16+icount)
803  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1BC0,iVolNum++,3, ppar);
804  GetEnvelopes(16+icount)
805  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1BC2,iVolNum++,3, ppar);
806 
807 // 2 vertical
808  spar[0]=dpar[0];
809  spar[1]=fgkSizeSupport2V[1];
810  spar[2]=fgkSizeSupport2V[2];
811  sparysave=spar[1]+fgkSizeSupport2H[1];
812  TString volEnvSuppAng2VBC0 = GetVolEnvSuppAngName("2", "V", "B", icount, 0);
813  TString volEnvSuppAng2VBC2 = GetVolEnvSuppAngName("2", "V", "B", icount, 2);
814  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VBC0, 0, true,
815  TGeoTranslation(xEnv,-yEnvM-dpar[1]-fDYsave,-(fgkSizeVSupExt[0]+spar[2])));
816  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VBC2, 0, true,
817  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-fDYsave,fgkSizeVSupExt[0]+spar[2]),
818  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
819 
820  TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
821  GetEnvelopes(16+icount)
822  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VBC0,iVolNum++,3, spar);
823  GetEnvelopes(16+icount)
824  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VBC2,iVolNum++,3, spar);
825 
826 // 2 horizontal
827  spar[0]=dpar[0];
828  spar[1]=fgkSizeSupport2H[1];
829  spar[2]=fgkSizeSupport2H[2];
830  TString volEnvSuppAng2HBC0 = GetVolEnvSuppAngName("2", "H", "B", icount, 0);
831  TString volEnvSuppAng2HBC2 = GetVolEnvSuppAngName("2", "H", "B", icount, 2);
832  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HBC0, 0, true,
833  TGeoTranslation(xEnv,-yEnvM-dpar[1]-fDYsave-sparysave,-(fgkSizeVSupExt[0]+spar[2])));
834  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HBC2, 0, true,
835  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-fDYsave-sparysave,fgkSizeVSupExt[0]+spar[2]),
836  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
837 
838  TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
839  GetEnvelopes(16+icount)
840  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HBC0,iVolNum++,3, spar);
841  GetEnvelopes(16+icount)
842  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HBC2,iVolNum++,3, spar);
843 
844 // 3 vertical
845  spar[0]=fDXsave-fgkAvoidExtrusion;
846  spar[1]=fgkSizeSupport1V[1];
847  spar[2]=fgkSizeSupport1V[2];
848  sparysave=spar[1];
849  TString volEnvSuppAng3VBC0 = GetVolEnvSuppAngName("3", "V", "B", icount, 0);
850  TString volEnvSuppAng3VBC2 = GetVolEnvSuppAngName("3", "V", "B", icount, 2);
851  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VBC0, 0, true,
852  TGeoTranslation(xEnv+xpossave,-yEnvM+dpar[1]+fDYsave,fgkZm-dpar[2]-spar[2]));
853  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VBC2, 0, true,
854  TGeoTranslation(-xEnv-xpossave,-yEnvP+dpar[1]+fDYsave,fgkZp+dpar[2]+spar[2]),
855  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
856 
857  TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
858  GetEnvelopes(16+icount)
859  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VBC0,iVolNum++,3, spar);
860  GetEnvelopes(16+icount)
861  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VBC2,iVolNum++,3, spar);
862 
863 // 3 horizontal
864  spar[0]=fDXsave-fgkAvoidExtrusion;
865  spar[1]=fgkSizeSupport1H[1];
866  spar[2]=fgkSizeSupport1H[2];
867  TString volEnvSuppAng3HBC0 = GetVolEnvSuppAngName("3", "H", "B", icount, 0);
868  TString volEnvSuppAng3HBC2 = GetVolEnvSuppAngName("3", "H", "B", icount, 2);
869  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HBC0, 0, true,
870  TGeoTranslation(xEnv+xpossave,-yEnvM+dpar[1]+fDYsave+sparysave,fgkZm-(dpar[2]-spar[2])));
871  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HBC2, 0, true,
872  TGeoTranslation(-xEnv-xpossave,-yEnvP+dpar[1]+fDYsave+sparysave,fgkZp+dpar[2]-spar[2]),
873  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
874 
875  TString volAluAngSupport3H = GetVolAluAngSuppName("3", "H", icount);
876  GetEnvelopes(16+icount)
877  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HBC0,iVolNum++,3, spar);
878  GetEnvelopes(16+icount)
879  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HBC2,iVolNum++,3, spar);
880 
881 // gas pipe (high)
882  ppar[0]=fgkSizeGasPipe[0];
883  ppar[1]=fgkSizeGasPipe[1];
884  ppar[2]=fDXsave-fgkAvoidExtrusion;
885  TString volEnvInoxGasPipe2BC0 = GetVolEnvInoxGasPipeName("2", "BC", icount, 0);
886  TString volEnvInoxGasPipe2BC2 = GetVolEnvInoxGasPipeName("2", "BC", icount, 2);
887  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2BC0, 0, true,
888  TGeoTranslation(xEnv+xpossave,-yEnvM+dpar[1]+fDYsave+sparysave+fgkOffsetGasPipe,fgkZm),
889  fRsupportpipe);
890  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2BC2, 0, true,
891  TGeoTranslation(-xEnv-xpossave,-yEnvP+dpar[1]+fDYsave+sparysave+fgkOffsetGasPipe,fgkZp),
892  fRsupportpipe);
893  GetEnvelopes(16+icount)
894  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2BC0,iVolNum++,3, ppar);
895  GetEnvelopes(16+icount)
896  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2BC2,iVolNum++,3, ppar);
897 
898 // 4 vertical
899  spar[0]=fDXsave-fgkAvoidExtrusion;
900  spar[1]=fgkSizeSupport2V[1];
901  spar[2]=fgkSizeSupport2V[2];
902  sparysave=spar[1]+fgkSizeSupport2H[1];
903  TString volEnvSuppAng4VBC0 = GetVolEnvSuppAngName("4", "V", "B", icount, 0);
904  TString volEnvSuppAng4VBC2 = GetVolEnvSuppAngName("4", "V", "B", icount, 2);
905  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VBC0, 0, true,
906  TGeoTranslation(xEnv+xpossave,-yEnvM+dpar[1]+fDYsave,-(fgkSizeVSupExt[0]+spar[2])));
907  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VBC2, 0, true,
908  TGeoTranslation(-xEnv-xpossave,-yEnvP+dpar[1]+fDYsave,fgkSizeVSupExt[0]+spar[2]),
909  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
910 
911  TString volAluAngSupport4V = GetVolAluAngSuppName("4", "V", icount);
912  GetEnvelopes(16+icount)
913  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VBC0,iVolNum++,3, spar);
914  GetEnvelopes(16+icount)
915  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VBC2,iVolNum++,3, spar);
916 
917 // 4 horizontal
918  spar[0]=fDXsave-fgkAvoidExtrusion;
919  spar[1]=fgkSizeSupport2H[1];
920  spar[2]=fgkSizeSupport2H[2];
921  TString volEnvSuppAng4HBC0 = GetVolEnvSuppAngName("4", "H", "B", icount, 0);
922  TString volEnvSuppAng4HBC2 = GetVolEnvSuppAngName("4", "H", "B", icount, 2);
923  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HBC0, 0, true,
924  TGeoTranslation(xEnv+xpossave,-yEnvM+dpar[1]+fDYsave+sparysave,-(fgkSizeVSupExt[0]+spar[2])));
925  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HBC2, 0, true,
926  TGeoTranslation(-xEnv-xpossave,-yEnvP+dpar[1]+fDYsave+sparysave,fgkSizeVSupExt[0]+spar[2]),
927  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
928 
929  TString volAluAngSupport4H = GetVolAluAngSuppName("4", "H", icount);
930  GetEnvelopes(16+icount)
931  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HBC0,iVolNum++,3, spar);
932  GetEnvelopes(16+icount)
933  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HBC2,iVolNum++,3, spar);
934 
935 // X horizontal
936  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
937  spar[1]=fgkSizeSupportXH[1];
938  spar[2]=fgkSizeSupportXH[2];
939  Float_t sparysavex=spar[1];
940  TString volEnvSuppAngXHBC0 = GetVolEnvSuppAngName("X", "H", "B", icount, 0);
941  TString volEnvSuppAngXHBC2 = GetVolEnvSuppAngName("X", "H", "B", icount, 2);
942  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHBC0, 0, true,
943  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvM+dpar[1]+fDYsave+sparysave+1.0,
944  -(fgkSizeVSupExt[0]+spar[2])));
945  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHBC2, 0, true,
946  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvP+dpar[1]+fDYsave+sparysave+1.0,
947  fgkSizeVSupExt[0]+spar[2]),
948  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
949 
950  TString volAluAngSupportXH = GetVolAluAngSuppName("X", "H", icount);
951  GetEnvelopes(16+icount)
952  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHBC0,iVolNum++,3, spar);
953  GetEnvelopes(16+icount)
954  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHBC2,iVolNum++,3, spar);
955 // X vertical
956  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
957  spar[1]=fgkSizeSupportXV[1];
958  spar[2]=fgkSizeSupportXV[2];
959  TString volEnvSuppAngXVBC0 = GetVolEnvSuppAngName("X", "V", "B", icount, 0);
960  TString volEnvSuppAngXVBC2 = GetVolEnvSuppAngName("X", "V", "B", icount, 2);
961  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVBC0, 0, true,
962  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,
963  -yEnvM+dpar[1]+fDYsave+sparysave+1.0+sparysavex+spar[1],
964  -(fgkSizeVSupExt[0]+spar[2])));
965  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVBC2, 0, true,
966  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),
967  -yEnvP+dpar[1]+fDYsave+sparysave+1.0+sparysavex+spar[1],
968  fgkSizeVSupExt[0]+spar[2]),
969  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
970 
971  TString volAluAngSupportXV = GetVolAluAngSuppName("X", "V", icount);
972  GetEnvelopes(16+icount)
973  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVBC0,iVolNum++,3, spar);
974  GetEnvelopes(16+icount)
975  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVBC2,iVolNum++,3, spar);
976 
977 // B
978 // 1 vertical
979  spar[0]=fDXsave-fgkAvoidExtrusion;
980  spar[1]=fgkSizeSupport1V[1];
981  spar[2]=fgkSizeSupport1V[2];
982  sparysave=spar[1];
983  TString volEnvSuppAng1VBC1 = GetVolEnvSuppAngName("1", "V", "B", icount, 1);
984  TString volEnvSuppAng1VBC3 = GetVolEnvSuppAngName("1", "V", "B", icount, 3);
985  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VBC1, 0, true,
986  TGeoTranslation(xEnv+xpossave,yEnvM-dpar[1]-fDYsave,fgkZm-dpar[2]-spar[2]));
987  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VBC3, 0, true,
988  TGeoTranslation(-xEnv-xpossave,yEnvP-dpar[1]-fDYsave,fgkZp+dpar[2]+spar[2]),
989  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
990  //TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
991  GetEnvelopes(16+icount)
992  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VBC1,iVolNum++,3, spar);
993  GetEnvelopes(16+icount)
994  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VBC3,iVolNum++,3, spar);
995 
996 
997 // 1 horizontal
998  spar[0]=fDXsave-fgkAvoidExtrusion;
999  spar[1]=fgkSizeSupport1H[1];
1000  spar[2]=fgkSizeSupport1H[2];
1001 
1002  TString volEnvSuppAng1HBC1 = GetVolEnvSuppAngName("1", "H", "B", icount, 1);
1003  TString volEnvSuppAng1HBC3 = GetVolEnvSuppAngName("1", "H", "B", icount, 3);
1004  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HBC1, 0, true,
1005  TGeoTranslation(xEnv+xpossave,yEnvM-dpar[1]-fDYsave-sparysave,fgkZm-(dpar[2]-spar[2])));
1006  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HBC3, 0, true,
1007  TGeoTranslation(-xEnv-xpossave,yEnvP-dpar[1]-fDYsave-sparysave,fgkZp+dpar[2]-spar[2]),
1008  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1009 
1010  //TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
1011  GetEnvelopes(16+icount)
1012  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HBC1,iVolNum++,3, spar);
1013  GetEnvelopes(16+icount)
1014  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HBC3,iVolNum++,3, spar);
1015 
1016 // gas pipe (low)
1017  ppar[0]=fgkSizeGasPipe[0];
1018  ppar[1]=fgkSizeGasPipe[1];
1019  ppar[2]=fDXsave-fgkAvoidExtrusion;
1020  TString volEnvInoxGasPipe1BC1 = GetVolEnvInoxGasPipeName("1", "BC", icount, 1);
1021  TString volEnvInoxGasPipe1BC3 = GetVolEnvInoxGasPipeName("1", "BC", icount, 3);
1022  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1BC1, 0, true,
1023  TGeoTranslation(xEnv+xpossave,yEnvM-dpar[1]-fDYsave-sparysave-fgkOffsetGasPipe,fgkZm),
1024  fRsupportpipe);
1025  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1BC3, 0, true,
1026  TGeoTranslation(-xEnv-xpossave,yEnvP-dpar[1]-fDYsave-sparysave-fgkOffsetGasPipe,fgkZp),
1027  fRsupportpipe);
1028  GetEnvelopes(16+icount)
1029  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1BC1,iVolNum++,3, ppar);
1030  GetEnvelopes(16+icount)
1031  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1BC3,iVolNum++,3, ppar);
1032 
1033 // 2 vertical
1034  spar[0]=fDXsave-fgkAvoidExtrusion;
1035  spar[1]=fgkSizeSupport2V[1];
1036  spar[2]=fgkSizeSupport2V[2];
1037  sparysave=spar[1]+fgkSizeSupport2H[1];
1038  TString volEnvSuppAng2VBC1 = GetVolEnvSuppAngName("2", "V", "B", icount, 1);
1039  TString volEnvSuppAng2VBC3 = GetVolEnvSuppAngName("2", "V", "B", icount, 3);
1040  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VBC1, 0, true,
1041  TGeoTranslation(xEnv+xpossave,yEnvM-dpar[1]-fDYsave,-(fgkSizeVSupExt[0]+spar[2])));
1042  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VBC3, 0, true,
1043  TGeoTranslation(-xEnv-xpossave,yEnvP-dpar[1]-fDYsave,fgkSizeVSupExt[0]+spar[2]),
1044  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1045 
1046  //TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
1047  GetEnvelopes(16+icount)
1048  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VBC1,iVolNum++,3, spar);
1049  GetEnvelopes(16+icount)
1050  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VBC3,iVolNum++,3, spar);
1051 // 2 horizontal
1052  spar[0]=fDXsave-fgkAvoidExtrusion;
1053  spar[1]=fgkSizeSupport2H[1];
1054  spar[2]=fgkSizeSupport2H[2];
1055  TString volEnvSuppAng2HBC1 = GetVolEnvSuppAngName("2", "H", "B", icount, 1);
1056  TString volEnvSuppAng2HBC3 = GetVolEnvSuppAngName("2", "H", "B", icount, 3);
1057  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HBC1, 0, true,
1058  TGeoTranslation(xEnv+xpossave,yEnvM-dpar[1]-fDYsave-sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1059  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HBC3, 0, true,
1060  TGeoTranslation(-xEnv-xpossave,yEnvP-dpar[1]-fDYsave-sparysave,fgkSizeVSupExt[0]+spar[2]),
1061  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1062 
1063  //TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
1064  GetEnvelopes(16+icount)
1065  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HBC1,iVolNum++,3, spar);
1066  GetEnvelopes(16+icount)
1067  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HBC3,iVolNum++,3, spar);
1068 
1069 // 3 vertical
1070  spar[0]=dpar[0];
1071  spar[1]=fgkSizeSupport1V[1];
1072  spar[2]=fgkSizeSupport1V[2];
1073  sparysave=spar[1];
1074  TString volEnvSuppAng3VBC1 = GetVolEnvSuppAngName("3", "V", "B", icount, 1);
1075  TString volEnvSuppAng3VBC3 = GetVolEnvSuppAngName("3", "V", "B", icount, 3);
1076  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VBC1, 0, true,
1077  TGeoTranslation(xEnv,yEnvM+dpar[1]+fDYsave,fgkZm-dpar[2]-spar[2]));
1078  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VBC3, 0, true,
1079  TGeoTranslation(-xEnv,yEnvP+dpar[1]+fDYsave,fgkZp+dpar[2]+spar[2]),
1080  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1081 
1082  //TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
1083  GetEnvelopes(16+icount)
1084  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VBC1,iVolNum++,3, spar);
1085  GetEnvelopes(16+icount)
1086  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VBC3,iVolNum++,3, spar);
1087 
1088 // 3 horizontal
1089  spar[1]=fgkSizeSupport1H[1];
1090  spar[2]=fgkSizeSupport1H[2];
1091 
1092  TString volEnvSuppAng3HBC1 = GetVolEnvSuppAngName("3", "H", "B", icount, 1);
1093  TString volEnvSuppAng3HBC3 = GetVolEnvSuppAngName("3", "H", "B", icount, 3);
1094  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HBC1, 0, true,
1095  TGeoTranslation(xEnv,yEnvM+dpar[1]+fDYsave+sparysave,fgkZm-(dpar[2]-spar[2])));
1096  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HBC3, 0, true,
1097  TGeoTranslation(-xEnv,yEnvP+dpar[1]+fDYsave+sparysave,fgkZp+dpar[2]-spar[2]),
1098  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1099 
1100  GetEnvelopes(16+icount)
1101  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HBC1,iVolNum++,3, spar);
1102  GetEnvelopes(16+icount)
1103  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HBC3,iVolNum++,3, spar);
1104 
1105 // gas pipe (high)
1106  ppar[0]=fgkSizeGasPipe[0];
1107  ppar[1]=fgkSizeGasPipe[1];
1108  ppar[2]=dpar[0];
1109  TString volEnvInoxGasPipe2BC1 = GetVolEnvInoxGasPipeName("2", "BC", icount, 1);
1110  TString volEnvInoxGasPipe2BC3 = GetVolEnvInoxGasPipeName("2", "BC", icount, 3);
1111  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2BC1, 0, true,
1112  TGeoTranslation(xEnv,yEnvM+dpar[1]+fDYsave+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1113  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2BC3, 0, true,
1114  TGeoTranslation(-xEnv,yEnvP+dpar[1]+fDYsave+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1115  GetEnvelopes(16+icount)
1116  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2BC1,iVolNum++,3, ppar);
1117  GetEnvelopes(16+icount)
1118  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2BC3,iVolNum++,3, ppar);
1119 
1120 // 4 vertical
1121  spar[0]=dpar[0];
1122  spar[1]=fgkSizeSupport2V[1];
1123  spar[2]=fgkSizeSupport2V[2];
1124  sparysave=spar[1]+fgkSizeSupport2H[1];
1125  TString volEnvSuppAng4VBC1 = GetVolEnvSuppAngName("4", "V", "B", icount, 1);
1126  TString volEnvSuppAng4VBC3 = GetVolEnvSuppAngName("4", "V", "B", icount, 3);
1127  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VBC1, 0, true,
1128  TGeoTranslation(xEnv,yEnvM+dpar[1]+fDYsave,-(fgkSizeVSupExt[0]+spar[2])));
1129  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VBC3, 0, true,
1130  TGeoTranslation(-xEnv,yEnvP+dpar[1]+fDYsave,fgkSizeVSupExt[0]+spar[2]),
1131  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1132 
1133  GetEnvelopes(16+icount)
1134  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VBC1,iVolNum++,3, spar);
1135  GetEnvelopes(16+icount)
1136  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VBC3,iVolNum++,3, spar);
1137 
1138 // 4 horizontal
1139  spar[1]=fgkSizeSupport2H[1];
1140  spar[2]=fgkSizeSupport2H[2];
1141  TString volEnvSuppAng4HBC1 = GetVolEnvSuppAngName("4", "H", "B", icount, 1);
1142  TString volEnvSuppAng4HBC3 = GetVolEnvSuppAngName("4", "H", "B", icount, 3);
1143  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HBC1, 0, true,
1144  TGeoTranslation(xEnv,yEnvM+dpar[1]+fDYsave+sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1145  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HBC3, 0, true,
1146  TGeoTranslation(-xEnv,yEnvP+dpar[1]+fDYsave+sparysave,fgkSizeVSupExt[0]+spar[2]),
1147  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1148 
1149  GetEnvelopes(16+icount)
1150  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HBC1,iVolNum++,3, spar);
1151  GetEnvelopes(16+icount)
1152  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HBC3,iVolNum++,3, spar);
1153 
1154 // X horizontal
1155  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1156  spar[1]=fgkSizeSupportXH[1];
1157  spar[2]=fgkSizeSupportXH[2];
1158  sparysavex=spar[1];
1159  TString volEnvSuppAngXHBC1 = GetVolEnvSuppAngName("X", "H", "B", icount, 1);
1160  TString volEnvSuppAngXHBC3 = GetVolEnvSuppAngName("X", "H", "B", icount, 3);
1161  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHBC1, 0, true,
1162  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvM+dpar[1]+fDYsave+sparysave+1.0,
1163  -(fgkSizeVSupExt[0]+spar[2])));
1164  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHBC3, 0, true,
1165  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvP+dpar[1]+fDYsave+sparysave+1.0,
1166  fgkSizeVSupExt[0]+spar[2]),
1167  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1168 
1169  GetEnvelopes(16+icount)
1170  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHBC1,iVolNum++,3, spar);
1171  GetEnvelopes(16+icount)
1172  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHBC3,iVolNum++,3, spar);
1173 
1174 // X vertical
1175  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1176  spar[1]=fgkSizeSupportXV[1];
1177  spar[2]=fgkSizeSupportXV[2];
1178  TString volEnvSuppAngXVBC1 = GetVolEnvSuppAngName("X", "V", "B", icount, 1);
1179  TString volEnvSuppAngXVBC3 = GetVolEnvSuppAngName("X", "V", "B", icount, 3);
1180  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVBC1, 0, true,
1181  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,
1182  yEnvM+dpar[1]+fDYsave+sparysave+1.0+sparysavex+spar[1],-(fgkSizeVSupExt[0]+spar[2])));
1183  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVBC3, 0, true,
1184  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),
1185  yEnvP+dpar[1]+fDYsave+sparysave+1.0+sparysavex+spar[1],fgkSizeVSupExt[0]+spar[2]),
1186  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1187 
1188  GetEnvelopes(16+icount)
1189  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVBC1,iVolNum++,3, spar);
1190  GetEnvelopes(16+icount)
1191  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVBC3,iVolNum++,3, spar);
1192 
1193  // keep values of yEnvP, yEnvM
1194  fYEnvPsave = yEnvP;
1195  fYEnvMsave = yEnvM;
1196 }
1197 
1198 //______________________________________________________________________________
1199 void AliMUONTriggerGeometryBuilder::BuildChamberTypeD(Int_t& iVolNum, Int_t icount)
1200 {
1201 // ratio of zpos1m/zpos1p and inverse for first plane
1202  Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
1203  Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1204  Float_t zpm=1./zmp;
1205  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
1206  Float_t xEnv = (fgkDXZERO+fgkXMAX/2.)*zRatio;
1207 
1208  Double_t dpar[3];
1209  Double_t spar[3];
1210  Double_t ppar[3];
1211 
1212 // D
1213  Float_t yEnvP = 0;
1214  Float_t yEnvM = 0;
1215  yEnvP = (fYEnvMsave + fgkYMIN * zRatio ) * zpm + fgkYMIN * zRatio;
1216  yEnvM = (fYEnvPsave + fgkYMIN * zRatio ) * zmp + fgkYMIN * zRatio;
1217  dpar[0] = (fgkXMAX/2.)*zRatio;
1218  dpar[1] = fgkYMIN*zRatio;
1219  dpar[2] = 0.4;
1220 
1221  Int_t detElemId = (10+icount+1)*100+16;
1222  TString volEnv2 = GetVolEnvName(icount, 2);
1223  TString volEnv6 = GetVolEnvName(icount, 6);
1224  TString volEnv11 = GetVolEnvName(icount, 11);
1225  TString volEnv15 = GetVolEnvName(icount, 15);
1226  TString volAlu = GetVolumeName("volAlu", icount);
1227 
1228  GetEnvelopes(16+icount)
1229  ->AddEnvelope(volEnv2, detElemId, true, TGeoTranslation(xEnv,-yEnvP,fgkZp));
1230  detElemId = (10+icount+1)*100+2;
1231  GetEnvelopes(16+icount)
1232  ->AddEnvelope(volEnv6, detElemId, true, TGeoTranslation(xEnv, yEnvP,fgkZp));
1233  detElemId = (10+icount+1)*100+11;
1234  GetEnvelopes(16+icount)
1235  ->AddEnvelope(volEnv11, detElemId, true, TGeoTranslation(-xEnv,-yEnvM,fgkZm),
1236  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1237  detElemId = (10+icount+1)*100+7;
1238  GetEnvelopes(16+icount)
1239  ->AddEnvelope(volEnv15, detElemId, true, TGeoTranslation(-xEnv, yEnvM,fgkZm),
1240  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1241 
1242  GetEnvelopes(16+icount)
1243  ->AddEnvelopeConstituentParam(volAlu,volEnv2,iVolNum++,3, dpar);
1244  GetEnvelopes(16+icount)
1245  ->AddEnvelopeConstituentParam(volAlu,volEnv6,iVolNum++,3, dpar);
1246  GetEnvelopes(16+icount)
1247  ->AddEnvelopeConstituentParam(volAlu,volEnv11,iVolNum++,3, dpar);
1248  GetEnvelopes(16+icount)
1249  ->AddEnvelopeConstituentParam(volAlu,volEnv15,iVolNum++,3, dpar);
1250 
1251 // horizontal cable support chamber type D
1252 
1253  char volEnvSupportHD[12][8];
1254  for(Int_t jj=0;jj<2;jj++){
1255  for(Int_t ii=0;ii<6;ii++){
1256  snprintf(volEnvSupportHD[6*jj+ii],8,"SA%dHD%d",icount+1,6*jj+ii);
1257  }
1258  }
1259 
1260  spar[0]=dpar[0]-(fgkYVSup[0]/2.)*zRatio;
1261  spar[1]=fgkSizeSupportCable[1];
1262  spar[2]=fgkSizeSupportCable[2];
1263  for(Int_t in=0;in<3;in++){
1264  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHD[in], 0, true,
1265  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio,-(yEnvP+dpar[1]/2.*(in-1)),
1266  -(fgkSizeVSupExt[0]+spar[2])));
1267  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHD[in+3], 0, true,
1268  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio, yEnvP+dpar[1]/2.*(in-1),
1269  -(fgkSizeVSupExt[0]+spar[2])));
1270  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHD[in+6], 0, true,
1271  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio),-(yEnvM+dpar[1]/2.*(in-1)),
1272  fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1273  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHD[in+9], 0, true,
1274  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio),yEnvM+dpar[1]/2.*(in-1),
1275  fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1276  }
1277  for(Int_t ii=0;ii<12;ii++) {
1278  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
1279  GetEnvelopes(16+icount)
1280  ->AddEnvelopeConstituentParam(volAluSupportH,volEnvSupportHD[ii],iVolNum++,3, spar);
1281  }
1282 
1283 // angular supports chamber type D
1284 // 1 vertical
1285 
1286  spar[0]=dpar[0];
1287  spar[1]=fgkSizeSupport1V[1];
1288  spar[2]=fgkSizeSupport1V[2];
1289  Double_t sparysave=spar[1];
1290 
1291  TString volEnvSuppAng1VD[4];
1292  volEnvSuppAng1VD[0] = GetVolEnvSuppAngName("1", "V", "D", icount, 0);
1293  volEnvSuppAng1VD[1] = GetVolEnvSuppAngName("1", "V", "D", icount, 1);
1294  volEnvSuppAng1VD[2] = GetVolEnvSuppAngName("1", "V", "D", icount, 2);
1295  volEnvSuppAng1VD[3] = GetVolEnvSuppAngName("1", "V", "D", icount, 3);
1296 
1297  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VD[0], 0, true,
1298  TGeoTranslation(xEnv,-yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]));
1299  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VD[1], 0, true,
1300  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]));
1301  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VD[2], 0, true,
1302  TGeoTranslation(-xEnv,-yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]),
1303  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1304  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VD[3], 0, true,
1305  TGeoTranslation(-xEnv,yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]),
1306  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1307 
1308 
1309  TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
1310  for (Int_t i=0;i<4;i++)
1311  GetEnvelopes(16+icount)
1312  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VD[i],iVolNum++,3, spar);
1313 
1314 
1315 // 1 horizontal
1316 
1317  spar[0]=dpar[0];
1318  spar[1]=fgkSizeSupport1H[1];
1319  spar[2]=fgkSizeSupport1H[2];
1320 
1321  TString volEnvSuppAng1HD[4];
1322  volEnvSuppAng1HD[0] = GetVolEnvSuppAngName("1", "H", "D", icount, 0);
1323  volEnvSuppAng1HD[1] = GetVolEnvSuppAngName("1", "H", "D", icount, 1);
1324  volEnvSuppAng1HD[2] = GetVolEnvSuppAngName("1", "H", "D", icount, 2);
1325  volEnvSuppAng1HD[3] = GetVolEnvSuppAngName("1", "H", "D", icount, 3);
1326 
1327  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HD[0], 0, true,
1328  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]));
1329  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HD[1], 0, true,
1330  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]));
1331  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HD[2], 0, true,
1332  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])),
1333  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1334  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HD[3], 0, true,
1335  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])),
1336  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1337 
1338  TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
1339  for (Int_t i=0;i<4;i++)
1340  GetEnvelopes(16+icount)
1341  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HD[i],iVolNum++,3, spar);
1342 
1343 // gas pipe (low)
1344  ppar[0]=fgkSizeGasPipe[0];
1345  ppar[1]=fgkSizeGasPipe[1];
1346  ppar[2]=dpar[0];
1347  TString volEnvInoxGasPipe1D[4];
1348  volEnvInoxGasPipe1D[0] = GetVolEnvInoxGasPipeName("1", "D", icount, 0);
1349  volEnvInoxGasPipe1D[1] = GetVolEnvInoxGasPipeName("1", "D", icount, 1);
1350  volEnvInoxGasPipe1D[2] = GetVolEnvInoxGasPipeName("1", "D", icount, 2);
1351  volEnvInoxGasPipe1D[3] = GetVolEnvInoxGasPipeName("1", "D", icount, 3);
1352  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1D[0], 0, true,
1353  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1354  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1D[1], 0, true,
1355  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1356  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1D[2], 0, true,
1357  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1358  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1D[3], 0, true,
1359  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1360 
1361  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
1362  for (Int_t i=0;i<4;i++)
1363  GetEnvelopes(16+icount)
1364  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1D[i],iVolNum++,3, ppar);
1365 
1366 // 2 vertical
1367 
1368  spar[0]=dpar[0];
1369  spar[1]=fgkSizeSupport2V[1];
1370  spar[2]=fgkSizeSupport2V[2];
1371  sparysave=spar[1]+fgkSizeSupport2H[1];
1372  TString volEnvSuppAng2VD[4];
1373  volEnvSuppAng2VD[0] = GetVolEnvSuppAngName("2", "V", "D", icount, 0);
1374  volEnvSuppAng2VD[1] = GetVolEnvSuppAngName("2", "V", "D", icount, 1);
1375  volEnvSuppAng2VD[2] = GetVolEnvSuppAngName("2", "V", "D", icount, 2);
1376  volEnvSuppAng2VD[3] = GetVolEnvSuppAngName("2", "V", "D", icount, 3);
1377 
1378  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VD[0], 0, true,
1379  TGeoTranslation(xEnv,-yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]));
1380  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VD[1], 0, true,
1381  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]));
1382  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VD[2], 0, true,
1383  TGeoTranslation(-xEnv,-yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
1384  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1385  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VD[3], 0, true,
1386  TGeoTranslation(-xEnv,yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
1387  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1388 
1389  TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
1390  for (Int_t i=0;i<4;i++)
1391  GetEnvelopes(16+icount)
1392  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VD[i],iVolNum++,3, spar);
1393 
1394 // 2 horizontal
1395 
1396  spar[0]=dpar[0];
1397  spar[1]=fgkSizeSupport2H[1];
1398  spar[2]=fgkSizeSupport2H[2];
1399  TString volEnvSuppAng2HD[4];
1400  volEnvSuppAng2HD[0] = GetVolEnvSuppAngName("2", "H", "D", icount, 0);
1401  volEnvSuppAng2HD[1] = GetVolEnvSuppAngName("2", "H", "D", icount, 1);
1402  volEnvSuppAng2HD[2] = GetVolEnvSuppAngName("2", "H", "D", icount, 2);
1403  volEnvSuppAng2HD[3] = GetVolEnvSuppAngName("2", "H", "D", icount, 3);
1404 
1405  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HD[0], 0, true,
1406  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]));
1407  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HD[1], 0, true,
1408  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]));
1409  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HD[2], 0, true,
1410  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])),
1411  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1412  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HD[3], 0, true,
1413  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])),
1414  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1415 
1416  TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
1417  for (Int_t i=0;i<4;i++)
1418  GetEnvelopes(16+icount)
1419  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HD[i],iVolNum++,3, spar);
1420 
1421 // 3 vertical
1422 
1423  spar[0]=dpar[0];
1424  spar[1]=fgkSizeSupport1V[1];
1425  spar[2]=fgkSizeSupport1V[2];
1426  sparysave=spar[1];
1427  TString volEnvSuppAng3VD[4];
1428  volEnvSuppAng3VD[0] = GetVolEnvSuppAngName("3", "V", "D", icount, 0);
1429  volEnvSuppAng3VD[1] = GetVolEnvSuppAngName("3", "V", "D", icount, 1);
1430  volEnvSuppAng3VD[2] = GetVolEnvSuppAngName("3", "V", "D", icount, 2);
1431  volEnvSuppAng3VD[3] = GetVolEnvSuppAngName("3", "V", "D", icount, 3);
1432 
1433  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VD[0], 0, true,
1434  TGeoTranslation(xEnv,-yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]));
1435  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VD[1], 0, true,
1436  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]));
1437  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VD[2], 0, true,
1438  TGeoTranslation(-xEnv,-yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]),
1439  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1440  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VD[3], 0, true,
1441  TGeoTranslation(-xEnv,yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]),
1442  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1443 
1444  TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
1445  for (Int_t i=0;i<4;i++)
1446  GetEnvelopes(16+icount)
1447  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VD[i],iVolNum++,3, spar);
1448 
1449 
1450 // 3 horizontal
1451 
1452  spar[0]=dpar[0];
1453  spar[1]=fgkSizeSupport1H[1];
1454  spar[2]=fgkSizeSupport1H[2];
1455  TString volEnvSuppAng3HD[4];
1456  volEnvSuppAng3HD[0] = GetVolEnvSuppAngName("3", "H", "D", icount, 0);
1457  volEnvSuppAng3HD[1] = GetVolEnvSuppAngName("3", "H", "D", icount, 1);
1458  volEnvSuppAng3HD[2] = GetVolEnvSuppAngName("3", "H", "D", icount, 2);
1459  volEnvSuppAng3HD[3] = GetVolEnvSuppAngName("3", "H", "D", icount, 3);
1460 
1461  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HD[0], 0, true,
1462  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]));
1463  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HD[1], 0, true,
1464  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]));
1465  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HD[2], 0, true,
1466  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])),
1467  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1468  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HD[3], 0, true,
1469  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])),
1470  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1471 
1472  TString volAluAngSupport3H = GetVolAluAngSuppName("3", "H", icount);
1473  for (Int_t i=0;i<4;i++)
1474  GetEnvelopes(16+icount)
1475  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HD[i],iVolNum++,3, spar);
1476 
1477 // gas pipe (high)
1478  ppar[0]=fgkSizeGasPipe[0];
1479  ppar[1]=fgkSizeGasPipe[1];
1480  ppar[2]=dpar[0];
1481  TString volEnvInoxGasPipe2D[4];
1482  volEnvInoxGasPipe2D[0] = GetVolEnvInoxGasPipeName("2", "D", icount, 0);
1483  volEnvInoxGasPipe2D[1] = GetVolEnvInoxGasPipeName("2", "D", icount, 1);
1484  volEnvInoxGasPipe2D[2] = GetVolEnvInoxGasPipeName("2", "D", icount, 2);
1485  volEnvInoxGasPipe2D[3] = GetVolEnvInoxGasPipeName("2", "D", icount, 3);
1486  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2D[0], 0, true,
1487  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1488  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2D[1], 0, true,
1489  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1490  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2D[2], 0, true,
1491  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1492  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2D[3], 0, true,
1493  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1494 
1495  for (Int_t i=0;i<4;i++)
1496  GetEnvelopes(16+icount)
1497  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2D[i],iVolNum++,3, ppar);
1498 
1499 // 4 vertical
1500 
1501  spar[0]=dpar[0];
1502  spar[1]=fgkSizeSupport2V[1];
1503  spar[2]=fgkSizeSupport2V[2];
1504  sparysave=spar[1]+fgkSizeSupport2H[1];
1505  TString volEnvSuppAng4VD[4];
1506  volEnvSuppAng4VD[0] = GetVolEnvSuppAngName("4", "V", "D", icount, 0);
1507  volEnvSuppAng4VD[1] = GetVolEnvSuppAngName("4", "V", "D", icount, 1);
1508  volEnvSuppAng4VD[2] = GetVolEnvSuppAngName("4", "V", "D", icount, 2);
1509  volEnvSuppAng4VD[3] = GetVolEnvSuppAngName("4", "V", "D", icount, 3);
1510 
1511  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VD[0], 0, true,
1512  TGeoTranslation(xEnv,-yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]));
1513  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VD[1], 0, true,
1514  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]));
1515  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VD[2], 0, true,
1516  TGeoTranslation(-xEnv,-yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
1517  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1518  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VD[3], 0, true,
1519  TGeoTranslation(-xEnv,yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
1520  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1521 
1522  TString volAluAngSupport4V = GetVolAluAngSuppName("4", "V", icount);
1523  for (Int_t i=0;i<4;i++)
1524  GetEnvelopes(16+icount)
1525  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VD[i],iVolNum++,3, spar);
1526 
1527 // 4 horizontal
1528 
1529  spar[0]=dpar[0];
1530  spar[1]=fgkSizeSupport2H[1];
1531  spar[2]=fgkSizeSupport2H[2];
1532  TString volEnvSuppAng4HD[4];
1533  volEnvSuppAng4HD[0] = GetVolEnvSuppAngName("4", "H", "D", icount, 0);
1534  volEnvSuppAng4HD[1] = GetVolEnvSuppAngName("4", "H", "D", icount, 1);
1535  volEnvSuppAng4HD[2] = GetVolEnvSuppAngName("4", "H", "D", icount, 2);
1536  volEnvSuppAng4HD[3] = GetVolEnvSuppAngName("4", "H", "D", icount, 3);
1537 
1538  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HD[0], 0, true,
1539  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]));
1540  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HD[1], 0, true,
1541  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]));
1542  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HD[2], 0, true,
1543  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])),
1544  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1545  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HD[3], 0, true,
1546  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])),
1547  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1548 
1549  TString volAluAngSupport4H = GetVolAluAngSuppName("4", "H", icount);
1550  for (Int_t i=0;i<4;i++)
1551  GetEnvelopes(16+icount)
1552  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HD[i],iVolNum++,3, spar);
1553 
1554 // X horizontal
1555  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1556  spar[1]=fgkSizeSupportXH[1];
1557  spar[2]=fgkSizeSupportXH[2];
1558  Double_t sparysavex=spar[1];
1559  TString volEnvSuppAngXHD[4];
1560  volEnvSuppAngXHD[0] = GetVolEnvSuppAngName("X", "H", "D", icount, 0);
1561  volEnvSuppAngXHD[1] = GetVolEnvSuppAngName("X", "H", "D", icount, 1);
1562  volEnvSuppAngXHD[2] = GetVolEnvSuppAngName("X", "H", "D", icount, 2);
1563  volEnvSuppAngXHD[3] = GetVolEnvSuppAngName("X", "H", "D", icount, 3);
1564 
1565  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHD[0], 0, true,
1566  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvP+dpar[1]+sparysave+1.0,
1567  fgkSizeVSupExt[0]+spar[2]));
1568  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHD[1], 0, true,
1569  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0,
1570  fgkSizeVSupExt[0]+spar[2]));
1571  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHD[2], 0, true,
1572  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0,
1573  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1574  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHD[3], 0, true,
1575  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvM+dpar[1]+sparysave+1.0,
1576  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1577 
1578  TString volAluAngSupportXH = GetVolAluAngSuppName("X", "H", icount);
1579  for (Int_t i=0;i<4;i++)
1580  GetEnvelopes(16+icount)
1581  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHD[i],iVolNum++,3, spar);
1582 
1583 // X vertical
1584  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1585  spar[1]=fgkSizeSupportXV[1];
1586  spar[2]=fgkSizeSupportXV[2];
1587  TString volEnvSuppAngXVD[4];
1588  volEnvSuppAngXVD[0] = GetVolEnvSuppAngName("X", "V", "D", icount, 0);
1589  volEnvSuppAngXVD[1] = GetVolEnvSuppAngName("X", "V", "D", icount, 1);
1590  volEnvSuppAngXVD[2] = GetVolEnvSuppAngName("X", "V", "D", icount, 2);
1591  volEnvSuppAngXVD[3] = GetVolEnvSuppAngName("X", "V", "D", icount, 3);
1592 
1593  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVD[0], 0, true,
1594  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1595  fgkSizeVSupExt[0]+spar[2]));
1596  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVD[1], 0, true,
1597  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1598  fgkSizeVSupExt[0]+spar[2]));
1599  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVD[2], 0, true,
1600  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1601  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1602  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVD[3], 0, true,
1603  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1604  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1605 
1606  TString volAluAngSupportXV = GetVolAluAngSuppName("X", "V", icount);
1607  for (Int_t i=0;i<4;i++)
1608  GetEnvelopes(16+icount)
1609  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVD[i],iVolNum++,3, spar);
1610 
1611  // keep values of yEnvP, yEnvM
1612  fYEnvPsave = yEnvP;
1613  fYEnvMsave = yEnvM;
1614 }
1615 
1616 //______________________________________________________________________________
1617 void AliMUONTriggerGeometryBuilder::BuildChamberTypeE(Int_t& iVolNum, Int_t icount)
1618 {
1619 // ratio of zpos1m/zpos1p and inverse for first plane
1620  Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
1621  Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
1622  Float_t zpm=1./zmp;
1623  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
1624  Float_t xEnv = (fgkDXZERO+fgkXMAX/2.)*zRatio;
1625 
1626  Double_t dpar[3];
1627  Double_t spar[3];
1628  Double_t ppar[3];
1629 
1630 // E
1631  Float_t yEnvP = 0;
1632  Float_t yEnvM = 0;
1633  yEnvP = (fYEnvMsave + fgkYMIN * zRatio ) * zpm + fgkYMIN * zRatio;
1634  yEnvM = (fYEnvPsave + fgkYMIN * zRatio ) * zmp + fgkYMIN * zRatio;
1635 
1636  Int_t detElemId = (10+icount+1)*100+15;
1637  TString volEnv1 = GetVolEnvName(icount, 1);
1638  TString volEnv7 = GetVolEnvName(icount, 7);
1639  TString volEnv10 = GetVolEnvName(icount, 10);
1640  TString volEnv16 = GetVolEnvName(icount, 16);
1641  TString volAlu = GetVolumeName("volAlu", icount);
1642 
1643  GetEnvelopes(16+icount)
1644  ->AddEnvelope(volEnv1, detElemId, true, TGeoTranslation(xEnv,-yEnvM,fgkZm));
1645  detElemId = (10+icount+1)*100+3;
1646  GetEnvelopes(16+icount)
1647  ->AddEnvelope(volEnv7, detElemId, true, TGeoTranslation(xEnv, yEnvM,fgkZm));
1648  detElemId = (10+icount+1)*100+12;
1649  GetEnvelopes(16+icount)->AddEnvelope(volEnv10, detElemId, true, TGeoTranslation(-xEnv,-yEnvP,fgkZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1650  detElemId = (10+icount+1)*100+6;
1651  GetEnvelopes(16+icount)->AddEnvelope(volEnv16, detElemId, true, TGeoTranslation(-xEnv, yEnvP,fgkZp),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1652 
1653  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv1,iVolNum++,3,dpar);
1654  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv7,iVolNum++,3,dpar);
1655  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv10,iVolNum++,3,dpar);
1656  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv16,iVolNum++,3,dpar);
1657 
1658 // horizontal cable support chamber type E
1659 
1660  char volEnvSupportHE[12][8];
1661  for(Int_t jj=0;jj<2;jj++){
1662  for(Int_t ii=0;ii<6;ii++){
1663  snprintf(volEnvSupportHE[6*jj+ii],8,"SA%dHE%d",icount+1,6*jj+ii);
1664  }
1665  }
1666 
1667  spar[0]=dpar[0]-(fgkYVSup[0]/2.)*zRatio;
1668  spar[1]=fgkSizeSupportCable[1];
1669  spar[2]=fgkSizeSupportCable[2];
1670  for(Int_t in=0;in<3;in++){
1671  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHE[in], 0, true, TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio,-(yEnvM+dpar[1]/2.*(in-1)),fgkSizeVSupExt[0]+spar[2]));
1672  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHE[in+3], 0, true, TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio, yEnvM+dpar[1]/2.*(in-1),fgkSizeVSupExt[0]+spar[2]));
1673  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHE[in+6], 0, true, TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio),-(yEnvP+dpar[1]/2.*(in-1)),-(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1674  GetEnvelopes(16+icount)->AddEnvelope(volEnvSupportHE[in+9], 0, true, TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio), yEnvP+dpar[1]/2.*(in-1),-(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1675  }
1676  for(Int_t ii=0;ii<12;ii++) {
1677  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
1678  GetEnvelopes(16+icount)
1679  ->AddEnvelopeConstituentParam(volAluSupportH,volEnvSupportHE[ii],iVolNum++,3, spar);
1680  }
1681 
1682 // angular supports chamber type E
1683 // 1 vertical
1684 
1685  spar[0]=dpar[0];
1686  spar[1]=fgkSizeSupport1V[1];
1687  spar[2]=fgkSizeSupport1V[2];
1688  Double_t sparysave=spar[1];
1689 
1690  TString volEnvSuppAng1VE[4];
1691  volEnvSuppAng1VE[0] = GetVolEnvSuppAngName("1", "V", "E", icount, 0);
1692  volEnvSuppAng1VE[1] = GetVolEnvSuppAngName("1", "V", "E", icount, 1);
1693  volEnvSuppAng1VE[2] = GetVolEnvSuppAngName("1", "V", "E", icount, 2);
1694  volEnvSuppAng1VE[3] = GetVolEnvSuppAngName("1", "V", "E", icount, 3);
1695 
1696  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VE[0], 0, true,
1697  TGeoTranslation(xEnv,-yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]));
1698  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VE[1], 0, true,
1699  TGeoTranslation(xEnv,yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]));
1700  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VE[2], 0, true,
1701  TGeoTranslation(-xEnv,-yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1702  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VE[3], 0, true,
1703  TGeoTranslation(-xEnv,yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1704 
1705  TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
1706  for (Int_t i=0;i<4;i++)
1707  GetEnvelopes(16+icount)
1708  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VE[i],iVolNum++,3, spar);
1709 
1710 
1711 // 1 horizontal
1712 
1713  spar[0]=dpar[0];
1714  spar[1]=fgkSizeSupport1H[1];
1715  spar[2]=fgkSizeSupport1H[2];
1716 
1717  TString volEnvSuppAng1HE[4];
1718  volEnvSuppAng1HE[0] = GetVolEnvSuppAngName("1", "H", "E", icount, 0);
1719  volEnvSuppAng1HE[1] = GetVolEnvSuppAngName("1", "H", "E", icount, 1);
1720  volEnvSuppAng1HE[2] = GetVolEnvSuppAngName("1", "H", "E", icount, 2);
1721  volEnvSuppAng1HE[3] = GetVolEnvSuppAngName("1", "H", "E", icount, 3);
1722 
1723  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HE[0], 0, true,
1724  TGeoTranslation(xEnv,-yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])));
1725  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HE[1], 0, true,
1726  TGeoTranslation(xEnv,yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])));
1727  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HE[2], 0, true, TGeoTranslation(-xEnv,-yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1728  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HE[3], 0, true, TGeoTranslation(-xEnv,yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1729 
1730  TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
1731  for (Int_t i=0;i<4;i++)
1732  GetEnvelopes(16+icount)
1733  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HE[i],iVolNum++,3, spar);
1734 
1735 // gas pipe (low)
1736  ppar[0]=fgkSizeGasPipe[0];
1737  ppar[1]=fgkSizeGasPipe[1];
1738  ppar[2]=dpar[0];
1739  TString volEnvInoxGasPipe1E[4];
1740  volEnvInoxGasPipe1E[0] = GetVolEnvInoxGasPipeName("1", "E", icount, 0);
1741  volEnvInoxGasPipe1E[1] = GetVolEnvInoxGasPipeName("1", "E", icount, 1);
1742  volEnvInoxGasPipe1E[2] = GetVolEnvInoxGasPipeName("1", "E", icount, 2);
1743  volEnvInoxGasPipe1E[3] = GetVolEnvInoxGasPipeName("1", "E", icount, 3);
1744  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1E[0], 0, true,
1745  TGeoTranslation(xEnv,-yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1746  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1E[1], 0, true,
1747  TGeoTranslation(xEnv,yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1748  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1E[2], 0, true,
1749  TGeoTranslation(-xEnv,-yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1750  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1E[3], 0, true,
1751  TGeoTranslation(-xEnv,yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1752 
1753  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
1754  for (Int_t i=0;i<4;i++)
1755  GetEnvelopes(16+icount)
1756  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1E[i],iVolNum++,3, ppar);
1757 
1758 // 2 vertical
1759 
1760  spar[0]=dpar[0];
1761  spar[1]=fgkSizeSupport2V[1];
1762  spar[2]=fgkSizeSupport2V[2];
1763  sparysave=spar[1]+fgkSizeSupport2H[1];
1764  TString volEnvSuppAng2VE[4];
1765  volEnvSuppAng2VE[0] = GetVolEnvSuppAngName("2", "V", "E", icount, 0);
1766  volEnvSuppAng2VE[1] = GetVolEnvSuppAngName("2", "V", "E", icount, 1);
1767  volEnvSuppAng2VE[2] = GetVolEnvSuppAngName("2", "V", "E", icount, 2);
1768  volEnvSuppAng2VE[3] = GetVolEnvSuppAngName("2", "V", "E", icount, 3);
1769  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VE[0], 0, true,
1770  TGeoTranslation(xEnv,-yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])));
1771  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VE[1], 0, true,
1772  TGeoTranslation(xEnv,yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])));
1773  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VE[2], 0, true,
1774  TGeoTranslation(-xEnv,-yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1775  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VE[3], 0, true,
1776  TGeoTranslation(-xEnv,yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1777 
1778  TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
1779  for (Int_t i=0;i<4;i++)
1780  GetEnvelopes(16+icount)
1781  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VE[i],iVolNum++,3, spar);
1782 
1783 // 2 horizontal
1784 
1785  spar[0]=dpar[0];
1786  spar[1]=fgkSizeSupport2H[1];
1787  spar[2]=fgkSizeSupport2H[2];
1788 
1789  TString volEnvSuppAng2HE[4];
1790  volEnvSuppAng2HE[0] = GetVolEnvSuppAngName("2", "H", "E", icount, 0);
1791  volEnvSuppAng2HE[1] = GetVolEnvSuppAngName("2", "H", "E", icount, 1);
1792  volEnvSuppAng2HE[2] = GetVolEnvSuppAngName("2", "H", "E", icount, 2);
1793  volEnvSuppAng2HE[3] = GetVolEnvSuppAngName("2", "H", "E", icount, 3);
1794 
1795  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HE[0], 0, true,
1796  TGeoTranslation(xEnv,-yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1797  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HE[1], 0, true,
1798  TGeoTranslation(xEnv,yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1799  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HE[2], 0, true, TGeoTranslation(-xEnv,-yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1800  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HE[3], 0, true, TGeoTranslation(-xEnv,yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1801 
1802  TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
1803  for (Int_t i=0;i<4;i++)
1804  GetEnvelopes(16+icount)
1805  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HE[i],iVolNum++,3, spar);
1806 
1807 // 3 vertical
1808 
1809  spar[0]=dpar[0];
1810  spar[1]=fgkSizeSupport1V[1];
1811  spar[2]=fgkSizeSupport1V[2];
1812  sparysave=spar[1];
1813  TString volEnvSuppAng3VE[4];
1814  volEnvSuppAng3VE[0] = GetVolEnvSuppAngName("3", "V", "E", icount, 0);
1815  volEnvSuppAng3VE[1] = GetVolEnvSuppAngName("3", "V", "E", icount, 1);
1816  volEnvSuppAng3VE[2] = GetVolEnvSuppAngName("3", "V", "E", icount, 2);
1817  volEnvSuppAng3VE[3] = GetVolEnvSuppAngName("3", "V", "E", icount, 3);
1818 
1819  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VE[0], 0, true,
1820  TGeoTranslation(xEnv,-yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]));
1821  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VE[1], 0, true,
1822  TGeoTranslation(xEnv,yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]));
1823  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VE[2], 0, true,
1824  TGeoTranslation(-xEnv,-yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1825  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VE[3], 0, true,
1826  TGeoTranslation(-xEnv,yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1827 
1828  TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
1829  for (Int_t i=0;i<4;i++)
1830  GetEnvelopes(16+icount)
1831  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VE[i],iVolNum++,3, spar);
1832 
1833 
1834 // 3 horizontal
1835 
1836  spar[0]=dpar[0];
1837  spar[1]=fgkSizeSupport1H[1];
1838  spar[2]=fgkSizeSupport1H[2];
1839 
1840  TString volEnvSuppAng3HE[4];
1841  volEnvSuppAng3HE[0] = GetVolEnvSuppAngName("3", "H", "E", icount, 0);
1842  volEnvSuppAng3HE[1] = GetVolEnvSuppAngName("3", "H", "E", icount, 1);
1843  volEnvSuppAng3HE[2] = GetVolEnvSuppAngName("3", "H", "E", icount, 2);
1844  volEnvSuppAng3HE[3] = GetVolEnvSuppAngName("3", "H", "E", icount, 3);
1845 
1846  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HE[0], 0, true,
1847  TGeoTranslation(xEnv,-yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])));
1848  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HE[1], 0, true,
1849  TGeoTranslation(xEnv,yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])));
1850  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HE[2], 0, true, TGeoTranslation(-xEnv,-yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1851  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HE[3], 0, true, TGeoTranslation(-xEnv,yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1852 
1853  TString volAluAngSupport3H = GetVolAluAngSuppName("3", "H", icount);
1854  for (Int_t i=0;i<4;i++)
1855  GetEnvelopes(16+icount)
1856  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HE[i],iVolNum++,3, spar);
1857 
1858 // gas pipe (high)
1859  ppar[0]=fgkSizeGasPipe[0];
1860  ppar[1]=fgkSizeGasPipe[1];
1861  ppar[2]=dpar[0];
1862  TString volEnvInoxGasPipe2E[4];
1863  volEnvInoxGasPipe2E[0] = GetVolEnvInoxGasPipeName("2", "E", icount, 0);
1864  volEnvInoxGasPipe2E[1] = GetVolEnvInoxGasPipeName("2", "E", icount, 1);
1865  volEnvInoxGasPipe2E[2] = GetVolEnvInoxGasPipeName("2", "E", icount, 2);
1866  volEnvInoxGasPipe2E[3] = GetVolEnvInoxGasPipeName("2", "E", icount, 3);
1867  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2E[0], 0, true,
1868  TGeoTranslation(xEnv,-yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1869  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2E[1], 0, true,
1870  TGeoTranslation(xEnv,yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
1871  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2E[2], 0, true,
1872  TGeoTranslation(-xEnv,-yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1873  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2E[3], 0, true,
1874  TGeoTranslation(-xEnv,yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
1875 
1876  for (Int_t i=0;i<4;i++)
1877  GetEnvelopes(16+icount)
1878  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2E[i],iVolNum++,3, ppar);
1879 
1880 // 4 vertical
1881 
1882  spar[0]=dpar[0];
1883  spar[1]=fgkSizeSupport2V[1];
1884  spar[2]=fgkSizeSupport2V[2];
1885  sparysave=spar[1]+fgkSizeSupport2H[1];
1886 
1887  TString volEnvSuppAng4VE[4];
1888  volEnvSuppAng4VE[0] = GetVolEnvSuppAngName("4", "V", "E", icount, 0);
1889  volEnvSuppAng4VE[1] = GetVolEnvSuppAngName("4", "V", "E", icount, 1);
1890  volEnvSuppAng4VE[2] = GetVolEnvSuppAngName("4", "V", "E", icount, 2);
1891  volEnvSuppAng4VE[3] = GetVolEnvSuppAngName("4", "V", "E", icount, 3);
1892 
1893  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VE[0], 0, true,
1894  TGeoTranslation(xEnv,-yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])));
1895  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VE[1], 0, true,
1896  TGeoTranslation(xEnv,yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])));
1897  GetEnvelopes(16+icount)
1898  ->AddEnvelope(volEnvSuppAng4VE[2], 0, true,
1899  TGeoTranslation(-xEnv,-yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]),
1900  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1901  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VE[3], 0, true,
1902  TGeoTranslation(-xEnv,yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]),
1903  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1904 
1905  TString volAluAngSupport4V = GetVolAluAngSuppName("4", "V", icount);
1906  for (Int_t i=0;i<4;i++)
1907  GetEnvelopes(16+icount)
1908  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VE[i],iVolNum++,3, spar);
1909 
1910 // 4 horizontal
1911 
1912  spar[0]=dpar[0];
1913  spar[1]=fgkSizeSupport2H[1];
1914  spar[2]=fgkSizeSupport2H[2];
1915 
1916  TString volEnvSuppAng4HE[4];
1917  volEnvSuppAng4HE[0] = GetVolEnvSuppAngName("4", "H", "E", icount, 0);
1918  volEnvSuppAng4HE[1] = GetVolEnvSuppAngName("4", "H", "E", icount, 1);
1919  volEnvSuppAng4HE[2] = GetVolEnvSuppAngName("4", "H", "E", icount, 2);
1920  volEnvSuppAng4HE[3] = GetVolEnvSuppAngName("4", "H", "E", icount, 3);
1921 
1922  GetEnvelopes(16+icount)
1923  ->AddEnvelope(volEnvSuppAng4HE[0], 0, true,
1924  TGeoTranslation(xEnv,-yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1925  GetEnvelopes(16+icount)
1926  ->AddEnvelope(volEnvSuppAng4HE[1], 0, true,
1927  TGeoTranslation(xEnv,yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])));
1928  GetEnvelopes(16+icount)
1929  ->AddEnvelope(volEnvSuppAng4HE[2], 0, true,
1930  TGeoTranslation(-xEnv,-yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]),
1931  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1932  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HE[3], 0, true,
1933  TGeoTranslation(-xEnv,yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]),
1934  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1935 
1936  TString volAluAngSupport4H = GetVolAluAngSuppName("4", "H", icount);
1937  for (Int_t i=0;i<4;i++)
1938  GetEnvelopes(16+icount)
1939  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HE[i],iVolNum++,3, spar);
1940 
1941 // X horizontal
1942  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1943  spar[1]=fgkSizeSupportXH[1];
1944  spar[2]=fgkSizeSupportXH[2];
1945  Double_t sparysavex=spar[1];
1946 
1947  TString volEnvSuppAngXHE[4];
1948  volEnvSuppAngXHE[0] = GetVolEnvSuppAngName("X", "H", "E", icount, 0);
1949  volEnvSuppAngXHE[1] = GetVolEnvSuppAngName("X", "H", "E", icount, 1);
1950  volEnvSuppAngXHE[2] = GetVolEnvSuppAngName("X", "H", "E", icount, 2);
1951  volEnvSuppAngXHE[3] = GetVolEnvSuppAngName("X", "H", "E", icount, 3);
1952 
1953  GetEnvelopes(16+icount)
1954  ->AddEnvelope(volEnvSuppAngXHE[0], 0, true,
1955  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvM+dpar[1]+sparysave+1.0,
1956  -(fgkSizeVSupExt[0]+spar[2])));
1957  GetEnvelopes(16+icount)
1958  ->AddEnvelope(volEnvSuppAngXHE[1], 0, true,
1959  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvM+dpar[1]+sparysave+1.0,
1960  -(fgkSizeVSupExt[0]+spar[2])));
1961  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHE[2], 0, true,
1962  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvP+dpar[1]+sparysave+1.0,
1963  fgkSizeVSupExt[0]+spar[2]),
1964  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1965  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHE[3], 0, true,
1966  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvP+dpar[1]+sparysave+1.0,
1967  fgkSizeVSupExt[0]+spar[2]),
1968  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1969 
1970  TString volAluAngSupportXH = GetVolAluAngSuppName("X", "H", icount);
1971  for (Int_t i=0;i<4;i++)
1972  GetEnvelopes(16+icount)
1973  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHE[i],iVolNum++,3, spar);
1974 
1975 // X vertical
1976  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
1977  spar[1]=fgkSizeSupportXV[1];
1978  spar[2]=fgkSizeSupportXV[2];
1979 
1980  TString volEnvSuppAngXVE[4];
1981  volEnvSuppAngXVE[0] = GetVolEnvSuppAngName("X", "V", "E", icount, 0);
1982  volEnvSuppAngXVE[1] = GetVolEnvSuppAngName("X", "V", "E", icount, 1);
1983  volEnvSuppAngXVE[2] = GetVolEnvSuppAngName("X", "V", "E", icount, 2);
1984  volEnvSuppAngXVE[3] = GetVolEnvSuppAngName("X", "V", "E", icount, 3);
1985 
1986  GetEnvelopes(16+icount)
1987  ->AddEnvelope(volEnvSuppAngXVE[0], 0, true,
1988  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1989  -(fgkSizeVSupExt[0]+spar[2])));
1990  GetEnvelopes(16+icount)
1991  ->AddEnvelope(volEnvSuppAngXVE[1], 0, true,
1992  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1993  -(fgkSizeVSupExt[0]+spar[2])));
1994  GetEnvelopes(16+icount)
1995  ->AddEnvelope(volEnvSuppAngXVE[2], 0, true,
1996  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
1997  fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
1998  GetEnvelopes(16+icount)
1999  ->AddEnvelope(volEnvSuppAngXVE[3], 0, true,
2000  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
2001  fgkSizeVSupExt[0]+spar[2]),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2002 
2003  TString volAluAngSupportXV = GetVolAluAngSuppName("X", "V", icount);
2004  for (Int_t i=0;i<4;i++)
2005  GetEnvelopes(16+icount)
2006  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVE[i],iVolNum++,3, spar);
2007 
2008  // keep values of yEnvP, yEnvM
2009  fYEnvPsave = yEnvP;
2010  fYEnvMsave = yEnvM;
2011 }
2012 
2013 //______________________________________________________________________________
2014 void AliMUONTriggerGeometryBuilder::BuildChamberTypeF(Int_t& iVolNum, Int_t icount)
2015 {
2016 // ratio of zpos1m/zpos1p and inverse for first plane
2017  Float_t zpos1= AliMUONConstants::DefaultChamberZ(10);
2018  Float_t zmp=(zpos1-3.6)/(zpos1+3.6);
2019  Float_t zpm=1./zmp;
2020  Float_t zRatio = AliMUONConstants::DefaultRatioTriggerChamber(icount);
2021  Float_t xEnv = (fgkDXZERO+fgkXMAX/2.)*zRatio;
2022 
2023  Double_t dpar[3];
2024  Double_t spar[3];
2025  Double_t ppar[3];
2026 
2027 // F
2028  dpar[0] = (fgkXMAX/2.)*zRatio;
2029  dpar[1] = fgkYMIN*zRatio;
2030  dpar[2] = 0.4;
2031 
2032  Float_t yEnvP = 0;
2033  Float_t yEnvM = 0;
2034  yEnvP = (fYEnvMsave + fgkYMIN * zRatio ) * zpm + fgkYMIN * zRatio;
2035  yEnvM = (fYEnvPsave + fgkYMIN * zRatio ) * zmp + fgkYMIN * zRatio;
2036 
2037  Int_t detElemId = (10+icount+1)*100+14;
2038  TString volEnv0 = GetVolEnvName(icount, 0);
2039  TString volEnv8 = GetVolEnvName(icount, 8);
2040  TString volEnv9 = GetVolEnvName(icount, 9);
2041  TString volEnv17 = GetVolEnvName(icount, 17);
2042  TString volAlu = GetVolumeName("volAlu", icount);
2043  GetEnvelopes(16+icount)
2044  ->AddEnvelope(volEnv0, detElemId, true, TGeoTranslation(xEnv,-yEnvP,fgkZp));
2045  detElemId = (10+icount+1)*100+4;
2046  GetEnvelopes(16+icount)
2047  ->AddEnvelope(volEnv8, detElemId, true, TGeoTranslation(xEnv, yEnvP,fgkZp));
2048  detElemId = (10+icount+1)*100+13;
2049  GetEnvelopes(16+icount)
2050  ->AddEnvelope(volEnv9, detElemId, true, TGeoTranslation(-xEnv,-yEnvM,fgkZm),
2051  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2052  detElemId = (10+icount+1)*100+5;
2053  GetEnvelopes(16+icount)
2054  ->AddEnvelope(volEnv17, detElemId, true, TGeoTranslation(-xEnv, yEnvM,fgkZm),
2055  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2056 
2057  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv0,iVolNum++,3,dpar);
2058  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv8,iVolNum++,3,dpar);
2059  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv9,iVolNum++,3,dpar);
2060  GetEnvelopes(16+icount)->AddEnvelopeConstituentParam(volAlu,volEnv17,iVolNum++,3,dpar);
2061 
2062 // horizontal cable support chamber type F
2063 
2064  char volEnvSupportHF[12][8];
2065  for(Int_t jj=0;jj<2;jj++){
2066  for(Int_t ii=0;ii<6;ii++){
2067  snprintf(volEnvSupportHF[6*jj+ii],8,"SA%dHF%d",icount+1,6*jj+ii);
2068  }
2069  }
2070 
2071  spar[0]=dpar[0]-(fgkYVSup[0]/2.)*zRatio;
2072  spar[1]=fgkSizeSupportCable[1];
2073  spar[2]=fgkSizeSupportCable[2];
2074  for(Int_t in=0;in<3;in++){
2075  GetEnvelopes(16+icount)
2076  ->AddEnvelope(volEnvSupportHF[in], 0, true,
2077  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio,-(yEnvP+dpar[1]/2.*(in-1)),
2078  -(fgkSizeVSupExt[0]+spar[2])));
2079  GetEnvelopes(16+icount)
2080  ->AddEnvelope(volEnvSupportHF[in+3], 0, true,
2081  TGeoTranslation(xEnv+fgkYVSup[0]/2.*zRatio,yEnvP+dpar[1]/2.*(in-1),
2082  -(fgkSizeVSupExt[0]+spar[2])));
2083  GetEnvelopes(16+icount)
2084  ->AddEnvelope(volEnvSupportHF[in+6], 0, true,
2085  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio),-(yEnvM+dpar[1]/2.*(in-1)),
2086  fgkSizeVSupExt[0]+spar[2]),
2087  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2088  GetEnvelopes(16+icount)
2089  ->AddEnvelope(volEnvSupportHF[in+9], 0, true,
2090  TGeoTranslation(-(xEnv+fgkYVSup[0]/2.*zRatio), yEnvM+dpar[1]/2.*(in-1),
2091  fgkSizeVSupExt[0]+spar[2]),
2092  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2093  }
2094  for(Int_t ii=0;ii<12;ii++) {
2095  TString volAluSupportH = GetVolumeName("volAluSupportH", icount);
2096  GetEnvelopes(16+icount)
2097  ->AddEnvelopeConstituentParam(volAluSupportH,volEnvSupportHF[ii],iVolNum++,3, spar);
2098  }
2099 
2100 // angular supports chamber type F
2101 // 1 vertical
2102 
2103  spar[0]=dpar[0];
2104  spar[1]=fgkSizeSupport1V[1];
2105  spar[2]=fgkSizeSupport1V[2];
2106  Double_t sparysave=spar[1];
2107  TString volEnvSuppAng1VF[4];
2108  volEnvSuppAng1VF[0] = GetVolEnvSuppAngName("1", "V", "F", icount, 0);
2109  volEnvSuppAng1VF[1] = GetVolEnvSuppAngName("1", "V", "F", icount, 1);
2110  volEnvSuppAng1VF[2] = GetVolEnvSuppAngName("1", "V", "F", icount, 2);
2111  volEnvSuppAng1VF[3] = GetVolEnvSuppAngName("1", "V", "F", icount, 3);
2112 
2113  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VF[0], 0, true,
2114  TGeoTranslation(xEnv,-yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]));
2115  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VF[1], 0, true,
2116  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkZp+dpar[2]+spar[2]));
2117  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VF[2], 0, true,
2118  TGeoTranslation(-xEnv,-yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]),
2119  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2120  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1VF[3], 0, true,
2121  TGeoTranslation(-xEnv,yEnvM-dpar[1],fgkZm-dpar[2]-spar[2]),
2122  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2123 
2124  TString volAluAngSupport1V = GetVolAluAngSuppName("1", "V", icount);
2125  for (Int_t i=0;i<4;i++)
2126  GetEnvelopes(16+icount)
2127  ->AddEnvelopeConstituentParam(volAluAngSupport1V,volEnvSuppAng1VF[i],iVolNum++,3, spar);
2128 
2129 // 1 horizontal
2130 
2131  spar[0]=dpar[0];
2132  spar[1]=fgkSizeSupport1H[1];
2133  spar[2]=fgkSizeSupport1H[2];
2134 
2135  TString volEnvSuppAng1HF[4];
2136  volEnvSuppAng1HF[0] = GetVolEnvSuppAngName("1", "H", "F", icount, 0);
2137  volEnvSuppAng1HF[1] = GetVolEnvSuppAngName("1", "H", "F", icount, 1);
2138  volEnvSuppAng1HF[2] = GetVolEnvSuppAngName("1", "H", "F", icount, 2);
2139  volEnvSuppAng1HF[3] = GetVolEnvSuppAngName("1", "H", "F", icount, 3);
2140 
2141  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HF[0], 0, true,
2142  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]));
2143  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HF[1], 0, true,
2144  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkZp+dpar[2]-spar[2]));
2145  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HF[2], 0, true,
2146  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])),
2147  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2148  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng1HF[3], 0, true,
2149  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,fgkZm-(dpar[2]-spar[2])),
2150  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2151 
2152  TString volAluAngSupport1H = GetVolAluAngSuppName("1", "H", icount);
2153  for (Int_t i=0;i<4;i++)
2154  GetEnvelopes(16+icount)
2155  ->AddEnvelopeConstituentParam(volAluAngSupport1H,volEnvSuppAng1HF[i],iVolNum++,3, spar);
2156 
2157 // gas pipe (low)
2158  ppar[0]=fgkSizeGasPipe[0];
2159  ppar[1]=fgkSizeGasPipe[1];
2160  ppar[2]=dpar[0];
2161  TString volEnvInoxGasPipe1F[4];
2162  volEnvInoxGasPipe1F[0] = GetVolEnvInoxGasPipeName("1", "F", icount, 0);
2163  volEnvInoxGasPipe1F[1] = GetVolEnvInoxGasPipeName("1", "F", icount, 1);
2164  volEnvInoxGasPipe1F[2] = GetVolEnvInoxGasPipeName("1", "F", icount, 2);
2165  volEnvInoxGasPipe1F[3] = GetVolEnvInoxGasPipeName("1", "F", icount, 3);
2166  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1F[0], 0, true,
2167  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
2168  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1F[1], 0, true,
2169  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZp),fRsupportpipe);
2170  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1F[2], 0, true,
2171  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
2172  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe1F[3], 0, true,
2173  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave-fgkOffsetGasPipe,fgkZm),fRsupportpipe);
2174 
2175  TString volInoxGasPipe = GetVolumeName("volInoxGasPipe", icount);
2176  for (Int_t i=0;i<4;i++)
2177  GetEnvelopes(16+icount)
2178  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe1F[i],iVolNum++,3, ppar);
2179 
2180 // 2 vertical
2181 
2182  spar[0]=dpar[0];
2183  spar[1]=fgkSizeSupport2V[1];
2184  spar[2]=fgkSizeSupport2V[2];
2185  sparysave=spar[1]+fgkSizeSupport2H[1];
2186 
2187  TString volEnvSuppAng2VF[4];
2188  volEnvSuppAng2VF[0] = GetVolEnvSuppAngName("2", "V", "F", icount, 0);
2189  volEnvSuppAng2VF[1] = GetVolEnvSuppAngName("2", "V", "F", icount, 1);
2190  volEnvSuppAng2VF[2] = GetVolEnvSuppAngName("2", "V", "F", icount, 2);
2191  volEnvSuppAng2VF[3] = GetVolEnvSuppAngName("2", "V", "F", icount, 3);
2192 
2193  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VF[0], 0, true,
2194  TGeoTranslation(xEnv,-yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]));
2195  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VF[1], 0, true,
2196  TGeoTranslation(xEnv,yEnvP-dpar[1],fgkSizeVSupExt[0]+spar[2]));
2197  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VF[2], 0, true,
2198  TGeoTranslation(-xEnv,-yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2199  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2VF[3], 0, true,
2200  TGeoTranslation(-xEnv,yEnvM-dpar[1],-(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2201 
2202  TString volAluAngSupport2V = GetVolAluAngSuppName("2", "V", icount);
2203  for (Int_t i=0;i<4;i++)
2204  GetEnvelopes(16+icount)
2205  ->AddEnvelopeConstituentParam(volAluAngSupport2V,volEnvSuppAng2VF[i],iVolNum++,3, spar);
2206 
2207 // 2 horizontal
2208 
2209  spar[0]=dpar[0];
2210  spar[1]=fgkSizeSupport2H[1];
2211  spar[2]=fgkSizeSupport2H[2];
2212 
2213  TString volEnvSuppAng2HF[4];
2214  volEnvSuppAng2HF[0] = GetVolEnvSuppAngName("2", "H", "F", icount, 0);
2215  volEnvSuppAng2HF[1] = GetVolEnvSuppAngName("2", "H", "F", icount, 1);
2216  volEnvSuppAng2HF[2] = GetVolEnvSuppAngName("2", "H", "F", icount, 2);
2217  volEnvSuppAng2HF[3] = GetVolEnvSuppAngName("2", "H", "F", icount, 3);
2218 
2219  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HF[0], 0, true,
2220  TGeoTranslation(xEnv,-yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]));
2221  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HF[1], 0, true,
2222  TGeoTranslation(xEnv,yEnvP-dpar[1]-sparysave,fgkSizeVSupExt[0]+spar[2]));
2223  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HF[2], 0, true,
2224  TGeoTranslation(-xEnv,-yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])),
2225  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2226  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng2HF[3], 0, true,
2227  TGeoTranslation(-xEnv,yEnvM-dpar[1]-sparysave,-(fgkSizeVSupExt[0]+spar[2])),
2228  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2229 
2230  TString volAluAngSupport2H = GetVolAluAngSuppName("2", "H", icount);
2231  for (Int_t i=0;i<4;i++)
2232  GetEnvelopes(16+icount)
2233  ->AddEnvelopeConstituentParam(volAluAngSupport2H,volEnvSuppAng2HF[i],iVolNum++,3, spar);
2234 
2235 // 3 vertical
2236 
2237  spar[0]=dpar[0];
2238  spar[1]=fgkSizeSupport1V[1];
2239  spar[2]=fgkSizeSupport1V[2];
2240  sparysave=spar[1];
2241 
2242  TString volEnvSuppAng3VF[4];
2243  volEnvSuppAng3VF[0] = GetVolEnvSuppAngName("3", "V", "F", icount, 0);
2244  volEnvSuppAng3VF[1] = GetVolEnvSuppAngName("3", "V", "F", icount, 1);
2245  volEnvSuppAng3VF[2] = GetVolEnvSuppAngName("3", "V", "F", icount, 2);
2246  volEnvSuppAng3VF[3] = GetVolEnvSuppAngName("3", "V", "F", icount, 3);
2247 
2248  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VF[0], 0, true,
2249  TGeoTranslation(xEnv,-yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]));
2250  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VF[1], 0, true,
2251  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkZp+dpar[2]+spar[2]));
2252  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VF[2], 0, true,
2253  TGeoTranslation(-xEnv,-yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]),
2254  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2255  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3VF[3], 0, true,
2256  TGeoTranslation(-xEnv,yEnvM+dpar[1],fgkZm-dpar[2]-spar[2]),
2257  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2258 
2259  TString volAluAngSupport3V = GetVolAluAngSuppName("3", "V", icount);
2260  for (Int_t i=0;i<4;i++)
2261  GetEnvelopes(16+icount)
2262  ->AddEnvelopeConstituentParam(volAluAngSupport3V,volEnvSuppAng3VF[i],iVolNum++,3, spar);
2263 
2264 // 3 horizontal
2265 
2266  spar[0]=dpar[0];
2267  spar[1]=fgkSizeSupport1H[1];
2268  spar[2]=fgkSizeSupport1H[2];
2269 
2270  TString volEnvSuppAng3HF[4];
2271  volEnvSuppAng3HF[0] = GetVolEnvSuppAngName("3", "H", "F", icount, 0);
2272  volEnvSuppAng3HF[1] = GetVolEnvSuppAngName("3", "H", "F", icount, 1);
2273  volEnvSuppAng3HF[2] = GetVolEnvSuppAngName("3", "H", "F", icount, 2);
2274  volEnvSuppAng3HF[3] = GetVolEnvSuppAngName("3", "H", "F", icount, 3);
2275 
2276  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HF[0], 0, true,
2277  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]));
2278  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HF[1], 0, true,
2279  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkZp+dpar[2]-spar[2]));
2280  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HF[2], 0, true,
2281  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])),
2282  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2283  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng3HF[3], 0, true,
2284  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,fgkZm-(dpar[2]-spar[2])),
2285  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2286 
2287  TString volAluAngSupport3H = GetVolAluAngSuppName("3", "H", icount);
2288  for (Int_t i=0;i<4;i++)
2289  GetEnvelopes(16+icount)
2290  ->AddEnvelopeConstituentParam(volAluAngSupport3H,volEnvSuppAng3HF[i],iVolNum++,3, spar);
2291 
2292 // gas pipe (high)
2293  ppar[0]=fgkSizeGasPipe[0];
2294  ppar[1]=fgkSizeGasPipe[1];
2295  ppar[2]=dpar[0];
2296  TString volEnvInoxGasPipe2F[4];
2297  volEnvInoxGasPipe2F[0] = GetVolEnvInoxGasPipeName("2", "F", icount, 0);
2298  volEnvInoxGasPipe2F[1] = GetVolEnvInoxGasPipeName("2", "F", icount, 1);
2299  volEnvInoxGasPipe2F[2] = GetVolEnvInoxGasPipeName("2", "F", icount, 2);
2300  volEnvInoxGasPipe2F[3] = GetVolEnvInoxGasPipeName("2", "F", icount, 3);
2301  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2F[0], 0, true,
2302  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
2303  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2F[1], 0, true,
2304  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZp),fRsupportpipe);
2305  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2F[2], 0, true,
2306  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
2307  GetEnvelopes(16+icount)->AddEnvelope(volEnvInoxGasPipe2F[3], 0, true,
2308  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave+fgkOffsetGasPipe,fgkZm),fRsupportpipe);
2309 
2310  for (Int_t i=0;i<4;i++)
2311  GetEnvelopes(16+icount)
2312  ->AddEnvelopeConstituentParam(volInoxGasPipe,volEnvInoxGasPipe2F[i],iVolNum++,3, ppar);
2313 
2314 // 4 vertical
2315 
2316  spar[0]=dpar[0];
2317  spar[1]=fgkSizeSupport2V[1];
2318  spar[2]=fgkSizeSupport2V[2];
2319  sparysave=spar[1]+fgkSizeSupport2H[1];
2320 
2321  TString volEnvSuppAng4VF[4];
2322  volEnvSuppAng4VF[0] = GetVolEnvSuppAngName("4", "V", "F", icount, 0);
2323  volEnvSuppAng4VF[1] = GetVolEnvSuppAngName("4", "V", "F", icount, 1);
2324  volEnvSuppAng4VF[2] = GetVolEnvSuppAngName("4", "V", "F", icount, 2);
2325  volEnvSuppAng4VF[3] = GetVolEnvSuppAngName("4", "V", "F", icount, 3);
2326 
2327  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VF[0], 0, true,
2328  TGeoTranslation(xEnv,-yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]));
2329  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VF[1], 0, true,
2330  TGeoTranslation(xEnv,yEnvP+dpar[1],fgkSizeVSupExt[0]+spar[2]));
2331  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VF[2], 0, true,
2332  TGeoTranslation(-xEnv,-yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
2333  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2334  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4VF[3], 0, true,
2335  TGeoTranslation(-xEnv,yEnvM+dpar[1],-(fgkSizeVSupExt[0]+spar[2])),
2336  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2337 
2338  TString volAluAngSupport4V = GetVolAluAngSuppName("4", "V", icount);
2339  for (Int_t i=0;i<4;i++)
2340  GetEnvelopes(16+icount)
2341  ->AddEnvelopeConstituentParam(volAluAngSupport4V,volEnvSuppAng4VF[i],iVolNum++,3, spar);
2342 
2343 // 4 horizontal
2344 
2345  spar[0]=dpar[0];
2346  spar[1]=fgkSizeSupport2H[1];
2347  spar[2]=fgkSizeSupport2H[2];
2348 
2349  TString volEnvSuppAng4HF[4];
2350  volEnvSuppAng4HF[0] = GetVolEnvSuppAngName("4", "H", "F", icount, 0);
2351  volEnvSuppAng4HF[1] = GetVolEnvSuppAngName("4", "H", "F", icount, 1);
2352  volEnvSuppAng4HF[2] = GetVolEnvSuppAngName("4", "H", "F", icount, 2);
2353  volEnvSuppAng4HF[3] = GetVolEnvSuppAngName("4", "H", "F", icount, 3);
2354 
2355  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HF[0], 0, true,
2356  TGeoTranslation(xEnv,-yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]));
2357  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HF[1], 0, true,
2358  TGeoTranslation(xEnv,yEnvP+dpar[1]+sparysave,fgkSizeVSupExt[0]+spar[2]));
2359  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HF[2], 0, true,
2360  TGeoTranslation(-xEnv,-yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])),
2361  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2362  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAng4HF[3], 0, true,
2363  TGeoTranslation(-xEnv,yEnvM+dpar[1]+sparysave,-(fgkSizeVSupExt[0]+spar[2])),
2364  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2365 
2366  TString volAluAngSupport4H = GetVolAluAngSuppName("4", "H", icount);
2367  for (Int_t i=0;i<4;i++)
2368  GetEnvelopes(16+icount)
2369  ->AddEnvelopeConstituentParam(volAluAngSupport4H,volEnvSuppAng4HF[i],iVolNum++,3, spar);
2370 
2371 
2372 // X horizontal
2373  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
2374  spar[1]=fgkSizeSupportXH[1];
2375  spar[2]=fgkSizeSupportXH[2];
2376  Double_t sparysavex=spar[1];
2377 
2378  TString volEnvSuppAngXHF[4];
2379  volEnvSuppAngXHF[0] = GetVolEnvSuppAngName("X", "H", "F", icount, 0);
2380  volEnvSuppAngXHF[1] = GetVolEnvSuppAngName("X", "H", "F", icount, 1);
2381  volEnvSuppAngXHF[2] = GetVolEnvSuppAngName("X", "H", "F", icount, 2);
2382  volEnvSuppAngXHF[3] = GetVolEnvSuppAngName("X", "H", "F", icount, 3);
2383 
2384  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHF[0], 0, true,
2385  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvP+dpar[1]+sparysave+1.0,
2386  fgkSizeVSupExt[0]+spar[2]));
2387  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHF[1], 0, true,
2388  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0,
2389  fgkSizeVSupExt[0]+spar[2]));
2390  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHF[2], 0, true,
2391  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvM+dpar[1]+sparysave+1.0,
2392  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2393  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXHF[3], 0, true,
2394  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0,
2395  -(fgkSizeVSupExt[0]+spar[2])),
2396  TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2397 
2398  TString volAluAngSupportXH = GetVolAluAngSuppName("X", "H", icount);
2399  for (Int_t i=0;i<4;i++)
2400  GetEnvelopes(16+icount)
2401  ->AddEnvelopeConstituentParam(volAluAngSupportXH,volEnvSuppAngXHF[i],iVolNum++,3, spar);
2402 
2403 // X vertical
2404  spar[0]=(fgkYVSup[3]-fgkYVSup[0])/2.*zRatio;
2405  spar[1]=fgkSizeSupportXV[1];
2406  spar[2]=fgkSizeSupportXV[2];
2407 
2408  TString volEnvSuppAngXVF[4];
2409  volEnvSuppAngXVF[0] = GetVolEnvSuppAngName("X", "V", "F", icount, 0);
2410  volEnvSuppAngXVF[1] = GetVolEnvSuppAngName("X", "V", "F", icount, 1);
2411  volEnvSuppAngXVF[2] = GetVolEnvSuppAngName("X", "V", "F", icount, 2);
2412  volEnvSuppAngXVF[3] = GetVolEnvSuppAngName("X", "V", "F", icount, 3);
2413 
2414  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVF[0], 0, true,
2415  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,-yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
2416  fgkSizeVSupExt[0]+spar[2]));
2417  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVF[1], 0, true,
2418  TGeoTranslation(spar[0]+fgkYVSup[0]*zRatio,yEnvP+dpar[1]+sparysave+1.0+sparysavex+spar[1],
2419  fgkSizeVSupExt[0]+spar[2]));
2420  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVF[2], 0, true,
2421  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),-yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
2422  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2423  GetEnvelopes(16+icount)->AddEnvelope(volEnvSuppAngXVF[3], 0, true,
2424  TGeoTranslation(-(spar[0]+fgkYVSup[0]*zRatio),yEnvM+dpar[1]+sparysave+1.0+sparysavex+spar[1],
2425  -(fgkSizeVSupExt[0]+spar[2])),TGeoRotation("rot1",90.,180.,90.,90.,180.,0.));
2426 
2427  TString volAluAngSupportXV = GetVolAluAngSuppName("X", "V", icount);
2428  for (Int_t i=0;i<4;i++)
2429  GetEnvelopes(16+icount)
2430  ->AddEnvelopeConstituentParam(volAluAngSupportXV,volEnvSuppAngXVF[i],iVolNum++,3, spar);
2431 
2432  // keep values of yEnvP, yEnvM
2433  fYEnvPsave = yEnvP;
2434  fYEnvMsave = yEnvM;
2435 }
2436 
2437 //
2438 // public methods
2439 //
2440 
2441 //______________________________________________________________________________
2443 {
2445 
2446  /*
2447  zpos1 and zpos2 are the middle of the first and second
2448  planes of station 1 (+1m for second station):
2449  zpos1=(zpos1m+zpos1p)/2=(15999+16071)/2=16035 mm, thick/2=40 mm
2450  zpos2=(zpos2m+zpos2p)/2=(16169+16241)/2=16205 mm, thick/2=40 mm
2451  zposxm and zposxp= middles of gaz gaps within a detection plane
2452  rem: the total thickness accounts for 1 mm of al on both
2453  side of the RPCs (see zpos1 and zpos2)
2454  */
2455 
2456  fIdtmed = fMUON->GetIdtmed()->GetArray()-1099;
2457  fIdAir= fIdtmed[1100]; // medium 1
2458  fIdAlu1=fIdtmed[1103]; // medium 4
2459  fIdInox = fIdtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe)
2460 
2461  Double_t dstation = ( ( - AliMUONConstants::DefaultChamberZ(11)) -
2462  ( - AliMUONConstants::DefaultChamberZ(10)) ) /2.1;
2463  Float_t par[3];
2464  par[2] = dstation;
2465 
2466  Int_t icount=0; // chamber counter (0 1 2 3)
2467 
2468  for (Int_t istation=0; istation<2; istation++) { // loop on stations
2469  for (Int_t iplane=0; iplane<2; iplane++) { // loop on detection planes
2470 
2471  Int_t iVolNum=1; // counter Volume Number
2472  icount = Int_t(iplane<<0)+Int_t(istation<<1);
2473 
2474  cout << "## In AliMUONTriggerGeometryBuilder " << icount << endl;
2475 
2476  par[0] = AliMUONConstants::Rmin(5+istation);
2477  par[1] = AliMUONConstants::Rmax(5+istation);
2478  Char_t volName[6];
2479  snprintf(volName,6,"%s%d", "SC",11+icount);
2480  TVirtualMC::GetMC()->Gsvolu(volName,"TUBE", fIdAir, par, 3);
2481 
2482 // chamber prototype
2483  BuildChamberPrototype(icount);
2484 
2485 // RPC supports (vertical)
2486  BuildRPCSupportsVertical(iVolNum, icount);
2487 
2488 // RPC supports (horizontal)
2489 
2490 // supports for cables
2492 
2493 // Angular supports for chambers
2495 
2496 // gas pipes
2497  BuildGasPipes(icount);
2498 
2499 // chamber type A
2500  BuildChamberTypeA(iVolNum, icount);
2501 
2502 // chamber type B (plus envelope chambers B & C)
2503  BuildChamberTypeB(iVolNum, icount);
2504 
2505 // chamber type D, E and F (same size)
2506  BuildChamberTypeD(iVolNum, icount);
2507  BuildChamberTypeE(iVolNum, icount);
2508  BuildChamberTypeF(iVolNum, icount);
2509  } // end loop on detection planes
2510  } // end loop on stations
2511 }
2512 
2513 //______________________________________________________________________________
2515 {
2517 
2518  if (gAlice->GetModule("SHIL")) {
2519  SetMotherVolume(16, "YOUT2");
2520  SetMotherVolume(17, "YOUT2");
2521  SetMotherVolume(18, "YOUT2");
2522  SetMotherVolume(19, "YOUT2");
2523  }
2524 
2525  SetVolume(16, "SC11");
2526  SetVolume(17, "SC12");
2527  SetVolume(18, "SC13");
2528  SetVolume(19, "SC14");
2529 }
2530 
2531 //______________________________________________________________________________
2533 {
2535 
2536  TGeoRotation st345inclination("rotbeam");
2537  st345inclination.RotateX(-AliMUONConstants::St345Inclination());
2538 
2539  Double_t zpos1= AliMUONConstants::DefaultChamberZ(10);
2540  SetTransformation(16, TGeoTranslation(0., 0, zpos1), st345inclination);
2541 
2543  SetTransformation(17, TGeoTranslation(0., 0, zpos1), st345inclination);
2544 
2546  SetTransformation(18, TGeoTranslation(0., 0, zpos1), st345inclination);
2547 
2549  SetTransformation(19, TGeoTranslation(0., 0, zpos1), st345inclination);
2550 }
2551 
2552 //______________________________________________________________________________
2554 {
2556 
2557  GetGeometry(16)->SetSensitiveVolume("S11G");
2558  GetGeometry(17)->SetSensitiveVolume("S12G");
2559  GetGeometry(18)->SetSensitiveVolume("S13G");
2560  GetGeometry(19)->SetSensitiveVolume("S14G");
2561 }
2562 
static const Float_t fgkAvoidExtrusion
Small cut on some volumes to avoid extrusion from SC1x.
static const Float_t fgkDXZERO
vertical gap between right and left chambers (kDXZERO*2=4cm)
Abstract base class for geometry construction per module(s)
static Float_t DefaultRatioTriggerChamber(Int_t i)
Return ratio between trigger chambers.
virtual void SetVolumes()
and eventually the mother volume name should be defined
static Float_t St345Inclination()
Return Inclination with respect the vertical axis of stations 345.
void SetMotherVolume(Int_t moduleId, const TString &volumeName)
static const Float_t fgkXMED
xmed distance in first plane/first station
void BuildRPCSupportsVertical(Int_t &iVolNum, Int_t icount) const
void BuildRPCSupportsHorizontal(Int_t icount) const
Int_t fIdInox
! medium 29 Stainless Steel (18Cr,9Ni,Fe)
void SetTransformation(Int_t moduleId, const TGeoTranslation &translation, const TGeoRotation &rotation)
static const Float_t fgkSizeSupportXV[3]
transverse dimensions of XV angular supports
AliDetector class for MUON subsystem providing simulation data management.
Definition: AliMUON.h:37
void SetSensitiveVolume(Int_t volId)
static const Float_t fgkSizeGasPipe[3]
transverse dimensions of horizontal cable supports
static const Float_t fgkSizeSupport1V[3]
transverse dimensions of 1V angular supports
static const Float_t fgkSizeSupport2H[3]
transverse dimensions of 2H angular supports
void AddEnvelope(const TString &name, Int_t id, Bool_t isVirtual, const char *only="ONLY")
static const Float_t fgkXMAX
xmax distance in first plane/first station
static const Float_t fgkZm
inner radius of flange between beam shield. and chambers (1/station)
void BuildChamberTypeA(Int_t &iVolNum, Int_t icount)
TString GetVolEnvName(Int_t icount, Int_t ienv) const
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
static Float_t Rmax(Int_t i)
Return chamber i outer radius.
static const Float_t fgkSizeSupportXH[3]
transverse dimensions of XH angular supports
TGeoRotation fRsupportpipe
pipe support rotation
AliMUONGeometryModule * GetGeometry(Int_t moduleId) const
static const Float_t fgkSizeVSupExt[3]
ext dimensions of vertical supports
void BuildChamberTypeE(Int_t &iVolNum, Int_t icount)
static const Float_t fgkSizeSupport1H[3]
transverse dimensions of 1H angular supports
static const Float_t fgkSizeSupport2V[3]
transverse dimensions of 2V angular supports
TString GetVolEnvSuppAngName(const TString &type1234X, const TString &typeHV, const TString &typeABDEF, Int_t icount, Int_t ivol) const
static const Float_t fgkOffsetGasPipe
Position of gas pipe with respect to angular support.
AliRun * gAlice
static const Float_t fgkXMIN
xmin distance in first plane/first station
static Float_t Rmin(Int_t i)
Return chamber i inner radius.
AliMUONGeometryEnvelopeStore * GetEnvelopes(Int_t moduleId) const
TString GetVolEnvInoxGasPipeName(const TString &type12, const TString &typeABCDEF, Int_t icount, Int_t ivol) const
AliMUON * muon()
void SetVolume(Int_t moduleId, const TString &volumeName, Bool_t isVirtual=false)
static Float_t * DefaultChamberZ()
Return pointer to array of positions.
static const Float_t fgkZp
outer radius of flange between beam shield. and chambers (1/station)
void BuildChamberTypeF(Int_t &iVolNum, Int_t icount)
void BuildChamberTypeB(Int_t &iVolNum, Int_t icount)
void AddEnvelopeConstituentParam(const TString &name, const TString &envName, Int_t copyNo, Int_t npar, Double_t *param)
TString GetVolumeName(const TString &volume, Int_t icount) const
void BuildChamberTypeD(Int_t &iVolNum, Int_t icount)
MUON Trigger stations geometry construction class.
void BuildAngularSupportForChambers(Int_t icount) const
AliMUON * fMUON
the MUON detector class
TString GetVolAluAngSuppName(const TString &type1234X, const TString &typeHV, Int_t icount) const
static const Float_t fgkSizeVSupInt[3]
int dimensions of vertical supports
static const Float_t fgkYVSup[4]
y positions of vertical supports