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