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