e118b27e |
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 | |
d1cd2474 |
16 | // $Id$ |
17 | // |
18 | // Class AliMUONSlatGeometryBuilder |
19 | // ------------------------------- |
20 | // Abstract base class for geometry construction per chamber. |
21 | // |
f4a7360f |
22 | |
2057e0cc |
23 | |
24 | |
c10e6eaf |
25 | // This Builder is designed according to the enveloppe methode. The basic idea is to be able to allow moves |
26 | // of the slats on the support panels. |
27 | // Those moves can be described with a simple set of parameters. The next step should be now to describe all |
28 | // the slats and their places by a unique |
29 | // class, which would make the SlatBuilder far more compact since now only three parameters can define a slat |
30 | // and its position, like: |
2057e0cc |
31 | // * Bool_t rounded_shape_slat |
32 | // * Float_t slat_length |
33 | // * Float_t slat_number or Float_t slat_position |
34 | |
d1cd2474 |
35 | #include <TVirtualMC.h> |
d1cd2474 |
36 | #include <TGeoMatrix.h> |
30178c30 |
37 | #include <Riostream.h> |
d1cd2474 |
38 | |
e118b27e |
39 | #include "AliRun.h" |
40 | #include "AliLog.h" |
41 | |
d1cd2474 |
42 | #include "AliMUONSlatGeometryBuilder.h" |
43 | #include "AliMUON.h" |
b7ef3c96 |
44 | #include "AliMUONConstants.h" |
e118b27e |
45 | #include "AliMUONGeometryModule.h" |
a432117a |
46 | #include "AliMUONGeometryEnvelopeStore.h" |
e516b01d |
47 | #include "AliMUONConstants.h" |
d1cd2474 |
48 | |
49 | ClassImp(AliMUONSlatGeometryBuilder) |
50 | |
d1cd2474 |
51 | |
52 | //______________________________________________________________________________ |
53 | AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon) |
b7ef3c96 |
54 | : AliMUONVGeometryBuilder(4, 5, 6, 7, 8, 9), |
d1cd2474 |
55 | fMUON(muon) |
56 | { |
57 | // Standard constructor |
58 | |
59 | } |
60 | |
61 | //______________________________________________________________________________ |
62 | AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder() |
63 | : AliMUONVGeometryBuilder(), |
64 | fMUON(0) |
65 | { |
66 | // Default constructor |
67 | } |
68 | |
69 | |
70 | //______________________________________________________________________________ |
71 | AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(const AliMUONSlatGeometryBuilder& rhs) |
72 | : AliMUONVGeometryBuilder(rhs) |
73 | { |
8c343c7c |
74 | AliFatal("Copy constructor is not implemented."); |
d1cd2474 |
75 | } |
76 | |
77 | //______________________________________________________________________________ |
78 | AliMUONSlatGeometryBuilder::~AliMUONSlatGeometryBuilder() { |
79 | // |
80 | } |
81 | |
82 | //______________________________________________________________________________ |
83 | AliMUONSlatGeometryBuilder& |
84 | AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs) |
85 | { |
86 | // check assignement to self |
87 | if (this == &rhs) return *this; |
88 | |
8c343c7c |
89 | AliFatal("Assignment operator is not implemented."); |
d1cd2474 |
90 | |
91 | return *this; |
92 | } |
93 | |
94 | // |
95 | // public methods |
96 | // |
97 | |
98 | //______________________________________________________________________________ |
99 | void AliMUONSlatGeometryBuilder::CreateGeometry() |
100 | { |
e516b01d |
101 | // CreateGeometry is the method containing all the informations concerning Stations 345 geometry. |
102 | // It includes description and placements of support panels and slats. |
103 | // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning |
104 | // the use of Enveloppe method to place the Geant volumes. |
105 | // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, |
106 | // and this builder would then be dedicated only to the |
107 | // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor... |
d1cd2474 |
108 | |
e516b01d |
109 | Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099; |
110 | |
111 | Float_t angle; |
112 | Float_t *dum=0; |
113 | |
114 | // define the id of tracking media: |
115 | Int_t idAir = idtmed[1100]; // medium 1 |
116 | Int_t idGas = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%) |
117 | Int_t idCopper = idtmed[1110]; |
118 | Int_t idG10 = idtmed[1111]; |
119 | Int_t idCarbon = idtmed[1112]; |
120 | Int_t idRoha = idtmed[1113]; |
121 | Int_t idNomex = idtmed[1114]; // honey comb |
122 | Int_t idNoryl = idtmed[1115]; |
123 | Int_t idNomexB = idtmed[1116]; // bulk material |
124 | |
125 | // sensitive area: 40*40 cm**2 |
126 | const Float_t kSensLength = 40.; |
127 | const Float_t kSensHeight = 40.; |
1c334adf |
128 | const Float_t kSensWidth = AliMUONConstants::Pitch()*2;// 0.5 cm, according to TDR fig 2.120 |
e516b01d |
129 | const Int_t kSensMaterial = idGas; |
130 | // const Float_t kYoverlap = 1.5; |
131 | |
132 | // PCB dimensions in cm; width: 30 mum copper |
133 | const Float_t kPcbLength = kSensLength; |
134 | const Float_t kPcbHeight = 58.; // updated Ch. Finck |
135 | const Float_t kPcbWidth = 0.003; |
136 | const Int_t kPcbMaterial = idCopper; |
137 | |
138 | // Insulating material: 220 mum G10 fiber glued to pcb |
139 | const Float_t kInsuLength = kPcbLength; |
140 | const Float_t kInsuHeight = kPcbHeight; |
141 | const Float_t kInsuWidth = 0.022; // updated Ch. Finck |
142 | const Int_t kInsuMaterial = idG10; |
143 | |
144 | // Carbon fiber panels: 200mum carbon/epoxy skin |
145 | const Float_t kCarbonWidth = 0.020; |
146 | const Int_t kCarbonMaterial = idCarbon; |
147 | |
148 | // Nomex (honey comb) between the two panel carbon skins |
149 | const Float_t kNomexLength = kSensLength; |
150 | const Float_t kNomexHeight = kSensHeight; |
151 | const Float_t kNomexWidth = 0.8; // updated Ch. Finck |
152 | const Int_t kNomexMaterial = idNomex; |
153 | |
154 | // Bulk Nomex under panel sandwich Ch. Finck |
155 | const Float_t kNomexBWidth = 0.025; |
156 | const Int_t kNomexBMaterial = idNomexB; |
157 | |
158 | // Panel sandwich 0.02 carbon*2 + 0.8 nomex |
159 | const Float_t kPanelLength = kSensLength; |
160 | const Float_t kPanelHeight = kSensHeight; |
161 | const Float_t kPanelWidth = 2 * kCarbonWidth + kNomexWidth; |
162 | |
f4a7360f |
163 | // Frame along the rounded (spacers) slats |
164 | const Float_t kRframeHeight = 2.00; |
165 | |
e516b01d |
166 | // spacer around the slat: 2 sticks along length,2 along height |
167 | // H: the horizontal ones |
168 | const Float_t kHframeLength = kPcbLength; |
169 | const Float_t kHframeHeight = 1.95; // updated Ch. Finck |
170 | const Float_t kHframeWidth = kSensWidth; |
171 | const Int_t kHframeMaterial = idNoryl; |
172 | |
173 | // V: the vertical ones; vertical spacers |
174 | const Float_t kVframeLength = 2.5; |
175 | const Float_t kVframeHeight = kSensHeight + kHframeHeight; |
176 | const Float_t kVframeWidth = kSensWidth; |
177 | const Int_t kVframeMaterial = idNoryl; |
178 | |
179 | // B: the horizontal border filled with rohacell: ok Ch. Finck |
180 | const Float_t kBframeLength = kHframeLength; |
181 | const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight; |
182 | const Float_t kBframeWidth = kHframeWidth; |
183 | const Int_t kBframeMaterial = idRoha; |
184 | |
185 | // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics |
186 | const Float_t kNulocLength = 2.5; |
187 | const Float_t kNulocHeight = kBframeHeight; |
188 | const Float_t kNulocWidth = 0.0030 + 0.0014; // equivalent copper width of vetronite; |
189 | const Int_t kNulocMaterial = idCopper; |
190 | |
191 | // Slat parameters |
192 | const Float_t kSlatHeight = kPcbHeight; |
193 | const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth |
194 | + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck |
eb1c3e3a |
195 | // const Int_t kSlatMaterial = idAir; |
e516b01d |
196 | const Float_t kDslatLength = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck |
197 | Float_t zSlat = AliMUONConstants::DzSlat();// implemented Ch. Finck |
198 | Float_t dzCh = AliMUONConstants::DzCh(); |
199 | |
200 | Float_t spar[3]; |
201 | Int_t i, j; |
202 | Int_t detElemId; |
203 | |
204 | // the panel volume contains the nomex |
205 | Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. }; |
206 | Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. }; |
207 | Float_t twidth = kPanelWidth + kNomexBWidth; |
208 | Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex |
209 | |
210 | // insulating material contains PCB-> gas |
211 | twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ; |
212 | Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. }; |
213 | twidth -= 2 * kInsuWidth; |
214 | Float_t pcbpar[3] = {kPcbLength/2., kPcbHeight/2., twidth/2. }; |
215 | Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. }; |
216 | Float_t theight = 2 * kHframeHeight + kSensHeight; |
217 | Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.}; |
218 | Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.}; |
219 | Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.}; |
220 | Float_t nulocpar[3] = {kNulocLength/2., kNulocHeight/2., kNulocWidth/2.}; |
221 | |
222 | Float_t xx; |
223 | Float_t xxmax = (kBframeLength - kNulocLength)/2.; |
224 | Int_t index=0; |
d1cd2474 |
225 | |
e516b01d |
226 | AliMUONChamber *iChamber, *iChamber1, *iChamber2; |
d12a7158 |
227 | |
e516b01d |
228 | Int_t* fStations = new Int_t[5]; |
229 | for (Int_t i=0; i<5; i++) fStations[i] = 1; |
230 | fStations[2] = 1; |
231 | |
232 | if (fStations[2]) |
d1cd2474 |
233 | { |
e516b01d |
234 | //******************************************************************** |
e118b27e |
235 | // Station 3 ** |
236 | //******************************************************************** |
237 | // indices 1 and 2 for first and second chambers in the station |
238 | // iChamber (first chamber) kept for other quanties than Z, |
239 | // assumed to be the same in both chambers |
e516b01d |
240 | |
e118b27e |
241 | iChamber = &fMUON->Chamber(4); |
e516b01d |
242 | iChamber1 = iChamber; |
e118b27e |
243 | iChamber2 = &fMUON->Chamber(5); |
d1cd2474 |
244 | |
b7ef3c96 |
245 | //GetGeometry(4)->SetDebug(kTRUE); |
246 | //GetGeometry(5)->SetDebug(kTRUE); |
e118b27e |
247 | |
6ffd4cb7 |
248 | if (!gAlice->GetModule("DIPO")) { |
249 | // Mother volume for each chamber in st3 are only defined if Dipole volue is there. |
250 | // Outer excess and inner recess for mother volume radius |
251 | // with respect to ROuter and RInner |
124dd59f |
252 | Float_t dMotherInner = AliMUONConstants::Rmin(2)-kRframeHeight; |
253 | Float_t dMotherOutner= AliMUONConstants::Rmax(2)+kVframeLength + 37.0; |
254 | // Additional 37 cm gap is needed to wrap the corners of the slats sin Rmax represent the maximum active radius of the chamber with 2pi phi acceptance |
6ffd4cb7 |
255 | Float_t tpar[3]; |
b7ef3c96 |
256 | Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(5)) - |
257 | (-AliMUONConstants::DefaultChamberZ(4)) ) /2.1; |
124dd59f |
258 | tpar[0] = dMotherInner; |
259 | tpar[1] = dMotherOutner; |
6ffd4cb7 |
260 | tpar[2] = dstation; |
261 | gMC->Gsvolu("CH05", "TUBE", idAir, tpar, 3); |
262 | gMC->Gsvolu("CH06", "TUBE", idAir, tpar, 3); |
6ffd4cb7 |
263 | } |
e516b01d |
264 | // volumes for slat geometry (xx=5,..,10 chamber id): |
265 | // Sxx0 Sxx1 Sxx2 Sxx3 --> Slat Mother volumes |
266 | // SxxG --> Sensitive volume (gas) |
267 | // SxxP --> PCB (copper) |
268 | // SxxI --> Insulator (G10) |
269 | // SxxC --> Carbon panel |
270 | // SxxN --> Nomex comb |
271 | // SxxX --> Nomex bulk |
272 | // SxxH, SxxV --> Horizontal and Vertical frames (Noryl) |
273 | // SB5x --> Volumes for the 35 cm long PCB |
274 | // slat dimensions: slat is a MOTHER volume!!! made of air |
275 | |
276 | // only for chamber 5: slat 1 has a PCB shorter by 5cm! |
277 | |
278 | Float_t tlength = 35.; |
279 | Float_t panelpar2[3] = { tlength/2., panelpar[1], panelpar[2]}; |
280 | Float_t nomexpar2[3] = { tlength/2., nomexpar[1], nomexpar[2]}; |
281 | Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1], nomexbpar[2]}; |
282 | Float_t insupar2[3] = { tlength/2., insupar[1], insupar[2]}; |
283 | Float_t pcbpar2[3] = { tlength/2., pcbpar[1], pcbpar[2]}; |
284 | Float_t senspar2[3] = { tlength/2., senspar[1], senspar[2]}; |
285 | Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]}; |
286 | Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]}; |
287 | Float_t *dum=0; |
288 | Float_t pcbDLength3 = (kPcbLength - tlength); |
289 | |
290 | const Int_t kNslats3 = 5; // number of slats per quadrant |
291 | const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat |
292 | const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.}; |
293 | const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7}; |
294 | Float_t slatLength3[kNslats3]; |
295 | |
296 | // create and position the slat (mother) volumes |
297 | |
298 | char idSlatCh5[5]; |
299 | char idSlatCh6[5]; |
300 | Float_t xSlat3; |
301 | Float_t ySlat3 = 0; |
302 | Float_t angle = 0.; |
303 | Float_t spar2[3]; |
304 | for (i = 0; i < kNslats3; i++){ |
305 | |
306 | slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength; |
307 | xSlat3 = slatLength3[i]/2. + kDslatLength + kXpos3[i]; |
308 | ySlat3 += kYpos3[i]; |
309 | |
310 | spar[0] = slatLength3[i]/2.; |
311 | spar[1] = kSlatHeight/2.; |
312 | spar[2] = kSlatWidth/2.; |
313 | // take away 5 cm from the first slat in chamber 5 |
7ddb761c |
314 | if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm |
e516b01d |
315 | spar2[0] = spar[0] - pcbDLength3/2.; |
316 | } else { |
317 | spar2[0] = spar[0]; |
318 | } |
319 | spar2[1] = spar[1]; |
320 | spar2[2] = spar[2]; |
321 | Float_t dzCh3 = dzCh; |
322 | Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ? |
323 | |
e856ab99 |
324 | sprintf(idSlatCh5,"LA%d",i+kNslats3-1); |
eb1c3e3a |
325 | //gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3); |
e856ab99 |
326 | detElemId = 509 - (i + kNslats3-1-4); |
e516b01d |
327 | GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3), |
328 | TGeoRotation("rot1",90,angle,90,90+angle,0,0) ); |
329 | |
330 | sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i); |
eb1c3e3a |
331 | //gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3); |
e856ab99 |
332 | detElemId = 500 + (i + kNslats3-1-4); |
e516b01d |
333 | GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3), |
334 | TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) ); |
335 | |
336 | if (i > 0) { |
337 | sprintf(idSlatCh5,"LA%d",kNslats3-1-i); |
eb1c3e3a |
338 | // gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3); |
e856ab99 |
339 | detElemId = 509 + (i + kNslats3-1-4); |
e516b01d |
340 | GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3), |
341 | TGeoRotation("rot3",90,angle,90,270+angle,180,0) ); |
342 | |
343 | sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i); |
eb1c3e3a |
344 | // gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3); |
e856ab99 |
345 | detElemId = 518 - (i + kNslats3-1-4); |
e516b01d |
346 | GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3), |
347 | TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) ); |
348 | } |
349 | |
350 | sprintf(idSlatCh6,"LB%d",kNslats3-1+i); |
eb1c3e3a |
351 | // gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
352 | detElemId = 609 - (i + kNslats3-1-4); |
e516b01d |
353 | GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3), |
354 | TGeoRotation("rot5",90,angle,90,90+angle,0,0) ); |
355 | sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i); |
eb1c3e3a |
356 | // gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
357 | detElemId = 600 + (i + kNslats3-1-4); |
e516b01d |
358 | GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3), |
359 | TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) ); |
360 | |
361 | if (i > 0) { |
362 | sprintf(idSlatCh6,"LB%d",kNslats3-1-i); |
eb1c3e3a |
363 | //gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
364 | detElemId = 609 + (i + kNslats3-1-4); |
e516b01d |
365 | GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3), |
366 | TGeoRotation("rot7",90,angle,90,270+angle,180,0) ); |
367 | |
368 | sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i); |
eb1c3e3a |
369 | //gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
370 | detElemId = 618 - (i + kNslats3-1-4); |
e516b01d |
371 | GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3), |
372 | TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) ); |
373 | } |
374 | } |
d1cd2474 |
375 | |
e516b01d |
376 | // create the panel volume |
d1cd2474 |
377 | |
e516b01d |
378 | gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3); |
379 | gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3); |
380 | gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3); |
4846c3ab |
381 | |
e516b01d |
382 | // create the nomex volume (honey comb) |
d1cd2474 |
383 | |
e516b01d |
384 | gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3); |
385 | gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3); |
386 | gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3); |
4846c3ab |
387 | |
e516b01d |
388 | // create the nomex volume (bulk) |
389 | |
390 | gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3); |
391 | gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3); |
392 | gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3); |
d1cd2474 |
393 | |
e516b01d |
394 | // create the insulating material volume |
395 | |
396 | gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3); |
397 | gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3); |
398 | gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3); |
4846c3ab |
399 | |
e516b01d |
400 | // create the PCB volume |
d1cd2474 |
401 | |
e516b01d |
402 | gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3); |
403 | gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3); |
404 | gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3); |
d1cd2474 |
405 | |
e516b01d |
406 | // create the sensitive volumes, |
4846c3ab |
407 | |
e516b01d |
408 | gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0); |
409 | gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0); |
d1cd2474 |
410 | |
e516b01d |
411 | // create the vertical frame volume |
d1cd2474 |
412 | |
e516b01d |
413 | gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3); |
414 | gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3); |
d1cd2474 |
415 | |
e516b01d |
416 | // create the horizontal frame volume |
d1cd2474 |
417 | |
e516b01d |
418 | gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3); |
419 | gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3); |
420 | gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3); |
4846c3ab |
421 | |
e516b01d |
422 | // create the horizontal border volume |
d1cd2474 |
423 | |
e516b01d |
424 | gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3); |
425 | gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3); |
426 | gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3); |
4846c3ab |
427 | |
e516b01d |
428 | index = 0; |
429 | for (i = 0; i<kNslats3; i++){ |
430 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
431 | |
432 | if (i == 0 && quadrant == 2) continue; |
433 | if (i == 0 && quadrant == 4) continue; |
434 | |
435 | sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1)); |
436 | sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1)); |
437 | Float_t xvFrame = (slatLength3[i] - kVframeLength)/2.; |
438 | Float_t xvFrame2 = xvFrame; |
439 | |
440 | if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.; |
441 | |
442 | // position the vertical frames |
443 | if ( i > 2) { |
444 | GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, |
445 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
446 | GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, |
447 | (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
448 | GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, |
449 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
450 | GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, |
451 | (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
452 | } |
453 | |
454 | if (i == 2) { |
455 | GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, |
456 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.)); |
457 | GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, |
458 | (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
459 | GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, |
460 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
461 | GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, |
462 | (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
463 | } |
464 | |
465 | if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck) |
466 | GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, |
467 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.)); |
468 | GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, |
469 | (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
470 | } |
471 | |
472 | // position the panels and the insulating material |
473 | for (j = 0; j < kNPCB3[i]; j++){ |
474 | if (i == 1 && j == 0) continue; |
475 | if (i == 0 && j == 0) continue; |
476 | index++; |
477 | Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5); |
478 | Float_t xx2 = xx - pcbDLength3/2.; |
d1cd2474 |
479 | |
e516b01d |
480 | Float_t zPanel = spar[2] - nomexbpar[2]; |
481 | |
482 | if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm |
483 | GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel)); |
484 | GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel)); |
485 | GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.)); |
486 | } else { |
487 | GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
488 | GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
489 | GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.)); |
490 | } |
491 | GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
492 | GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
493 | GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.)); |
d1cd2474 |
494 | |
e516b01d |
495 | } |
496 | } |
497 | } |
498 | |
499 | // position the nomex volume inside the panel volume |
500 | gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY"); |
501 | gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY"); |
502 | gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY"); |
4846c3ab |
503 | |
e516b01d |
504 | // position panel volume inside the bulk nomex material volume |
505 | gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
506 | gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
507 | gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
508 | |
509 | // position the PCB volume inside the insulating material volume |
510 | gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY"); |
511 | gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY"); |
512 | gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY"); |
4846c3ab |
513 | |
e516b01d |
514 | // position the horizontal frame volume inside the PCB volume |
515 | gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY"); |
516 | gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY"); |
517 | gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY"); |
4846c3ab |
518 | |
e516b01d |
519 | // position the sensitive volume inside the horizontal frame volume |
520 | gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3); |
521 | gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3); |
522 | gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3); |
4846c3ab |
523 | |
524 | |
e516b01d |
525 | // position the border volumes inside the PCB volume |
526 | Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; |
527 | gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY"); |
528 | gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY"); |
529 | gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY"); |
530 | gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY"); |
531 | |
532 | gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY"); |
533 | gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY"); |
4846c3ab |
534 | |
e516b01d |
535 | // create the NULOC volume and position it in the horizontal frame |
536 | gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3); |
537 | gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3); |
538 | index = 0; |
539 | Float_t xxmax2 = xxmax - pcbDLength3/2.; |
540 | for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { |
541 | index++; |
542 | gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
543 | gMC->Gspos("S05E",2*index ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY"); |
544 | gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
545 | gMC->Gspos("S06E",2*index ,"S06B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY"); |
546 | if (xx > -xxmax2 && xx< xxmax2) { |
547 | gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY"); |
548 | gMC->Gspos("S05E",2*index ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY"); |
549 | } |
550 | } |
551 | |
552 | // position the volumes approximating the circular section of the pipe |
553 | Float_t epsilon = 0.001; |
554 | Int_t ndiv = 6; |
555 | Int_t imax = 1; |
556 | Double_t divpar[3]; |
557 | Double_t dydiv = kSensHeight/ndiv; |
558 | Double_t ydiv = (kSensHeight - dydiv)/2.; |
b7ef3c96 |
559 | Double_t rmin = AliMUONConstants::Rmin(2);// Same radius for both chamber in St3 |
e516b01d |
560 | Double_t xdiv = 0.; |
561 | Float_t xvol; |
562 | Float_t yvol; |
563 | |
564 | for (Int_t idiv = 0; idiv < ndiv; idiv++){ |
565 | ydiv += dydiv; |
566 | xdiv = 0.; |
6f7aa53f |
567 | if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) ); |
e516b01d |
568 | divpar[0] = (kPcbLength - xdiv)/2.; |
569 | divpar[1] = dydiv/2. - epsilon; |
570 | divpar[2] = kSensWidth/2.; |
571 | xvol = (kPcbLength + xdiv)/2.; |
572 | yvol = ydiv; |
573 | |
574 | // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber |
575 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
576 | sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1)); |
577 | sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1)); |
578 | |
579 | GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1, |
580 | TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar); |
581 | |
582 | GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6, quadrant*100+imax+4*idiv+1, |
583 | TGeoTranslation(xvol-(kPcbLength * kNPCB3[1]/2.),yvol-kPcbLength,0.),3,divpar); |
584 | } |
585 | } |
586 | |
587 | // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3) |
588 | // Gines Martinez, Subatech sep 04 |
589 | // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3 |
590 | // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002 |
591 | // Rmin = 31.5 cm |
b7ef3c96 |
592 | rmin = AliMUONConstants::Rmin(2); // Same radius for both chamber in St3 |
e516b01d |
593 | ndiv = 9; |
594 | dydiv = kSensHeight/ndiv; // Vertical size of the box volume approximating the rounded PCB |
595 | ydiv = -kSensHeight/2 + dydiv/2.; // Initializing vertical position of the volume from bottom |
596 | xdiv = 0.; // Initializing horizontal position of the box volumes |
597 | |
598 | for (Int_t idiv = 0; idiv < ndiv; idiv++){ |
599 | xdiv = TMath::Abs( rmin * TMath::Sin( TMath::ACos(ydiv/rmin) ) ); |
600 | divpar[0] = (kPcbLength - xdiv)/2.; // Dimension of the box volume |
601 | divpar[1] = dydiv/2. - epsilon; |
602 | divpar[2] = kSensWidth/2.; |
603 | xvol = (kPcbLength + xdiv)/2.; //2D traslition for positionning of box volume |
604 | yvol = ydiv; |
605 | Int_t side; |
606 | for (side = 1; side <= 2; side++) { |
607 | sprintf(idSlatCh5,"LA%d",4); |
608 | sprintf(idSlatCh6,"LB%d",4); |
609 | if(side == 2) { |
610 | sprintf(idSlatCh5,"LA%d",13); |
611 | sprintf(idSlatCh6,"LB%d",13); |
612 | } |
613 | GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1, |
614 | TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar); |
615 | |
616 | GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1, |
617 | TGeoTranslation(xvol-(kPcbLength * kNPCB3[0]/2.),yvol,0.),3,divpar); |
618 | } |
619 | ydiv += dydiv; // Going from bottom to top |
620 | } |
621 | // cout << "Geometry for Station 3...... done" << endl; |
d1cd2474 |
622 | } |
623 | |
e516b01d |
624 | if (fStations[3]) { |
d1cd2474 |
625 | |
626 | |
e516b01d |
627 | // //******************************************************************** |
628 | // // Station 4 ** |
629 | // //******************************************************************** |
630 | // // indices 1 and 2 for first and second chambers in the station |
631 | // // iChamber (first chamber) kept for other quanties than Z, |
632 | // // assumed to be the same in both chambers |
633 | // corrected geometry (JP. Cussonneau, Ch. Finck) |
d1cd2474 |
634 | |
e118b27e |
635 | iChamber = &fMUON->Chamber(6); |
e516b01d |
636 | iChamber1 = iChamber; |
e118b27e |
637 | iChamber2 = &fMUON->Chamber(7); |
e516b01d |
638 | |
639 | const Int_t kNslats4 = 7; // number of slats per quadrant |
640 | const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat |
641 | const Float_t kXpos4[kNslats4] = {38.2, 0., 0., 0., 0., 0., 0.}; |
642 | const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6}; |
643 | const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 29.4, 37.0, 28.6}; |
644 | |
645 | Float_t slatLength4[kNslats4]; |
646 | |
6ffd4cb7 |
647 | |
648 | // Mother volume for each chamber |
649 | // Outer excess and inner recess for mother volume radius |
650 | // with respect to ROuter and RInner |
124dd59f |
651 | Float_t dMotherInner = AliMUONConstants::Rmin(3)-kRframeHeight; |
652 | // Additional 40 cm gap is needed to wrap the corners of the slats since Rmax represent the maximum active radius of the chamber with 2pi phi acceptance |
653 | Float_t dMotherOutner= AliMUONConstants::Rmax(3)+kVframeLength + 40.0; |
6ffd4cb7 |
654 | Float_t tpar[3]; |
b7ef3c96 |
655 | Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(7)) - |
2c9844e7 |
656 | (-AliMUONConstants::DefaultChamberZ(6)) ) /2.2; |
124dd59f |
657 | tpar[0] = dMotherInner; |
658 | tpar[1] = dMotherOutner; |
6ffd4cb7 |
659 | tpar[2] = dstation; |
660 | gMC->Gsvolu("CH07", "TUBE", idAir, tpar, 3); |
661 | gMC->Gsvolu("CH08", "TUBE", idAir, tpar, 3); |
6ffd4cb7 |
662 | |
e516b01d |
663 | // create and position the slat (mother) volumes |
664 | |
665 | char idSlatCh7[5]; |
666 | char idSlatCh8[5]; |
667 | Float_t xSlat4; |
668 | Float_t ySlat41 = 0; |
669 | Float_t ySlat42 = 0; |
670 | |
671 | angle = 0.; |
672 | |
673 | for (i = 0; i<kNslats4; i++){ |
674 | slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength; |
675 | xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i]; |
676 | ySlat41 += kYpos41[i]; |
677 | ySlat42 += kYpos42[i]; |
678 | |
679 | spar[0] = slatLength4[i]/2.; |
680 | spar[1] = kSlatHeight/2.; |
681 | spar[2] = kSlatWidth/2.; |
682 | Float_t dzCh4 = dzCh; |
683 | Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat; |
684 | |
685 | sprintf(idSlatCh7,"LC%d",kNslats4-1+i); |
eb1c3e3a |
686 | //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
687 | detElemId = 713 - (i + kNslats4-1-6); |
e516b01d |
688 | GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4), |
689 | TGeoRotation("rot1",90,angle,90,90+angle,0,0) ); |
690 | |
691 | sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i); |
eb1c3e3a |
692 | //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
693 | detElemId = 700 + (i + kNslats4-1-6); |
e516b01d |
694 | GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4), |
695 | TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) ); |
d1cd2474 |
696 | |
e516b01d |
697 | if (i > 0) { |
698 | sprintf(idSlatCh7,"LC%d",kNslats4-1-i); |
eb1c3e3a |
699 | //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
700 | detElemId = 713 + (i + kNslats4-1-6); |
e516b01d |
701 | GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4), |
702 | TGeoRotation("rot3",90,angle,90,270+angle,180,0) ); |
703 | |
704 | sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i); |
e856ab99 |
705 | detElemId = 726 - (i + kNslats4-1-6); |
eb1c3e3a |
706 | //gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3); |
e516b01d |
707 | GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, |
708 | TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4), |
709 | TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) ); |
710 | } |
711 | |
712 | sprintf(idSlatCh8,"LD%d",kNslats4-1+i); |
eb1c3e3a |
713 | //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3); |
e856ab99 |
714 | detElemId = 813 - (i + kNslats4-1-6); |
e516b01d |
715 | GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4), |
716 | TGeoRotation("rot5",90,angle,90,90+angle,0,0) ); |
717 | |
718 | sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i); |
e856ab99 |
719 | detElemId = 800 + (i + kNslats4-1-6); |
eb1c3e3a |
720 | //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3); |
e516b01d |
721 | GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4), |
722 | TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) ); |
723 | if (i > 0) { |
724 | sprintf(idSlatCh8,"LD%d",kNslats4-1-i); |
e856ab99 |
725 | detElemId = 813 + (i + kNslats4-1-6); |
eb1c3e3a |
726 | //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3); |
e516b01d |
727 | GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4), |
728 | TGeoRotation("rot7",90,angle,90,270+angle,180,0) ); |
729 | sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i); |
e856ab99 |
730 | detElemId = 826 - (i + kNslats4-1-6); |
eb1c3e3a |
731 | //gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3); |
e516b01d |
732 | GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4), |
733 | TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) ); |
734 | } |
735 | } |
d1cd2474 |
736 | |
e516b01d |
737 | // create the panel volume |
d1cd2474 |
738 | |
e516b01d |
739 | gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3); |
740 | gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3); |
d1cd2474 |
741 | |
e516b01d |
742 | // create the nomex volume |
d1cd2474 |
743 | |
e516b01d |
744 | gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3); |
745 | gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3); |
d1cd2474 |
746 | |
d1cd2474 |
747 | |
e516b01d |
748 | // create the nomex volume (bulk) |
d1cd2474 |
749 | |
e516b01d |
750 | gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3); |
751 | gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3); |
d1cd2474 |
752 | |
e516b01d |
753 | // create the insulating material volume |
754 | |
755 | gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3); |
756 | gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3); |
757 | |
758 | // create the PCB volume |
759 | |
760 | gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3); |
761 | gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3); |
d1cd2474 |
762 | |
e516b01d |
763 | // create the sensitive volumes, |
764 | |
765 | gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0); |
766 | gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0); |
767 | |
768 | // create the vertical frame volume |
769 | |
770 | gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3); |
771 | gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3); |
772 | |
773 | // create the horizontal frame volume |
774 | |
775 | gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3); |
776 | gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3); |
777 | |
778 | // create the horizontal border volume |
779 | |
780 | gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3); |
781 | gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3); |
782 | |
783 | index = 0; |
784 | for (i = 0; i < kNslats4; i++){ |
785 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
786 | |
787 | if (i == 0 && quadrant == 2) continue; |
788 | if (i == 0 && quadrant == 4) continue; |
789 | |
790 | sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1)); |
791 | sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1)); |
792 | Float_t xvFrame = (slatLength4[i] - kVframeLength)/2.; |
793 | |
794 | // position the vertical frames |
795 | if (i != 1) { |
796 | GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
797 | GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
798 | GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
799 | GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
800 | } else { // no rounded spacer yet |
801 | GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
802 | // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
803 | GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
804 | // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
805 | } |
806 | // position the panels and the insulating material |
807 | for (j = 0; j < kNPCB4[i]; j++){ |
808 | if (i == 1 && j == 0) continue; |
809 | index++; |
810 | Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5); |
811 | |
812 | Float_t zPanel = spar[2] - nomexbpar[2]; |
813 | GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
814 | GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
815 | GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.)); |
816 | GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
817 | GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
818 | GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.)); |
819 | } |
820 | } |
821 | } |
822 | |
823 | // position the nomex volume inside the panel volume |
824 | gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY"); |
825 | gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY"); |
826 | |
827 | // position panel volume inside the bulk nomex material volume |
828 | gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
829 | gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
830 | |
831 | // position the PCB volume inside the insulating material volume |
832 | gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY"); |
833 | gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY"); |
834 | |
835 | // position the horizontal frame volume inside the PCB volume |
836 | gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY"); |
837 | gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY"); |
838 | |
839 | // position the sensitive volume inside the horizontal frame volume |
840 | gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3); |
841 | gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3); |
842 | |
843 | // position the border volumes inside the PCB volume |
844 | Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; |
845 | gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY"); |
846 | gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY"); |
847 | gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY"); |
848 | gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY"); |
849 | |
850 | // create the NULOC volume and position it in the horizontal frame |
851 | |
852 | gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3); |
853 | gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3); |
854 | index = 0; |
855 | for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { |
856 | index++; |
857 | gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
858 | gMC->Gspos("S07E",2*index ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY"); |
859 | gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
860 | gMC->Gspos("S08E",2*index ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY"); |
861 | } |
862 | |
863 | // position the volumes approximating the circular section of the pipe |
864 | |
865 | Float_t epsilon = 0.001; |
866 | Int_t ndiv = 10; |
867 | Int_t imax = 1; |
868 | Double_t divpar[3]; |
869 | Double_t dydiv = kSensHeight/ndiv; |
870 | Double_t ydiv = (kSensHeight - dydiv)/2.; |
b7ef3c96 |
871 | Float_t rmin = AliMUONConstants::Rmin(3); // Same radius for both chamber of St4 |
e516b01d |
872 | Float_t xdiv = 0.; |
873 | Float_t xvol; |
874 | Float_t yvol; |
875 | |
876 | for (Int_t idiv = 0; idiv < ndiv; idiv++){ |
877 | ydiv += dydiv; |
878 | xdiv = 0.; |
6f7aa53f |
879 | if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) ); |
e516b01d |
880 | divpar[0] = (kPcbLength - xdiv)/2.; |
881 | divpar[1] = dydiv/2. - epsilon; |
882 | divpar[2] = kSensWidth/2.; |
883 | xvol = (kPcbLength + xdiv)/2.; |
884 | yvol = ydiv ; |
6296ba34 |
885 | |
e516b01d |
886 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
887 | sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1)); |
888 | sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1)); |
6296ba34 |
889 | |
e516b01d |
890 | GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1, |
891 | TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar); |
6296ba34 |
892 | |
e516b01d |
893 | GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1, |
894 | TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar); |
895 | } |
d12a7158 |
896 | } |
e516b01d |
897 | // cout << "Geometry for Station 4...... done" << endl; |
898 | |
899 | } |
d1cd2474 |
900 | |
e516b01d |
901 | if (fStations[4]) { |
6296ba34 |
902 | |
d1cd2474 |
903 | |
e516b01d |
904 | // //******************************************************************** |
905 | // // Station 5 ** |
906 | // //******************************************************************** |
907 | // // indices 1 and 2 for first and second chambers in the station |
908 | // // iChamber (first chamber) kept for other quanties than Z, |
909 | // // assumed to be the same in both chambers |
910 | // corrected geometry (JP. Cussonneau, Ch. Finck) |
911 | |
e118b27e |
912 | iChamber = &fMUON->Chamber(8); |
e516b01d |
913 | iChamber1 = iChamber; |
e118b27e |
914 | iChamber2 = &fMUON->Chamber(9); |
d1cd2474 |
915 | |
e516b01d |
916 | const Int_t kNslats5 = 7; // number of slats per quadrant |
917 | const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat |
918 | const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.}; |
919 | const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75}; |
920 | Float_t slatLength5[kNslats5]; |
921 | |
6ffd4cb7 |
922 | // Mother volume for each chamber |
923 | // Outer excess and inner recess for mother volume radius |
924 | // with respect to ROuter and RInner |
124dd59f |
925 | Float_t dMotherInner = AliMUONConstants::Rmin(4)-kRframeHeight; |
926 | // Additional 40 cm gap is needed to wrap the corners of the slats since Rmax represent the maximum active radius of the chamber with 2pi phi acceptance |
927 | Float_t dMotherOutner= AliMUONConstants::Rmax(4)+kVframeLength + 40.0; |
6ffd4cb7 |
928 | Float_t tpar[3]; |
b7ef3c96 |
929 | Double_t dstation = ( (-AliMUONConstants::DefaultChamberZ(9)) - |
930 | (-AliMUONConstants::DefaultChamberZ(8)) ) /2.3; |
124dd59f |
931 | tpar[0] = dMotherInner; |
932 | tpar[1] = dMotherOutner; |
6ffd4cb7 |
933 | tpar[2] = dstation; |
934 | gMC->Gsvolu("CH09", "TUBE", idAir, tpar, 3); |
935 | gMC->Gsvolu("CH10", "TUBE", idAir, tpar, 3); |
6ffd4cb7 |
936 | |
e516b01d |
937 | // create and position the slat (mother) volumes |
938 | |
939 | char idSlatCh9[5]; |
940 | char idSlatCh10[5]; |
941 | Float_t xSlat5; |
942 | Float_t ySlat5 = 0; |
943 | angle = 0.; |
944 | |
945 | for (i = 0; i < kNslats5; i++){ |
946 | |
947 | slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength; |
948 | xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i]; |
949 | ySlat5 += kYpos5[i]; |
950 | |
951 | spar[0] = slatLength5[i]/2.; |
952 | spar[1] = kSlatHeight/2.; |
953 | spar[2] = kSlatWidth/2.; |
954 | |
955 | Float_t dzCh5 = dzCh; |
956 | Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat; |
957 | |
958 | sprintf(idSlatCh9,"LE%d",kNslats5-1+i); |
e856ab99 |
959 | detElemId = 913 - (i + kNslats5-1-6); |
eb1c3e3a |
960 | //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3); |
e516b01d |
961 | GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5), |
962 | TGeoRotation("rot1",90,angle,90,90+angle,0,0) ); |
963 | |
964 | sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i); |
e856ab99 |
965 | detElemId = 900 + (i + kNslats5-1-6); |
eb1c3e3a |
966 | //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3); |
e516b01d |
967 | GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5), |
968 | TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) ); |
d1cd2474 |
969 | |
e516b01d |
970 | if (i > 0) { |
971 | sprintf(idSlatCh9,"LE%d",kNslats5-1-i); |
e856ab99 |
972 | detElemId = 913 + (i + kNslats5-1-6); |
eb1c3e3a |
973 | //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3); |
e516b01d |
974 | GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5), |
975 | TGeoRotation("rot3",90,angle,90,270+angle,180,0) ); |
976 | |
977 | sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i); |
e856ab99 |
978 | detElemId = 926 - (i + kNslats5-1-6); |
eb1c3e3a |
979 | //gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3); |
e516b01d |
980 | GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5), |
981 | TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) ); |
982 | } |
983 | |
984 | sprintf(idSlatCh10,"LF%d",kNslats5-1+i); |
e856ab99 |
985 | detElemId = 1013 - (i + kNslats5-1-6); |
eb1c3e3a |
986 | //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3); |
e516b01d |
987 | GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5), |
988 | TGeoRotation("rot5",90,angle,90,90+angle,0,0) ); |
989 | |
990 | sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i); |
e856ab99 |
991 | detElemId = 1000 + (i + kNslats5-1-6); |
eb1c3e3a |
992 | //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3); |
e516b01d |
993 | GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5), |
994 | TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) ); |
995 | |
996 | if (i > 0) { |
997 | sprintf(idSlatCh10,"LF%d",kNslats5-1-i); |
e856ab99 |
998 | detElemId = 1013 + (i + kNslats5-1-6); |
eb1c3e3a |
999 | //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3); |
e516b01d |
1000 | GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5), |
1001 | TGeoRotation("rot7",90,angle,90,270+angle,180,0) ); |
1002 | sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i); |
e856ab99 |
1003 | detElemId = 1026 - (i + kNslats5-1-6); |
eb1c3e3a |
1004 | //gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3); |
e516b01d |
1005 | GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5), |
1006 | TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) ); |
1007 | } |
1008 | } |
1009 | |
1010 | // create the panel volume |
d12a7158 |
1011 | |
e516b01d |
1012 | gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3); |
1013 | gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3); |
1014 | |
1015 | // create the nomex volume |
1016 | |
1017 | gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3); |
1018 | gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3); |
d1cd2474 |
1019 | |
d1cd2474 |
1020 | |
e516b01d |
1021 | // create the nomex volume (bulk) |
d1cd2474 |
1022 | |
e516b01d |
1023 | gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3); |
1024 | gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3); |
d1cd2474 |
1025 | |
e516b01d |
1026 | // create the insulating material volume |
d1cd2474 |
1027 | |
e516b01d |
1028 | gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3); |
1029 | gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3); |
c3b69531 |
1030 | |
e516b01d |
1031 | // create the PCB volume |
1032 | |
1033 | gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3); |
1034 | gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3); |
d1cd2474 |
1035 | |
e516b01d |
1036 | // create the sensitive volumes, |
1037 | |
1038 | gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0); |
1039 | gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0); |
1040 | |
1041 | // create the vertical frame volume |
1042 | |
1043 | gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3); |
1044 | gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3); |
1045 | |
1046 | // create the horizontal frame volume |
1047 | |
1048 | gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3); |
1049 | gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3); |
1050 | |
1051 | // create the horizontal border volume |
1052 | |
1053 | gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3); |
1054 | gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3); |
1055 | |
1056 | index = 0; |
1057 | for (i = 0; i < kNslats5; i++){ |
1058 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
1059 | |
1060 | if (i == 0 && quadrant == 2) continue; |
1061 | if (i == 0 && quadrant == 4) continue; |
1062 | |
1063 | sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1)); |
1064 | sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1)); |
1065 | Float_t xvFrame = (slatLength5[i] - kVframeLength)/2.; // ok |
1066 | |
1067 | // position the vertical frames (spacers) |
1068 | if (i != 1) { |
1069 | GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
1070 | GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
1071 | GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
1072 | GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
1073 | } else { // no rounded spacer yet |
1074 | GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
1075 | // GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
1076 | GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.)); |
1077 | // GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.)); |
1078 | } |
1079 | |
1080 | // position the panels and the insulating material |
1081 | for (j = 0; j < kNPCB5[i]; j++){ |
1082 | if (i == 1 && j == 0) continue; |
1083 | index++; |
1084 | Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5); |
1085 | |
1086 | Float_t zPanel = spar[2] - nomexbpar[2]; |
1087 | GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
1088 | GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
1089 | GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.)); |
1090 | |
1091 | GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel)); |
1092 | GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel)); |
1093 | GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.)); |
1094 | } |
1095 | } |
1096 | } |
1097 | |
1098 | // position the nomex volume inside the panel volume |
1099 | gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY"); |
1100 | gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY"); |
1101 | |
1102 | // position panel volume inside the bulk nomex material volume |
1103 | gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
1104 | gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY"); |
1105 | |
1106 | // position the PCB volume inside the insulating material volume |
1107 | gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY"); |
1108 | gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY"); |
1109 | |
1110 | // position the horizontal frame volume inside the PCB volume |
1111 | gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY"); |
1112 | gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY"); |
1113 | |
1114 | // position the sensitive volume inside the horizontal frame volume |
1115 | gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3); |
1116 | gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3); |
1117 | |
1118 | // position the border volumes inside the PCB volume |
1119 | Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; |
1120 | gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY"); |
1121 | gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY"); |
1122 | gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY"); |
1123 | gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY"); |
1124 | |
1125 | // // create the NULOC volume and position it in the horizontal frame |
1126 | |
1127 | gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3); |
1128 | gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3); |
1129 | index = 0; |
1130 | for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { |
1131 | index++; |
1132 | gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
1133 | gMC->Gspos("S09E",2*index ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY"); |
1134 | gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY"); |
1135 | gMC->Gspos("S10E",2*index ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY"); |
1136 | } |
1137 | |
d1cd2474 |
1138 | |
e516b01d |
1139 | // position the volumes approximating the circular section of the pipe |
1140 | Float_t epsilon = 0.001; |
1141 | Int_t ndiv = 10; |
1142 | Int_t imax = 1; |
1143 | Double_t divpar[3]; |
1144 | Double_t dydiv = kSensHeight/ndiv; |
1145 | Double_t ydiv = (kSensHeight - dydiv)/2.; |
b7ef3c96 |
1146 | Float_t rmin = AliMUONConstants::Rmin(4); |
e516b01d |
1147 | Float_t xdiv = 0.; |
1148 | Float_t xvol; |
1149 | Float_t yvol; |
1150 | |
1151 | for (Int_t idiv = 0; idiv < ndiv; idiv++){ |
1152 | ydiv += dydiv; |
1153 | xdiv = 0.; |
6f7aa53f |
1154 | if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos((ydiv-dydiv/2.)/rmin) ); |
e516b01d |
1155 | divpar[0] = (kPcbLength - xdiv)/2.; |
1156 | divpar[1] = dydiv/2. - epsilon; |
1157 | divpar[2] = kSensWidth/2.; |
1158 | xvol = (kPcbLength + xdiv)/2.; |
1159 | yvol = ydiv; |
1160 | |
1161 | for (Int_t quadrant = 1; quadrant <= 4; quadrant++) { |
1162 | sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1)); |
1163 | sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1)); |
1164 | |
1165 | GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1, |
1166 | TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar); |
1167 | GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10, quadrant*100+imax+4*idiv+1, |
1168 | TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar); |
1169 | } |
d1cd2474 |
1170 | } |
e516b01d |
1171 | // cout << "Geometry for Station 5...... done" << endl; |
1172 | |
1173 | } |
d1cd2474 |
1174 | } |
1175 | |
1176 | |
1177 | //______________________________________________________________________________ |
1178 | void AliMUONSlatGeometryBuilder::SetTransformations() |
1179 | { |
2c9844e7 |
1180 | // Defines the transformations for the station345 chambers. |
d1cd2474 |
1181 | // --- |
eb1c3e3a |
1182 | |
1183 | if (gAlice->GetModule("DIPO")) { |
1184 | // if DIPO is preset, the whole station will be placed in DDIP volume |
1185 | SetMotherVolume(4, "DDIP"); |
1186 | SetMotherVolume(5, "DDIP"); |
1187 | SetVolume(4, "CH05", true); |
1188 | SetVolume(5, "CH06", true); |
1189 | } |
1190 | else { |
1191 | SetVolume(4, "CH05"); |
1192 | SetVolume(5, "CH06"); |
c0404a6c |
1193 | } |
1194 | |
1195 | if (gAlice->GetModule("SHIL")) { |
1196 | SetMotherVolume(6, "YOUT2"); |
1197 | SetMotherVolume(7, "YOUT2"); |
1198 | SetMotherVolume(8, "YOUT2"); |
1199 | SetMotherVolume(9, "YOUT2"); |
eb1c3e3a |
1200 | } |
c0404a6c |
1201 | |
eb1c3e3a |
1202 | SetVolume(6, "CH07"); |
1203 | SetVolume(7, "CH08"); |
1204 | SetVolume(8, "CH09"); |
1205 | SetVolume(9, "CH10"); |
1206 | |
2c9844e7 |
1207 | // Stations 345 are not perpendicular to the beam axis |
1208 | // See AliMUONConstants class |
1209 | TGeoRotation st345inclination("rot99"); |
1210 | st345inclination.RotateX(AliMUONConstants::St345Inclination()); |
1211 | |
b7ef3c96 |
1212 | Double_t zpos1= - AliMUONConstants::DefaultChamberZ(4); |
2c9844e7 |
1213 | SetTransformation(4, TGeoTranslation(0., 0., zpos1), st345inclination); |
b7ef3c96 |
1214 | |
1215 | zpos1= - AliMUONConstants::DefaultChamberZ(5); |
2c9844e7 |
1216 | SetTransformation(5, TGeoTranslation(0., 0., zpos1), st345inclination); |
b7ef3c96 |
1217 | |
1218 | zpos1 = - AliMUONConstants::DefaultChamberZ(6); |
2c9844e7 |
1219 | SetTransformation(6, TGeoTranslation(0., 0., zpos1), st345inclination); |
b7ef3c96 |
1220 | |
1221 | zpos1 = - AliMUONConstants::DefaultChamberZ(7); |
2c9844e7 |
1222 | SetTransformation(7, TGeoTranslation(0., 0., zpos1), st345inclination ); |
b7ef3c96 |
1223 | |
1224 | zpos1 = - AliMUONConstants::DefaultChamberZ(8); |
2c9844e7 |
1225 | SetTransformation(8, TGeoTranslation(0., 0., zpos1), st345inclination); |
b7ef3c96 |
1226 | |
1227 | zpos1 = - AliMUONConstants::DefaultChamberZ(9); |
2c9844e7 |
1228 | SetTransformation(9, TGeoTranslation(0., 0., zpos1), st345inclination); |
d1cd2474 |
1229 | |
1230 | } |
1231 | |
1232 | //______________________________________________________________________________ |
1233 | void AliMUONSlatGeometryBuilder::SetSensitiveVolumes() |
1234 | { |
1235 | // Defines the sensitive volumes for slat stations chambers. |
1236 | // --- |
1237 | |
e118b27e |
1238 | GetGeometry(4)->SetSensitiveVolume("S05G"); |
1239 | GetGeometry(5)->SetSensitiveVolume("S06G"); |
1240 | GetGeometry(6)->SetSensitiveVolume("S07G"); |
1241 | GetGeometry(7)->SetSensitiveVolume("S08G"); |
1242 | GetGeometry(8)->SetSensitiveVolume("S09G"); |
1243 | GetGeometry(9)->SetSensitiveVolume("S10G"); |
d1cd2474 |
1244 | } |
1245 | |
1246 | //______________________________________________________________________________ |
1247 | Int_t AliMUONSlatGeometryBuilder::ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq) const |
1248 | { |
2057e0cc |
1249 | // On-line function establishing the correspondance between numslat (the slat number on a particular quadrant (numslat->0....4 for St3)) |
1250 | // and slatnum (the slat number on the whole panel (slatnum->1...18 for St3) |
c10e6eaf |
1251 | numslat += 1; |
1252 | if (quadnum==2 || quadnum==3) |
1253 | numslat += fspq; |
1254 | else |
1255 | numslat = fspq + 2-numslat; |
1256 | numslat -= 1; |
d1cd2474 |
1257 | |
c10e6eaf |
1258 | if (quadnum==3 || quadnum==4) numslat += 2*fspq+1; |
1259 | |
1260 | return numslat; |
d1cd2474 |
1261 | } |