]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONSt1GeometryBuilderV2.cxx
Removed unused include
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.cxx
... / ...
Content-type: text/html ]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - MUON/AliMUONSt1GeometryBuilderV2.cxx


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 5) line 1, <$fd> line 676.
CommitLineData
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// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
19//
20// Class AliMUONSt1GeometryBuilderV2
21// ---------------------------------
22// MUON Station1 detailed geometry construction class.
23// (Originally defined in AliMUONv2.cxx - now removed.)
24// Included in AliRoot 2004/01/23
25
26#include "AliMUONSt1GeometryBuilderV2.h"
27#include "AliMUONSt1SpecialMotif.h"
28#include "AliMUON.h"
29#include "AliMUONConstants.h"
30#include "AliMUONGeometryModule.h"
31#include "AliMUONGeometryEnvelopeStore.h"
32
33#include "AliMpContainers.h"
34#include "AliMpConstants.h"
35#include "AliMpFiles.h"
36#include "AliMpSectorReader.h"
37#include "AliMpSector.h"
38#include "AliMpRow.h"
39#include "AliMpVRowSegment.h"
40#include "AliMpMotifMap.h"
41#include "AliMpMotifPosition.h"
42#include "AliMpPlaneType.h"
43
44#include "AliRun.h"
45#include "AliMagF.h"
46#include "AliLog.h"
47
48#include <TVector2.h>
49#include <TVector3.h>
50#include <TGeoMatrix.h>
51#include <TClonesArray.h>
52#include <Riostream.h>
53#include <TSystem.h>
54#include <TVirtualMC.h>
55#include <TGeoManager.h>
56#include <TGeoVolume.h>
57#include <TGeoTube.h>
58#include <TGeoCompositeShape.h>
59
60#ifdef WITH_STL
61 #include <vector>
62#endif
63
64#ifdef WITH_ROOT
65 #include "TArrayI.h"
66#endif
67
68/// \cond CLASSIMP
69ClassImp(AliMUONSt1GeometryBuilderV2)
70/// \endcond
71
72// Thickness Constants
73const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzPadPlane=0.0148/2.; //Pad plane
74const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFoam = 2.503/2.; //Foam of mechanicalplane
75const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFR4 = 0.062/2.; //FR4 of mechanical plane
76const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt)
77const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzKapton = 0.0122/2.; //Kapton
78const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergPlastic = 0.3062/2.;//Berg connector
79const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergCopper = 0.1882/2.; //Berg connector
80const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzDaughter = 0.0156/2.; //Daughter board
81const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzGas = 0.42/2.; //Gas thickness
82
83// Quadrant Mother volume - TUBS1 - Middle layer of model
84const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR1 = 18.3;
85const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR1 = 105.673;
86const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick1 = 6.5/2;
87const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL1 = 0.;
88const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU1 = 90.;
89
90// Quadrant Mother volume - TUBS2 - near and far layers of model
91const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR2 = 20.7;
92const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR2 = 100.073;
93const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick2 = 3.0/2;
94const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL2 = 0.;
95const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU2 = 90.;
96
97// Sensitive copper pads, foam layer, PCB and electronics model parameters
98const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxHole=1.5/2.;
99const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyHole=6./2.;
100const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergPlastic=0.74/2.;
101const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergPlastic=5.09/2.;
102const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergCopper=0.25/2.;
103const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergCopper=3.6/2.;
104const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxKapton=0.8/2.;
105const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyKapton=5.7/2.;
106const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxDaughter=2.3/2.;
107const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyDaughter=6.3/2.;
108const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetX=1.46;
109const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetY=0.71;
110const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamX=1.46;
111const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamY=0.051;
112
113const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaQuadLHC=2.6; // LHC Origin wrt Quadrant Origin
114const GReal_t AliMUONSt1GeometryBuilderV2::fgkFrameOffset=5.2;
115 // Fix (1) of overlap SQN* layers with SQM* ones (was 5.0)
116
117// Pad planes offsets
118const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadXOffsetBP = 0.50 - 0.63/2; // = 0.185
119const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadYOffsetBP = -0.31 - 0.42/2; // =-0.52
120
121const char* AliMUONSt1GeometryBuilderV2::fgkHoleName="SCHL";
122const char* AliMUONSt1GeometryBuilderV2::fgkDaughterName="SCDB";
123const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantEnvelopeName="SE";
124const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM";
125const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN";
126const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF";
127const Int_t AliMUONSt1GeometryBuilderV2::fgkFoamBoxNameOffset=200;
128const Int_t AliMUONSt1GeometryBuilderV2::fgkFR4BoxNameOffset=400;
129const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000;
130
131//______________________________________________________________________________
132AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon)
133 : AliMUONVGeometryBuilder(0, 2),
134 fMUON(muon)
135{
136/// Standard constructor
137
138 // set path to mapping data files
139 if (! gSystem->Getenv("MINSTALL")) {
140 TString dirPath = gSystem->Getenv("ALICE_ROOT");
141 dirPath += "/MUON/mapping";
142 AliMpFiles::SetTopPath(dirPath);
143 gSystem->Setenv("MINSTALL", dirPath.Data());
144 //cout << "AliMpFiles top path set to " << dirPath << endl;
145 }
146 //else
147 // cout << gSystem->Getenv("MINSTALL") << endl;
148}
149
150//______________________________________________________________________________
151AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2()
152 : AliMUONVGeometryBuilder(),
153 fMUON(0)
154{
155/// Default Constructor
156}
157
158//______________________________________________________________________________
159AliMUONSt1GeometryBuilderV2::~AliMUONSt1GeometryBuilderV2()
160{
161/// Destructor
162}
163
164
165//
166// Private methods
167//
168
169//______________________________________________________________________________
170TString
171AliMUONSt1GeometryBuilderV2::QuadrantEnvelopeName(Int_t chamber, Int_t quadrant) const
172{
173/// Generate unique envelope name from chamber Id and quadrant number
174
175 return Form("%s%d", Form("%s%d",fgkQuadrantEnvelopeName,chamber), quadrant);
176}
177
178//______________________________________________________________________________
179void AliMUONSt1GeometryBuilderV2::CreateHole()
180{
181/// Create all the elements found inside a foam hole
182
183 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
184 Int_t idAir = idtmed[1100]; // medium 1
185 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
186 Int_t idCopper = idtmed[1121]; // medium 22 = copper
187
188 GReal_t par[3];
189 GReal_t posX,posY,posZ;
190
191 par[0] = fgkHxHole;
192 par[1] = fgkHyHole;
193 par[2] = fgkHzFoam;
194 gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3);
195
196 par[0] = fgkHxKapton;
197 par[1] = fgkHyKapton;
198 par[2] = fgkHzSnPb;
199 gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3);
200 posX = 0.;
201 posY = 0.;
202 posZ = -fgkHzFoam+fgkHzSnPb;
203 gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
204
205 par[0] = fgkHxHole;
206 par[1] = fgkHyBergPlastic;
207 par[2] = fgkHzKapton;
208 gMC->Gsvolu("SKPT", "BOX", idCopper, par, 3);
209 posX = 0.;
210 posY = 0.;
211 posZ = 0.;
212 gMC->Gspos("SKPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
213}
214
215//______________________________________________________________________________
216void AliMUONSt1GeometryBuilderV2::CreateDaughterBoard()
217{
218/// Create all the elements in a daughter board
219
220 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
221 Int_t idAir = idtmed[1100]; // medium 1
222 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
223 //Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic
224 Int_t idCopper = idtmed[1121]; // medium 22 = copper
225 Int_t idPlastic =idtmed[1127]; // medium 28 = Plastic
226
227 GReal_t par[3];
228 GReal_t posX,posY,posZ;
229
230 par[0]=fgkHxDaughter;
231 par[1]=fgkHyDaughter;
232 par[2]=TotalHzDaughter();
233 gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3);
234
235 par[0]=fgkHxBergPlastic;
236 par[1]=fgkHyBergPlastic;
237 par[2]=fgkHzBergPlastic;
238 gMC->Gsvolu("SBGP","BOX",idPlastic,par,3);
239 posX=0.;
240 posY=0.;
241 posZ = -TotalHzDaughter() + fgkHzBergPlastic;
242 gMC->Gspos("SBGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
243
244 par[0]=fgkHxBergCopper;
245 par[1]=fgkHyBergCopper;
246 par[2]=fgkHzBergCopper;
247 gMC->Gsvolu("SBGC","BOX",idCopper,par,3);
248 posX=0.;
249 posY=0.;
250 posZ=0.;
251 gMC->Gspos("SBGC",1,"SBGP",posX,posY,posZ,0,"ONLY");
252
253 par[0]=fgkHxDaughter;
254 par[1]=fgkHyDaughter;
255 par[2]=fgkHzDaughter;
256 gMC->Gsvolu("SDGH","BOX",idCopper,par,3);
257 posX=0.;
258 posY=0.;
259 posZ = -TotalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter;
260 gMC->Gspos("SDGH",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
261}
262
263//______________________________________________________________________________
264void AliMUONSt1GeometryBuilderV2::CreateInnerLayers()
265{
266/// Create the layer of sensitive volumes with gas
267/// and the copper layer.
268
269// Gas Medium
270 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
271 //Int_t idArCO2 = idtmed[1108]; // medium 9 (ArCO2 80%)
272 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
273 Int_t idArCO2 = idtmed[1124]; // medium 25 (ArCO2 80%)
274 Int_t idCopper = idtmed[1121]; // medium 22 = copper
275
276 Float_t par[11];
277
278//Make gas volume - composed of 11 trapezoids
279// section 1 of 11
280 par[0] = fgkHzGas;
281 par[1] = 0.;
282 par[2] = 0.;
283 par[3] = 71.33/2.;
284 par[4] = 9.76/2.;
285 par[5] = 48.77/2.;
286 par[6] = 15.3;
287 par[7] = 71.33/2.;
288 par[8] = 9.76/2.;
289 par[9] = 48.77/2.;
290 par[10] = 15.3;
291
292 gMC->Gsvolu("SA1G", "TRAP", idArCO2, par, 11);
293 gMC->Gsvolu("SA2G", "TRAP", idArCO2, par, 11);
294
295 par[0] = fgkHzPadPlane;
296 gMC->Gsvolu("SA1C", "TRAP", idCopper,par, 11);
297
298// section 2 of 11
299 par[0] = fgkHzGas;
300 par[1] = 0.;
301 par[2] = 0.;
302 par[3] = 79.68/2.;
303 par[4] = 10.4/2.;
304 par[5] = 57.0/2.;
305 par[6] = 0.;
306 par[7] = 79.68/2.;
307 par[8] = 10.4/2.;
308 par[9] = 57.0/2.;
309 par[10] = 0.;
310 gMC->Gsvolu("SB1G", "TRAP", idArCO2, par, 11);
311 gMC->Gsvolu("SB2G", "TRAP", idArCO2, par, 11);
312
313 par[0] = fgkHzPadPlane;
314 gMC->Gsvolu("SB1C", "TRAP", idCopper,par, 11);
315
316// section 3 of 11
317 par[0] = fgkHzGas;
318 par[1] = 0.;
319 par[2] = 0.;
320 par[3] = 71.33/2.;
321 par[4] = 48.77/2.;
322 par[5] = 9.73/2.;
323 par[6] = -15.3;
324 par[7] = 71.33/2.;
325 par[8] = 48.77/2.;
326 par[9] = 9.73/2.;
327 par[10] = -15.3;
328
329 gMC->Gsvolu("SC1G", "TRAP", idArCO2, par, 11);
330 gMC->Gsvolu("SC2G", "TRAP", idArCO2, par, 11);
331
332 par[0] = fgkHzPadPlane;
333 gMC->Gsvolu("SC1C", "TRAP", idCopper,par, 11);
334
335// section 4 of 11
336 par[0] = fgkHzGas;
337 par[1] = 0.;
338 par[2] = 0.;
339 par[3] = 6.00/2.;
340 par[4] = 0.;
341 par[5] = 1.56/2.;
342 par[6] = 7.41;
343 par[7] = 6.00/2.;
344 par[8] = 0.;
345 par[9] = 1.56/2.;
346 par[10] = 7.41;
347 gMC->Gsvolu("SD1G", "TRAP", idArCO2, par, 11);
348 gMC->Gsvolu("SD2G", "TRAP", idArCO2, par, 11);
349
350 par[0] = fgkHzPadPlane;
351 gMC->Gsvolu("SD1C", "TRAP", idCopper,par, 11);
352
353// section 5 of 11
354 par[0] = fgkHzGas;
355 par[1] = 0.;
356 par[2] = 0.;
357 par[3] = 1.516/2.;
358 par[4] = 0.;
359 par[5] = 0.829/2.;
360 par[6] = 15.3;
361 par[7] = 1.516/2.;
362 par[8] = 0.;
363 par[9] = 0.829/2.;
364 par[10] = 15.3;
365 gMC->Gsvolu("SE1G", "TRAP", idArCO2, par, 11);
366 gMC->Gsvolu("SE2G", "TRAP", idArCO2, par, 11);
367
368 par[0] = fgkHzPadPlane;
369 gMC->Gsvolu("SE1C", "TRAP", idCopper,par, 11);
370
371// section 6 of 11
372 par[0] = fgkHzGas;
373 par[1] = 0.;
374 par[2] = 0.;
375 par[3] = 3.92/2.;
376 par[4] = 0.;
377 par[5] = 0.562/2.;
378 par[6] = -4.1;
379 par[7] = 3.92/2.;
380 par[8] = 0.;
381 par[9] = 0.562/2.;
382 par[10] = -4.1;
383 gMC->Gsvolu("SF1G", "TRAP", idArCO2, par, 11);
384 gMC->Gsvolu("SF2G", "TRAP", idArCO2, par, 11);
385
386 par[0] = fgkHzPadPlane;
387 gMC->Gsvolu("SF1C", "TRAP", idCopper,par, 11);
388
389// section 7 of 11
390 par[0] = fgkHzGas;
391 par[1] = 0.;
392 par[2] = 0.;
393 par[3] = 0.941/2.;
394 par[4] = 0.562/2.;
395 par[5] = 0.;
396 par[6] = -16.6;
397 par[7] = 0.941/2.;
398 par[8] = 0.562/2.;
399 par[9] = 0.;
400 par[10] =-16.6;
401 gMC->Gsvolu("SG1G", "TRAP", idArCO2, par, 11);
402 gMC->Gsvolu("SG2G", "TRAP", idArCO2, par, 11);
403
404 par[0] = fgkHzPadPlane;
405 gMC->Gsvolu("SG1C", "TRAP", idCopper,par, 11);
406
407// section 8 of 11
408 par[0] = fgkHzGas;
409 par[1] = 0.;
410 par[2] = 0.;
411 par[3] = 3.94/2.;
412 par[4] = 0.57/2.;
413 par[5] = 0.;
414 par[6] = 4.14;
415 par[7] = 3.94/2.;
416 par[8] = 0.57/2.;
417 par[9] = 0.;
418 par[10] = 4.14;
419 gMC->Gsvolu("SH1G", "TRAP", idArCO2, par, 11);
420 gMC->Gsvolu("SH2G", "TRAP", idArCO2, par, 11);
421
422 par[0] = fgkHzPadPlane;
423 gMC->Gsvolu("SH1C", "TRAP", idCopper,par, 11);
424
425// section 9 of 11
426 par[0] = fgkHzGas;
427 par[1] = 0.;
428 par[2] = 0.;
429 par[3] = 0.95/2.;
430 par[4] = 0.;
431 par[5] = 0.57/2;
432 par[6] = 16.7;
433 par[7] = 0.95/2.;
434 par[8] = 0.;
435 par[9] = 0.57/2;
436 par[10] = 16.7;
437 gMC->Gsvolu("SI1G", "TRAP", idArCO2, par, 11);
438 gMC->Gsvolu("SI2G", "TRAP", idArCO2, par, 11);
439
440 par[0] = fgkHzPadPlane;
441 gMC->Gsvolu("SI1C", "TRAP", idCopper,par, 11);
442
443// section 10 of 11
444 par[0] = fgkHzGas;
445 par[1] = 0.;
446 par[2] = 0.;
447 par[3] = 1.49/2.;
448 par[4] = 0.;
449 par[5] = 0.817/2.;
450 par[6] = -15.4;
451 par[7] = 1.49/2.;
452 par[8] = 0.;
453 par[9] = 0.817/2.;
454 par[10] = -15.4;
455 gMC->Gsvolu("SJ1G", "TRAP", idArCO2, par, 11);
456 gMC->Gsvolu("SJ2G", "TRAP", idArCO2, par, 11);
457
458 par[0] = fgkHzPadPlane;
459 gMC->Gsvolu("SJ1C", "TRAP", idCopper,par, 11);
460
461// section 11 of 11
462 par[0] = fgkHzGas;
463 par[1] = 0.;
464 par[2] = 0.;
465 par[3] = 5.93/2.;
466 par[4] = 0.;
467 par[5] = 1.49/2.;
468 par[6] = -7.16;
469 par[7] = 5.93/2.;
470 par[8] = 0.;
471 par[9] = 1.49/2.;
472 par[10] = -7.16;
473 gMC->Gsvolu("SK1G", "TRAP", idArCO2, par, 11);
474 gMC->Gsvolu("SK2G", "TRAP", idArCO2, par, 11);
475
476 par[0] = fgkHzPadPlane;
477 gMC->Gsvolu("SK1C", "TRAP", idCopper,par, 11);
478}
479
480//______________________________________________________________________________
481void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
482{
483/// Create the quadrant (bending and non-bending planes)
484/// for the given chamber
485
486 CreateFrame(chamber);
487
488#ifdef WITH_STL
489 SpecialMap specialMap;
490 specialMap[76] = AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.);
491 specialMap[75] = AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36));
492 specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.01, 0.36));
493#endif
494
495#ifdef WITH_ROOT
496 SpecialMap specialMap;
497 specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.84), 90.));
498 specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.5, 0.36)));
499 specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
500#endif
501
502 AliMpSectorReader reader1(kStation1, kBendingPlane);
503 AliMpSector* sector1 = reader1.BuildSector();
504
505 //Bool_t reflectZ = true;
506 Bool_t reflectZ = false;
507 //TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
508 TVector3 where = TVector3(fgkDeltaQuadLHC + fgkPadXOffsetBP,
509 fgkDeltaQuadLHC + fgkPadYOffsetBP, 0.);
510 PlaceSector(sector1, specialMap, where, reflectZ, chamber);
511
512#ifdef WITH_STL
513 specialMap.clear();
514 specialMap[76] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.);
515 specialMap[75] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17));
516 specialMap[47] = AliMUONSt1SpecialMotif(TVector2(2.18,-0.98));
517 specialMap[20] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08));
518 specialMap[46] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25));
519 specialMap[74] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21));
520 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
521 // in the true position)
522 // Was: specialMap[47] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18));
523#endif
524
525#ifdef WITH_ROOT
526 Int_t nb = AliMpConstants::ManuMask(kNonBendingPlane);
527 specialMap.Delete();
528 specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.));
529 specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.96, 0.17)));
530 specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.18,-0.98)));
531 specialMap.Add(20 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
532 specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25)));
533 specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.28, 0.21)));
534 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
535 // in the true position)
536 // Was: specialMap.Add(47,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)));
537#endif
538
539 AliMpSectorReader reader2(kStation1, kNonBendingPlane);
540 AliMpSector* sector2 = reader2.BuildSector();
541
542 //reflectZ = false;
543 reflectZ = true;
544 TVector2 offset = sector2->Position();
545 where = TVector3(where.X()+offset.X(), where.Y()+offset.Y(), 0.);
546 // Add the half-pad shift of the non-bending plane wrt bending plane
547 // (The shift is defined in the mapping as sector offset)
548 // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2
549 PlaceSector(sector2, specialMap, where, reflectZ, chamber);
550
551#ifdef WITH_ROOT
552 specialMap.Delete();
553#endif
554}
555
556//______________________________________________________________________________
557void AliMUONSt1GeometryBuilderV2::CreateFoamBox(
558 Int_t segNumber,
559 const TVector2& dimensions)
560{
561/// Create all the elements in the copper plane
562
563 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
564 Int_t idAir = idtmed[1100]; // medium 1
565 //Int_t idFoam = idtmed[1115]; // medium 16 = Foam
566 //Int_t idFR4 = idtmed[1114]; // medium 15 = FR4
567 Int_t idFoam = idtmed[1125]; // medium 26 = Foam
568 Int_t idFR4 = idtmed[1122]; // medium 23 = FR4
569
570 // mother volume
571 GReal_t par[3];
572 par[0] = dimensions.X();
573 par[1] = dimensions.Y();
574 par[2] = TotalHzPlane();
575 gMC->Gsvolu(PlaneSegmentName(segNumber).Data(),"BOX",idAir,par,3);
576
577 // foam layer
578 par[0] = dimensions.X();
579 par[1] = dimensions.Y();
580 par[2] = fgkHzFoam;
581 gMC->Gsvolu(FoamBoxName(segNumber).Data(),"BOX",idFoam,par,3);
582 GReal_t posX,posY,posZ;
583 posX=0.;
584 posY=0.;
585 posZ = -TotalHzPlane() + fgkHzFoam;
586 gMC->Gspos(FoamBoxName(segNumber).Data(),1,
587 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
588
589 // mechanical plane FR4 layer
590 par[0] = dimensions.X();
591 par[1] = dimensions.Y();
592 par[2] = fgkHzFR4;
593 gMC->Gsvolu(FR4BoxName(segNumber).Data(),"BOX",idFR4,par,3);
594 posX=0.;
595 posY=0.;
596 posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4;
597 gMC->Gspos(FR4BoxName(segNumber).Data(),1,
598 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
599}
600
601//______________________________________________________________________________
602void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber,
603 const TVector2& dimensions,
604 Int_t nofHoles)
605{
606/// Create a segment of a plane (this includes a foam layer,
607/// holes in the foam to feed the kaptons through, kapton connectors
608/// and the mother board.)
609
610 CreateFoamBox(segNumber,dimensions);
611
612 for (Int_t holeNum=0;holeNum<nofHoles;holeNum++) {
613 GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X();
614 GReal_t posY = 0.;
615 GReal_t posZ = 0.;
616
617 gMC->Gspos(fgkHoleName,holeNum+1,
618 FoamBoxName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
619 }
620}
621
622//______________________________________________________________________________
623void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber)
624{
625/// Create the non-sensitive elements of the frame for the \a chamber
626///
627/// Model and notation: \n
628/// \n
629/// The Quadrant volume name starts with SQ \n
630/// The volume segments are numbered 00 to XX \n
631/// \n
632/// OutTopFrame \n
633/// (SQ02-16) \n
634/// ------------ \n
635/// OutEdgeFrame / | \n
636/// (SQ17-24) / | InVFrame (SQ00-01) \n
637/// / | \n
638/// | | \n
639/// OutVFrame | _- - \n
640/// (SQ25-39) | | InArcFrame (SQ42-45) \n
641/// | | \n
642/// ------------- \n
643/// InHFrame (SQ40-41) \n
644/// \n
645/// \n
646/// 06 February 2003 - Overlapping volumes resolved. \n
647/// One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx,
648/// where SQMx is the Quadrant Middle layer for chamber \a chamber ( posZ in [-3.25,3.25]),
649/// SQNx is the Quadrant Near side layer for chamber \a chamber ( posZ in [-6.25,3-.25) ), and
650/// SQFx is the Quadrant Far side layer for chamber \a chamber ( posZ in (3.25,6.25] ).
651
652 const Float_t kNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin
653
654 // tracking medias
655 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
656
657 Int_t idAir = idtmed[1100]; // medium 1
658 //Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730
659 //Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe)
660 //Int_t idFR4 = idtmed[1110]; // medium 11 FR4
661 //Int_t idCopper = idtmed[1109]; // medium 10 Copper
662 //Int_t idAlu = idtmed[1103]; // medium 4 Aluminium
663 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
664 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
665 Int_t idFR4 = idtmed[1122]; // medium 23 FR4 // was 15 not 11
666 Int_t idCopper = idtmed[1121]; // medium 22 Copper
667 Int_t idAlu = idtmed[1120]; // medium 21 Aluminium
668
669
670// Rotation Matrices
671 Int_t rot1, rot2, rot3;
672
673// Rotation matrices
674 fMUON->AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane
675 fMUON->AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane
676