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