]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilderV2.cxx
Moved old AliMagFCheb to AliMagF, small fixes/optimizations in field classes
[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 1834.
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
331a617a 34#include "AliMpSegmentation.h"
35#include "AliMpDEManager.h"
86488ea7 36#include "AliMpContainers.h"
4d8c279c 37#include "AliMpConstants.h"
331a617a 38#include "AliMpCDB.h"
adbabf6d 39#include "AliMpSector.h"
40#include "AliMpRow.h"
41#include "AliMpVRowSegment.h"
42#include "AliMpMotifMap.h"
43#include "AliMpMotifPosition.h"
4d8c279c 44#include "AliMpPlaneType.h"
adbabf6d 45
46#include "AliRun.h"
47#include "AliMagF.h"
48#include "AliLog.h"
ba030c0e 49
50#include <TVector2.h>
d1cd2474 51#include <TVector3.h>
52#include <TGeoMatrix.h>
ba030c0e 53#include <TClonesArray.h>
5f91c9e8 54#include <Riostream.h>
55#include <TSystem.h>
5d12ce38 56#include <TVirtualMC.h>
91111b9c 57#include <TGeoManager.h>
58#include <TGeoVolume.h>
59#include <TGeoTube.h>
0ab920eb 60#include <TGeoXtru.h>
91111b9c 61#include <TGeoCompositeShape.h>
ba030c0e 62
86488ea7 63#ifdef WITH_STL
adbabf6d 64 #include <vector>
65#endif
e118b27e 66
86488ea7 67#ifdef WITH_ROOT
adbabf6d 68 #include "TArrayI.h"
69#endif
ba030c0e 70
5398f946 71/// \cond CLASSIMP
72ClassImp(AliMUONSt1GeometryBuilderV2)
73/// \endcond
74
5f91c9e8 75// Thickness Constants
d1cd2474 76const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzPadPlane=0.0148/2.; //Pad plane
1c4b9c4c 77const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFoam = 2.503/2.; //Foam of mechanicalplane
78const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFR4 = 0.062/2.; //FR4 of mechanical plane
d1cd2474 79const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt)
80const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzKapton = 0.0122/2.; //Kapton
81const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergPlastic = 0.3062/2.;//Berg connector
82const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergCopper = 0.1882/2.; //Berg connector
83const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzDaughter = 0.0156/2.; //Daughter board
b367fd8f 84const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzGas = 0.42/2.; //Gas thickness
5f91c9e8 85
86// Quadrant Mother volume - TUBS1 - Middle layer of model
d1cd2474 87const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR1 = 18.3;
88const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR1 = 105.673;
89const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick1 = 6.5/2;
90const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL1 = 0.;
91const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU1 = 90.;
5f91c9e8 92
93// Quadrant Mother volume - TUBS2 - near and far layers of model
d1cd2474 94const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR2 = 20.7;
95const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR2 = 100.073;
96const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick2 = 3.0/2;
97const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL2 = 0.;
98const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU2 = 90.;
5f91c9e8 99
100// Sensitive copper pads, foam layer, PCB and electronics model parameters
d1cd2474 101const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxHole=1.5/2.;
102const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyHole=6./2.;
103const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergPlastic=0.74/2.;
104const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergPlastic=5.09/2.;
105const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergCopper=0.25/2.;
106const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergCopper=3.6/2.;
107const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxKapton=0.8/2.;
108const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyKapton=5.7/2.;
109const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxDaughter=2.3/2.;
110const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyDaughter=6.3/2.;
111const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetX=1.46;
112const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetY=0.71;
5ae5869b 113const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamX=1.00;
d1cd2474 114const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamY=0.051;
115
116const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaQuadLHC=2.6; // LHC Origin wrt Quadrant Origin
b367fd8f 117const GReal_t AliMUONSt1GeometryBuilderV2::fgkFrameOffset=5.2;
118 // Fix (1) of overlap SQN* layers with SQM* ones (was 5.0)
119
120// Pad planes offsets
121const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadXOffsetBP = 0.50 - 0.63/2; // = 0.185
122const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadYOffsetBP = -0.31 - 0.42/2; // =-0.52
d1cd2474 123
62c708bf 124const char* AliMUONSt1GeometryBuilderV2::fgkHoleName="SCHL";
125const char* AliMUONSt1GeometryBuilderV2::fgkDaughterName="SCDB";
b367fd8f 126const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantEnvelopeName="SE";
d1cd2474 127const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM";
128const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN";
129const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF";
5ae5869b 130const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMFLayerName="SQMF";
62c708bf 131const Int_t AliMUONSt1GeometryBuilderV2::fgkFoamBoxNameOffset=200;
132const Int_t AliMUONSt1GeometryBuilderV2::fgkFR4BoxNameOffset=400;
e8c253a0 133const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000;
5f91c9e8 134
135//______________________________________________________________________________
d1cd2474 136AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon)
8cf07955 137 : AliMUONVGeometryBuilder(0, 2),
d1cd2474 138 fMUON(muon)
ba030c0e 139{
5398f946 140/// Standard constructor
ba030c0e 141}
142
5f91c9e8 143//______________________________________________________________________________
d1cd2474 144AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2()
145 : AliMUONVGeometryBuilder(),
146 fMUON(0)
ba030c0e 147{
5398f946 148/// Default Constructor
ba030c0e 149}
ba030c0e 150
5f91c9e8 151//______________________________________________________________________________
d1cd2474 152AliMUONSt1GeometryBuilderV2::~AliMUONSt1GeometryBuilderV2()
ba030c0e 153{
5398f946 154/// Destructor
ba030c0e 155}
156
d1cd2474 157
5f91c9e8 158//
159// Private methods
160//
161
b367fd8f 162//______________________________________________________________________________
163TString
164AliMUONSt1GeometryBuilderV2::QuadrantEnvelopeName(Int_t chamber, Int_t quadrant) const
165{
5398f946 166/// Generate unique envelope name from chamber Id and quadrant number
b367fd8f 167
168 return Form("%s%d", Form("%s%d",fgkQuadrantEnvelopeName,chamber), quadrant);
169}
170
5f91c9e8 171//______________________________________________________________________________
d1cd2474 172void AliMUONSt1GeometryBuilderV2::CreateHole()
ba030c0e 173{
5398f946 174/// Create all the elements found inside a foam hole
175
d1cd2474 176 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
177 Int_t idAir = idtmed[1100]; // medium 1
178 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
179 Int_t idCopper = idtmed[1121]; // medium 22 = copper
ba030c0e 180
5f91c9e8 181 GReal_t par[3];
182 GReal_t posX,posY,posZ;
183
184 par[0] = fgkHxHole;
185 par[1] = fgkHyHole;
186 par[2] = fgkHzFoam;
187 gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3);
ba030c0e 188
5f91c9e8 189 par[0] = fgkHxKapton;
190 par[1] = fgkHyKapton;
191 par[2] = fgkHzSnPb;
192 gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3);
193 posX = 0.;
194 posY = 0.;
195 posZ = -fgkHzFoam+fgkHzSnPb;
196 gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
ba030c0e 197
5f91c9e8 198 par[0] = fgkHxHole;
199 par[1] = fgkHyBergPlastic;
200 par[2] = fgkHzKapton;
62c708bf 201 gMC->Gsvolu("SKPT", "BOX", idCopper, par, 3);
5f91c9e8 202 posX = 0.;
203 posY = 0.;
204 posZ = 0.;
62c708bf 205 gMC->Gspos("SKPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
5f91c9e8 206}
ba030c0e 207
5f91c9e8 208//______________________________________________________________________________
d1cd2474 209void AliMUONSt1GeometryBuilderV2::CreateDaughterBoard()
5f91c9e8 210{
5398f946 211/// Create all the elements in a daughter board
212
d1cd2474 213 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 214 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 215 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
216 //Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic
217 Int_t idCopper = idtmed[1121]; // medium 22 = copper
218 Int_t idPlastic =idtmed[1127]; // medium 28 = Plastic
ba030c0e 219
5f91c9e8 220 GReal_t par[3];
221 GReal_t posX,posY,posZ;
222
223 par[0]=fgkHxDaughter;
224 par[1]=fgkHyDaughter;
225 par[2]=TotalHzDaughter();
226 gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3);
ba030c0e 227
5f91c9e8 228 par[0]=fgkHxBergPlastic;
229 par[1]=fgkHyBergPlastic;
230 par[2]=fgkHzBergPlastic;
62c708bf 231 gMC->Gsvolu("SBGP","BOX",idPlastic,par,3);
5f91c9e8 232 posX=0.;
233 posY=0.;
234 posZ = -TotalHzDaughter() + fgkHzBergPlastic;
62c708bf 235 gMC->Gspos("SBGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
5f91c9e8 236
237 par[0]=fgkHxBergCopper;
238 par[1]=fgkHyBergCopper;
239 par[2]=fgkHzBergCopper;
62c708bf 240 gMC->Gsvolu("SBGC","BOX",idCopper,par,3);
5f91c9e8 241 posX=0.;
242 posY=0.;
243 posZ=0.;
62c708bf 244 gMC->Gspos("SBGC",1,"SBGP",posX,posY,posZ,0,"ONLY");
5f91c9e8 245
246 par[0]=fgkHxDaughter;
247 par[1]=fgkHyDaughter;
248 par[2]=fgkHzDaughter;
62c708bf 249 gMC->Gsvolu("SDGH","BOX",idCopper,par,3);
5f91c9e8 250 posX=0.;
251 posY=0.;
252 posZ = -TotalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter;
62c708bf 253 gMC->Gspos("SDGH",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
5f91c9e8 254}
255
256//______________________________________________________________________________
d1cd2474 257void AliMUONSt1GeometryBuilderV2::CreateInnerLayers()
5f91c9e8 258{
5398f946 259/// Create the layer of sensitive volumes with gas
260/// and the copper layer.
0ab920eb 261/// The shape of the sensitive area is defined as an extruded
262/// solid substracted with tube (to get inner circular shape).
5f91c9e8 263
0ab920eb 264 TGeoMedium* kMedArCO2 = gGeoManager->GetMedium("MUON_ARG_CO2");
265 TGeoMedium* kMedCopper = gGeoManager->GetMedium("MUON_COPPER_II");
5f91c9e8 266
0ab920eb 267 Double_t rmin = 0.0;
268 Double_t rmax = fgkMotherIR1;
269 Double_t hz = fgkHzPadPlane + fgkHzGas;
270 new TGeoTube("cutTube",rmin, rmax, hz);
5f91c9e8 271
0ab920eb 272 Double_t maxXY = 89.0;
273 Double_t xy1 = 77.33;
274 Double_t xy2 = 48.77;
275 Double_t dxy1 = maxXY - xy1;
5f91c9e8 276
0ab920eb 277 Int_t nz = 2;
278 Int_t nv = 6;
279 Double_t vx[6] = { 0.0, 0.0, xy2, maxXY, maxXY, dxy1 };
280 Double_t vy[6] = { dxy1, maxXY, maxXY, xy2, 0.0, 0.0 };
281
282 TGeoXtru* xtruS1 = new TGeoXtru(nz);
283 xtruS1->SetName("xtruS1");
284 xtruS1->DefinePolygon(nv, vx, vy);
285 xtruS1->DefineSection(0, -fgkHzGas, 0.0, 0.0, 1.0);
286 xtruS1->DefineSection(1, fgkHzGas, 0.0, 0.0, 1.0);
287 TGeoCompositeShape* layerS1 = new TGeoCompositeShape("layerS1", "xtruS1-cutTube");
288 new TGeoVolume("SA1G", layerS1, kMedArCO2 );
289
290 TGeoXtru* xtruS2 = new TGeoXtru(nz);
291 xtruS2->SetName("xtruS2");
292 xtruS2->DefinePolygon(nv, vx, vy);
293 xtruS2->DefineSection(0, -fgkHzGas, 0.0, 0.0, 1.0);
294 xtruS2->DefineSection(1, fgkHzGas, 0.0, 0.0, 1.0);
295 TGeoCompositeShape* layerS2 = new TGeoCompositeShape("layerS2", "xtruS2-cutTube");
296 new TGeoVolume("SA2G", layerS2, kMedArCO2 );
297
298 TGeoXtru* xtruS3 = new TGeoXtru(nz);
299 xtruS3->SetName("xtruS3");
300 xtruS3->DefinePolygon(nv, vx, vy);
301 xtruS3->DefineSection(0, -fgkHzPadPlane, 0.0, 0.0, 1.0);
302 xtruS3->DefineSection(1, fgkHzPadPlane, 0.0, 0.0, 1.0);
303 TGeoCompositeShape* layerS3 = new TGeoCompositeShape("layerS3", "xtruS3-cutTube");
304 new TGeoVolume("SA1C", layerS3, kMedCopper );
305}
306
5f91c9e8 307
fdbaed6e 308//______________________________________________________________________________
309void AliMUONSt1GeometryBuilderV2::CreateSpacer0()
310{
311/// The spacer volumes are defined according to the input prepared by Nicole Willis
312/// without any modifications
313/// <pre>
314/// No. Type Material Center (mm) Dimensions (mm) (half lengths)
315/// 5 BOX EPOXY 408.2 430.4 522.41 5.75 1.5 25.5
316/// 5P BOX EPOXY 408.2 445.4 522.41 5.75 1.5 25.5
317/// 6 BOX EPOXY 408.2 437.9 519.76 5.75 15.0 1.0
318/// 6P BOX EPOXY 408.2 437.9 525.06 5.75 15.0 1.0
319/// 7 CYL INOX 408.2 437.9 522.41 r=3.0 hz=20.63
ab6c4493 320/// </pre>
fdbaed6e 321
322 // tracking medias
323 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
324 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
325 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
326
327 GReal_t par[3];
328 par[0] = 0.575;
329 par[1] = 0.150;
330 par[2] = 2.550;
331 gMC->Gsvolu("Spacer05","BOX",idFrameEpoxy,par,3);
332
333 par[0] = 0.575;
334 par[1] = 1.500;
335 par[2] = 0.100;
336 gMC->Gsvolu("Spacer06","BOX",idFrameEpoxy,par,3);
337
338 par[0] = 0.000;
339 par[1] = 0.300;
340 par[2] = 2.063;
341 gMC->Gsvolu("Spacer07","TUBE",idInox,par,3);
342}
343
344
345//______________________________________________________________________________
346void AliMUONSt1GeometryBuilderV2::CreateSpacer()
347{
348/// The spacer volumes are defined according to the input prepared by Nicole Willis
349/// with modifications needed to fit into existing geometry.
350/// <pre>
351/// No. Type Material Center (mm) Dimensions (mm) (half lengths)
352/// 5 BOX EPOXY 408.2 430.4 522.41 5.75 1.5 25.5
353/// 5P BOX EPOXY 408.2 445.4 522.41 5.75 1.5 25.5
354/// 6 BOX EPOXY 408.2 437.9 519.76 5.75 15.0 1.0
355/// 6P BOX EPOXY 408.2 437.9 525.06 5.75 15.0 1.0
356/// 7 CYL INOX 408.2 437.9 522.41 r=3.0 hz=20.63
357/// </pre>
358/// To fit in existing volumes the volumes 5 and 7 are represented by 2 volumes
359/// with half size in z (5A, &A); the dimensions of the volume 5A were also modified
360/// to avoid overlaps (x made smaller, y larger to abotain the identical volume)
361
362 // tracking medias
363 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
364 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
365 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
366
367 //GReal_t par[3];
368 //par[0] = 0.575;
369 //par[1] = 0.150;
370 //par[2] = 2.550;
371 //gMC->Gsvolu("Spacer5","BOX",idFrameEpoxy,par,3);
372
373 GReal_t par[3];
374 par[0] = 0.510;
375 par[1] = 0.170;
5ae5869b 376 par[2] = 1.1515;
fdbaed6e 377 gMC->Gsvolu("Spacer5A","BOX",idFrameEpoxy,par,3);
378
afab29fc 379 par[0] = 0.510;
fdbaed6e 380 par[1] = 1.500;
381 par[2] = 0.100;
382 gMC->Gsvolu("Spacer6","BOX",idFrameEpoxy,par,3);
383
384 //par[0] = 0.000;
385 //par[1] = 0.300;
386 //par[2] = 2.063;
387 //gMC->Gsvolu("Spacer7","TUBE",idInox,par,3);
388
389 par[0] = 0.000;
390 par[1] = 0.300;
391 par[2] = 1.0315;
392 gMC->Gsvolu("Spacer7A","TUBE",idInox,par,3);
393}
394
5f91c9e8 395//______________________________________________________________________________
d1cd2474 396void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
ba030c0e 397{
5398f946 398/// Create the quadrant (bending and non-bending planes)
399/// for the given chamber
5f91c9e8 400
5ae5869b 401 // CreateQuadrantLayersAsVolumes(chamber);
402 CreateQuadrantLayersAsAssemblies(chamber);
ba030c0e 403
5ae5869b 404 CreateFrame(chamber);
d1cd2474 405
5ae5869b 406 TExMap specialMap;
407 specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.72), 90.));
ddfa5dbc 408 specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.7, 0.36)));
e8c253a0 409 specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
d1cd2474 410
331a617a 411 // Load mapping from OCDB
412 if ( ! AliMpSegmentation::Instance() ) {
413 AliFatal("Mapping has to be loaded first !");
414 }
415
f3ed9a44 416 const AliMpSector* kSector1
417 = AliMpSegmentation::Instance()->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane));
418 if ( ! kSector1 ) {
331a617a 419 AliFatal("Could not access sector segmentation !");
420 }
5ae5869b 421
b367fd8f 422 //Bool_t reflectZ = true;
423 Bool_t reflectZ = false;
424 //TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
425 TVector3 where = TVector3(fgkDeltaQuadLHC + fgkPadXOffsetBP,
426 fgkDeltaQuadLHC + fgkPadYOffsetBP, 0.);
331a617a 427 PlaceSector(kSector1, specialMap, where, reflectZ, chamber);
ba030c0e 428
866c3232 429 Int_t nb = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
cd872630 430 TExMapIter it(&specialMap);
431 Long_t key;
432 Long_t value;
433 while ( it.Next(key,value) == kTRUE ) {
434 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
435 }
d1cd2474 436 specialMap.Delete();
5ae5869b 437 specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.51),90.));
35bf4a8f 438 specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.20,-0.08)));
439 specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.40,-1.11)));
4d8c279c 440 specialMap.Add(20 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
35bf4a8f 441 specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.92 , 0.17)));
ddfa5dbc 442 specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.405, -0.10)));
b367fd8f 443 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
444 // in the true position)
5ae5869b 445
f3ed9a44 446 const AliMpSector* kSector2
447 = AliMpSegmentation::Instance()
448 ->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane));
449 if ( ! kSector2 ) {
450 AliFatal("Could not access sector !");
331a617a 451 }
331a617a 452
b367fd8f 453 //reflectZ = false;
454 reflectZ = true;
331a617a 455 TVector2 offset = kSector2->Position();
e77b6d6b 456 where = TVector3(where.X()+offset.X(), where.Y()+offset.Y(), 0.);
b367fd8f 457 // Add the half-pad shift of the non-bending plane wrt bending plane
458 // (The shift is defined in the mapping as sector offset)
459 // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2
331a617a 460 PlaceSector(kSector2, specialMap, where, reflectZ, chamber);
d1cd2474 461
cd872630 462 it.Reset();
463 while ( it.Next(key,value) == kTRUE ) {
464 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
465 }
d1cd2474 466 specialMap.Delete();
ba030c0e 467}
468
5f91c9e8 469//______________________________________________________________________________
62c708bf 470void AliMUONSt1GeometryBuilderV2::CreateFoamBox(
471 Int_t segNumber,
472 const TVector2& dimensions)
ba030c0e 473{
5398f946 474/// Create all the elements in the copper plane
ba030c0e 475
d1cd2474 476 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 477 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 478 //Int_t idFoam = idtmed[1115]; // medium 16 = Foam
479 //Int_t idFR4 = idtmed[1114]; // medium 15 = FR4
480 Int_t idFoam = idtmed[1125]; // medium 26 = Foam
481 Int_t idFR4 = idtmed[1122]; // medium 23 = FR4
ba030c0e 482
5f91c9e8 483 // mother volume
484 GReal_t par[3];
485 par[0] = dimensions.X();
486 par[1] = dimensions.Y();
487 par[2] = TotalHzPlane();
62c708bf 488 gMC->Gsvolu(PlaneSegmentName(segNumber).Data(),"BOX",idAir,par,3);
5f91c9e8 489
490 // foam layer
5f91c9e8 491 par[0] = dimensions.X();
492 par[1] = dimensions.Y();
493 par[2] = fgkHzFoam;
62c708bf 494 gMC->Gsvolu(FoamBoxName(segNumber).Data(),"BOX",idFoam,par,3);
495 GReal_t posX,posY,posZ;
5f91c9e8 496 posX=0.;
497 posY=0.;
498 posZ = -TotalHzPlane() + fgkHzFoam;
62c708bf 499 gMC->Gspos(FoamBoxName(segNumber).Data(),1,
500 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
ba030c0e 501
5f91c9e8 502 // mechanical plane FR4 layer
5f91c9e8 503 par[0] = dimensions.X();
504 par[1] = dimensions.Y();
505 par[2] = fgkHzFR4;
62c708bf 506 gMC->Gsvolu(FR4BoxName(segNumber).Data(),"BOX",idFR4,par,3);
5f91c9e8 507 posX=0.;
508 posY=0.;
509 posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4;
62c708bf 510 gMC->Gspos(FR4BoxName(segNumber).Data(),1,
511 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 512}
ba030c0e 513
5f91c9e8 514//______________________________________________________________________________
62c708bf 515void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber,
516 const TVector2& dimensions,
517 Int_t nofHoles)
5f91c9e8 518{
5398f946 519/// Create a segment of a plane (this includes a foam layer,
520/// holes in the foam to feed the kaptons through, kapton connectors
521/// and the mother board.)
ba030c0e 522
62c708bf 523 CreateFoamBox(segNumber,dimensions);
fdbaed6e 524
525 // Place spacer in the concrete plane segments:
526 // S225 (in S025), S267 (in S067) in chamber1 and S309 (in S109). S351(in S151)
527 // in chamber2
528 // The segments were found as those which caused overlaps when we placed
529 // the spacer in global coordinates via PlaceSpacer0
530 //
531 // <posXYZ X_Y_Z=" 12.6000; 0.75000; 0.0000"> <volume name="Spacer5A"/>
532 // <posXYZ X_Y_Z=" 12.6000; -0.75000; 0.0000"> <volume name="Spacer5A"/>
533 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 1.1515"> <volume name="Spacer6"/>
534 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 0.0000"> <volume name="Spacer7A"/>
535
536 if ( FoamBoxName(segNumber) == "S225" ||
537 FoamBoxName(segNumber) == "S267" ||
538 FoamBoxName(segNumber) == "S309" ||
539 FoamBoxName(segNumber) == "S351" )
540 {
5ae5869b 541 GReal_t posX = 12.6;
542 GReal_t posY = 0.75;
543 GReal_t posZ = -0.1;
544 if ( FoamBoxName(segNumber) == "S267" ||
545 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 546 gMC->Gspos("Spacer5A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
547
548 posY = -0.75;
5ae5869b 549 if ( FoamBoxName(segNumber) == "S267" ||
550 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 551 gMC->Gspos("Spacer5A", 2, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
552
553 posY = 0.0;
554 posZ = 1.1515;
555 if ( FoamBoxName(segNumber) == "S267" ||
5ae5869b 556 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 557 gMC->Gspos("Spacer6", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
558
559 posY = 0.0;
560 posZ = 0.0;
5ae5869b 561 if ( FoamBoxName(segNumber) == "S267" ||
562 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 563 gMC->Gspos("Spacer7A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
564 }
ba030c0e 565
5f91c9e8 566 for (Int_t holeNum=0;holeNum<nofHoles;holeNum++) {
567 GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X();
568 GReal_t posY = 0.;
569 GReal_t posZ = 0.;
5ae5869b 570
62c708bf 571 gMC->Gspos(fgkHoleName,holeNum+1,
572 FoamBoxName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 573 }
574}
ba030c0e 575
5ae5869b 576//______________________________________________________________________________
577void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsVolumes(Int_t chamber)
578{
579/// Create the three main layers as real volumes.
580/// Not used anymore.
581
582 // tracking medias
583 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
584 Int_t idAir = idtmed[1100]; // medium 1
585
586 Float_t par[11];
587 Float_t posX,posY,posZ;
588
589// Quadrant volume TUBS1, positioned at the end
590 par[0] = fgkMotherIR1;
591 par[1] = fgkMotherOR1;
592 par[2] = fgkMotherThick1;
593 par[3] = fgkMotherPhiL1;
594 par[4] = fgkMotherPhiU1;
595 gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5);
596 // gMC->Gsvolu(QuadrantMFLayerName(chamber),"TUBS",idAir,par,5);
597
598// Replace the volume shape with a composite shape
599// with substracted overlap with beam shield (YMOT)
600
601 if ( gMC->IsRootGeometrySupported() ) {
602
603 // Get shape
604 TGeoVolume* mlayer
605 = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber));
606 if ( !mlayer ) {
607 AliErrorStream()
608 << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found"
609 << endl;
610 }
611 else {
612 TGeoShape* quadrant = mlayer->GetShape();
613 quadrant->SetName("quadrant");
614
615 // Beam shield recess
616 par[0] = 0;
617 par[1] = 15.4;
618 par[2] = fgkMotherThick1;
619 new TGeoTube("shield_tube", par[0], par[1], par[2]);
620
621 // Displacement
622 posX = 2.6;
623 posY = 2.6;
624 posZ = 0;
625 TGeoTranslation* displacement
626 = new TGeoTranslation("TR", posX, posY, posZ);
627 displacement->RegisterYourself();
628
629 // Composite shape
630 TGeoShape* composite
631 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
632
633 // Reset shape to volume
634 mlayer->SetShape(composite);
635 }
636
637 TGeoVolume* malayer
638 = gGeoManager->FindVolumeFast(QuadrantMFLayerName(chamber));
639 if ( !malayer ) {
640 AliErrorStream()
641 << "Quadrant volume " << QuadrantMFLayerName(chamber) << " not found"
642 << endl;
643 }
644 else {
645 TGeoShape* quadrant = malayer->GetShape();
646 quadrant->SetName("quadrant");
647
648 // Beam shield recess
649 par[0] = 0;
650 par[1] = 15.4;
651 par[2] = fgkMotherThick1;
652 new TGeoTube("shield_tube", par[0], par[1], par[2]);
653
654 // Displacement
655 posX = 2.6;
656 posY = 2.6;
657 posZ = 0;
658 TGeoTranslation* displacement
659 = new TGeoTranslation("TR", posX, posY, posZ);
660 displacement->RegisterYourself();
661
662 // Composite shape
663 TGeoShape* composite
664 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
665
666 // Reset shape to volume
667 malayer->SetShape(composite);
668 }
669 }
670
671// Quadrant volume TUBS2, positioned at the end
672 par[0] = fgkMotherIR2;
673 par[1] = fgkMotherOR2;
674 par[2] = fgkMotherThick2;
675 par[3] = fgkMotherPhiL2;
676 par[4] = fgkMotherPhiU2;
677
678 gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5);
679 gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5);
680}
681
682//______________________________________________________________________________
683void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsAssemblies(Int_t chamber)
684{
685/// Create the three main layers as assemblies
686
687 gGeoManager->MakeVolumeAssembly(QuadrantMLayerName(chamber).Data());
688 gGeoManager->MakeVolumeAssembly(QuadrantMFLayerName(chamber).Data());
689 gGeoManager->MakeVolumeAssembly(QuadrantNLayerName(chamber).Data());
690 gGeoManager->MakeVolumeAssembly(QuadrantFLayerName(chamber).Data());
691}
692
5f91c9e8 693//______________________________________________________________________________
d1cd2474 694void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber)
5f91c9e8 695{
5398f946 696/// Create the non-sensitive elements of the frame for the \a chamber
697///
698/// Model and notation: \n
699/// \n
700/// The Quadrant volume name starts with SQ \n
701/// The volume segments are numbered 00 to XX \n
702/// \n
703/// OutTopFrame \n
704/// (SQ02-16) \n
705/// ------------ \n
706/// OutEdgeFrame / | \n
707/// (SQ17-24) / | InVFrame (SQ00-01) \n
708/// / | \n
709/// | | \n
710/// OutVFrame | _- - \n
711/// (SQ25-39) | | InArcFrame (SQ42-45) \n
712/// | | \n
713/// ------------- \n
714/// InHFrame (SQ40-41) \n
715/// \n
716/// \n
717/// 06 February 2003 - Overlapping volumes resolved. \n
718/// One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx,
719/// where SQMx is the Quadrant Middle layer for chamber \a chamber ( posZ in [-3.25,3.25]),
720/// SQNx is the Quadrant Near side layer for chamber \a chamber ( posZ in [-6.25,3-.25) ), and
721/// SQFx is the Quadrant Far side layer for chamber \a chamber ( posZ in (3.25,6.25] ).
ba030c0e 722
5ae5869b 723 // TString quadrantMLayerName = QuadrantMLayerName(chamber);
724
725 TString quadrantMLayerName = QuadrantMFLayerName(chamber);
726 TString quadrantNLayerName = QuadrantNLayerName(chamber);
727 TString quadrantFLayerName = QuadrantFLayerName(chamber);
728
d1cd2474 729 const Float_t kNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin
ba030c0e 730
ba030c0e 731 // tracking medias
d1cd2474 732 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 733
5ae5869b 734 //Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 735 //Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730
736 //Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe)
737 //Int_t idFR4 = idtmed[1110]; // medium 11 FR4
738 //Int_t idCopper = idtmed[1109]; // medium 10 Copper
739 //Int_t idAlu = idtmed[1103]; // medium 4 Aluminium
740 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
741 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
742 Int_t idFR4 = idtmed[1122]; // medium 23 FR4 // was 15 not 11
743 Int_t idCopper = idtmed[1121]; // medium 22 Copper
744 Int_t idAlu = idtmed[1120]; // medium 21 Aluminium
5f91c9e8 745
746
0ab920eb 747 TGeoMedium* kMedEpoxy = gGeoManager->GetMedium("MUON_FrameCH$");
748 TGeoMedium* kMedInox = gGeoManager->GetMedium("MUON_Kapton");
749 TGeoMedium* kMedAlu = gGeoManager->GetMedium("MUON_ALU_II$");
750
751
5f91c9e8 752// Rotation Matrices
0ab920eb 753 Int_t rot1, rot2, rot3, rot4;
5f91c9e8 754
755// Rotation matrices
d1cd2474 756 fMUON->AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane
757 fMUON->AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane
758