]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilderV2.cxx
silvermy - name change for DCS temperature alias, as suggested by Chiara Z
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1GeometryBuilderV2.cxx
Content-type: text/html ]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSt1GeometryBuilderV2.cxx


500 - Internal Server Error

Malformed UTF-8 character (fatal) at (eval 5) line 1, <$fd> line 2137.
CommitLineData
ba030c0e 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
15
d1cd2474 16// $Id$
17//
3d1463c8 18//-----------------------------------------------------------------------------
d1cd2474 19// Class AliMUONSt1GeometryBuilderV2
20// ---------------------------------
21// MUON Station1 detailed geometry construction class.
5f1df83a 22// (Originally defined in AliMUONv2.cxx - now removed.)
23// Included in AliRoot 2004/01/23
3d1463c8 24// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
25//-----------------------------------------------------------------------------
d1cd2474 26
adbabf6d 27#include "AliMUONSt1GeometryBuilderV2.h"
28#include "AliMUONSt1SpecialMotif.h"
29#include "AliMUON.h"
30#include "AliMUONConstants.h"
31#include "AliMUONGeometryModule.h"
32#include "AliMUONGeometryEnvelopeStore.h"
ba030c0e 33
331a617a 34#include "AliMpSegmentation.h"
35#include "AliMpDEManager.h"
86488ea7 36#include "AliMpContainers.h"
4d8c279c 37#include "AliMpConstants.h"
331a617a 38#include "AliMpCDB.h"
39#include "AliMpSectorSegmentation.h"
adbabf6d 40#include "AliMpSector.h"
41#include "AliMpRow.h"
42#include "AliMpVRowSegment.h"
43#include "AliMpMotifMap.h"
44#include "AliMpMotifPosition.h"
4d8c279c 45#include "AliMpPlaneType.h"
adbabf6d 46
47#include "AliRun.h"
48#include "AliMagF.h"
49#include "AliLog.h"
ba030c0e 50
51#include <TVector2.h>
d1cd2474 52#include <TVector3.h>
53#include <TGeoMatrix.h>
ba030c0e 54#include <TClonesArray.h>
5f91c9e8 55#include <Riostream.h>
56#include <TSystem.h>
5d12ce38 57#include <TVirtualMC.h>
91111b9c 58#include <TGeoManager.h>
59#include <TGeoVolume.h>
60#include <TGeoTube.h>
61#include <TGeoCompositeShape.h>
ba030c0e 62
86488ea7 63#ifdef WITH_STL
adbabf6d 64 #include <vector>
65#endif
e118b27e 66
86488ea7 67#ifdef WITH_ROOT
adbabf6d 68 #include "TArrayI.h"
69#endif
ba030c0e 70
5398f946 71/// \cond CLASSIMP
72ClassImp(AliMUONSt1GeometryBuilderV2)
73/// \endcond
74
5f91c9e8 75// Thickness Constants
d1cd2474 76const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzPadPlane=0.0148/2.; //Pad plane
1c4b9c4c 77const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFoam = 2.503/2.; //Foam of mechanicalplane
78const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzFR4 = 0.062/2.; //FR4 of mechanical plane
d1cd2474 79const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt)
80const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzKapton = 0.0122/2.; //Kapton
81const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergPlastic = 0.3062/2.;//Berg connector
82const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzBergCopper = 0.1882/2.; //Berg connector
83const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzDaughter = 0.0156/2.; //Daughter board
b367fd8f 84const GReal_t AliMUONSt1GeometryBuilderV2::fgkHzGas = 0.42/2.; //Gas thickness
5f91c9e8 85
86// Quadrant Mother volume - TUBS1 - Middle layer of model
d1cd2474 87const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR1 = 18.3;
88const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR1 = 105.673;
89const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick1 = 6.5/2;
90const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL1 = 0.;
91const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU1 = 90.;
5f91c9e8 92
93// Quadrant Mother volume - TUBS2 - near and far layers of model
d1cd2474 94const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherIR2 = 20.7;
95const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherOR2 = 100.073;
96const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherThick2 = 3.0/2;
97const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiL2 = 0.;
98const GReal_t AliMUONSt1GeometryBuilderV2::fgkMotherPhiU2 = 90.;
5f91c9e8 99
100// Sensitive copper pads, foam layer, PCB and electronics model parameters
d1cd2474 101const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxHole=1.5/2.;
102const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyHole=6./2.;
103const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergPlastic=0.74/2.;
104const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergPlastic=5.09/2.;
105const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxBergCopper=0.25/2.;
106const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyBergCopper=3.6/2.;
107const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxKapton=0.8/2.;
108const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyKapton=5.7/2.;
109const GReal_t AliMUONSt1GeometryBuilderV2::fgkHxDaughter=2.3/2.;
110const GReal_t AliMUONSt1GeometryBuilderV2::fgkHyDaughter=6.3/2.;
111const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetX=1.46;
112const GReal_t AliMUONSt1GeometryBuilderV2::fgkOffsetY=0.71;
5ae5869b 113const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamX=1.00;
d1cd2474 114const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaFilleEtamY=0.051;
115
116const GReal_t AliMUONSt1GeometryBuilderV2::fgkDeltaQuadLHC=2.6; // LHC Origin wrt Quadrant Origin
b367fd8f 117const GReal_t AliMUONSt1GeometryBuilderV2::fgkFrameOffset=5.2;
118 // Fix (1) of overlap SQN* layers with SQM* ones (was 5.0)
119
120// Pad planes offsets
121const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadXOffsetBP = 0.50 - 0.63/2; // = 0.185
122const GReal_t AliMUONSt1GeometryBuilderV2::fgkPadYOffsetBP = -0.31 - 0.42/2; // =-0.52
d1cd2474 123
62c708bf 124const char* AliMUONSt1GeometryBuilderV2::fgkHoleName="SCHL";
125const char* AliMUONSt1GeometryBuilderV2::fgkDaughterName="SCDB";
b367fd8f 126const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantEnvelopeName="SE";
d1cd2474 127const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMLayerName="SQM";
128const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantNLayerName="SQN";
129const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantFLayerName="SQF";
5ae5869b 130const char* AliMUONSt1GeometryBuilderV2::fgkQuadrantMFLayerName="SQMF";
62c708bf 131const Int_t AliMUONSt1GeometryBuilderV2::fgkFoamBoxNameOffset=200;
132const Int_t AliMUONSt1GeometryBuilderV2::fgkFR4BoxNameOffset=400;
e8c253a0 133const Int_t AliMUONSt1GeometryBuilderV2::fgkDaughterCopyNoOffset=1000;
5f91c9e8 134
135//______________________________________________________________________________
d1cd2474 136AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2(AliMUON* muon)
8cf07955 137 : AliMUONVGeometryBuilder(0, 2),
d1cd2474 138 fMUON(muon)
ba030c0e 139{
5398f946 140/// Standard constructor
ba030c0e 141}
142
5f91c9e8 143//______________________________________________________________________________
d1cd2474 144AliMUONSt1GeometryBuilderV2::AliMUONSt1GeometryBuilderV2()
145 : AliMUONVGeometryBuilder(),
146 fMUON(0)
ba030c0e 147{
5398f946 148/// Default Constructor
ba030c0e 149}
ba030c0e 150
5f91c9e8 151//______________________________________________________________________________
d1cd2474 152AliMUONSt1GeometryBuilderV2::~AliMUONSt1GeometryBuilderV2()
ba030c0e 153{
5398f946 154/// Destructor
ba030c0e 155}
156
d1cd2474 157
5f91c9e8 158//
159// Private methods
160//
161
b367fd8f 162//______________________________________________________________________________
163TString
164AliMUONSt1GeometryBuilderV2::QuadrantEnvelopeName(Int_t chamber, Int_t quadrant) const
165{
5398f946 166/// Generate unique envelope name from chamber Id and quadrant number
b367fd8f 167
168 return Form("%s%d", Form("%s%d",fgkQuadrantEnvelopeName,chamber), quadrant);
169}
170
5f91c9e8 171//______________________________________________________________________________
d1cd2474 172void AliMUONSt1GeometryBuilderV2::CreateHole()
ba030c0e 173{
5398f946 174/// Create all the elements found inside a foam hole
175
d1cd2474 176 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
177 Int_t idAir = idtmed[1100]; // medium 1
178 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
179 Int_t idCopper = idtmed[1121]; // medium 22 = copper
ba030c0e 180
5f91c9e8 181 GReal_t par[3];
182 GReal_t posX,posY,posZ;
183
184 par[0] = fgkHxHole;
185 par[1] = fgkHyHole;
186 par[2] = fgkHzFoam;
187 gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3);
ba030c0e 188
5f91c9e8 189 par[0] = fgkHxKapton;
190 par[1] = fgkHyKapton;
191 par[2] = fgkHzSnPb;
192 gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3);
193 posX = 0.;
194 posY = 0.;
195 posZ = -fgkHzFoam+fgkHzSnPb;
196 gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
ba030c0e 197
5f91c9e8 198 par[0] = fgkHxHole;
199 par[1] = fgkHyBergPlastic;
200 par[2] = fgkHzKapton;
62c708bf 201 gMC->Gsvolu("SKPT", "BOX", idCopper, par, 3);
5f91c9e8 202 posX = 0.;
203 posY = 0.;
204 posZ = 0.;
62c708bf 205 gMC->Gspos("SKPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
5f91c9e8 206}
ba030c0e 207
5f91c9e8 208//______________________________________________________________________________
d1cd2474 209void AliMUONSt1GeometryBuilderV2::CreateDaughterBoard()
5f91c9e8 210{
5398f946 211/// Create all the elements in a daughter board
212
d1cd2474 213 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 214 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 215 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
216 //Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic
217 Int_t idCopper = idtmed[1121]; // medium 22 = copper
218 Int_t idPlastic =idtmed[1127]; // medium 28 = Plastic
ba030c0e 219
5f91c9e8 220 GReal_t par[3];
221 GReal_t posX,posY,posZ;
222
223 par[0]=fgkHxDaughter;
224 par[1]=fgkHyDaughter;
225 par[2]=TotalHzDaughter();
226 gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3);
ba030c0e 227
5f91c9e8 228 par[0]=fgkHxBergPlastic;
229 par[1]=fgkHyBergPlastic;
230 par[2]=fgkHzBergPlastic;
62c708bf 231 gMC->Gsvolu("SBGP","BOX",idPlastic,par,3);
5f91c9e8 232 posX=0.;
233 posY=0.;
234 posZ = -TotalHzDaughter() + fgkHzBergPlastic;
62c708bf 235 gMC->Gspos("SBGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
5f91c9e8 236
237 par[0]=fgkHxBergCopper;
238 par[1]=fgkHyBergCopper;
239 par[2]=fgkHzBergCopper;
62c708bf 240 gMC->Gsvolu("SBGC","BOX",idCopper,par,3);
5f91c9e8 241 posX=0.;
242 posY=0.;
243 posZ=0.;
62c708bf 244 gMC->Gspos("SBGC",1,"SBGP",posX,posY,posZ,0,"ONLY");
5f91c9e8 245
246 par[0]=fgkHxDaughter;
247 par[1]=fgkHyDaughter;
248 par[2]=fgkHzDaughter;
62c708bf 249 gMC->Gsvolu("SDGH","BOX",idCopper,par,3);
5f91c9e8 250 posX=0.;
251 posY=0.;
252 posZ = -TotalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter;
62c708bf 253 gMC->Gspos("SDGH",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
5f91c9e8 254}
255
256//______________________________________________________________________________
d1cd2474 257void AliMUONSt1GeometryBuilderV2::CreateInnerLayers()
5f91c9e8 258{
5398f946 259/// Create the layer of sensitive volumes with gas
260/// and the copper layer.
5f91c9e8 261
262// Gas Medium
d1cd2474 263 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
79be0537 264 Int_t idArCO2 = idtmed[1108]; // medium 9 (ArCO2 80%)
d1cd2474 265 //Int_t idCopper = idtmed[1109]; // medium 10 = copper
79be0537 266 //Int_t idArCO2 = idtmed[1124]; // medium 25 (ArCO2 80%)
d1cd2474 267 Int_t idCopper = idtmed[1121]; // medium 22 = copper
5f91c9e8 268
269 Float_t par[11];
270
271//Make gas volume - composed of 11 trapezoids
272// section 1 of 11
273 par[0] = fgkHzGas;
274 par[1] = 0.;
275 par[2] = 0.;
276 par[3] = 71.33/2.;
277 par[4] = 9.76/2.;
278 par[5] = 48.77/2.;
279 par[6] = 15.3;
280 par[7] = 71.33/2.;
281 par[8] = 9.76/2.;
282 par[9] = 48.77/2.;
283 par[10] = 15.3;
284
285 gMC->Gsvolu("SA1G", "TRAP", idArCO2, par, 11);
286 gMC->Gsvolu("SA2G", "TRAP", idArCO2, par, 11);
ba030c0e 287
5f91c9e8 288 par[0] = fgkHzPadPlane;
289 gMC->Gsvolu("SA1C", "TRAP", idCopper,par, 11);
290
291// section 2 of 11
292 par[0] = fgkHzGas;
293 par[1] = 0.;
294 par[2] = 0.;
295 par[3] = 79.68/2.;
296 par[4] = 10.4/2.;
297 par[5] = 57.0/2.;
298 par[6] = 0.;
299 par[7] = 79.68/2.;
300 par[8] = 10.4/2.;
301 par[9] = 57.0/2.;
302 par[10] = 0.;
303 gMC->Gsvolu("SB1G", "TRAP", idArCO2, par, 11);
304 gMC->Gsvolu("SB2G", "TRAP", idArCO2, par, 11);
305
306 par[0] = fgkHzPadPlane;
307 gMC->Gsvolu("SB1C", "TRAP", idCopper,par, 11);
308
309// section 3 of 11
310 par[0] = fgkHzGas;
311 par[1] = 0.;
312 par[2] = 0.;
313 par[3] = 71.33/2.;
314 par[4] = 48.77/2.;
315 par[5] = 9.73/2.;
316 par[6] = -15.3;
317 par[7] = 71.33/2.;
318 par[8] = 48.77/2.;
319 par[9] = 9.73/2.;
320 par[10] = -15.3;
321
322 gMC->Gsvolu("SC1G", "TRAP", idArCO2, par, 11);
323 gMC->Gsvolu("SC2G", "TRAP", idArCO2, par, 11);
324
325 par[0] = fgkHzPadPlane;
326 gMC->Gsvolu("SC1C", "TRAP", idCopper,par, 11);
327
328// section 4 of 11
329 par[0] = fgkHzGas;
330 par[1] = 0.;
331 par[2] = 0.;
332 par[3] = 6.00/2.;
333 par[4] = 0.;
334 par[5] = 1.56/2.;
335 par[6] = 7.41;
336 par[7] = 6.00/2.;
337 par[8] = 0.;
338 par[9] = 1.56/2.;
339 par[10] = 7.41;
340 gMC->Gsvolu("SD1G", "TRAP", idArCO2, par, 11);
341 gMC->Gsvolu("SD2G", "TRAP", idArCO2, par, 11);
342
343 par[0] = fgkHzPadPlane;
344 gMC->Gsvolu("SD1C", "TRAP", idCopper,par, 11);
345
346// section 5 of 11
347 par[0] = fgkHzGas;
348 par[1] = 0.;
349 par[2] = 0.;
350 par[3] = 1.516/2.;
351 par[4] = 0.;
352 par[5] = 0.829/2.;
353 par[6] = 15.3;
354 par[7] = 1.516/2.;
355 par[8] = 0.;
356 par[9] = 0.829/2.;
357 par[10] = 15.3;
358 gMC->Gsvolu("SE1G", "TRAP", idArCO2, par, 11);
359 gMC->Gsvolu("SE2G", "TRAP", idArCO2, par, 11);
360
361 par[0] = fgkHzPadPlane;
362 gMC->Gsvolu("SE1C", "TRAP", idCopper,par, 11);
363
364// section 6 of 11
365 par[0] = fgkHzGas;
366 par[1] = 0.;
367 par[2] = 0.;
368 par[3] = 3.92/2.;
369 par[4] = 0.;
370 par[5] = 0.562/2.;
371 par[6] = -4.1;
372 par[7] = 3.92/2.;
373 par[8] = 0.;
374 par[9] = 0.562/2.;
375 par[10] = -4.1;
376 gMC->Gsvolu("SF1G", "TRAP", idArCO2, par, 11);
377 gMC->Gsvolu("SF2G", "TRAP", idArCO2, par, 11);
378
379 par[0] = fgkHzPadPlane;
380 gMC->Gsvolu("SF1C", "TRAP", idCopper,par, 11);
381
382// section 7 of 11
383 par[0] = fgkHzGas;
384 par[1] = 0.;
385 par[2] = 0.;
386 par[3] = 0.941/2.;
387 par[4] = 0.562/2.;
388 par[5] = 0.;
389 par[6] = -16.6;
390 par[7] = 0.941/2.;
391 par[8] = 0.562/2.;
392 par[9] = 0.;
393 par[10] =-16.6;
394 gMC->Gsvolu("SG1G", "TRAP", idArCO2, par, 11);
395 gMC->Gsvolu("SG2G", "TRAP", idArCO2, par, 11);
396
397 par[0] = fgkHzPadPlane;
398 gMC->Gsvolu("SG1C", "TRAP", idCopper,par, 11);
399
400// section 8 of 11
401 par[0] = fgkHzGas;
402 par[1] = 0.;
403 par[2] = 0.;
404 par[3] = 3.94/2.;
405 par[4] = 0.57/2.;
406 par[5] = 0.;
407 par[6] = 4.14;
408 par[7] = 3.94/2.;
409 par[8] = 0.57/2.;
410 par[9] = 0.;
411 par[10] = 4.14;
412 gMC->Gsvolu("SH1G", "TRAP", idArCO2, par, 11);
413 gMC->Gsvolu("SH2G", "TRAP", idArCO2, par, 11);
414
415 par[0] = fgkHzPadPlane;
416 gMC->Gsvolu("SH1C", "TRAP", idCopper,par, 11);
417
418// section 9 of 11
419 par[0] = fgkHzGas;
420 par[1] = 0.;
421 par[2] = 0.;
422 par[3] = 0.95/2.;
423 par[4] = 0.;
424 par[5] = 0.57/2;
425 par[6] = 16.7;
426 par[7] = 0.95/2.;
427 par[8] = 0.;
428 par[9] = 0.57/2;
429 par[10] = 16.7;
430 gMC->Gsvolu("SI1G", "TRAP", idArCO2, par, 11);
431 gMC->Gsvolu("SI2G", "TRAP", idArCO2, par, 11);
432
433 par[0] = fgkHzPadPlane;
434 gMC->Gsvolu("SI1C", "TRAP", idCopper,par, 11);
435
436// section 10 of 11
437 par[0] = fgkHzGas;
438 par[1] = 0.;
439 par[2] = 0.;
440 par[3] = 1.49/2.;
441 par[4] = 0.;
442 par[5] = 0.817/2.;
443 par[6] = -15.4;
444 par[7] = 1.49/2.;
445 par[8] = 0.;
446 par[9] = 0.817/2.;
447 par[10] = -15.4;
448 gMC->Gsvolu("SJ1G", "TRAP", idArCO2, par, 11);
449 gMC->Gsvolu("SJ2G", "TRAP", idArCO2, par, 11);
450
451 par[0] = fgkHzPadPlane;
452 gMC->Gsvolu("SJ1C", "TRAP", idCopper,par, 11);
453
454// section 11 of 11
455 par[0] = fgkHzGas;
456 par[1] = 0.;
457 par[2] = 0.;
458 par[3] = 5.93/2.;
459 par[4] = 0.;
460 par[5] = 1.49/2.;
461 par[6] = -7.16;
462 par[7] = 5.93/2.;
463 par[8] = 0.;
464 par[9] = 1.49/2.;
465 par[10] = -7.16;
466 gMC->Gsvolu("SK1G", "TRAP", idArCO2, par, 11);
467 gMC->Gsvolu("SK2G", "TRAP", idArCO2, par, 11);
468
469 par[0] = fgkHzPadPlane;
470 gMC->Gsvolu("SK1C", "TRAP", idCopper,par, 11);
ba030c0e 471}
5f91c9e8 472
fdbaed6e 473//______________________________________________________________________________
474void AliMUONSt1GeometryBuilderV2::CreateSpacer0()
475{
476/// The spacer volumes are defined according to the input prepared by Nicole Willis
477/// without any modifications
478/// <pre>
479/// No. Type Material Center (mm) Dimensions (mm) (half lengths)
480/// 5 BOX EPOXY 408.2 430.4 522.41 5.75 1.5 25.5
481/// 5P BOX EPOXY 408.2 445.4 522.41 5.75 1.5 25.5
482/// 6 BOX EPOXY 408.2 437.9 519.76 5.75 15.0 1.0
483/// 6P BOX EPOXY 408.2 437.9 525.06 5.75 15.0 1.0
484/// 7 CYL INOX 408.2 437.9 522.41 r=3.0 hz=20.63
ab6c4493 485/// </pre>
fdbaed6e 486
487 // tracking medias
488 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
489 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
490 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
491
492 GReal_t par[3];
493 par[0] = 0.575;
494 par[1] = 0.150;
495 par[2] = 2.550;
496 gMC->Gsvolu("Spacer05","BOX",idFrameEpoxy,par,3);
497
498 par[0] = 0.575;
499 par[1] = 1.500;
500 par[2] = 0.100;
501 gMC->Gsvolu("Spacer06","BOX",idFrameEpoxy,par,3);
502
503 par[0] = 0.000;
504 par[1] = 0.300;
505 par[2] = 2.063;
506 gMC->Gsvolu("Spacer07","TUBE",idInox,par,3);
507}
508
509
510//______________________________________________________________________________
511void AliMUONSt1GeometryBuilderV2::CreateSpacer()
512{
513/// The spacer volumes are defined according to the input prepared by Nicole Willis
514/// with modifications needed to fit into existing geometry.
515/// <pre>
516/// No. Type Material Center (mm) Dimensions (mm) (half lengths)
517/// 5 BOX EPOXY 408.2 430.4 522.41 5.75 1.5 25.5
518/// 5P BOX EPOXY 408.2 445.4 522.41 5.75 1.5 25.5
519/// 6 BOX EPOXY 408.2 437.9 519.76 5.75 15.0 1.0
520/// 6P BOX EPOXY 408.2 437.9 525.06 5.75 15.0 1.0
521/// 7 CYL INOX 408.2 437.9 522.41 r=3.0 hz=20.63
522/// </pre>
523/// To fit in existing volumes the volumes 5 and 7 are represented by 2 volumes
524/// with half size in z (5A, &A); the dimensions of the volume 5A were also modified
525/// to avoid overlaps (x made smaller, y larger to abotain the identical volume)
526
527 // tracking medias
528 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
529 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
530 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
531
532 //GReal_t par[3];
533 //par[0] = 0.575;
534 //par[1] = 0.150;
535 //par[2] = 2.550;
536 //gMC->Gsvolu("Spacer5","BOX",idFrameEpoxy,par,3);
537
538 GReal_t par[3];
539 par[0] = 0.510;
540 par[1] = 0.170;
5ae5869b 541 par[2] = 1.1515;
fdbaed6e 542 gMC->Gsvolu("Spacer5A","BOX",idFrameEpoxy,par,3);
543
5ae5869b 544 par[0] = 0.516;
fdbaed6e 545 par[1] = 1.500;
546 par[2] = 0.100;
547 gMC->Gsvolu("Spacer6","BOX",idFrameEpoxy,par,3);
548
549 //par[0] = 0.000;
550 //par[1] = 0.300;
551 //par[2] = 2.063;
552 //gMC->Gsvolu("Spacer7","TUBE",idInox,par,3);
553
554 par[0] = 0.000;
555 par[1] = 0.300;
556 par[2] = 1.0315;
557 gMC->Gsvolu("Spacer7A","TUBE",idInox,par,3);
558}
559
5f91c9e8 560//______________________________________________________________________________
d1cd2474 561void AliMUONSt1GeometryBuilderV2::CreateQuadrant(Int_t chamber)
ba030c0e 562{
5398f946 563/// Create the quadrant (bending and non-bending planes)
564/// for the given chamber
5f91c9e8 565
5ae5869b 566 // CreateQuadrantLayersAsVolumes(chamber);
567 CreateQuadrantLayersAsAssemblies(chamber);
ba030c0e 568
5ae5869b 569 CreateFrame(chamber);
d1cd2474 570
5ae5869b 571 TExMap specialMap;
572 specialMap.Add(76, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.1, 0.72), 90.));
ddfa5dbc 573 specialMap.Add(75, (Long_t) new AliMUONSt1SpecialMotif(TVector2( 0.7, 0.36)));
e8c253a0 574 specialMap.Add(47, (Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01, 0.36)));
d1cd2474 575
331a617a 576 // Load mapping from OCDB
577 if ( ! AliMpSegmentation::Instance() ) {
578 AliFatal("Mapping has to be loaded first !");
579 }
580
581 const AliMpSectorSegmentation* kSegmentation1
582 = dynamic_cast<const AliMpSectorSegmentation*>(
583 AliMpSegmentation::Instance()
584 ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kBendingPlane)));
585 if ( ! kSegmentation1 ) {
586 AliFatal("Could not access sector segmentation !");
587 }
5ae5869b 588
331a617a 589 const AliMpSector* kSector1 = kSegmentation1->GetSector();
5ae5869b 590
b367fd8f 591 //Bool_t reflectZ = true;
592 Bool_t reflectZ = false;
593 //TVector3 where = TVector3(2.5+0.1+0.56+0.001, 2.5+0.1+0.001, 0.);
594 TVector3 where = TVector3(fgkDeltaQuadLHC + fgkPadXOffsetBP,
595 fgkDeltaQuadLHC + fgkPadYOffsetBP, 0.);
331a617a 596 PlaceSector(kSector1, specialMap, where, reflectZ, chamber);
ba030c0e 597
866c3232 598 Int_t nb = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
cd872630 599 TExMapIter it(&specialMap);
600 Long_t key;
601 Long_t value;
602 while ( it.Next(key,value) == kTRUE ) {
603 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
604 }
d1cd2474 605 specialMap.Delete();
5ae5869b 606 specialMap.Add(76 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.01,0.51),90.));
ddfa5dbc 607 specialMap.Add(75 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.20,-0.04)));
5ae5869b 608 specialMap.Add(47 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(2.18,-1.11)));
4d8c279c 609 specialMap.Add(20 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08)));
5ae5869b 610 specialMap.Add(46 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.6 , 0.17)));
ddfa5dbc 611 specialMap.Add(74 | nb,(Long_t) new AliMUONSt1SpecialMotif(TVector2(0.405, -0.10)));
b367fd8f 612 // Fix (7) - overlap of SQ42 with MCHL (after moving the whole sector
613 // in the true position)
614 // Was: specialMap.Add(47,(Long_t) new AliMUONSt1SpecialMotif(TVector2(1.61,-1.18)));
5ae5869b 615
331a617a 616 const AliMpSectorSegmentation* kSegmentation2
617 = dynamic_cast<const AliMpSectorSegmentation*>(
618 AliMpSegmentation::Instance()
619 ->GetMpSegmentation(100, AliMpDEManager::GetCathod(100, AliMp::kNonBendingPlane)));
620 if ( ! kSegmentation2 ) {
621 AliFatal("Could not access sector segmentation !");
622 }
623
624 const AliMpSector* kSector2 = kSegmentation2->GetSector();
625
b367fd8f 626 //reflectZ = false;
627 reflectZ = true;
331a617a 628 TVector2 offset = kSector2->Position();
e77b6d6b 629 where = TVector3(where.X()+offset.X(), where.Y()+offset.Y(), 0.);
b367fd8f 630 // Add the half-pad shift of the non-bending plane wrt bending plane
631 // (The shift is defined in the mapping as sector offset)
632 // Fix (4) - was TVector3(where.X()+0.63/2, ... - now it is -0.63/2
331a617a 633 PlaceSector(kSector2, specialMap, where, reflectZ, chamber);
d1cd2474 634
cd872630 635 it.Reset();
636 while ( it.Next(key,value) == kTRUE ) {
637 delete reinterpret_cast<AliMUONSt1SpecialMotif*>(value);
638 }
d1cd2474 639 specialMap.Delete();
ba030c0e 640}
641
5f91c9e8 642//______________________________________________________________________________
62c708bf 643void AliMUONSt1GeometryBuilderV2::CreateFoamBox(
644 Int_t segNumber,
645 const TVector2& dimensions)
ba030c0e 646{
5398f946 647/// Create all the elements in the copper plane
ba030c0e 648
d1cd2474 649 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 650 Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 651 //Int_t idFoam = idtmed[1115]; // medium 16 = Foam
652 //Int_t idFR4 = idtmed[1114]; // medium 15 = FR4
653 Int_t idFoam = idtmed[1125]; // medium 26 = Foam
654 Int_t idFR4 = idtmed[1122]; // medium 23 = FR4
ba030c0e 655
5f91c9e8 656 // mother volume
657 GReal_t par[3];
658 par[0] = dimensions.X();
659 par[1] = dimensions.Y();
660 par[2] = TotalHzPlane();
62c708bf 661 gMC->Gsvolu(PlaneSegmentName(segNumber).Data(),"BOX",idAir,par,3);
5f91c9e8 662
663 // foam layer
5f91c9e8 664 par[0] = dimensions.X();
665 par[1] = dimensions.Y();
666 par[2] = fgkHzFoam;
62c708bf 667 gMC->Gsvolu(FoamBoxName(segNumber).Data(),"BOX",idFoam,par,3);
668 GReal_t posX,posY,posZ;
5f91c9e8 669 posX=0.;
670 posY=0.;
671 posZ = -TotalHzPlane() + fgkHzFoam;
62c708bf 672 gMC->Gspos(FoamBoxName(segNumber).Data(),1,
673 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
ba030c0e 674
5f91c9e8 675 // mechanical plane FR4 layer
5f91c9e8 676 par[0] = dimensions.X();
677 par[1] = dimensions.Y();
678 par[2] = fgkHzFR4;
62c708bf 679 gMC->Gsvolu(FR4BoxName(segNumber).Data(),"BOX",idFR4,par,3);
5f91c9e8 680 posX=0.;
681 posY=0.;
682 posZ = -TotalHzPlane()+ 2.*fgkHzFoam + fgkHzFR4;
62c708bf 683 gMC->Gspos(FR4BoxName(segNumber).Data(),1,
684 PlaneSegmentName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 685}
ba030c0e 686
5f91c9e8 687//______________________________________________________________________________
62c708bf 688void AliMUONSt1GeometryBuilderV2::CreatePlaneSegment(Int_t segNumber,
689 const TVector2& dimensions,
690 Int_t nofHoles)
5f91c9e8 691{
5398f946 692/// Create a segment of a plane (this includes a foam layer,
693/// holes in the foam to feed the kaptons through, kapton connectors
694/// and the mother board.)
ba030c0e 695
62c708bf 696 CreateFoamBox(segNumber,dimensions);
fdbaed6e 697
698 // Place spacer in the concrete plane segments:
699 // S225 (in S025), S267 (in S067) in chamber1 and S309 (in S109). S351(in S151)
700 // in chamber2
701 // The segments were found as those which caused overlaps when we placed
702 // the spacer in global coordinates via PlaceSpacer0
703 //
704 // <posXYZ X_Y_Z=" 12.6000; 0.75000; 0.0000"> <volume name="Spacer5A"/>
705 // <posXYZ X_Y_Z=" 12.6000; -0.75000; 0.0000"> <volume name="Spacer5A"/>
706 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 1.1515"> <volume name="Spacer6"/>
707 // <posXYZ X_Y_Z=" 12.6000; 0.0000; 0.0000"> <volume name="Spacer7A"/>
708
709 if ( FoamBoxName(segNumber) == "S225" ||
710 FoamBoxName(segNumber) == "S267" ||
711 FoamBoxName(segNumber) == "S309" ||
712 FoamBoxName(segNumber) == "S351" )
713 {
5ae5869b 714 GReal_t posX = 12.6;
715 GReal_t posY = 0.75;
716 GReal_t posZ = -0.1;
717 if ( FoamBoxName(segNumber) == "S267" ||
718 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 719 gMC->Gspos("Spacer5A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
720
721 posY = -0.75;
5ae5869b 722 if ( FoamBoxName(segNumber) == "S267" ||
723 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 724 gMC->Gspos("Spacer5A", 2, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
725
726 posY = 0.0;
727 posZ = 1.1515;
728 if ( FoamBoxName(segNumber) == "S267" ||
5ae5869b 729 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 730 gMC->Gspos("Spacer6", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
731
732 posY = 0.0;
733 posZ = 0.0;
5ae5869b 734 if ( FoamBoxName(segNumber) == "S267" ||
735 FoamBoxName(segNumber) == "S351" ) posY += fgkPadYOffsetBP;
fdbaed6e 736 gMC->Gspos("Spacer7A", 1, FoamBoxName(segNumber).Data(), posX, posY, posZ,0, "ONLY");
737 }
ba030c0e 738
5f91c9e8 739 for (Int_t holeNum=0;holeNum<nofHoles;holeNum++) {
740 GReal_t posX = ((2.*holeNum+1.)/nofHoles-1.)*dimensions.X();
741 GReal_t posY = 0.;
742 GReal_t posZ = 0.;
5ae5869b 743
62c708bf 744 gMC->Gspos(fgkHoleName,holeNum+1,
745 FoamBoxName(segNumber).Data(),posX,posY,posZ,0,"ONLY");
5f91c9e8 746 }
747}
ba030c0e 748
5ae5869b 749//______________________________________________________________________________
750void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsVolumes(Int_t chamber)
751{
752/// Create the three main layers as real volumes.
753/// Not used anymore.
754
755 // tracking medias
756 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
757 Int_t idAir = idtmed[1100]; // medium 1
758
759 Float_t par[11];
760 Float_t posX,posY,posZ;
761
762// Quadrant volume TUBS1, positioned at the end
763 par[0] = fgkMotherIR1;
764 par[1] = fgkMotherOR1;
765 par[2] = fgkMotherThick1;
766 par[3] = fgkMotherPhiL1;
767 par[4] = fgkMotherPhiU1;
768 gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5);
769 // gMC->Gsvolu(QuadrantMFLayerName(chamber),"TUBS",idAir,par,5);
770
771// Replace the volume shape with a composite shape
772// with substracted overlap with beam shield (YMOT)
773
774 if ( gMC->IsRootGeometrySupported() ) {
775
776 // Get shape
777 TGeoVolume* mlayer
778 = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber));
779 if ( !mlayer ) {
780 AliErrorStream()
781 << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found"
782 << endl;
783 }
784 else {
785 TGeoShape* quadrant = mlayer->GetShape();
786 quadrant->SetName("quadrant");
787
788 // Beam shield recess
789 par[0] = 0;
790 par[1] = 15.4;
791 par[2] = fgkMotherThick1;
792 new TGeoTube("shield_tube", par[0], par[1], par[2]);
793
794 // Displacement
795 posX = 2.6;
796 posY = 2.6;
797 posZ = 0;
798 TGeoTranslation* displacement
799 = new TGeoTranslation("TR", posX, posY, posZ);
800 displacement->RegisterYourself();
801
802 // Composite shape
803 TGeoShape* composite
804 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
805
806 // Reset shape to volume
807 mlayer->SetShape(composite);
808 }
809
810 TGeoVolume* malayer
811 = gGeoManager->FindVolumeFast(QuadrantMFLayerName(chamber));
812 if ( !malayer ) {
813 AliErrorStream()
814 << "Quadrant volume " << QuadrantMFLayerName(chamber) << " not found"
815 << endl;
816 }
817 else {
818 TGeoShape* quadrant = malayer->GetShape();
819 quadrant->SetName("quadrant");
820
821 // Beam shield recess
822 par[0] = 0;
823 par[1] = 15.4;
824 par[2] = fgkMotherThick1;
825 new TGeoTube("shield_tube", par[0], par[1], par[2]);
826
827 // Displacement
828 posX = 2.6;
829 posY = 2.6;
830 posZ = 0;
831 TGeoTranslation* displacement
832 = new TGeoTranslation("TR", posX, posY, posZ);
833 displacement->RegisterYourself();
834
835 // Composite shape
836 TGeoShape* composite
837 = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR");
838
839 // Reset shape to volume
840 malayer->SetShape(composite);
841 }
842 }
843
844// Quadrant volume TUBS2, positioned at the end
845 par[0] = fgkMotherIR2;
846 par[1] = fgkMotherOR2;
847 par[2] = fgkMotherThick2;
848 par[3] = fgkMotherPhiL2;
849 par[4] = fgkMotherPhiU2;
850
851 gMC->Gsvolu(QuadrantNLayerName(chamber),"TUBS",idAir,par,5);
852 gMC->Gsvolu(QuadrantFLayerName(chamber),"TUBS",idAir,par,5);
853}
854
855//______________________________________________________________________________
856void AliMUONSt1GeometryBuilderV2::CreateQuadrantLayersAsAssemblies(Int_t chamber)
857{
858/// Create the three main layers as assemblies
859
860 gGeoManager->MakeVolumeAssembly(QuadrantMLayerName(chamber).Data());
861 gGeoManager->MakeVolumeAssembly(QuadrantMFLayerName(chamber).Data());
862 gGeoManager->MakeVolumeAssembly(QuadrantNLayerName(chamber).Data());
863 gGeoManager->MakeVolumeAssembly(QuadrantFLayerName(chamber).Data());
864}
865
5f91c9e8 866//______________________________________________________________________________
d1cd2474 867void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber)
5f91c9e8 868{
5398f946 869/// Create the non-sensitive elements of the frame for the \a chamber
870///
871/// Model and notation: \n
872/// \n
873/// The Quadrant volume name starts with SQ \n
874/// The volume segments are numbered 00 to XX \n
875/// \n
876/// OutTopFrame \n
877/// (SQ02-16) \n
878/// ------------ \n
879/// OutEdgeFrame / | \n
880/// (SQ17-24) / | InVFrame (SQ00-01) \n
881/// / | \n
882/// | | \n
883/// OutVFrame | _- - \n
884/// (SQ25-39) | | InArcFrame (SQ42-45) \n
885/// | | \n
886/// ------------- \n
887/// InHFrame (SQ40-41) \n
888/// \n
889/// \n
890/// 06 February 2003 - Overlapping volumes resolved. \n
891/// One quarter chamber is comprised of three TUBS volumes: SQMx, SQNx, and SQFx,
892/// where SQMx is the Quadrant Middle layer for chamber \a chamber ( posZ in [-3.25,3.25]),
893/// SQNx is the Quadrant Near side layer for chamber \a chamber ( posZ in [-6.25,3-.25) ), and
894/// SQFx is the Quadrant Far side layer for chamber \a chamber ( posZ in (3.25,6.25] ).
ba030c0e 895
5ae5869b 896 // TString quadrantMLayerName = QuadrantMLayerName(chamber);
897
898 TString quadrantMLayerName = QuadrantMFLayerName(chamber);
899 TString quadrantNLayerName = QuadrantNLayerName(chamber);
900 TString quadrantFLayerName = QuadrantFLayerName(chamber);
901
d1cd2474 902 const Float_t kNearFarLHC=2.4; // Near and Far TUBS Origin wrt LHC Origin
ba030c0e 903
ba030c0e 904 // tracking medias
d1cd2474 905 Int_t* idtmed = fMUON->GetIdtmed()->GetArray()-1099;
5f91c9e8 906
5ae5869b 907 //Int_t idAir = idtmed[1100]; // medium 1
d1cd2474 908 //Int_t idFrameEpoxy = idtmed[1115]; // medium 16 = Frame Epoxy ME730
909 //Int_t idInox = idtmed[1116]; // medium 17 Stainless Steel (18%Cr,9%Ni,Fe)
910 //Int_t idFR4 = idtmed[1110]; // medium 11 FR4
911 //Int_t idCopper = idtmed[1109]; // medium 10 Copper
912 //Int_t idAlu = idtmed[1103]; // medium 4 Aluminium
913 Int_t idFrameEpoxy = idtmed[1123]; // medium 24 = Frame Epoxy ME730 // was 20 not 16
914 Int_t idInox = idtmed[1128]; // medium 29 Stainless Steel (18%Cr,9%Ni,Fe) // was 21 not 17
915 Int_t idFR4 = idtmed[1122]; // medium 23 FR4 // was 15 not 11
916 Int_t idCopper = idtmed[1121]; // medium 22 Copper
917 Int_t idAlu = idtmed[1120]; // medium 21 Aluminium
5f91c9e8 918
919
920// Rotation Matrices
921 Int_t rot1, rot2, rot3;
922
923// Rotation matrices
d1cd2474 924 fMUON->AliMatrix(rot1, 90., 90., 90., 180., 0., 0.); // +90 deg in x-y plane
925 fMUON->AliMatrix(rot2, 90., 45., 90., 135., 0., 0.); // +45 deg in x-y plane
926