Fixing a warning
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.cxx
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
155//______________________________________________________________________________
b367fd8f 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
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);
181
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;
ba030c0e 215
5f91c9e8 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
301//______________________________________________________________________________
fdbaed6e 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
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);
ccd5731f 424#if ROOT_SVN_REVISION >= 29598
82280315 425 Long64_t key;
426 Long64_t value;
427#else
cd872630 428 Long_t key;
429 Long_t value;
82280315 430#endif
431
cd872630 432 while ( it.Next(key,value) == kTRUE ) {
433 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
434 }
d1cd2474 435 specialMap.Delete();
5ae5869b 436 specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.51),90.));
35bf4a8f 437 specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.20,-0.08)));
438 specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.40,-1.11)));
4d8c279c 439 specialMap.Add(20 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
35bf4a8f 440 specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.92 , 0.17)));
ddfa5dbc 441 specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.405, -0.10)));
b367fd8f 442 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
443 // in the true position)
5ae5869b 444
f3ed9a44 445 const AliMpSector* kSector2
446 = AliMpSegmentation::Instance()
447 ->GetSector(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane));
448 if ( ! kSector2 ) {
449 AliFatal("Could not access sector !");
331a617a 450 }
331a617a 451
b367fd8f 452 //reflectZ = false;
453 reflectZ = true;
6e97fbb8 454 TVector2 offset = TVector2(kSector2->GetPositionX(), kSector2->GetPositionY());
e77b6d6b 455 where = TVector3(where.X()+offset.X(), where.Y()+offset.Y(), 0.);
b367fd8f 456 // Add the half-pad shift of the non-bending plane wrt bending plane
457 // (The shift is defined in the mapping as sector offset)
458 // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2
331a617a 459 PlaceSector(kSector2, specialMap, where, reflectZ, chamber);
d1cd2474 460
cd872630 461 it.Reset();
462 while ( it.Next(key,value) == kTRUE ) {
463 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
464 }
d1cd2474 465 specialMap.Delete();
ba030c0e 466}
467
5f91c9e8 468//______________________________________________________________________________
62c708bf 469void AliMUONSt1GeometryBuilderV2::CreateFoamBox(
470 Int_t segNumber,
471 const TVector2& dimensions)
ba030c0e 472{
5398f946 473/// Create all the elements in the copper plane
ba030c0e 474
d1cd2474 475 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 476 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 477 //Int_t idFoam = idtmed[1115]; // medium 16 = Foam
478 //Int_t idFR4 = idtmed[1114]; // medium 15 = FR4
479 Int_t idFoam = idtmed[1125]; // medium 26 = Foam
480 Int_t idFR4 = idtmed[1122]; // medium 23 = FR4
ba030c0e 481
5f91c9e8 482 // mother volume
483 GReal_t par[3];
484 par[0] = dimensions.X();
485 par[1] = dimensions.Y();
486 par[2] = TotalHzPlane();
62c708bf 487 gMC->Gsvolu(PlaneSegmentName(segNumber).Data(),"BOX",idAir,par,3);
5f91c9e8 488
489 // foam layer
5f91c9e8 490 par[0] = dimensions.X();
491 par[1] = dimensions.Y();
492 par[2] = fgkHzFoam;
62c708bf 493 gMC->Gsvolu(FoamBoxName(segNumber).Data(),"BOX",idFoam,par,3);
494 GReal_t posX,posY,posZ;
5f91c9e8 495 posX=0.;
496 posY=0.;
497 posZ = -TotalHzPlane() + fgkHzFoam;
62c708bf 498 gMC->Gspos(FoamBoxName(segNumber).Data(),1,
499 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
ba030c0e 500
5f91c9e8 501 // mechanical plane FR4 layer
5f91c9e8 502 par[0] = dimensions.X();
503 par[1] = dimensions.Y();
504 par[2] = fgkHzFR4;
62c708bf 505 gMC->Gsvolu(FR4BoxName(segNumber).Data(),"BOX",idFR4,par,3);
5f91c9e8 506 posX=0.;
507 posY=0.;
508 posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4;
62c708bf 509 gMC->Gspos(FR4BoxName(segNumber).Data(),1,
510 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 511}
ba030c0e 512
5f91c9e8 513//______________________________________________________________________________
62c708bf 514void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber,
515 const TVector2& dimensions,
516 Int_t nofHoles)
5f91c9e8 517{
5398f946 518/// Create a segment of a plane (this includes a foam layer,
519/// holes in the foam to feed the kaptons through, kapton connectors
520/// and the mother board.)
ba030c0e 521
62c708bf 522 CreateFoamBox(segNumber,dimensions);
fdbaed6e 523
524 // Place spacer in the concrete plane segments:
525 // S225 (in S025), S267 (in S067) in chamber1 and S309 (in S109). S351(in S151)
526 // in chamber2
527 // The segments were found as those which caused overlaps when we placed
528 // the spacer in global coordinates via PlaceSpacer0
529 //
530 // <posXYZ X_Y_Z=" 12.6000; 0.75000; 0.0000"> <volume name="Spacer5A"/>
531 // <posXYZ X_Y_Z=" 12.6000; -0.75000; 0.0000"> <volume name="Spacer5A"/>
532 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 1.1515"> <volume name="Spacer6"/>
533 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 0.0000"> <volume name="Spacer7A"/>
534
535 if ( FoamBoxName(segNumber) == "S225" ||
536 FoamBoxName(segNumber) == "S267" ||
537 FoamBoxName(segNumber) == "S309" ||
538 FoamBoxName(segNumber) == "S351" )
539 {
5ae5869b 540 GReal_t posX = 12.6;
541 GReal_t posY = 0.75;
542 GReal_t posZ = -0.1;
543 if ( FoamBoxName(segNumber) == "S267" ||
544 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 545 gMC->Gspos("Spacer5A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
546
547 posY = -0.75;
5ae5869b 548 if ( FoamBoxName(segNumber) == "S267" ||
549 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 550 gMC->Gspos("Spacer5A", 2, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
551
552 posY = 0.0;
553 posZ = 1.1515;
554 if ( FoamBoxName(segNumber) == "S267" ||
5ae5869b 555 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 556 gMC->Gspos("Spacer6", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
557
558 posY = 0.0;
559 posZ = 0.0;
5ae5869b 560 if ( FoamBoxName(segNumber) == "S267" ||
561 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 562 gMC->Gspos("Spacer7A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
563 }
ba030c0e 564
5f91c9e8 565 for (Int_t holeNum=0;holeNum<nofHoles;holeNum++) {
566 GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X();
567 GReal_t posY = 0.;
568 GReal_t posZ = 0.;
5ae5869b 569
62c708bf 570 gMC->Gspos(fgkHoleName,holeNum+1,
571 FoamBoxName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 572 }
ba030c0e 573}
574
5f91c9e8 575//______________________________________________________________________________
5ae5869b 576void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsVolumes(Int_t chamber)
577{
578/// Create the three main layers as real volumes.
579/// Not used anymore.
580
581 // tracking medias
582 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
583 Int_t idAir = idtmed[1100]; // medium 1
584
585 Float_t par[11];
586 Float_t posX,posY,posZ;
587
588// Quadrant volume TUBS1, positioned at the end
589 par[0] = fgkMotherIR1;
590 par[1] = fgkMotherOR1;
591 par[2] = fgkMotherThick1;
592 par[3] = fgkMotherPhiL1;
593 par[4] = fgkMotherPhiU1;
594 gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5);
595 // gMC->Gsvolu(QuadrantMFLayerName(chamber),"TUBS",idAir,par,5);
596
597// Replace the volume shape with a composite shape
598// with substracted overlap with beam shield (YMOT)
599
600 if ( gMC->IsRootGeometrySupported() ) {
601
602 // Get shape
603 TGeoVolume* mlayer
604 = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber));
605 if ( !mlayer ) {
606 AliErrorStream()
607 << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found"
608 << endl;
609 }
610 else {
611 TGeoShape* quadrant = mlayer->GetShape();
612 quadrant->SetName("quadrant");
613
614 // Beam shield recess
615 par[0] = 0;
616 par[1] = 15.4;
617 par[2] = fgkMotherThick1;
618 new TGeoTube("shield_tube", par[0], par[1], par[2]);
619
620 // Displacement
621 posX = 2.6;
622 posY = 2.6;
623 posZ = 0;
624 TGeoTranslation* displacement
625 = new TGeoTranslation("TR", posX, posY, posZ);
626 displacement->RegisterYourself();
627
628 // Composite shape
629 TGeoShape* composite
630 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
631
632 // Reset shape to volume
633 mlayer->SetShape(composite);
634 }
635
636 TGeoVolume* malayer
637 = gGeoManager->FindVolumeFast(QuadrantMFLayerName(chamber));
638 if ( !malayer ) {
639 AliErrorStream()
640 << "Quadrant volume " << QuadrantMFLayerName(chamber) << " not found"
641 << endl;
642 }
643 else {
644 TGeoShape* quadrant = malayer->GetShape();
645 quadrant->SetName("quadrant");
646
647 // Beam shield recess
648 par[0] = 0;
649 par[1] = 15.4;
650 par[2] = fgkMotherThick1;
651 new TGeoTube("shield_tube", par[0], par[1], par[2]);
652
653 // Displacement
654 posX = 2.6;
655 posY = 2.6;
656 posZ = 0;
657 TGeoTranslation* displacement
658 = new TGeoTranslation("TR", posX, posY, posZ);
659 displacement->RegisterYourself();
660
661 // Composite shape
662 TGeoShape* composite
663 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
664
665 // Reset shape to volume
666 malayer->SetShape(composite);
667 }
668 }
669
670// Quadrant volume TUBS2, positioned at the end
671 par[0] = fgkMotherIR2;
672 par[1] = fgkMotherOR2;
673 par[2] = fgkMotherThick2;
674 par[3] = fgkMotherPhiL2;
675 par[4] = fgkMotherPhiU2;
676
677 gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5);
678 gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5);
679}
680
681//______________________________________________________________________________
682void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsAssemblies(Int_t chamber)
683{
684/// Create the three main layers as assemblies
685
686 gGeoManager->MakeVolumeAssembly(QuadrantMLayerName(chamber).Data());
687 gGeoManager->MakeVolumeAssembly(QuadrantMFLayerName(chamber).Data());
688 gGeoManager->MakeVolumeAssembly(QuadrantNLayerName(chamber).Data());
689 gGeoManager->MakeVolumeAssembly(QuadrantFLayerName(chamber).Data());
690}
691
692//______________________________________________________________________________
d1cd2474 693void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber)
ba030c0e 694{
5398f946 695/// Create the non-sensitive elements of the frame for the \a chamber
696///
697/// Model and notation: \n
698/// \n
699/// The Quadrant volume name starts with SQ \n
700/// The volume segments are numbered 00 to XX \n
701/// \n
702/// OutTopFrame \n
703/// (SQ02-16) \n
704/// ------------ \n
705/// OutEdgeFrame / | \n
706/// (SQ17-24) / | InVFrame (SQ00-01) \n
707/// / | \n
708/// | | \n
709/// OutVFrame | _- - \n
710/// (SQ25-39) | | InArcFrame (SQ42-45) \n
711/// | | \n
712/// ------------- \n
713/// InHFrame (SQ40-41) \n
714/// \n
715/// \n
716/// 06 February 2003 - Overlapping volumes resolved. \n
717/// One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx,
718/// where SQMx is the Quadrant Middle layer for chamber \a chamber ( posZ in [-3.25,3.25]),
719/// SQNx is the Quadrant Near side layer for chamber \a chamber ( posZ in [-6.25,3-.25) ), and
720/// SQFx is the Quadrant Far side layer for chamber \a chamber ( posZ in (3.25,6.25] ).
ba030c0e 721
5ae5869b 722 // TString quadrantMLayerName = QuadrantMLayerName(chamber);
723
724 TString quadrantMLayerName = QuadrantMFLayerName(chamber);
725 TString quadrantNLayerName = QuadrantNLayerName(chamber);
726 TString quadrantFLayerName = QuadrantFLayerName(chamber);
727
d1cd2474 728 const Float_t kNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin
ba030c0e 729
ba030c0e 730 // tracking medias
d1cd2474 731 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 732
5ae5869b 733 //Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 734 //Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730
735 //Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe)
736 //Int_t idFR4 = idtmed[1110]; // medium 11 FR4
737 //Int_t idCopper = idtmed[1109]; // medium 10 Copper
738 //Int_t idAlu = idtmed[1103]; // medium 4 Aluminium
739 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
740 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
741 Int_t idFR4 = idtmed[1122]; // medium 23 FR4 // was 15 not 11
742 Int_t idCopper = idtmed[1121]; // medium 22 Copper
743 Int_t idAlu = idtmed[1120]; // medium 21 Aluminium
5f91c9e8 744
745
0ab920eb 746 TGeoMedium* kMedEpoxy = gGeoManager->GetMedium("MUON_FrameCH$");
747 TGeoMedium* kMedInox = gGeoManager->GetMedium("MUON_Kapton");
748 TGeoMedium* kMedAlu = gGeoManager->GetMedium("MUON_ALU_II$");
749
750
5f91c9e8 751// Rotation Matrices
0ab920eb 752 Int_t rot1, rot2, rot3, rot4;
5f91c9e8 753
754// Rotation matrices
d1cd2474 755 fMUON->AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane
756 fMUON->AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane
757 fMUON->AliMatrix(rot3, 90., 45., 90., 315.,180., 0.); // +45 deg in x-y + rotation 180° around y
0ab920eb 758 fMUON->AliMatrix(rot4, 90., 315., 90., 45., 0., 0.); // -45 deg in x-y plane
5f91c9e8 759
0ab920eb 760// ___________________Volume thicknesses________________________
ba030c0e 761
d1cd2474 762 const Float_t kHzFrameThickness = 1.59/2.; //equivalent thickness
763 const Float_t kHzOuterFrameEpoxy = 1.19/2.; //equivalent thickness
764 const Float_t kHzOuterFrameInox = 0.1/2.; //equivalent thickness
765 const Float_t kHzFoam = 2.083/2.; //evaluated elsewhere
766 // CHECK with fgkHzFoam
5f91c9e8 767
768// Pertaining to the top outer area
d1cd2474 769 const Float_t kHzTopAnodeSteel1 = 0.185/2.; //equivalent thickness
770 const Float_t kHzTopAnodeSteel2 = 0.51/2.; //equivalent thickness
771 const Float_t kHzAnodeFR4 = 0.08/2.; //equivalent thickness
772 const Float_t kHzTopEarthFaceCu = 0.364/2.; //equivalent thickness
773 const Float_t kHzTopEarthProfileCu = 1.1/2.; //equivalent thickness
774 const Float_t kHzTopPositionerSteel = 1.45/2.; //should really be 2.125/2.;
775 const Float_t kHzTopGasSupportAl = 0.85/2.; //equivalent thickness
5f91c9e8 776
777// Pertaining to the vertical outer area
d1cd2474 778 const Float_t kHzVerticalCradleAl = 0.8/2.; //equivalent thickness
779 const Float_t kHzLateralSightAl = 0.975/2.; //equivalent thickness
780 const Float_t kHzLateralPosnInoxFace = 2.125/2.;//equivalent thickness
781 const Float_t kHzLatPosInoxProfM = 6.4/2.; //equivalent thickness
782 const Float_t kHzLatPosInoxProfNF = 1.45/2.; //equivalent thickness
783 const Float_t kHzLateralPosnAl = 0.5/2.; //equivalent thickness
784 const Float_t kHzVertEarthFaceCu = 0.367/2.; //equivalent thickness
785 const Float_t kHzVertBarSteel = 0.198/2.; //equivalent thickness
786 const Float_t kHzVertEarthProfCu = 1.1/2.; //equivalent thickness
5f91c9e8 787
0ab920eb 788//_______________Parameter definitions in sequence _________
5f91c9e8 789
790// InVFrame parameters
d1cd2474 791 const Float_t kHxInVFrame = 1.85/2.;
792 const Float_t kHyInVFrame = 73.95/2.;
793 const Float_t kHzInVFrame = kHzFrameThickness;
ba030c0e 794
5f91c9e8 795//Flat 7.5mm vertical section
d1cd2474 796 const Float_t kHxV1mm = 0.75/2.;
797 const Float_t kHyV1mm = 1.85/2.;
798 const Float_t kHzV1mm = kHzFrameThickness;
ba030c0e 799
5f91c9e8 800// OuterTopFrame Structure
801//
802// FRAME
803// The frame is composed of a cuboid and two trapezoids
804// (TopFrameAnode, TopFrameAnodeA, TopFrameAnodeB).
805// Each shape is composed of two layers (Epoxy and Inox) and
806// takes the frame's inner anode circuitry into account in the material budget.
807//
808// ANODE
809// The overhanging anode part is composed froma cuboid and two trapezoids
810// (TopAnode, TopAnode1, and TopAnode2). These surfaces neglect implanted
811// resistors, but accounts for the major Cu, Pb/Sn, and FR4 material
812// contributions.
813// The stainless steel anode supports have been included.
814//
815// EARTHING (TopEarthFace, TopEarthProfile)
816// Al GAS SUPPORT (TopGasSupport)
817//
818// ALIGNMENT (TopPositioner) - Alignment system, three sights per quarter
819// chamber. This sight is forseen for the alignment of the horizontal level
820// (parallel to the OY axis of LHC). Its position will be evaluated relative
821// to a system of sights places on the cradles;
822//
823//---
ba030c0e 824
5f91c9e8 825//TopFrameAnode parameters - cuboid, 2 layers
d1cd2474 826 const Float_t kHxTFA = 34.1433/2.;
827 const Float_t kHyTFA = 7.75/2.;
828 const Float_t kHzTFAE = kHzOuterFrameEpoxy; // layer 1 thickness
829 const Float_t kHzTFAI = kHzOuterFrameInox; // layer 3 thickness
ba030c0e 830
0ab920eb 831// TopFrameAnode parameters - 2 trapezoids, 2 layers
832// (redefined with TGeoXtru shape)
d1cd2474 833 const Float_t kH1FAA = 8.7/2.;
d1cd2474 834 const Float_t kTl1FAB = 4.35/2.;
0ab920eb 835 const Float_t kTl1FAA = 7.75/2.;
836
5f91c9e8 837// TopAnode parameters - cuboid (part 1 of 3 parts)
d1cd2474 838 const Float_t kHxTA1 = 16.2/2.;
839 const Float_t kHyTA1 = 3.5/2.;
840 const Float_t kHzTA11 = kHzTopAnodeSteel1; // layer 1
841 const Float_t kHzTA12 = kHzAnodeFR4; // layer 2
5f91c9e8 842
843// TopAnode parameters - trapezoid 1 (part 2 of 3 parts)
d1cd2474 844 const Float_t kHzTA21 = kHzTopAnodeSteel2; // layer 1
845 const Float_t kHzTA22 = kHzAnodeFR4; // layer 2
846 const Float_t kTetTA2 = 0.;
847 const Float_t kPhiTA2= 0.;
848 const Float_t kH1TA2 = 7.268/2.;
849 const Float_t kBl1TA2 = 2.03/2.;
850 const Float_t kTl1TA2 = 3.5/2.;
851 const Float_t kAlp1TA2 = 5.78;
852 const Float_t kH2TA2 = 7.268/2.;
853 const Float_t kBl2TA2 = 2.03/2.;
854 const Float_t kTl2TA2 = 3.5/2.;
855 const Float_t kAlp2TA2 = 5.78;
5f91c9e8 856
857// TopAnode parameters - trapezoid 2 (part 3 of 3 parts)
d1cd2474 858 const Float_t kHzTA3 = kHzAnodeFR4; // layer 1
859 const Float_t kTetTA3 = 0.;
860 const Float_t kPhiTA3 = 0.;
861 const Float_t kH1TA3 = 7.268/2.;
862 const Float_t kBl1TA3 = 0.;
863 const Float_t kTl1TA3 = 2.03/2.;
864 const Float_t kAlp1TA3 = 7.95;
865 const Float_t kH2TA3 = 7.268/2.;
866 const Float_t kBl2TA3 = 0.;
867 const Float_t kTl2TA3 = 2.03/2.;
868 const Float_t kAlp2TA3 = 7.95;
ba030c0e 869
5f91c9e8 870// TopEarthFace parameters - single trapezoid
d1cd2474 871 const Float_t kHzTEF = kHzTopEarthFaceCu;
872 const Float_t kTetTEF = 0.;
873 const Float_t kPhiTEF = 0.;
874 const Float_t kH1TEF = 1.200/2.;
875 const Float_t kBl1TEF = 21.323/2.;
876 const Float_t kTl1TEF = 17.963/2.;
877 const Float_t kAlp1TEF = -54.46;
878 const Float_t kH2TEF = 1.200/2.;
879 const Float_t kBl2TEF = 21.323/2.;
880 const Float_t kTl2TEF = 17.963/2.;
881 const Float_t kAlp2TEF = -54.46;
5f91c9e8 882
883// TopEarthProfile parameters - single trapezoid
d1cd2474 884 const Float_t kHzTEP = kHzTopEarthProfileCu;
885 const Float_t kTetTEP = 0.;
886 const Float_t kPhiTEP = 0.;
887 const Float_t kH1TEP = 0.40/2.;
888 const Float_t kBl1TEP = 31.766/2.;
889 const Float_t kTl1TEP = 30.535/2.;
890 const Float_t kAlp1TEP = -56.98;
891 const Float_t kH2TEP = 0.40/2.;
892 const Float_t kBl2TEP = 31.766/2.;
893 const Float_t kTl2TEP = 30.535/2.;
894 const Float_t kAlp2TEP = -56.98;
5f91c9e8 895
896// TopPositioner parameters - single Stainless Steel trapezoid
d1cd2474 897 const Float_t kHzTP = kHzTopPositionerSteel;
898 const Float_t kTetTP = 0.;
899 const Float_t kPhiTP = 0.;
900 const Float_t kH1TP = 3.00/2.;
901 const Float_t kBl1TP = 7.023/2.;
902 const Float_t kTl1TP = 7.314/2.;
903 const Float_t kAlp1TP = 2.78;
904 const Float_t kH2TP = 3.00/2.;
905 const Float_t kBl2TP = 7.023/2.;
906 const Float_t kTl2TP = 7.314/2.;
907 const Float_t kAlp2TP = 2.78;
5f91c9e8 908
909// TopGasSupport parameters - single cuboid
d1cd2474 910 const Float_t kHxTGS = 8.50/2.;
911 const Float_t kHyTGS = 3.00/2.;
912 const Float_t kHzTGS = kHzTopGasSupportAl;
5f91c9e8 913
914// OutEdgeFrame parameters - 4 trapezoidal sections, 2 layers of material
0ab920eb 915// (redefined with TGeoXtru shape)
5f91c9e8 916//
d1cd2474 917 const Float_t kH1OETF = 7.196/2.; // common to all 4 trapezoids
0ab920eb 918 const Float_t kTl1OETF1 = 3.996/2.; // Trapezoid 1
919 const Float_t kTl1OETF2 = 3.75/2; // Trapezoid 2
920 const Float_t kTl1OETF3 = 3.01/2.; // Trapezoid 3
921 const Float_t kTl1OETF4 = 1.77/2.; // Trapezoid 4
922
5f91c9e8 923
5f91c9e8 924// Frame Structure (OutVFrame):
925//
926// OutVFrame and corner (OutVFrame cuboid, OutVFrame trapezoid)
927// EARTHING (VertEarthFaceCu,VertEarthSteel,VertEarthProfCu),
928// DETECTOR POSITIONNING (SuppLateralPositionner, LateralPositionner),
929// CRADLE (VertCradle), and
930// ALIGNMENT (LateralSightSupport, LateralSight)
931//
932//---
933
934// OutVFrame parameters - cuboid
d1cd2474 935 const Float_t kHxOutVFrame = 1.85/2.;
936 const Float_t kHyOutVFrame = 46.23/2.;
937 const Float_t kHzOutVFrame = kHzFrameThickness;
5f91c9e8 938
939// OutVFrame corner parameters - trapezoid
d1cd2474 940 const Float_t kHzOCTF = kHzFrameThickness;
941 const Float_t kTetOCTF = 0.;
942 const Float_t kPhiOCTF = 0.;
943 const Float_t kH1OCTF = 1.85/2.;
944 const Float_t kBl1OCTF = 0.;
945 const Float_t kTl1OCTF = 3.66/2.;
946 const Float_t kAlp1OCTF = 44.67;
947 const Float_t kH2OCTF = 1.85/2.;
948 const Float_t kBl2OCTF = 0.;
949 const Float_t kTl2OCTF = 3.66/2.;
950 const Float_t kAlp2OCTF = 44.67;
5f91c9e8 951
952// VertEarthFaceCu parameters - single trapezoid
d1cd2474 953 const Float_t kHzVFC = kHzVertEarthFaceCu;
954 const Float_t kTetVFC = 0.;
955 const Float_t kPhiVFC = 0.;
956 const Float_t kH1VFC = 1.200/2.;
957 const Float_t kBl1VFC = 46.11/2.;
958 const Float_t kTl1VFC = 48.236/2.;
959 const Float_t kAlp1VFC = 41.54;
960 const Float_t kH2VFC = 1.200/2.;
961 const Float_t kBl2VFC = 46.11/2.;
962 const Float_t kTl2VFC = 48.236/2.;
963 const Float_t kAlp2VFC = 41.54;
5f91c9e8 964
965// VertEarthSteel parameters - single trapezoid
d1cd2474 966 const Float_t kHzVES = kHzVertBarSteel;
967 const Float_t kTetVES = 0.;
968 const Float_t kPhiVES = 0.;
969 const Float_t kH1VES = 1.200/2.;
970 const Float_t kBl1VES = 30.486/2.;
971 const Float_t kTl1VES = 32.777/2.;
972 const Float_t kAlp1VES = 43.67;
973 const Float_t kH2VES = 1.200/2.;
974 const Float_t kBl2VES = 30.486/2.;
975 const Float_t kTl2VES = 32.777/2.;
976 const Float_t kAlp2VES = 43.67;
5f91c9e8 977
978// VertEarthProfCu parameters - single trapezoid
d1cd2474 979 const Float_t kHzVPC = kHzVertEarthProfCu;
980 const Float_t kTetVPC = 0.;
981 const Float_t kPhiVPC = 0.;
982 const Float_t kH1VPC = 0.400/2.;
983 const Float_t kBl1VPC = 29.287/2.;
984 const Float_t kTl1VPC = 30.091/2.;
985 const Float_t kAlp1VPC = 45.14;
986 const Float_t kH2VPC = 0.400/2.;
987 const Float_t kBl2VPC = 29.287/2.;
988 const Float_t kTl2VPC = 30.091/2.;
989 const Float_t kAlp2VPC = 45.14;
5f91c9e8 990
991// SuppLateralPositionner - single cuboid
d1cd2474 992 const Float_t kHxSLP = 2.80/2.;
993 const Float_t kHySLP = 5.00/2.;
994 const Float_t kHzSLP = kHzLateralPosnAl;
5f91c9e8 995
996// LateralPositionner - squared off U bend, face view
d1cd2474 997 const Float_t kHxLPF = 5.2/2.;
998 const Float_t kHyLPF = 3.0/2.;
999 const Float_t kHzLPF = kHzLateralPosnInoxFace;
5f91c9e8 1000
1001// LateralPositionner - squared off U bend, profile view
d1cd2474 1002 const Float_t kHxLPP = 0.425/2.;
1003 const Float_t kHyLPP = 3.0/2.;
1004 const Float_t kHzLPP = kHzLatPosInoxProfM; // middle layer
1005 const Float_t kHzLPNF = kHzLatPosInoxProfNF; // near and far layers
5f91c9e8 1006
1007// VertCradle, 3 layers (copies), each composed of 4 trapezoids
0ab920eb 1008// (redefined with TGeoXtru shape)
1009//
1010 const Float_t kH1VC1 = 10.25/2.; // all cradles
1011 const Float_t kBl1VC1 = 3.70/2.; // VertCradleA
1012 const Float_t kBl1VC2 = 6.266/2.; // VertCradleB
1013 const Float_t kBl1VC3 = 7.75/2.; // VertCradleC
5f91c9e8 1014
1015// VertCradleD
d1cd2474 1016 const Float_t kHzVC4 = kHzVerticalCradleAl;
1017 const Float_t kTetVC4 = 0.;
1018 const Float_t kPhiVC4 = 0.;
1019 const Float_t kH1VC4 = 10.27/2.;
1020 const Float_t kBl1VC4 = 8.273/2.;
1021 const Float_t kTl1VC4 = 7.75/2.;
1022 const Float_t kAlp1VC4 = -1.46;
1023 const Float_t kH2VC4 = 10.27/2.;
1024 const Float_t kBl2VC4 = 8.273/2.;
1025 const Float_t kTl2VC4 = 7.75/2.;
1026 const Float_t kAlp2VC4 = -1.46;
0ab920eb 1027
5f91c9e8 1028// LateralSightSupport - single trapezoid
d1cd2474 1029 const Float_t kHzVSS = kHzLateralSightAl;
1030 const Float_t kTetVSS = 0.;
1031 const Float_t kPhiVSS = 0.;
1032 const Float_t kH1VSS = 5.00/2.;
1033 const Float_t kBl1VSS = 7.747/2;
1034 const Float_t kTl1VSS = 7.188/2.;
1035 const Float_t kAlp1VSS = -3.20;
1036 const Float_t kH2VSS = 5.00/2.;
1037 const Float_t kBl2VSS = 7.747/2.;
1038 const Float_t kTl2VSS = 7.188/2.;
1039 const Float_t kAlp2VSS = -3.20;
5f91c9e8 1040
1041// LateralSight (reference point) - 3 per quadrant, only 1 programmed for now
d1cd2474 1042 const Float_t kVSInRad = 0.6;
1043 const Float_t kVSOutRad = 1.3;
1044 const Float_t kVSLen = kHzFrameThickness;
5f91c9e8 1045
1046//---
ba030c0e 1047
5f91c9e8 1048// InHFrame parameters
d1cd2474 1049 const Float_t kHxInHFrame = 75.8/2.;
1050 const Float_t kHyInHFrame = 1.85/2.;
1051 const Float_t kHzInHFrame = kHzFrameThickness;
5f91c9e8 1052
1053//Flat 7.5mm horizontal section
d1cd2474 1054 const Float_t kHxH1mm = 1.85/2.;
1055 const Float_t kHyH1mm = 0.75/2.;
1056 const Float_t kHzH1mm = kHzFrameThickness;
ba030c0e 1057
5f91c9e8 1058//---
ba030c0e 1059
5f91c9e8 1060// InArcFrame parameters
d1cd2474 1061 const Float_t kIAF = 15.70;
1062 const Float_t kOAF = 17.55;
1063 const Float_t kHzAF = kHzFrameThickness;
1064 const Float_t kAFphi1 = 0.0;
1065 const Float_t kAFphi2 = 90.0;
ba030c0e 1066
5f91c9e8 1067//---
ba030c0e 1068
5f91c9e8 1069// ScrewsInFrame parameters HEAD
d1cd2474 1070 const Float_t kSCRUHMI = 0.;
1071 const Float_t kSCRUHMA = 0.690/2.;
1072 const Float_t kSCRUHLE = 0.4/2.;
5f91c9e8 1073// ScrewsInFrame parameters MIDDLE
d1cd2474 1074 const Float_t kSCRUMMI = 0.;
1075 const Float_t kSCRUMMA = 0.39/2.;
1076 const Float_t kSCRUMLE = kHzFrameThickness;
5f91c9e8 1077// ScrewsInFrame parameters NUT
d1cd2474 1078 const Float_t kSCRUNMI = 0.;
1079 const Float_t kSCRUNMA = 0.78/2.;
1080 const Float_t kSCRUNLE = 0.8/2.;
5f91c9e8 1081
1082 // ___________________Make volumes________________________
ba030c0e 1083
5f91c9e8 1084 Float_t par[11];
1085 Float_t posX,posY,posZ;
ba030c0e 1086
5f91c9e8 1087 if (chamber==1) {
1088 // InVFrame
d1cd2474 1089 par[0] = kHxInVFrame;
1090 par[1] = kHyInVFrame;
1091 par[2] = kHzInVFrame;
5f91c9e8 1092 gMC->Gsvolu("SQ00","BOX",idFrameEpoxy,par,3);
1093
1094 //Flat 1mm vertical section
d1cd2474 1095 par[0] = kHxV1mm;
1096 par[1] = kHyV1mm;
1097 par[2] = kHzV1mm;
5f91c9e8 1098 gMC->Gsvolu("SQ01","BOX",idFrameEpoxy,par,3);
1099
1100// OutTopFrame
1101//
1102// - 3 components (a cuboid and 2 trapezes) and 2 layers (Epoxy/Inox)
1103//
1104//---
ba030c0e 1105
5f91c9e8 1106 // TopFrameAnode - layer 1 of 2
d1cd2474 1107 par[0] = kHxTFA;
1108 par[1] = kHyTFA;
1109 par[2] = kHzTFAE;
5f91c9e8 1110 gMC->Gsvolu("SQ02","BOX",idFrameEpoxy,par,3);
1111
1112 // TopFrameAnode - layer 2 of 2
d1cd2474 1113 par[2] = kHzTFAI;
5f91c9e8 1114 gMC->Gsvolu("SQ03","BOX",idInox,par,3);
1115
0ab920eb 1116
1117 // Common declarations for TGeoXtru parameters
1118 Double_t dx, dx0, dx1, dx2, dx3;
1119 Double_t dy, dy1, dy2, dy3, dy4;
1120 Double_t vx[16];
1121 Double_t vy[16];
1122 Int_t nz;
1123 Int_t nv;
1124
1125 // SQ04to06 and SQ05to07
1126
1127 dx = 2.*kH1FAA;
1128 dy1 = 2.*kTl1FAA;
1129 dy2 = 2.*kTl1FAB;
1130
1131 nz = 2;
1132 nv = 5;
1133 vx[0] = 0.0; vy[0] = 0.0;
1134 vx[1] = 0.0; vy[1] = dy1;
1135 vx[2] = dx; vy[2] = dy2;
1136 vx[3] = 2*dx; vy[3] = 0.0;
1137 vx[4] = dx; vy[4] = 0.0;
1138
1139 // Shift center in the middle
1140 for ( Int_t i=0; i<nv; i++ ) {
1141 vx[i] -= dx;
1142 vy[i] -= 0.5*dy1;
1143 }
1144
1145 TGeoXtru* xtruS5 = new TGeoXtru(nz);
1146 xtruS5->DefinePolygon(nv, vx, vy);
1147 xtruS5->DefineSection(0, -kHzOuterFrameEpoxy, 0.0, 0.0, 1.0);
1148 xtruS5->DefineSection(1, kHzOuterFrameEpoxy, 0.0, 0.0, 1.0);
1149 new TGeoVolume("SQ04toSQ06", xtruS5, kMedEpoxy);
1150
1151 TGeoXtru* xtruS6 = new TGeoXtru(nz);
1152 xtruS6->DefinePolygon(nv, vx, vy);
1153 xtruS6->DefineSection(0, -kHzOuterFrameInox, 0.0, 0.0, 1.0);
1154 xtruS6->DefineSection(1, kHzOuterFrameInox, 0.0, 0.0, 1.0);
1155 new TGeoVolume("SQ05toSQ07", xtruS6, kMedInox);
1156
5f91c9e8 1157
1158 // TopAnode1 - layer 1 of 2
d1cd2474 1159 par[0] = kHxTA1;
1160 par[1] = kHyTA1;
1161 par[2] = kHzTA11;
5f91c9e8 1162 gMC->Gsvolu("SQ08","BOX",idInox,par,3);
1163
1164 // TopAnode1 - layer 2 of 2
d1cd2474 1165 par[2] = kHzTA12;
6a3367ce 1166 gMC->Gsvolu("SQ09","BOX",idFR4,par,3);
5f91c9e8 1167
1168 // TopAnode2 - layer 1 of 2
d1cd2474 1169 par[0] = kHzTA21;
1170 par[1] = kTetTA2;
1171 par[2] = kPhiTA2;
1172 par[3] = kH1TA2;
1173 par[4] = kBl1TA2;
1174 par[5] = kTl1TA2;
1175 par[6] = kAlp1TA2;
1176 par[7] = kH2TA2;
1177 par[8] = kBl2TA2;
1178 par[9] = kTl2TA2;
1179 par[10] = kAlp2TA2;
5f91c9e8 1180 gMC->Gsvolu("SQ10","TRAP",idInox,par,11);
1181
1182 // TopAnode2 - layer 2 of 2
d1cd2474 1183 par[0] = kHzTA22;
5f91c9e8 1184 gMC->Gsvolu("SQ11","TRAP",idFR4,par,11);
1185
1186 // TopAnode3 - layer 1 of 1
d1cd2474 1187 par[0] = kHzTA3;
1188 par[1] = kTetTA3;
1189 par[2] = kPhiTA3;
1190 par[3] = kH1TA3;
1191 par[4] = kBl1TA3;
1192 par[5] = kTl1TA3;
1193 par[6] = kAlp1TA3;
1194 par[7] = kH2TA3;
1195 par[8] = kBl2TA3;
1196 par[9] = kTl2TA3;
1197 par[10] = kAlp2TA3;
5f91c9e8 1198 gMC->Gsvolu("SQ12","TRAP",idFR4,par,11);
1199
1200 // TopEarthFace
d1cd2474 1201 par[0] = kHzTEF;
1202 par[1] = kTetTEF;
1203 par[2] = kPhiTEF;
1204 par[3] = kH1TEF;
1205 par[4] = kBl1TEF;
1206 par[5] = kTl1TEF;
1207 par[6] = kAlp1TEF;
1208 par[7] = kH2TEF;
1209 par[8] = kBl2TEF;
1210 par[9] = kTl2TEF;
1211 par[10] = kAlp2TEF;
5f91c9e8 1212 gMC->Gsvolu("SQ13","TRAP",idCopper,par,11);
1213
1214 // TopEarthProfile
d1cd2474 1215 par[0] = kHzTEP;
1216 par[1] = kTetTEP;
1217 par[2] = kPhiTEP;
1218 par[3] = kH1TEP;
1219 par[4] = kBl1TEP;
1220 par[5] = kTl1TEP;
1221 par[6] = kAlp1TEP;
1222 par[7] = kH2TEP;
1223 par[8] = kBl2TEP;
1224 par[9] = kTl2TEP;
1225 par[10] = kAlp2TEP;
5f91c9e8 1226 gMC->Gsvolu("SQ14","TRAP",idCopper,par,11);
1227
1228 // TopGasSupport
d1cd2474 1229 par[0] = kHxTGS;
1230 par[1] = kHyTGS;
1231 par[2] = kHzTGS;
5f91c9e8 1232 gMC->Gsvolu("SQ15","BOX",idAlu,par,3);
1233
1234 // TopPositioner parameters - single Stainless Steel trapezoid
d1cd2474 1235 par[0] = kHzTP;
1236 par[1] = kTetTP;
1237 par[2] = kPhiTP;
1238 par[3] = kH1TP;
1239 par[4] = kBl1TP;
1240 par[5] = kTl1TP;
1241 par[6] = kAlp1TP;
1242 par[7] = kH2TP;
1243 par[8] = kBl2TP;
1244 par[9] = kTl2TP;
1245 par[10] = kAlp2TP;
5f91c9e8 1246 gMC->Gsvolu("SQ16","TRAP",idInox,par,11);
ba030c0e 1247
5f91c9e8 1248//
1249// OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox)
0ab920eb 1250// (redefined with TGeoXtru shape )
5f91c9e8 1251//---
ba030c0e 1252
0ab920eb 1253 dx = 2.*kH1OETF;
1254 dy1 = 2.*kTl1OETF4;
1255 dy2 = 2.*kTl1OETF3;
1256 dy3 = 2.*kTl1OETF2;
1257 dy4 = 2.*kTl1OETF1;
1258
1259 nz = 2;
1260 nv = 16;
1261 vx[0] = -4*dx; vy[0] = 0.0;
1262 vx[1] = -3*dx; vy[1] = dy1;
1263 vx[2] = -2*dx; vy[2] = dy2;
1264 vx[3] = -1*dx; vy[3] = dy3;
1265 vx[4] = 0.0; vy[4] = dy4;
1266 vx[5] = dx; vy[5] = dy3;
1267 vx[6] = 2*dx; vy[6] = dy2;
1268 vx[7] = 3*dx; vy[7] = dy1;
1269 vx[8] = 4*dx; vy[8] = 0.0;
1270 vx[9] = 3*dx; vy[9] = 0.0;
1271 vx[10] = 2*dx; vy[10] = 0.0;
1272 vx[11] = dx; vy[11] = 0.0;
1273 vx[12] = 0.0; vy[12] = 0.0;
1274 vx[13] = -1*dx; vy[13] = 0.0;
1275 vx[14] = -2*dx; vy[14] = 0.0;
1276 vx[15] = -3*dx; vy[15] = 0.0;
1277
1278 // Shift center in the middle
1279 for ( Int_t i=0; i<nv; i++ ) vy[i] += dy4/2.0;
1280
1281 TGeoXtru* xtruS1 = new TGeoXtru(nz);
1282 xtruS1->DefinePolygon(nv, vx, vy);
1283 xtruS1->DefineSection(0, -kHzOuterFrameEpoxy, 0.0, 0.0, 1.0);
1284 xtruS1->DefineSection(1, kHzOuterFrameEpoxy, 0.0, 0.0, 1.0);
1285 new TGeoVolume("SQ17to23", xtruS1, kMedEpoxy );
1286
1287 TGeoXtru* xtruS2 = new TGeoXtru(nz);
1288 xtruS2->DefinePolygon(nv, vx, vy);
1289 xtruS2->DefineSection(0, -kHzOuterFrameInox, 0.0, 0.0, 1.0);
1290 xtruS2->DefineSection(1, kHzOuterFrameInox, 0.0, 0.0, 1.0);
1291 new TGeoVolume("SQ18to24", xtruS2, kMedInox );
ba030c0e 1292
0ab920eb 1293//
1294// OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*2 layers (Epoxy/Inox)
5f91c9e8 1295//---
1296 // OutVFrame
d1cd2474 1297 par[0] = kHxOutVFrame;
1298 par[1] = kHyOutVFrame;
1299 par[2] = kHzOutVFrame;
5f91c9e8 1300 gMC->Gsvolu("SQ25","BOX",idFrameEpoxy,par,3);
d1cd2474 1301
5f91c9e8 1302 // OutVFrame corner
d1cd2474 1303 par[0] = kHzOCTF;
1304 par[1] = kTetOCTF;
1305 par[2] = kPhiOCTF;
1306 par[3] = kH1OCTF;
1307 par[4] = kBl1OCTF;
1308 par[5] = kTl1OCTF;
1309 par[6] = kAlp1OCTF;
1310 par[7] = kH2OCTF;
1311 par[8] = kBl2OCTF;
1312 par[9] = kTl2OCTF;
1313 par[10] = kAlp2OCTF;
5f91c9e8 1314 gMC->Gsvolu("SQ26","TRAP",idFrameEpoxy,par,11);
1315
1316 // EarthFaceCu trapezoid
d1cd2474 1317 par[0] = kHzVFC;
1318 par[1] = kTetVFC;
1319 par[2] = kPhiVFC;
1320 par[3] = kH1VFC;
1321 par[4] = kBl1VFC;
1322 par[5] = kTl1VFC;
1323 par[6] = kAlp1VFC;
1324 par[7] = kH2VFC;
1325 par[8] = kBl2VFC;
1326 par[9] = kTl2VFC;
1327 par[10] = kAlp2VFC;
5f91c9e8 1328 gMC->Gsvolu("SQ27","TRAP",idCopper,par,11);
1329
1330 // VertEarthSteel trapezoid
d1cd2474 1331 par[0] = kHzVES;
1332 par[1] = kTetVES;
1333 par[2] = kPhiVES;
1334 par[3] = kH1VES;
1335 par[4] = kBl1VES;
1336 par[5] = kTl1VES;
1337 par[6] = kAlp1VES;
1338 par[7] = kH2VES;
1339 par[8] = kBl2VES;
1340 par[9] = kTl2VES;
1341 par[10] = kAlp2VES;
5f91c9e8 1342 gMC->Gsvolu("SQ28","TRAP",idInox,par,11);
1343
1344 // VertEarthProfCu trapezoid
d1cd2474 1345 par[0] = kHzVPC;
1346 par[1] = kTetVPC;
1347 par[2] = kPhiVPC;
1348 par[3] = kH1VPC;
1349 par[4] = kBl1VPC;
1350 par[5] = kTl1VPC;
1351 par[6] = kAlp1VPC;
1352 par[7] = kH2VPC;
1353 par[8] = kBl2VPC;
1354 par[9] = kTl2VPC;
1355 par[10] = kAlp2VPC;
5f91c9e8 1356 gMC->Gsvolu("SQ29","TRAP",idCopper,par,11);
1357
1358 // SuppLateralPositionner cuboid
d1cd2474 1359 par[0] = kHxSLP;
1360 par[1] = kHySLP;
1361 par[2] = kHzSLP;
5f91c9e8 1362 gMC->Gsvolu("SQ30","BOX",idAlu,par,3);
1363
1364 // LateralPositionerFace
d1cd2474 1365 par[0] = kHxLPF;
1366 par[1] = kHyLPF;
1367 par[2] = kHzLPF;
5f91c9e8 1368 gMC->Gsvolu("SQ31","BOX",idInox,par,3);
1369
1370 // LateralPositionerProfile
d1cd2474 1371 par[0] = kHxLPP;
1372 par[1] = kHyLPP;
1373 par[2] = kHzLPP;
5f91c9e8 1374 gMC->Gsvolu("SQ32","BOX",idInox,par,3); // middle layer
1375
d1cd2474 1376 par[0] = kHxLPP;
1377 par[1] = kHyLPP;
1378 par[2] = kHzLPNF;
5f91c9e8 1379 gMC->Gsvolu("SQ33","BOX",idInox,par,3); // near and far layers
1380
0ab920eb 1381 dy = 2.*kH1VC1;
1382 dx0 = 2.*kBl1VC4;
1383 dx1 = 2.*kBl1VC3;
1384 dx2 = 2.*kBl1VC2;
1385 dx3 = 2.*kBl1VC1;
ba030c0e 1386
0ab920eb 1387 // VertCradle
1388 // (Trapezoids SQ34 to SQ36 or SQ37 redefined with TGeoXtru shape)
1389
1390 nz = 2;
1391 nv = 7;
1392 vx[0] = 0.0; vy[0] = 0.0;
1393 vx[1] = 0.0; vy[1] = dy;
1394 vx[2] = 0.0; vy[2] = 2*dy;
1395 vx[3] = 0.0; vy[3] = 3*dy;
1396 vx[4] = dx3; vy[4] = 2*dy;
1397 vx[5] = dx2; vy[5] = dy;
1398 vx[6] = dx1; vy[6] = 0.0;
1399
1400 // Shift center in the middle
1401 for ( Int_t i=0; i<nv; i++ ) {
1402 vx[i] -= dx1/2.0;
1403 vy[i] -= 1.5*dy;
1404 }
1405
1406 TGeoXtru* xtruS3 = new TGeoXtru(nz);
1407 xtruS3->DefinePolygon(nv, vx, vy);
1408 xtruS3->DefineSection(0, -kHzVerticalCradleAl, 0.0, 0.0, 1.0);
1409 xtruS3->DefineSection(1, kHzVerticalCradleAl, 0.0, 0.0, 1.0);
1410 new TGeoVolume("SQ34to36", xtruS3, kMedAlu);
1411
1412 // Trapezoids SQ34 to SQ37;
1413 // (keeping the same coordinate system as for SQ34to36)
1414
1415 nz = 2;
1416 nv = 9;
1417 vx[0] = 0.0; vy[0] =-1.0*dy;
1418 vx[1] = 0.0; vy[1] = 0.0;
1419 vx[2] = 0.0; vy[2] = dy;
1420 vx[3] = 0.0; vy[3] = 2*dy;
1421 vx[4] = 0.0; vy[4] = 3*dy;
1422 vx[5] = dx3; vy[5] = 2*dy;
1423 vx[6] = dx2; vy[6] = dy;
1424 vx[7] = dx1; vy[7] = 0.0;
1425 vx[8] = dx0; vy[8] =-1.0*dy;
1426
1427 // Shift center in the middle (of SQ34to36!!)
1428 for ( Int_t i=0; i<nv; i++ ) {
1429 vx[i] -= dx1/2.0;
1430 vy[i] -= 1.5*dy;
1431 }
1432
1433 TGeoXtru* xtruS4 = new TGeoXtru(nz);
1434 xtruS4->DefinePolygon(nv, vx, vy);
1435 xtruS4->DefineSection(0, -kHzVerticalCradleAl, 0.0, 0.0, 1.0);
1436 xtruS4->DefineSection(1, kHzVerticalCradleAl, 0.0, 0.0, 1.0);
1437 new TGeoVolume("SQ34to37", xtruS4, kMedAlu);
5f91c9e8 1438
1439 // VertCradleD - 4th trapezoid
d1cd2474 1440 par[0] = kHzVC4;
1441 par[1] = kTetVC4;
1442 par[2] = kPhiVC4;
1443 par[3] = kH1VC4;
1444 par[4] = kBl1VC4;
1445 par[5] = kTl1VC4;
1446 par[6] = kAlp1VC4;
1447 par[7] = kH2VC4;
1448 par[8] = kBl2VC4;
1449 par[9] = kTl2VC4;
1450 par[10] = kAlp2VC4;
5f91c9e8 1451 gMC->Gsvolu("SQ37","TRAP",idAlu,par,11);
1452
1453 // LateralSightSupport trapezoid
d1cd2474 1454 par[0] = kHzVSS;
1455 par[1] = kTetVSS;
1456 par[2] = kPhiVSS;
1457 par[3] = kH1VSS;
1458 par[4] = kBl1VSS;
1459 par[5] = kTl1VSS;
1460 par[6] = kAlp1VSS;
1461 par[7] = kH2VSS;
1462 par[8] = kBl2VSS;
1463 par[9] = kTl2VSS;
1464 par[10] = kAlp2VSS;
5f91c9e8 1465 gMC->Gsvolu("SQ38","TRAP",idAlu,par,11);
1466
1467 // LateralSight
d1cd2474 1468 par[0] = kVSInRad;
1469 par[1] = kVSOutRad;
1470 par[2] = kVSLen;
5f91c9e8 1471 gMC->Gsvolu("SQ39","TUBE",idFrameEpoxy,par,3);
1472
1473//---
1474 // InHFrame
d1cd2474 1475 par[0] = kHxInHFrame;
1476 par[1] = kHyInHFrame;
1477 par[2] = kHzInHFrame;
5f91c9e8 1478 gMC->Gsvolu("SQ40","BOX",idFrameEpoxy,par,3);
1479
1480 //Flat 7.5mm horizontal section
d1cd2474 1481 par[0] = kHxH1mm;
1482 par[1] = kHyH1mm;
1483 par[2] = kHzH1mm;
5f91c9e8 1484 gMC->Gsvolu("SQ41","BOX",idFrameEpoxy,par,3);
1485
1486 // InArcFrame
d1cd2474 1487 par[0] = kIAF;
1488 par[1] = kOAF;
1489 par[2] = kHzAF;
1490 par[3] = kAFphi1;
1491 par[4] = kAFphi2;
5f91c9e8 1492
1493 gMC->Gsvolu("SQ42","TUBS",idFrameEpoxy,par,5);
1494
1495//---
1496 // ScrewsInFrame - 3 sections in order to avoid overlapping volumes
1497 // Screw Head, in air
d1cd2474 1498 par[0] = kSCRUHMI;
1499 par[1] = kSCRUHMA;
1500 par[2] = kSCRUHLE;
5f91c9e8 1501
1502 gMC->Gsvolu("SQ43","TUBE",idInox,par,3);
1503
1504 // Middle part, in the Epoxy
d1cd2474 1505 par[0] = kSCRUMMI;
1506 par[1] = kSCRUMMA;
1507 par[2] = kSCRUMLE;
5f91c9e8 1508 gMC->Gsvolu("SQ44","TUBE",idInox,par,3);
1509
1510 // Screw nut, in air
d1cd2474 1511 par[0] = kSCRUNMI;
1512 par[1] = kSCRUNMA;
1513 par[2] = kSCRUNLE;
5f91c9e8 1514 gMC->Gsvolu("SQ45","TUBE",idInox,par,3);
1515 }
1516
1517// __________________Place volumes in the quadrant ____________
1518
1519 // InVFrame
d1cd2474 1520 posX = kHxInVFrame;
1521 posY = 2.0*kHyInHFrame+2.*kHyH1mm+kIAF+kHyInVFrame;
5f91c9e8 1522 posZ = 0.;
5ae5869b 1523 gMC->Gspos("SQ00",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
ba030c0e 1524
d1cd2474 1525// keep memory of the mid position. Used for placing screws
1526 const GReal_t kMidVposX = posX;
1527 const GReal_t kMidVposY = posY;
1528 const GReal_t kMidVposZ = posZ;
1529
5f91c9e8 1530 //Flat 7.5mm vertical section
d1cd2474 1531 posX = 2.0*kHxInVFrame+kHxV1mm;
1532 posY = 2.0*kHyInHFrame+2.*kHyH1mm+kIAF+kHyV1mm;
5f91c9e8 1533 posZ = 0.;
5ae5869b 1534 gMC->Gspos("SQ01",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY");
5f91c9e8 1535
1536 // TopFrameAnode place 2 layers of TopFrameAnode cuboids
d1cd2474 1537 posX = kHxTFA;
1538 posY = 2.*kHyInHFrame+2.*kHyH1mm+kIAF+2.*kHyInVFrame+kHyTFA;
ddfa5dbc 1539 posZ = -kHzOuterFrameInox;
5ae5869b 1540 gMC->Gspos("SQ02",1,quadrantMLayerName,posX, posY, posZ,0,"ONLY");
ddfa5dbc 1541 posZ = kHzOuterFrameEpoxy;
5ae5869b 1542 gMC->Gspos("SQ03",1,quadrantMLayerName,posX, posY, posZ,0,"ONLY");
5f91c9e8 1543
0ab920eb 1544 // TopFrameAnode - place 2 layers of 2 trapezoids
1545 // (SQ04 - SQ07)
1546 posX += kHxTFA + 2.*kH1FAA;
ddfa5dbc 1547 posZ = -kHzOuterFrameInox;
0ab920eb 1548 gMC->Gspos("SQ04toSQ06",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
ddfa5dbc 1549 posZ = kHzOuterFrameEpoxy;
0ab920eb 1550 gMC->Gspos("SQ05toSQ07",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1551
1552 // TopAnode1 place 2 layers
1553 posX = 6.8+fgkDeltaQuadLHC;
1554 posY = 99.85+fgkDeltaQuadLHC;
d1cd2474 1555 posZ = -1.*kHzAnodeFR4;
5ae5869b 1556 gMC->Gspos("SQ08",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
ddfa5dbc 1557 posZ = kHzTopAnodeSteel1;
5ae5869b 1558 gMC->Gspos("SQ09",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1559
1560 // TopAnode2 place 2 layers
1561 posX = 18.534+fgkDeltaQuadLHC;
1562 posY = 99.482+fgkDeltaQuadLHC;
d1cd2474 1563 posZ = -1.*kHzAnodeFR4;
afab29fc 1564 // shift up to solve overlap with SQ14
1565 posY += 0.1;
5ae5869b 1566 gMC->Gspos("SQ10",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
ddfa5dbc 1567 posZ = kHzTopAnodeSteel2;
5ae5869b 1568 gMC->Gspos("SQ11",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
5f91c9e8 1569
1570 // TopAnode3 place 1 layer
35bf4a8f 1571 posX = 25.804+fgkDeltaQuadLHC;
5f91c9e8 1572 posY = 98.61+fgkDeltaQuadLHC;
1573 posZ = 0.;
5ae5869b 1574 gMC->Gspos("SQ12",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
5f91c9e8 1575
1576 // TopEarthFace - 2 copies
1577 posX = 23.122+fgkDeltaQuadLHC;
1578 posY = 96.90+fgkDeltaQuadLHC;
d1cd2474 1579 posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+kHzTopEarthFaceCu;
5ae5869b 1580 gMC->Gspos("SQ13",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1581 posZ = -1.*posZ;
5ae5869b 1582 gMC->Gspos("SQ13",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1583
1584 // TopEarthProfile
1585 posX = 14.475+fgkDeltaQuadLHC;
1586 posY = 97.900+fgkDeltaQuadLHC;
d1cd2474 1587 posZ = kHzTopEarthProfileCu;
5ae5869b 1588 gMC->Gspos("SQ14",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1589 posZ = -1.0*posZ;
5ae5869b 1590 gMC->Gspos("SQ14",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1591
1592 // TopGasSupport - 2 copies
1593 posX = 4.9500+fgkDeltaQuadLHC;
1594 posY = 96.200+fgkDeltaQuadLHC;
d1cd2474 1595 posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+kHzTopGasSupportAl;
5ae5869b 1596 gMC->Gspos("SQ15",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1597 posZ = -1.*posZ;
5ae5869b 1598 gMC->Gspos("SQ15",2,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1599
1600 // TopPositioner parameters - single Stainless Steel trapezoid - 2 copies
1601 posX = 7.60+fgkDeltaQuadLHC;
1602 posY = 98.98+fgkDeltaQuadLHC;
d1cd2474 1603 posZ = kHzOuterFrameEpoxy+kHzOuterFrameInox+2.*kHzTopGasSupportAl+kHzTopPositionerSteel;
5ae5869b 1604 gMC->Gspos("SQ16",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
5f91c9e8 1605 posZ = -1.*posZ;
5ae5869b 1606 gMC->Gspos("SQ16",2,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
5f91c9e8 1607
1608 // OutEdgeFrame
5f91c9e8 1609
0ab920eb 1610 posZ = -1.0*kHzOuterFrameInox;
1611 //Double_t xCenterAll = 70.6615;
1612 Double_t xCenterAll = 70.500;
1613 Double_t yCenterAll = 70.350;
1614 gMC->Gspos("SQ17to23",1,quadrantMLayerName, xCenterAll, yCenterAll, posZ, rot4,"ONLY");
5f91c9e8 1615
ddfa5dbc 1616 posZ = kHzOuterFrameEpoxy;
0ab920eb 1617 gMC->Gspos("SQ18to24",1,quadrantMLayerName, xCenterAll, yCenterAll, posZ, rot4,"ONLY");
5f91c9e8 1618
5f91c9e8 1619//---
1620
ba030c0e 1621// OutVFrame
d1cd2474 1622 posX = 2.*kHxInVFrame+kIAF+2.*kHxInHFrame-kHxOutVFrame+2.*kHxV1mm;
1623 posY = 2.*kHyInHFrame+kHyOutVFrame;
ba030c0e 1624 posZ = 0.;
5ae5869b 1625 gMC->Gspos("SQ25",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1626
d1cd2474 1627 // keep memory of the mid position. Used for placing screws
1628 const GReal_t kMidOVposX = posX;
1629 const GReal_t kMidOVposY = posY;
1630 const GReal_t kMidOVposZ = posZ;
1631
1632 const Float_t kTOPY = posY+kHyOutVFrame;
1633 const Float_t kOUTX = posX;
ba030c0e 1634
5f91c9e8 1635// OutVFrame corner
d1cd2474 1636 posX = kOUTX;
1637 posY = kTOPY+((kBl1OCTF+kTl1OCTF)/2.);
5f91c9e8 1638 posZ = 0.;
4274a250 1639 // shift to solve overlap with SQ17to23 and SQ18to24
1640 posX += 0.02;
5ae5869b 1641 gMC->Gspos("SQ26",1,quadrantMLayerName,posX, posY, posZ, rot1,"ONLY");
5f91c9e8 1642
1643// VertEarthFaceCu - 2 copies
1644 posX = 89.4000+fgkDeltaQuadLHC;
1645 posY = 25.79+fgkDeltaQuadLHC;
d1cd2474 1646 posZ = kHzFrameThickness+2.0*kHzFoam+kHzVertEarthFaceCu;
5ae5869b 1647 gMC->Gspos("SQ27",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1648 posZ = -1.0*posZ;
5ae5869b 1649 gMC->Gspos("SQ27",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1650
1651// VertEarthSteel - 2 copies
1652 posX = 91.00+fgkDeltaQuadLHC;
1653 posY = 30.616+fgkDeltaQuadLHC;
d1cd2474 1654 posZ = kHzFrameThickness+2.0*kHzFoam+kHzVertBarSteel;
5ae5869b 1655 gMC->Gspos("SQ28",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1656 posZ = -1.0*posZ;
5ae5869b 1657 gMC->Gspos("SQ28",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1658
1659// VertEarthProfCu - 2 copies
1660 posX = 92.000+fgkDeltaQuadLHC;
1661 posY = 29.64+fgkDeltaQuadLHC;
d1cd2474 1662 posZ = kHzFrameThickness;
5ae5869b 1663 gMC->Gspos("SQ29",1,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1664 posZ = -1.0*posZ;
5ae5869b 1665 gMC->Gspos("SQ29",2,quadrantMLayerName,posX, posY, posZ, rot1, "ONLY");
5f91c9e8 1666
1667// SuppLateralPositionner - 2 copies
d1cd2474 1668 posX = 90.2-kNearFarLHC;
1669 posY = 5.00-kNearFarLHC;
1670 posZ = kHzLateralPosnAl-fgkMotherThick2;
5ae5869b 1671 gMC->Gspos("SQ30",1,quadrantFLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1672 posZ = -1.0*posZ;
5ae5869b 1673 gMC->Gspos("SQ30",2,quadrantNLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1674
1675// LateralPositionner - 2 copies - Face view
d1cd2474 1676 posX = 92.175-kNearFarLHC-2.*kHxLPP;
1677 posY = 5.00-kNearFarLHC;
1678 posZ =2.0*kHzLateralPosnAl+kHzLateralPosnInoxFace-fgkMotherThick2;
5ae5869b 1679 gMC->Gspos("SQ31",1,quadrantFLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1680 posZ = -1.0*posZ;
5ae5869b 1681 gMC->Gspos("SQ31",2,quadrantNLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1682
1683// LateralPositionner - Profile view
d1cd2474 1684 posX = 92.175+fgkDeltaQuadLHC+kHxLPF-kHxLPP;
5f91c9e8 1685 posY = 5.00+fgkDeltaQuadLHC;
1686 posZ = 0.;
5ae5869b 1687 gMC->Gspos("SQ32",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY"); // middle layer
5f91c9e8 1688
d1cd2474 1689 posX = 92.175-kNearFarLHC+kHxLPF-kHxLPP;
1690 posY = 5.0000-kNearFarLHC;
1691 posZ = fgkMotherThick2-kHzLPNF;
5ae5869b 1692 gMC->Gspos("SQ33",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY"); // near layer
5f91c9e8 1693 posZ = -1.*posZ;
5ae5869b 1694 gMC->Gspos("SQ33",2,quadrantFLayerName,posX, posY, posZ, 0, "ONLY"); // far layer
5f91c9e8 1695
5f91c9e8 1696
0ab920eb 1697// VertCradle - 3 (or 4 ) trapezoids redefined with TGeoXtru shape
5f91c9e8 1698
5f91c9e8 1699 posX = 97.29+fgkDeltaQuadLHC;
1700 posY = 23.02+fgkDeltaQuadLHC;
0ab920eb 1701 posZ = 0.;
1702 posX += 1.39311;
1703 gMC->Gspos("SQ34to37",2,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1704
d1cd2474 1705 posX = 97.29-kNearFarLHC;
1706 posY = 23.02-kNearFarLHC;
1707 posZ = 2.0*kHzLateralSightAl+kHzVerticalCradleAl-fgkMotherThick2;
0ab920eb 1708 posX += 1.39311;
1709 gMC->Gspos("SQ34to36",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY");
1710
1711 posZ = -1.0*posZ;
1712 gMC->Gspos("SQ34to36",3,quadrantFLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1713
5f91c9e8 1714
1715// OutVertCradleD 4th Trapeze - 3 copies
0ab920eb 1716
5f91c9e8 1717 posX = 98.81+fgkDeltaQuadLHC;
1718 posY = 2.52+fgkDeltaQuadLHC;
d1cd2474 1719 posZ = fgkMotherThick1-kHzVerticalCradleAl;
5ae5869b 1720 gMC->Gspos("SQ37",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1721 posZ = -1.0*posZ;
5ae5869b 1722 gMC->Gspos("SQ37",3,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1723
1724// LateralSightSupport - 2 copies
b367fd8f 1725 posX = 98.33-kNearFarLHC;
d1cd2474 1726 posY = 10.00-kNearFarLHC;
1727 posZ = kHzLateralSightAl-fgkMotherThick2;
b367fd8f 1728 // Fix (3) of extrusion SQ38 from SQN1, SQN2, SQF1, SQF2
1729 // (was posX = 98.53 ...)
5ae5869b 1730 gMC->Gspos("SQ38",1,quadrantNLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1731 posZ = -1.0*posZ;
5ae5869b 1732 gMC->Gspos("SQ38",2,quadrantFLayerName,posX, posY, posZ, 0, "ONLY");
5f91c9e8 1733
1734// Mire placement
1735 posX = 92.84+fgkDeltaQuadLHC;
1736 posY = 8.13+fgkDeltaQuadLHC;
ba030c0e 1737 posZ = 0.;
5ae5869b 1738 gMC->Gspos("SQ39",1,quadrantMLayerName,posX, posY, posZ, 0,"ONLY");
5f91c9e8 1739
1740//---
1741
1742// InHFrame
d1cd2474 1743 posX = 2.0*kHxInVFrame+2.*kHxV1mm+kIAF+kHxInHFrame;
1744 posY = kHyInHFrame;
5f91c9e8 1745 posZ = 0.;
5ae5869b 1746 gMC->Gspos("SQ40",1,quadrantMLayerName,posX, posY, posZ, 0, "ONLY");
ba030c0e 1747
d1cd2474 1748 // keep memory of the mid position. Used for placing screws
1749 const GReal_t kMidHposX = posX;
1750 const GReal_t kMidHposY = posY;
1751 const GReal_t kMidHposZ = posZ;
1752
5f91c9e8 1753// Flat 7.5mm horizontal section
d1cd2474 1754 posX = 2.0*kHxInVFrame+2.*kHxV1mm+kIAF+kHxH1mm;
1755 posY = 2.0*kHyInHFrame+kHyH1mm;
ba030c0e 1756 posZ = 0.;
5ae5869b 1757 gMC->Gspos("SQ41",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY");
ba030c0e 1758
1759// InArcFrame
d1cd2474 1760 posX = 2.0*kHxInVFrame+2.*kHxV1mm;
1761 posY = 2.0*kHyInHFrame+2.*kHyH1mm;
ba030c0e 1762 posZ = 0.;
5ae5869b 1763 gMC->Gspos("SQ42",1,quadrantMLayerName,posX, posY, posZ,0, "ONLY");
ba030c0e 1764
d1cd2474 1765// keep memory of the mid position. Used for placing screws
1766 const GReal_t kMidArcposX = posX;
1767 const GReal_t kMidArcposY = posY;
1768 const GReal_t kMidArcposZ = posZ;
1769
5f91c9e8 1770// ScrewsInFrame - in sensitive volume
ba030c0e 1771
1772 Float_t scruX[64];
1773 Float_t scruY[64];
1774
1775// Screws on IHEpoxyFrame
1776
d1cd2474 1777 const Int_t kNumberOfScrewsIH = 14; // no. of screws on the IHEpoxyFrame
1778 const Float_t kOffX = 5.; // inter-screw distance
ba030c0e 1779
1780 // first screw coordinates
1781 scruX[0] = 21.07;
1782 scruY[0] = -2.23;
1783 // other screw coordinates
d1cd2474 1784 for (Int_t i = 1;i<kNumberOfScrewsIH;i++){
1785 scruX[i] = scruX[i-1]+kOffX;
ba030c0e 1786 scruY[i] = scruY[0];
1787 }
1788 // Position the volumes on the frames
d1cd2474 1789 for (Int_t i = 0;i<kNumberOfScrewsIH;i++){
5f91c9e8 1790 posX = fgkDeltaQuadLHC + scruX[i];
1791 posY = fgkDeltaQuadLHC + scruY[i];
ba030c0e 1792 posZ = 0.;
5ae5869b 1793 gMC->Gspos("SQ43",i+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY");
d1cd2474 1794 if (chamber==1)
1795 gMC->Gspos("SQ44",i+1,"SQ40",posX+0.1-kMidHposX, posY+0.1-kMidHposY, posZ-kMidHposZ, 0, "ONLY");
5ae5869b 1796 gMC->Gspos("SQ45",i+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY");
ba030c0e 1797 }
1798 // special screw coordinates
1799 scruX[63] = 16.3;
1800 scruY[63] = -2.23;
5f91c9e8 1801 posX = fgkDeltaQuadLHC + scruX[63];
1802 posY = fgkDeltaQuadLHC + scruY[63];
ba030c0e 1803 posZ = 0.;
5ae5869b 1804 gMC->Gspos("SQ43",64,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY");
d1cd2474 1805 if (chamber==1)
1806 gMC->Gspos("SQ44",64,"SQ40",posX+0.1-kMidHposX, posY+0.1-kMidHposY, posZ-kMidHposZ, 0, "ONLY");
5ae5869b 1807 gMC->Gspos("SQ45",64,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY");
ba030c0e 1808
1809// Screws on the IVEpoxyFrame
1810
d1cd2474 1811 const Int_t kNumberOfScrewsIV = 15; // no. of screws on the IVEpoxyFrame
1812 const Float_t kOffY = 5.; // inter-screw distance
c03e5213 1813 Int_t firstScrew = 58;
1814 Int_t lastScrew = 44;
ba030c0e 1815
1816 // first (special) screw coordinates
c03e5213 1817 scruX[firstScrew-1] = -2.23;
1818 scruY[firstScrew-1] = 16.3;
ba030c0e 1819 // second (repetitive) screw coordinates
c03e5213 1820 scruX[firstScrew-2] = -2.23;
1821 scruY[firstScrew-2] = 21.07;
ba030c0e 1822 // other screw coordinates
c03e5213 1823 for (Int_t i = firstScrew-3;i>lastScrew-2;i--){
1824 scruX[i] = scruX[firstScrew-2];
d1cd2474 1825 scruY[i] = scruY[i+1]+kOffY;
ba030c0e 1826 }
1827
d1cd2474 1828 for (Int_t i = 0;i<kNumberOfScrewsIV;i++){
c03e5213 1829 posX = fgkDeltaQuadLHC + scruX[i+lastScrew-1];
1830 posY = fgkDeltaQuadLHC + scruY[i+lastScrew-1];
ba030c0e 1831 posZ = 0.;
5ae5869b 1832 gMC->Gspos("SQ43",i+lastScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY");
d1cd2474 1833 if (chamber==1)
1834 gMC->Gspos("SQ44",i+lastScrew,"SQ00",posX+0.1-kMidVposX, posY+0.1-kMidVposY, posZ-kMidVposZ, 0, "ONLY");
5ae5869b 1835 gMC->Gspos("SQ45",i+lastScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY");
ba030c0e 1836 }
1837
1838// Screws on the OVEpoxyFrame
1839
d1cd2474 1840 const Int_t kNumberOfScrewsOV = 10; // no. of screws on the OVEpoxyFrame
ba030c0e 1841
c03e5213 1842 firstScrew = 15;
1843 lastScrew = 25;
ba030c0e 1844
1845 // first (repetitive) screw coordinates
d1cd2474 1846 // notes: 1st screw should be placed in volume 40 (InnerHorizFrame)
c03e5213 1847 scruX[firstScrew-1] = 90.9;
1848 scruY[firstScrew-1] = -2.23; // true value
ba030c0e 1849
1850 // other screw coordinates
c03e5213 1851 for (Int_t i = firstScrew; i<lastScrew; i++ ){
1852 scruX[i] = scruX[firstScrew-1];
d1cd2474 1853 scruY[i] = scruY[i-1]+kOffY;
ba030c0e 1854 }
d1cd2474 1855 for (Int_t i = 1;i<kNumberOfScrewsOV;i++){
c03e5213 1856 posX = fgkDeltaQuadLHC + scruX[i+firstScrew-1];
1857 posY = fgkDeltaQuadLHC + scruY[i+firstScrew-1];
ba030c0e 1858 posZ = 0.;
5ae5869b 1859 gMC->Gspos("SQ43",i+firstScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY");
d1cd2474 1860 // ??
1861 if (chamber==1)
1862 gMC->Gspos("SQ44",i+firstScrew,"SQ25",posX+0.1-kMidOVposX, posY+0.1-kMidOVposY, posZ-kMidOVposZ, 0, "ONLY");
5ae5869b 1863 gMC->Gspos("SQ45",i+firstScrew,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY");
ba030c0e 1864 }
d1cd2474 1865 // special case for 1st screw, inside the horizontal frame (volume 40)
1866 posX = fgkDeltaQuadLHC + scruX[firstScrew-1];
1867 posY = fgkDeltaQuadLHC + scruY[firstScrew-1];
1868 posZ = 0.;
1869 if (chamber==1)
1870 gMC->Gspos("SQ44",firstScrew,"SQ40",posX+0.1-kMidHposX, posY+0.1-kMidHposY, posZ-kMidHposZ, 0, "ONLY");
1871
ba030c0e 1872// Inner Arc of Frame, screw positions and numbers-1
1873 scruX[62] = 16.009; scruY[62] = 1.401;
1874 scruX[61] = 14.564; scruY[61] = 6.791;
1875 scruX[60] = 11.363; scruY[60] = 11.363;
1876 scruX[59] = 6.791 ; scruY[59] = 14.564;
1877 scruX[58] = 1.401 ; scruY[58] = 16.009;
1878
1879 for (Int_t i = 0;i<5;i++){
5f91c9e8 1880 posX = fgkDeltaQuadLHC + scruX[i+58];
1881 posY = fgkDeltaQuadLHC + scruY[i+58];
ba030c0e 1882 posZ = 0.;
5ae5869b 1883 gMC->Gspos("SQ43",i+58+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ-kHzInHFrame-kSCRUHLE, 0, "ONLY");
d1cd2474 1884 if (chamber==1)
1885 gMC->Gspos("SQ44",i+58+1,"SQ42",posX+0.1-kMidArcposX, posY+0.1-kMidArcposY, posZ-kMidArcposZ, 0, "ONLY");
5ae5869b 1886 gMC->Gspos("SQ45",i+58+1,quadrantMLayerName,posX+0.1, posY+0.1, posZ+kHzInHFrame+kSCRUNLE, 0, "ONLY");
5f91c9e8 1887 }
1888}
5f91c9e8 1889//______________________________________________________________________________
d1cd2474 1890void AliMUONSt1GeometryBuilderV2::PlaceInnerLayers(Int_t chamber)
5f91c9e8 1891{
5398f946 1892/// Place the gas and copper layers for the specified chamber.
ba030c0e 1893
0ab920eb 1894 GReal_t x = fgkDeltaQuadLHC;
1895 GReal_t y = fgkDeltaQuadLHC;
1896 GReal_t zg = 0.0;
1897 GReal_t zc = fgkHzGas + fgkHzPadPlane;
1898 Int_t dpos = (chamber-1)*2;
1899
1900 TString name = GasVolumeName("SAG", chamber);
1901 gMC->Gspos(name,1,QuadrantMLayerName(chamber),x,y,zg,0,"ONLY");
1902 gMC->Gspos("SA1C", 1+dpos, QuadrantMLayerName(chamber),x,y, zc,0,"ONLY");
1903 gMC->Gspos("SA1C", 2+dpos, QuadrantMLayerName(chamber),x,y,-zc,0,"ONLY");
ba030c0e 1904}
1905
fdbaed6e 1906//______________________________________________________________________________
1907void AliMUONSt1GeometryBuilderV2::PlaceSpacer0(Int_t chamber)
1908{
1909/// Place the spacer defined in global positions
1910/// !! This method should be used only to find out the right mother volume
1911/// for the spacer if geometry is changed and the plane segment volumes
1912/// will change their numbering
1913
1914 // Global position of mother volume for the QuadrantMLayer
1915 // SQM1: (-2.6, -2.6, -522.41)
1916 // SQM2: (-2.6, -2.6, -541.49)
1917 GReal_t mx = 2.6;
1918 GReal_t my = -2.6;
1919 GReal_t mz = 522.41;
1920
1921 GReal_t x, y, z;
1922 x = 40.82 - mx;
1923 y = 43.04 - my;
1924 z = 522.41 - mz;
5ae5869b 1925 AliDebugStream(2) << "spacer05 pos1: " << x << ", " << y << ", " << z << endl;
fdbaed6e 1926 gMC->Gspos("Spacer05", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY");
1927
1928 y = 44.54 - my;
5ae5869b 1929 AliDebugStream(2) << "spacer05 pos2: " << x << ", " << y << ", " << z << endl;
fdbaed6e 1930 gMC->Gspos("Spacer05", 2, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY");
1931
1932 x = 40.82 - mx;
1933 y = 43.79 - my;
1934 z = 519.76 - mz;
5ae5869b 1935 AliDebugStream(2) << "spacer06 pos1: " << x << ", " << y << ", " << z << endl;
fdbaed6e 1936 gMC->Gspos("Spacer06", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY");
1937
1938 z = 525.06 - mz;
5ae5869b 1939 AliDebugStream(2) << "spacer06 pos2: " << x << ", " << y << ", " << z << endl;
fdbaed6e 1940 gMC->Gspos("Spacer06", 2, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY");
1941
1942 x = 40.82 - mx;
1943 y = 43.79 - my;
1944 z = 522.41 - mz;
5ae5869b 1945 AliDebugStream(2) << "spacer07 pos1: " << x << ", " << y << ", " << z << endl;
fdbaed6e 1946 gMC->Gspos("Spacer07", 1, QuadrantMLayerName(chamber), x, y, z, 0, "ONLY");
1947}
1948
5f91c9e8 1949//______________________________________________________________________________
331a617a 1950void AliMUONSt1GeometryBuilderV2::PlaceSector(const AliMpSector* sector,
5ae5869b 1951 TExMap specialMap,
5f91c9e8 1952 const TVector3& where, Bool_t reflectZ, Int_t chamber)
ba030c0e 1953{
5398f946 1954/// Place all the segments in the mother volume, at the position defined
5ae5869b 1955/// by the sector's data. \n
1956/// The lines with comments COMMENT OUT BEGIN/END indicates blocks
1957/// which can be commented out in order to reduce the number of volumes
1958/// in a sector to the plane segments corresponding to regular motifs only.
ba030c0e 1959
5f91c9e8 1960 static Int_t segNum=1;
1961 Int_t sgn;
1962 Int_t reflZ;
1963 Int_t rotMat;
1964
1965 if (!reflectZ) {
1966 sgn= 1;
1967 reflZ=0; // no reflection along z... nothing
d1cd2474 1968 fMUON->AliMatrix(rotMat, 90.,90.,90,180.,0.,0.); // 90° rotation around z, NO reflection along z
5f91c9e8 1969 } else {
1970 sgn=-1;
d1cd2474 1971 fMUON->AliMatrix(reflZ, 90.,0.,90,90.,180.,0.); // reflection along z
1972 fMUON->AliMatrix(rotMat, 90.,90.,90,180.,180.,0.); // 90° rotation around z AND reflection along z
5f91c9e8 1973 }
1974
ba030c0e 1975 GReal_t posX,posY,posZ;
1976
d1cd2474 1977 TArrayI alreadyDone(20);
1978 Int_t nofAlreadyDone = 0;
d1cd2474 1979
5f91c9e8 1980 for (Int_t irow=0;irow<sector->GetNofRows();irow++){ // for each row
1981 AliMpRow* row = sector->GetRow(irow);
ba030c0e 1982
ba030c0e 1983
5f91c9e8 1984 for (Int_t iseg=0;iseg<row->GetNofRowSegments();iseg++){ // for each row segment
1985 AliMpVRowSegment* seg = row->GetRowSegment(iseg);
5f91c9e8 1986
d1cd2474 1987 Long_t value = specialMap.GetValue(seg->GetMotifPositionId(0));
1988
1989 if ( value == 0 ){ //if this is a normal segment (ie. not part of <specialMap>)
5f91c9e8 1990
1991 // create the cathode part
6e97fbb8 1992 CreatePlaneSegment(segNum, TVector2(seg->GetDimensionX(),seg->GetDimensionY()),
1993 seg->GetNofMotifs());
5f91c9e8 1994
6e97fbb8 1995 posX = where.X() + seg->GetPositionX();
1996 posY = where.Y() + seg->GetPositionY();
5f91c9e8 1997 posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane);
62c708bf 1998 gMC->Gspos(PlaneSegmentName(segNum).Data(), 1,
1999 QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
5f91c9e8 2000
2001 // and place all the daughter boards of this segment
5ae5869b 2002
2003// COMMENT OUT BEGIN
5f91c9e8 2004 for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {
e8c253a0 2005
2006 // Copy number
5f91c9e8 2007 Int_t motifPosId = seg->GetMotifPositionId(motifNum);
2008 AliMpMotifPosition* motifPos =
2009 sector->GetMotifMap()->FindMotifPosition(motifPosId);
e8c253a0 2010 Int_t copyNo = motifPosId;
866c3232 2011 if ( sector->GetDirection() == AliMp::kX) copyNo += fgkDaughterCopyNoOffset;
5f91c9e8 2012
e8c253a0 2013 // Position
6e97fbb8 2014 posX = where.X() + motifPos->GetPositionX() + fgkOffsetX;
2015 posY = where.Y() + motifPos->GetPositionY() + fgkOffsetY;
5f91c9e8 2016 posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter());
e8c253a0 2017 gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, reflZ, "ONLY");
5f91c9e8 2018 }
5ae5869b 2019// COMMENT OUT END
2020
5f91c9e8 2021 segNum++;
2022
2023 } else {
2024
5ae5869b 2025// COMMENT OUT BEGIN
5f91c9e8 2026 // if this is a special segment
2027 for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {// for each motif
2028
2029 Int_t motifPosId = seg->GetMotifPositionId(motifNum);
2030
d1cd2474 2031 Bool_t isDone = false;
2032 Int_t i=0;
2033 while (i<nofAlreadyDone && !isDone) {
2034 if (alreadyDone.At(i) == motifPosId) isDone=true;
2035 i++;
2036 }
2037 if (isDone) continue; // don't treat the same motif twice
2038
2039 AliMUONSt1SpecialMotif spMot = *((AliMUONSt1SpecialMotif*)specialMap.GetValue(motifPosId));
5ae5869b 2040 AliDebugStream(2) << chamber << " processing special motif: " << motifPosId << endl;
d1cd2474 2041
5f91c9e8 2042 AliMpMotifPosition* motifPos = sector->GetMotifMap()->FindMotifPosition(motifPosId);
2043
e8c253a0 2044 // Copy number
2045 Int_t copyNo = motifPosId;
866c3232 2046 if ( sector->GetDirection() == AliMp::kX) copyNo += fgkDaughterCopyNoOffset;
e8c253a0 2047
5f91c9e8 2048 // place the hole for the motif, wrt the requested rotation angle
2049 Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? reflZ:rotMat;
2050
6e97fbb8 2051 posX = where.X() + motifPos->GetPositionX() + spMot.GetDelta().X();
2052 posY = where.Y() + motifPos->GetPositionY() + spMot.GetDelta().Y();
5f91c9e8 2053 posZ = where.Z() + sgn * (TotalHzPlane() + fgkHzGas + 2.*fgkHzPadPlane);
35bf4a8f 2054 // Shift the hole for special motif 46 to avoid debording into S047
afab29fc 2055 if ( copyNo == 2070 ) {
2056 posX -= 0.1;
2057 posY -= 0.1;
2058 }
e8c253a0 2059 gMC->Gspos(fgkHoleName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
5f91c9e8 2060
2061 // then place the daughter board for the motif, wrt the requested rotation angle
2062 posX = posX+fgkDeltaFilleEtamX;
2063 posY = posY+fgkDeltaFilleEtamY;
35bf4a8f 2064 // Do not shift the daughter board
afab29fc 2065 if ( copyNo == 2070 ) {
2066 posX += 0.1;
2067 posY += 0.1;
2068 }
5f91c9e8 2069 posZ = where.Z() + sgn * (fgkMotherThick1 - TotalHzDaughter());
e8c253a0 2070 gMC->Gspos(fgkDaughterName, copyNo, QuadrantMLayerName(chamber), posX, posY, posZ, rot, "ONLY");
5f91c9e8 2071
d1cd2474 2072 if (nofAlreadyDone == alreadyDone.GetSize())
2073 alreadyDone.Set(2*nofAlreadyDone);
2074 alreadyDone.AddAt(motifPosId, nofAlreadyDone++);
2294822d 2075
5ae5869b 2076 AliDebugStream(2) << chamber << " processed motifPosId: " << motifPosId << endl;
5f91c9e8 2077 }
5ae5869b 2078// COMMENT OUT END
2079
5f91c9e8 2080 }// end of special motif case
2081 }
2082 }
2083}
2084
2085//______________________________________________________________________________
d1cd2474 2086TString AliMUONSt1GeometryBuilderV2::GasVolumeName(const TString& name, Int_t chamber) const
ba030c0e 2087{
5398f946 2088/// Insert the chamber number into the name.
ba030c0e 2089
5f91c9e8 2090 TString newString(name);
2091
2092 TString number("");
2093 number += chamber;
ba030c0e 2094
5f91c9e8 2095 newString.Insert(2, number);
ba030c0e 2096
5f91c9e8 2097 return newString;
ba030c0e 2098}
2099
5f91c9e8 2100//
2101// public methods
2102//
2103
2104//______________________________________________________________________________
d1cd2474 2105void AliMUONSt1GeometryBuilderV2::CreateMaterials()
ba030c0e 2106{
5398f946 2107/// Define materials specific to station 1
2108
d1cd2474 2109// Materials and medias defined in MUONv1:
2110//
2111// AliMaterial( 9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
2112// AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
2113// AliMaterial(15, "AIR$ ", 14.61, 7.3, .001205, 30423.24, 67500);
2114// AliMixture( 19, "Bakelite$", abak, zbak, dbak, -3, wbak);
2115// AliMixture( 20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
2116// AliMixture( 21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
2117// AliMixture( 22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
2118// AliMixture( 23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
2119// AliMixture( 24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
2120// AliMaterial(31, "COPPER$", 63.54, 29., 8.96, 1.4, 0.);
2121// AliMixture( 32, "Vetronite$",aglass, zglass, dglass, 5, wglass);
2122// AliMaterial(33, "Carbon$", 12.01, 6., 2.265, 18.8, 49.9);
2123// AliMixture( 34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac);
2124
2125// AliMedium( 1, "AIR_CH_US ", 15, 1, iSXFLD, ...
2126// AliMedium( 4, "ALU_CH_US ", 9, 0, iSXFLD, ...
2127// AliMedium( 5, "ALU_CH_US ", 10, 0, iSXFLD, ...
2128// AliMedium( 6, "AR_CH_US ", 20, 1, iSXFLD, ...
2129// AliMedium( 7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, ...
2130// AliMedium( 8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, ...
2131// AliMedium( 9, "ARG_CO2 ", 22, 1, iSXFLD, ...
2132// AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, ...
2133// AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, ...
2134// AliMedium(13, "CARBON ", 33, 0, iSXFLD, ...
2135// AliMedium(14, "Rohacell ", 34, 0, iSXFLD, ...
2d5a9247 2136// AliMedium(24, "FrameCH$ ", 44, 1, iSXFLD, ...
d1cd2474 2137
2138 //
2139 // --- Define materials for GEANT ---
2140 //
2141
2142 fMUON->AliMaterial(41, "Aluminium II$", 26.98, 13., 2.7, -8.9, 26.1);
2143 // was id: 9
2144 // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18
2145 // ??? same but the last but one argument < 0
d1cd2474 2146 //
2147 // --- Define mixtures for GEANT ---
2148 //
2149
79be0537 2150 // // Ar-CO2 gas II (80%+20%)
2151// Float_t ag1[2] = { 39.95, 44.01};
2152// Float_t zg1[2] = { 18., 22.};
2153// Float_t wg1[2] = { .8, 0.2};
2154// Float_t dg1 = .001821;
2155// fMUON->AliMixture(45, "ArCO2 II 80%$", ag1, zg1, dg1, 2, wg1);
2156// // was id: 22
2157// // use wg1 weighting factors (6th arg > 0)
d1cd2474 2158
2159 // Rohacell 51 II - imide methacrylique
2160 Float_t aRohacell51[4] = { 12.01, 1.01, 16.00, 14.01};
2161 Float_t zRohacell51[4] = { 6., 1., 8., 7.};
2162 Float_t wRohacell51[4] = { 9., 13., 2., 1.};
5f91c9e8 2163 Float_t dRohacell51 = 0.052;
d1cd2474 2164 fMUON->AliMixture(46, "FOAM$",aRohacell51,zRohacell51,dRohacell51,-4,wRohacell51);
2165 // was id: 32
2166 // use relative A (molecular) values (6th arg < 0)
5f91c9e8 2167
d1cd2474 2168 Float_t aSnPb[2] = { 118.69, 207.19};
2169 Float_t zSnPb[2] = { 50, 82};
2170 Float_t wSnPb[2] = { 0.6, 0.4} ;
5f91c9e8 2171 Float_t dSnPb = 8.926;
d1cd2474 2172 fMUON->AliMixture(47, "SnPb$", aSnPb,zSnPb,dSnPb,2,wSnPb);
2173 // was id: 35
2174 // use wSnPb weighting factors (6th arg > 0)
ba030c0e 2175
5f91c9e8 2176 // plastic definition from K5, Freiburg (found on web)
d1cd2474 2177 Float_t aPlastic[2]={ 1.01, 12.01};
2178 Float_t zPlastic[2]={ 1, 6};
2179 Float_t wPlastic[2]={ 1, 1};
5f91c9e8 2180 Float_t denPlastic=1.107;
d1cd2474 2181 fMUON->AliMixture(48, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic);
2182 // was id: 33
2183 // use relative A (molecular) values (6th arg < 0)...no other info...
5f91c9e8 2184
d1cd2474 2185 // Not used, to be removed
2186 //
d1cd2474 2187 // was id: 34
2188
5f91c9e8 2189 // Inox/Stainless Steel (18%Cr, 9%Ni)
d1cd2474 2190 Float_t aInox[3] = {55.847, 51.9961, 58.6934};
2191 Float_t zInox[3] = {26., 24., 28.};
2192 Float_t wInox[3] = {0.73, 0.18, 0.09};
5f91c9e8 2193 Float_t denInox = 7.930;
d1cd2474 2194 fMUON->AliMixture(50, "StainlessSteel$",aInox,zInox,denInox,3,wInox);
2195 // was id: 37
2196 // use wInox weighting factors (6th arg > 0)
2197 // from CERN note NUFACT Note023, Oct.2000
2198 //
2199 // End - Not used, to be removed
2200
2201 //
2202 // --- Define the tracking medias for GEANT ---
2203 //
2204
5f91c9e8 2205 GReal_t epsil = .001; // Tracking precision,
d1cd2474 2206 //GReal_t stemax = -1.; // Maximum displacement for multiple scat
5f91c9e8 2207 GReal_t tmaxfd = -20.; // Maximum angle due to field deflection
d1cd2474 2208 //GReal_t deemax = -.3; // Maximum fractional energy loss, DLS
5f91c9e8 2209 GReal_t stmin = -.8;
d1cd2474 2210 GReal_t maxStepAlu = fMUON->GetMaxStepAlu();
2211 GReal_t maxDestepAlu = fMUON->GetMaxDestepAlu();
8224ab9a 2212 // GReal_t maxStepGas = fMUON->GetMaxStepGas();
f7a1cc68 2213 Int_t iSXFLD = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->PrecInteg();
2214 Float_t sXMGMX = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
5f91c9e8 2215
d1cd2474 2216 fMUON->AliMedium(21, "ALU_II$", 41, 0, iSXFLD, sXMGMX,
2217 tmaxfd, maxStepAlu, maxDestepAlu, epsil, stmin);
f1501d74 2218
d1cd2474 2219 // was med: 20 mat: 36
79be0537 2220 // fMUON->AliMedium(25, "ARG_CO2_II", 45, 1, iSXFLD, sXMGMX,
2221// tmaxfd, maxStepGas, maxDestepAlu, epsil, stmin);
2222// // was med: 9 mat: 22
d1cd2474 2223 fMUON->AliMedium(26, "FOAM_CH$", 46, 0, iSXFLD, sXMGMX,
2224 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
2225 // was med: 16 mat: 32
2226 fMUON->AliMedium(27, "SnPb$", 47, 0, iSXFLD, sXMGMX,
2227 10.0, 0.01, 1.0, 0.003, 0.003);
2228 // was med: 19 mat: 35
2229 fMUON->AliMedium(28, "Plastic$", 48, 0, iSXFLD, sXMGMX,
2230 10.0, 0.01, 1.0, 0.003, 0.003);
2231 // was med: 17 mat: 33
2232
2233 // Not used, to be romoved
2234 //
f1501d74 2235
d1cd2474 2236 fMUON->AliMedium(30, "InoxBolts$", 50, 1, iSXFLD, sXMGMX,
2237 10.0, 0.01, 1.0, 0.003, 0.003);
2238 // was med: 21 mat: 37
2239 //
2240 // End - Not used, to be removed
ba030c0e 2241}
2242
5f91c9e8 2243//______________________________________________________________________________
d1cd2474 2244void AliMUONSt1GeometryBuilderV2::CreateGeometry()
ba030c0e 2245{
5398f946 2246/// Create the detailed GEANT geometry for the dimuon arm station1
2247
5a0e88a7 2248 AliDebug(1,"Called");
5f91c9e8 2249
adbabf6d 2250 // Define chamber volumes as virtual
2251 //
2252
5f91c9e8 2253 // Create basic volumes
2254 //
2255 CreateHole();
2256 CreateDaughterBoard();
2257 CreateInnerLayers();
fdbaed6e 2258 // CreateSpacer0();
2259 CreateSpacer();
ba030c0e 2260
5f91c9e8 2261 // Create reflexion matrices
2262 //
d1cd2474 2263/*
5f91c9e8 2264 Int_t reflXZ, reflYZ, reflXY;
d1cd2474 2265 fMUON->AliMatrix(reflXZ, 90., 180., 90., 90., 180., 0.);
2266 fMUON->AliMatrix(reflYZ, 90., 0., 90.,-90., 180., 0.);
2267 fMUON->AliMatrix(reflXY, 90., 180., 90., 270., 0., 0.);
2268*/
5f91c9e8 2269 // Define transformations for each quadrant
e7addd77 2270 // In old coordinate system: In new coordinate system:
5f91c9e8 2271 //
e7addd77 2272 //
2273 // II. | I. I. | II.
ecbcb19e 2274 // | (101) | (100)
e7addd77 2275 // _____ | ____ _____ | ____
2276 // | |
2277 // III. | IV. IV. | III.
ecbcb19e 2278 // (102) | (103)
5f91c9e8 2279 //
d1cd2474 2280/*
5f91c9e8 2281 Int_t rotm[4];
2282 rotm[0]=0; // quadrant I
2283 rotm[1]=reflXZ; // quadrant II
2284 rotm[2]=reflXY; // quadrant III
2285 rotm[3]=reflYZ; // quadrant IV
d1cd2474 2286*/
2287 TGeoRotation rotm[4];
2288 rotm[0] = TGeoRotation("identity");
2289 rotm[1] = TGeoRotation("reflXZ", 90., 180., 90., 90., 180., 0.);
2290 rotm[2] = TGeoRotation("reflXY", 90., 180., 90., 270., 0., 0.);
2291 rotm[3] = TGeoRotation("reflYZ", 90., 0., 90.,-90., 180., 0.);
ba030c0e 2292
5f91c9e8 2293 TVector3 scale[4];
71167142 2294 scale[0] = TVector3( 1, 1, -1); // quadrant I
2295 scale[1] = TVector3(-1, 1, 1); // quadrant II
2296 scale[2] = TVector3(-1, -1, -1); // quadrant III
2297 scale[3] = TVector3( 1, -1, 1); // quadrant IV
ba030c0e 2298
a432117a 2299 Int_t detElemId[4];
ecbcb19e 2300 detElemId[0] = 1; // quadrant I
e7addd77 2301 detElemId[1] = 0; // quadrant II
ecbcb19e 2302 detElemId[2] = 3; // quadrant III
2303 detElemId[3] = 2; // quadrant IV
a432117a 2304
5f91c9e8 2305 // Shift in Z of the middle layer
10bb087f 2306 Double_t deltaZ = 7.5/2.;
5f91c9e8 2307
2308 // Position of quadrant I wrt to the chamber position
b367fd8f 2309 // TVector3 pos0(-fgkDeltaQuadLHC, -fgkDeltaQuadLHC, deltaZ);
5f91c9e8 2310
2311 // Shift for near/far layers
2312 GReal_t shiftXY = fgkFrameOffset;
2313 GReal_t shiftZ = fgkMotherThick1+fgkMotherThick2;
2314
2315 // Build two chambers
2316 //
2317 for (Int_t ich=1; ich<3; ich++) {
0ab920eb 2318 //for (Int_t ich=1; ich<2; ich++) {
5f91c9e8 2319
2320 // Create quadrant volume
2321 CreateQuadrant(ich);
2322
2323 // Place gas volumes
2324 PlaceInnerLayers(ich);
2325
2326 // Place the quadrant
2327 for (Int_t i=0; i<4; i++) {
0ab920eb 2328 //for (Int_t i=1; i<2; i++) {
b367fd8f 2329 // DE envelope
2330 GReal_t posx0, posy0, posz0;
2331 posx0 = fgkPadXOffsetBP * scale[i].X();
2332 posy0 = fgkPadYOffsetBP * scale[i].Y();;
2333 posz0 = deltaZ * scale[i].Z();
2334 GetEnvelopes(ich-1)
2335 ->AddEnvelope(QuadrantEnvelopeName(ich,i), detElemId[i] + ich*100, true,
2336 TGeoTranslation(posx0, posy0, posz0), rotm[i]);
2337
5f91c9e8 2338 // Middle layer
a432117a 2339 GReal_t posx, posy, posz;
b367fd8f 2340 posx = -fgkDeltaQuadLHC - fgkPadXOffsetBP;
2341 posy = -fgkDeltaQuadLHC - fgkPadYOffsetBP;
2342 posz = 0.;
a432117a 2343 GetEnvelopes(ich-1)
b367fd8f 2344 ->AddEnvelopeConstituent(QuadrantMLayerName(ich), QuadrantEnvelopeName(ich,i),
2345 i+1, TGeoTranslation(posx, posy, posz));
5ae5869b 2346 GetEnvelopes(ich-1)
2347 ->AddEnvelopeConstituent(QuadrantMFLayerName(ich), QuadrantEnvelopeName(ich,i),
2348 i+5, TGeoTranslation(posx, posy, posz));
5f91c9e8 2349
2350 // Near/far layers
b367fd8f 2351 GReal_t posx2 = posx + shiftXY;;
2352 GReal_t posy2 = posy + shiftXY;;
2353 GReal_t posz2 = posz - shiftZ;;
d1cd2474 2354 //gMC->Gspos(QuadrantNLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY");
a432117a 2355 GetEnvelopes(ich-1)
b367fd8f 2356 ->AddEnvelopeConstituent(QuadrantNLayerName(ich), QuadrantEnvelopeName(ich,i),
2357 i+1, TGeoTranslation(posx2, posy2, posz2));
5f91c9e8 2358
b367fd8f 2359 posz2 = posz + shiftZ;
d1cd2474 2360 //gMC->Gspos(QuadrantFLayerName(ich), i+1, "ALIC", posx2, posy2, posz2, rotm[i],"ONLY");
a432117a 2361 GetEnvelopes(ich-1)
b367fd8f 2362 ->AddEnvelopeConstituent(QuadrantFLayerName(ich), QuadrantEnvelopeName(ich,i),
2363 i+1, TGeoTranslation(posx2, posy2, posz2));
5ae5869b 2364
fdbaed6e 2365 // Place spacer in global coordinates in the first non rotated quadrant
2366 // if ( detElemId[i] == 0 ) PlaceSpacer0(ich);
2367 // !! This placement should be used only to find out the right mother volume
2368 // for the spacer if geometry is changed and the plane segment volumes
2369 // will change their numbering
2370 // The call to the method CreateSpacer0(); above haa to be uncommented, too
5f91c9e8 2371 }
2372 }
5f91c9e8 2373}
2374
2375//______________________________________________________________________________
b96f7067 2376void AliMUONSt1GeometryBuilderV2::SetVolumes()
5f91c9e8 2377{
b96f7067 2378/// Define the volumes for the station2 chambers.
5f91c9e8 2379
7b5f6560 2380 if (gAlice->GetModule("SHIL")) {
2381 SetMotherVolume(0, "YOUT1");
2382 SetMotherVolume(1, "YOUT1");
2383 }
2384
adbabf6d 2385 SetVolume(0, "SC01", true);
2386 SetVolume(1, "SC02", true);
b96f7067 2387}
2388
2389//______________________________________________________________________________
2390void AliMUONSt1GeometryBuilderV2::SetTransformations()
2391{
2392/// Define the transformations for the station2 chambers.
adbabf6d 2393
b7ef3c96 2394 Double_t zpos1 = - AliMUONConstants::DefaultChamberZ(0);
2395 SetTranslation(0, TGeoTranslation(0., 0., zpos1));
5f91c9e8 2396
b7ef3c96 2397 Double_t zpos2 = - AliMUONConstants::DefaultChamberZ(1);
2398 SetTranslation(1, TGeoTranslation(0., 0., zpos2));
d1cd2474 2399}
5f91c9e8 2400
d1cd2474 2401//______________________________________________________________________________
2402void AliMUONSt1GeometryBuilderV2::SetSensitiveVolumes()
2403{
5398f946 2404/// Define the sensitive volumes for station2 chambers.
5f91c9e8 2405
e118b27e 2406 GetGeometry(0)->SetSensitiveVolume("SA1G");
e118b27e 2407 GetGeometry(1)->SetSensitiveVolume("SA2G");
ba030c0e 2408}
5f91c9e8 2409