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