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