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