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