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