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