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