]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilderV2.cxx
Use new geometry segmentation framework.
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.cxx
Content-type: text/html ]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilderV2.cxx


500 - Internal Server Error

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