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