1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
20 // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
24 // Inherits from AliMUONv1 but with a more detailed
25 // geometrical description of station 1
33 #include <TClonesArray.h>
34 #include <TLorentzVector.h>
37 #include "AliMUONv2.h"
38 #include "AliMUONConstants.h"
39 #include "AliMUONHit.h"
47 #include <MVRowSegment.h>
49 #include <MMotifMap.h>
50 #include <MMotifPosition.h>
51 #include <MMotifType.h>
55 #include <Riostream.h>
61 const GReal_t AliMUONv2::fgkHzPadPlane=0.0148/2.; //Pad plane
62 const GReal_t AliMUONv2::fgkHzFoam = 2.083/2.; // Foam of mechanicalplane
63 const GReal_t AliMUONv2::fgkHzFR4 = 0.0031/2.; // FR4 of mechanical plane
64 const GReal_t AliMUONv2::fgkHzSnPb = 0.0091/2.; //Pad/Kapton connection (66 pt)
65 const GReal_t AliMUONv2::fgkHzKapton = 0.0122/2.; //Kapton
66 const GReal_t AliMUONv2::fgkHzBergPlastic = 0.3062/2.; //Berg connector
67 const GReal_t AliMUONv2::fgkHzBergCopper = 0.1882/2.; //Berg connector
68 const GReal_t AliMUONv2::fgkHzDaughter = 0.0156/2.; //Daughter board
69 const GReal_t AliMUONv2::fgkHzGas = 0.2/2.; //Gas
70 const GReal_t AliMUONv2::fgkHxQuadrant = 94.69/2.; //Box surrounding quadrant
71 const GReal_t AliMUONv2::fgkHyQuadrant = 100.31/2.; //Box surrounding quadrant
72 const GReal_t AliMUONv2::fgkMotherIR = 18.3;
73 const GReal_t AliMUONv2::fgkMotherOR = 104.974;
74 const GReal_t AliMUONv2::fgkMotherThick = 6.5/2; //6.5cm between two quadrants
75 const GReal_t AliMUONv2::fgkMotherPhiL = 0.;
76 const GReal_t AliMUONv2::fgkMotherPhiU = 90.;
79 const GReal_t AliMUONv2::fgkHxHole=1.5/2.;
80 const GReal_t AliMUONv2::fgkHyHole=6./2.;
81 const GReal_t AliMUONv2::fgkHxBergPlastic=0.74/2.;
82 const GReal_t AliMUONv2::fgkHyBergPlastic=5.09/2.;
83 const GReal_t AliMUONv2::fgkHxBergCopper=0.25/2.;
84 const GReal_t AliMUONv2::fgkHyBergCopper=3.6/2.;
85 const GReal_t AliMUONv2::fgkHxKapton=0.8/2.;
86 const GReal_t AliMUONv2::fgkHyKapton=5.7/2.;
87 const GReal_t AliMUONv2::fgkHxDaughter=2.3/2.;
88 const GReal_t AliMUONv2::fgkHyDaughter=6.3/2.;
89 const GReal_t AliMUONv2::fgkOffsetX=1.46;
90 const GReal_t AliMUONv2::fgkOffsetY=0.71;
91 const GReal_t AliMUONv2::fgkDeltaFilleEtamX=0.;
92 const GReal_t AliMUONv2::fgkDeltaFilleEtamY=0.5;
94 const char* AliMUONv2::fgkHoleName="MCHL";
95 const char* AliMUONv2::fgkDaughterName="MCDB";
96 const char AliMUONv2::fgkFoamLayerSuffix='F';
97 const char* AliMUONv2::fgkQuadrantName="QUA";
99 //___________________________________________
100 AliMUONv2::AliMUONv2()
104 // Default Constructor
111 //___________________________________________
112 AliMUONv2::AliMUONv2(const char *name, const char *title)
113 : AliMUONv1(name,title),
120 fHits = new TClonesArray("AliMUONHit",1000);
121 gAlice->AddHitList(fHits);
124 //___________________________________________
125 AliMUONv2::AliMUONv2(const AliMUONv2& rMUON)
127 // Dummy copy constructor
130 //___________________________________________
131 AliMUONv2::~AliMUONv2()
134 if(fDebug) printf("%s: Calling AliMUONv2 destructor !!!\n",ClassName());
142 //___________________________________________
143 void AliMUONv2::CreateGeometry()
145 // Create the GEANT geometry for the dimuon arm.
146 // Use the parent's method for stations 2, 3, 4 and 5.
147 // Use the detailed code for the first station.
149 cout << "AliMUONv2::CreateGeometry()" << endl;
150 cout << "_________________________________________" << endl;
153 Int_t* idtmed = fIdtmed->GetArray()-1099;
154 Int_t idAir = idtmed[1100]; // medium 1
158 //create reflexion matrix
159 Int_t reflXZ,reflYZ,reflXY;
160 AliMatrix(reflXZ, 90., 180., 90., 90., 180., 0.);
161 AliMatrix(reflYZ, 90., 0., 90.,-90., 180., 0.);
162 AliMatrix(reflXY, 90., 180., 90., 270., 0., 0.);
165 CreateDaughterBoard();
171 par[0] = fgkMotherIR;
172 par[1] = fgkMotherOR;
174 par[3] = fgkMotherPhiL;
175 par[4] = fgkMotherPhiU;
177 gMC->Gsvolu("S01G","TUBS",idAir,par,5);
178 gMC->Gspos("S01G",1,QuadrantName(1),0,0,0,0,"ONLY");
179 gMC->Gsvolu("S02G","TUBS",idAir,par,5);
180 gMC->Gspos("S02G",1,QuadrantName(2),0,0,0,0,"ONLY");
182 // place the four copies of it
188 Double_t deltaZ = 6.5/2.;
189 pos[0]=TVector3(-2.6,-2.6,AliMUONConstants::DefaultChamberZ(0)+deltaZ);
191 pos[1]=TVector3(2.6,-2.6,AliMUONConstants::DefaultChamberZ(0)-deltaZ);
193 pos[2]=TVector3(2.6,2.6,AliMUONConstants::DefaultChamberZ(0)+deltaZ);
195 pos[3]=TVector3(-2.6,2.6,AliMUONConstants::DefaultChamberZ(0)-deltaZ);
199 GReal_t posX,posY,posZ;
200 for (Int_t i=0;i<4;i++){
205 gMC->Gspos(QuadrantName(1),i+1,"ALIC",posX,posY,posZ,rotm[i],"ONLY");
207 posZ=pos[i].Z()+AliMUONConstants::DefaultChamberZ(1)
208 -AliMUONConstants::DefaultChamberZ(0);
209 gMC->Gspos(QuadrantName(2),i+5,"ALIC",posX,posY,posZ,rotm[i],"ONLY");
211 static Int_t stations[5]={0,1,1,1,1};
213 AliMUONv1::CreateGeometry();
215 //___________________________________________
216 void AliMUONv2::CreateQuadrant(Int_t chamber)
218 // create the quadrant (bending and non-bending planes)
219 // for the given chamber
221 CreateFrame(chamber);
223 TSpecialMap specialMap;
226 specialMap[1001] = AliMUONSt1SpecialMotif(TVector2(0.1 ,0.84),90.);
227 specialMap[1002] = AliMUONSt1SpecialMotif(TVector2(0.5 ,0.76));
228 specialMap[1003] = AliMUONSt1SpecialMotif(TVector2(1.01,0.76));
229 MReader reader1(kBendingPlane);
230 MSector* sector1 = reader1.BuildSector();
231 where=TVector3(0.185+2.6,-0.52+2.6,totalHz()+fgkHzGas);
232 PlaceSector(sector1,specialMap,where,chamber);
236 specialMap[4001] = AliMUONSt1SpecialMotif(TVector2(1.01,0.59),90.);
237 specialMap[4002] = AliMUONSt1SpecialMotif(TVector2(1.96, 0.17));
238 specialMap[4003] = AliMUONSt1SpecialMotif(TVector2(1.61,-1.18));
239 specialMap[4004] = AliMUONSt1SpecialMotif(TVector2(0.2 ,-0.08));
240 specialMap[4005] = AliMUONSt1SpecialMotif(TVector2(0.2 , 0.25));
241 specialMap[4006] = AliMUONSt1SpecialMotif(TVector2(0.28, 0.21));
243 MReader reader2(kNonBendingPlane);
244 MSector* sector2 = reader2.BuildSector();
245 where=TVector3(-0.13+2.6,-0.1775+2.6,-totalHz()-fgkHzGas);
246 PlaceSector(sector2,specialMap,where,chamber);
249 //___________________________________________
250 void AliMUONv2::CreateMaterials()
252 // --- Define the various mixtures for GEANT ---
254 // Ar-CO2 gas (80%+20%)
255 Float_t ag1[2] = { 39.95,44.01};
256 Float_t zg1[2] = { 18.,22.};
257 Float_t dg1 = .001821;
258 Float_t wg1[2] = { .8,0.2};
259 // use wg1 weighting factors (6th arg > 0)
260 AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 2, wg1);
262 // Ar-buthane-freon gas -- trigger chambers
263 Float_t atr1[4] = { 39.95,12.01,1.01,19. };
264 Float_t ztr1[4] = { 18.,6.,1.,9. };
265 Float_t wtr1[4] = { .56,.1262857,.2857143,.028 };
266 Float_t dtr1 = .002599;
267 AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
269 // Rohacell 51 - imide methacrylique
270 Float_t aRohacell51[4] = {12.01,1.01,16.00,14.01};
271 Float_t zRohacell51[4] = {6.,1.,8.,7.};
272 Float_t dRohacell51 = 0.052;
273 Float_t wRohacell51[4] = {9.,13.,2.,1.};
274 // use relative A (molecular) values (6th arg < 0)
275 AliMixture(32, "FOAM$",aRohacell51,zRohacell51,dRohacell51,-4,wRohacell51);
277 Float_t aSnPb[2] = {118.69,207.19};
278 Float_t zSnPb[2] = {50,82};
279 Float_t dSnPb = 8.926;
280 Float_t wSnPb[2] = {0.6, 0.4} ;
281 // use wSnPb weighting factors (6th arg > 0)
282 AliMixture(35, "SnPb$", aSnPb,zSnPb,dSnPb,2,wSnPb);
284 // plastic definition from K5, Freiburg (found on web)
285 Float_t aPlastic[2]={1.01,12.01};
286 Float_t zPlastic[2]={1,6};
287 Float_t denPlastic=1.107;
288 Float_t wPlastic[2]={1,1};
289 // use relative A (molecular) values (6th arg < 0)...no other info...
290 AliMixture( 33, "Plastic$",aPlastic,zPlastic,denPlastic,-2,wPlastic);
292 // from CERN note NUFACT Note023, Oct.2000
293 // Inox/Stainless Steel (18%Cr, 9%Ni)
294 Float_t aInox[3] = {55.847,51.9961,58.6934};
295 Float_t zInox[3] = {26.,24.,28.};
296 Float_t denInox = 7.930;
297 Float_t wInox[3] = {0.73,0.18,0.09};
298 // use wInox weighting factors (6th arg > 0)
299 AliMixture(37, "StainlessSteel$",aInox,zInox,denInox,3,wInox);
302 Float_t abak[3] = {12.01 , 1.01 , 16.};
303 Float_t zbak[3] = {6. , 1. , 8.};
304 Float_t wbak[3] = {6. , 6. , 1.};
306 AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
308 // Ar-Isobutane gas (80%+20%)
309 Float_t ag[3] = { 39.95,12.01,1.01 };
310 Float_t zg[3] = { 18.,6.,1. };
311 Float_t wg[3] = { .8,.057,.143 };
312 Float_t dg = .0019596;
313 AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
315 // Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger
316 Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
317 Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
318 Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
319 Float_t dtrig = .0031463;
320 AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
323 Float_t agas[3] = { 39.95,12.01,16. };
324 Float_t zgas[3] = { 18.,6.,8. };
325 Float_t wgas[3] = { .74,.086684,.173316 };
326 Float_t dgas = .0018327;
327 AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
329 // --- Define the various AliMaterials for GEANT ---
330 // from PDG and "The Particle Detector BriefBook", Bock and Vasilescu, P.18
331 AliMaterial( 9, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1);
332 AliMaterial(10, "Aluminium$", 26.98, 13., 2.7, -8.9, 26.1);
333 AliMaterial(15, "air$", 14.61, 7.3, .001205, -30423.24, 67500);
334 AliMaterial(30, "Copper$", 63.546,29.,8.96,-1.43,9.6);
335 AliMaterial(31, "FR4$", 17.749, 8.875, 1.7, -19.4, 999.); // from DPG
336 AliMaterial(34, "Kapton$", 12.01,6,1.42,-28.6,999); // from DPG
337 // Density of FrameEpoxy only from manufacturer's specifications
338 // Frame composite epoxy , X0 in g/cm**2 (guestimation!)
339 AliMaterial(36, "FrameEpoxy",12.24,6.0,1.85,-19.14,999);
341 // --- Define the tracking medias (AliMediums) for GEANT ---
342 GReal_t epsil = .001; // Tracking precision,
343 GReal_t stemax = -1.; // Maximum displacement for multiple scat
344 GReal_t tmaxfd = -20.; // Maximum angle due to field deflection
345 GReal_t deemax = -.3; // Maximum fractional energy loss, DLS
347 GReal_t maxStepAlu = 0.001; // from AliMUON.cxx
348 GReal_t maxDestepAlu = -1.; // from AliMUON.cxx
349 GReal_t maxStepGas=0.01; // from AliMUON.cxx
351 Int_t iSXFLD = gAlice->Field()->Integ();
352 Float_t sXMGMX = gAlice->Field()->Max();
354 AliMedium(1, "AIR_CH_US$", 15, 1, iSXFLD, sXMGMX, tmaxfd,
355 stemax, deemax, epsil, stmin);
356 AliMedium(4, "ALU_CH_US$", 9, 0, iSXFLD, sXMGMX, tmaxfd,
357 maxStepAlu, maxDestepAlu, epsil, stmin);
358 AliMedium(5, "ALU_CH_US$", 10, 0, iSXFLD, sXMGMX, tmaxfd,
359 maxStepAlu,maxDestepAlu, epsil, stmin);
360 AliMedium(6, "AR_CH_US ", 20, 1, iSXFLD, sXMGMX,
361 tmaxfd, fMaxStepGas,fMaxDestepGas, epsil, stmin);
363 // Ar-Isobuthane-Forane-SF6 gas
364 AliMedium(7, "GAS_CH_TRIGGER ", 21, 1, iSXFLD, sXMGMX,
365 tmaxfd, stemax, deemax, epsil, stmin);
366 AliMedium(8, "BAKE_CH_TRIGGER ", 19, 0, iSXFLD, sXMGMX,
367 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
369 AliMedium(9, "ARG_CO2$", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas,
370 maxDestepAlu, epsil, stmin);
371 AliMedium(10, "COPPER_CH$", 30, 0, iSXFLD, sXMGMX, tmaxfd,
372 maxStepAlu, maxDestepAlu, epsil, stmin);
373 AliMedium(11, "PCB_COPPER ", 31, 0, iSXFLD, sXMGMX, tmaxfd,
374 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
375 AliMedium(12, "VETRONITE ", 32, 0, iSXFLD, sXMGMX, tmaxfd,
376 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
377 AliMedium(13, "CARBON ", 33, 0, iSXFLD, sXMGMX, tmaxfd,
378 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
379 AliMedium(14, "Rohacell ", 34, 0, iSXFLD, sXMGMX, tmaxfd,
380 fMaxStepAlu, fMaxDestepAlu, epsil, stmin);
381 AliMedium(15, "FR4_CH$", 31, 0,iSXFLD, sXMGMX, 10., .01,.1, .003, .003);
382 AliMedium(16, "FOAM_CH$", 32, 0,
383 iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
384 AliMedium(17, "Plastic$", 33, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003);
385 AliMedium(18, "Kapton$", 34, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003);
386 AliMedium(19, "SnPb$", 35, 0,iSXFLD, sXMGMX, 10., .01, 1., .003, .003);
387 AliMedium(20, "FrameCH$", 36, 1,iSXFLD, sXMGMX, 10., .001, 0.001, .001, .001);
388 AliMedium(21, "InoxBolts$", 37,1,iSXFLD, sXMGMX, 10., .01, 1., .003, .003);
391 void AliMUONv2::CreateFrame(Int_t chamber)
393 // Create the non-sensitive elements of the frame for the <chamber>
399 // Rotation matrices in the x-y plane
401 AliMatrix(idrotm[1101], 90., 315., 90., 45., 0., 0.);
403 AliMatrix(idrotm[1102], 90., 90., 90., 180., 0., 0.);
405 AliMatrix(idrotm[1103], 180., 0., 90., 90.,90., 0.);
408 AliMatrix(idrotm[1104], 90., 45., 90., 135., 0., 0.);
409 // phi = +45 deg + rotation 180° around Y
410 AliMatrix(idrotm[1105], 90., 45., 90., 315., 180., 0.);
412 // Translation matrices in the x-y plane
413 // X -> X ; Y -> Y; Z -> Z
414 AliMatrix(idrotm[1110], 90., 0., 90., 90., 0., 0.);
415 // X->-X; Y -> Y; Z -> -Z
416 AliMatrix(idrotm[1111], 90., 180., 90., 90., 180., 0.);
417 // X->-X; Y ->-Y; Z -> Z
418 AliMatrix(idrotm[1112], 90., 180., 90., 270., 0., 0.);
419 // X->X; Y ->-Y; Z -> -Z
420 AliMatrix(idrotm[1113], 90., 0., 90., 270., 180., 0.);
424 Int_t* idtmed = fIdtmed->GetArray()-1099;
426 Int_t idAir = idtmed[1100]; // medium 1
427 Int_t idSolder = idtmed[1118]; // medium 19
428 Int_t idFrameEpoxy = idtmed[1119]; // medium 20 = Frame Epoxy ME730
429 Int_t idInox = idtmed[1120]; // medium 21 Stainless Steel (18%Cr,9%Ni,Fe)
431 //________________________________________________________________
435 // Epoxy Frame segments
439 // OutEdgeTrapFrame / |
441 // OutCornerTrapFrame / |
443 // OutVFrame | _- InArcFrame
448 // DATE: 27 NOVEMBER 2002 - MODEL UPDATED. THE MOTHER VOLUME IS A TUBS.
449 //__________________________________________________________________
451 const Float_t hzFrameThickness = 1.186/2.; //equivalent thickness
452 const Float_t hzOuterFrameEpoxy = 1.23/2.; //equivalent thickness
453 const Float_t hzOuterFrameSolder = 0.032/2.; //equivalent thickness
454 const Float_t hzOuterFrameInox = 0.035/2.; //equivalent thickness
456 // InHFrame parameters
457 const Float_t hxInHFrame = 75.8/2.;
458 const Float_t hyInHFrame = 2.5/2.;
459 const Float_t hzInHFrame = hzFrameThickness;
461 // InVFrame parameters
462 const Float_t hxInVFrame = 2.5/2.;
463 const Float_t hyInVFrame = 73.3/2.;
464 const Float_t hzInVFrame = hzFrameThickness;
466 //Flat 1mm vertical section
467 const Float_t hxV1mm = 0.1/2.;
468 const Float_t hyV1mm = 2.5/2.;
469 const Float_t hzV1mm = hzFrameThickness;
471 //Flat 1mm horizontal section
472 const Float_t hxH1mm = 2.5/2.;
473 const Float_t hyH1mm = 0.1/2.;
474 const Float_t hzH1mm = hzFrameThickness;
476 // InArcFrame parameters
477 const Float_t IAF = 15.70;
478 const Float_t OAF = 18.20;
479 const Float_t hzAF = hzFrameThickness;
480 const Float_t AFphi1 = 0.0;
481 const Float_t AFphi2 = 90.0;
483 // ScrewsInFrame parameters HEAD
484 const Float_t SCRUHMI = 0.;
485 const Float_t SCRUHMA = 0.690/2.;
486 const Float_t SCRUHLE = 0.4/2.;
487 // ScrewsInFrame parameters MIDDLE
488 const Float_t SCRUMMI = 0.;
489 const Float_t SCRUMMA = 0.39/2.;
490 const Float_t SCRUMLE = hzFrameThickness;
491 // ScrewsInFrame parameters NUT
492 const Float_t SCRUNMI = 0.;
493 const Float_t SCRUNMA = 0.78/2.;
494 const Float_t SCRUNLE = 0.8/2.;
496 // OutVFrame parameters
497 const Float_t hxOutVFrame = 2.5/2.;
498 const Float_t hyOutVFrame = 43.927/2.;
499 const Float_t hzOutVFrame = hzFrameThickness;
501 ///////////////////////////////////////////////////////
503 // OutTopCuboidFrame Epoxy parameters
504 const Float_t hxOutHFrame = 31.9304/2.;
505 const Float_t hyOutHFrame = 8.4/2.;
506 const Float_t hzOutHFrame = hzOuterFrameEpoxy;
508 // OutTopTrapFrameA Epoxy parameters
509 const Float_t hzOTTFA = hzOuterFrameEpoxy;
510 const Float_t tetOTTFA = 0.;
511 const Float_t phiOTTFA = 0.;
512 const Float_t h1OTTFA = 9.6716/2.;
513 const Float_t bl1OTTFA = 4.7787/2.;
514 const Float_t tl1OTTFA = 8.4/2.;
515 const Float_t alp1OTTFA = 10.6;
516 const Float_t h2OTTFA = 9.6716/2.;
517 const Float_t bl2OTTFA = 4.7787/2.;
518 const Float_t tl2OTTFA = 8.4/2.;
519 const Float_t alp2OTTFA = 10.6;
521 // OutTopTrapFrameB Epoxy parameters
522 const Float_t hzOTTFB = hzOuterFrameEpoxy;
523 const Float_t tetOTTFB = 0.;
524 const Float_t phiOTTFB = 0.;
525 const Float_t h1OTTFB = 9.6716/2.;
526 const Float_t bl1OTTFB = 0.;
527 const Float_t tl1OTTFB = 4.7787/2.;
528 const Float_t alp1OTTFB = 13.88;
529 const Float_t h2OTTFB = 9.6716/2.;
530 const Float_t bl2OTTFB = 0.;
531 const Float_t tl2OTTFB = 4.7787/2.;
532 const Float_t alp2OTTFB = 13.88;
534 // OutTopTrapFrame Solder parameters
535 const Float_t hzOTTFS = hzOuterFrameSolder;
537 // OutTopTrapFrame Inox parameters
538 const Float_t hzOTTFI = hzOuterFrameInox;
540 /////////////////////////////////////////////////////////
542 // OutEdgeTrapFrame parameters
544 const Float_t hzOETF = hzOuterFrameEpoxy;
545 const Float_t tetOETF = 0.;
546 const Float_t phiOETF = 0.;
547 const Float_t h1OETF = 7.129/2.;
548 const Float_t bl1OETF1 = 3.705/2;
549 const Float_t tl1OETF1 = 3.9471/2.;
550 const Float_t alp1OETF1 = 0.97;
551 const Float_t h2OETF = 7.129/2.;
552 const Float_t bl2OETF1 = 3.705/2;
553 const Float_t tl2OETF1 = 3.9471/2.;
554 const Float_t alp2OETF1 = 0.97;
557 const Float_t bl1OETF2 = 2.9744/2.;
558 const Float_t tl1OETF2 = 3.705/2;
559 const Float_t alp1OETF2 = 2.93;
561 const Float_t bl2OETF2 = 2.9744/2.;
562 const Float_t tl2OETF2 = 3.705/2;
563 const Float_t alp2OETF2 = 2.93;
566 const Float_t bl1OETF3 = 1.7455/2.;
567 const Float_t tl1OETF3 = 2.9744/2.;
568 const Float_t alp1OETF3 = 4.93;
570 const Float_t bl2OETF3 = 1.7455/2.;
571 const Float_t tl2OETF3 = 2.9744/2.;
572 const Float_t alp2OETF3 = 4.93;
575 const Float_t bl1OETF4 = 0.;
576 const Float_t tl1OETF4 = 1.7455/2.;
577 const Float_t alp1OETF4 = 6.98;
579 const Float_t bl2OETF4 = 0.;
580 const Float_t tl2OETF4 = 1.7455/2.;
581 const Float_t alp2OETF4 = 6.98;
583 ///////////////////////////////////////////////////
585 // OutCornerTrapFrame parameters
586 const Float_t hzOCTF = hzFrameThickness;
587 const Float_t tetOCTF = 0.;
588 const Float_t phiOCTF = 0.;
589 const Float_t h1OCTF = 2.5/2.;
590 const Float_t bl1OCTF = 0.;
591 const Float_t tl1OCTF = 4.7469/2.;
592 const Float_t alp1OCTF = 43.51;
593 const Float_t h2OCTF = 2.5/2.;
594 const Float_t bl2OCTF = 0.;
595 const Float_t tl2OCTF = 4.7469/2.;
596 const Float_t alp2OCTF = 43.51;
598 // Reference point - MIRE (3 per quadrant, only 1 programmed)
599 const Float_t MIREInRad = 0.6;
600 const Float_t MIREOutRad = 1.3;
601 const Float_t MIRELen = hzFrameThickness;
604 Float_t posX,posY,posZ;
606 // ___________________Make volumes________________________
609 par[0] = fgkMotherIR;
610 par[1] = fgkMotherOR;
611 par[2] = fgkMotherThick;
612 par[3] = fgkMotherPhiL;
613 par[4] = fgkMotherPhiU;
615 //Quadrant volume.....positionned at the end
616 gMC->Gsvolu(QuadrantName(chamber),"TUBS",idAir,par,5);
618 // _______________________________________________________
621 // simple epoxy layer...must be inside sensitive surface for tracking
626 gMC->Gsvolu("IVEF","BOX",idFrameEpoxy,par,3);
633 gMC->Gsvolu("IHEF","BOX",idFrameEpoxy,par,3);
635 //Flat 1mm vertical section
640 gMC->Gsvolu("FVMM","BOX",idFrameEpoxy,par,3);
642 //Flat 1mm vertical section
647 gMC->Gsvolu("FHMM","BOX",idFrameEpoxy,par,3);
650 par[0] = hxOutVFrame;
651 par[1] = hyOutVFrame;
652 par[2] = hzOutVFrame;
654 gMC->Gsvolu("OVEF","BOX",idFrameEpoxy,par,3);
663 gMC->Gsvolu("IAF1","TUBS",idFrameEpoxy,par,5);
665 // ScrewsInFrame - 3 sections in order to avoid overlapping volumes
666 // Screw Head, in air
671 gMC->Gsvolu("SCRH","TUBE",idInox,par,3);
673 // Middle part, in the Epoxy
678 gMC->Gsvolu("SCRM","TUBE",idInox,par,3);
685 gMC->Gsvolu("SCRN","TUBE",idInox,par,3);
687 ///////////////////////////////////////////
689 // OutTopTrapFrame Epoxy
690 // - 3 components (cuboid and 2 trapezes) and 3 layers (Epoxy/Inox/Solder)
692 // OutTopCuboidFrame Epoxy
693 par[0] = hxOutHFrame;
694 par[1] = hyOutHFrame;
695 par[2] = hzOutHFrame;
697 gMC->Gsvolu("OHEA","BOX",idFrameEpoxy,par,3);
699 // OutTopTrapFrameA Epoxy parameters
712 gMC->Gsvolu("OHEB","TRAP",idFrameEpoxy,par,11);
714 // OutTopTrapFrameB Epoxy parameters
727 gMC->Gsvolu("OHEC","TRAP",idFrameEpoxy,par,11);
729 // OutTopCuboidFrame Solder
730 par[0] = hxOutHFrame;
731 par[1] = hyOutHFrame;
733 gMC->Gsvolu("OHSA","BOX",idSolder,par,3);
735 // OutTopTrapFrameA Solder
748 gMC->Gsvolu("OHSB","TRAP",idSolder,par,11);
751 // OutTopTrapFrameB Solder
764 gMC->Gsvolu("OHSC","TRAP",idSolder,par,11);
766 // OutTopCuboidFrame Solder
767 par[0] = hxOutHFrame;
768 par[1] = hyOutHFrame;
770 gMC->Gsvolu("OHIA","BOX",idInox,par,3);
772 // OutTopTrapFrameA Inox
785 gMC->Gsvolu("OHIB","TRAP",idInox,par,11);
787 // OutTopTrapFrameB Inox
800 gMC->Gsvolu("OHIC","TRAP",idInox,par,11);
802 /////////////////////////////////
804 // OutEdgeTrapFrame Epoxy = (4 trapezes)*2 copies*3 layers (Epoxy/Inox/Solder)
818 gMC->Gsvolu("EDE1","TRAP",idFrameEpoxy,par,11);
828 gMC->Gsvolu("EDE2","TRAP",idFrameEpoxy,par,11);
838 gMC->Gsvolu("EDE3","TRAP",idFrameEpoxy,par,11);
848 gMC->Gsvolu("EDE4","TRAP",idFrameEpoxy,par,11);
850 ////////////////////////////////
853 par[0] = hzOuterFrameInox;
865 gMC->Gsvolu("EDI1","TRAP",idInox,par,11);
875 gMC->Gsvolu("EDI2","TRAP",idInox,par,11);
885 gMC->Gsvolu("EDI3","TRAP",idInox,par,11);
895 gMC->Gsvolu("EDI4","TRAP",idInox,par,11);
898 ////////////////////////////////
901 par[0] = hzOuterFrameSolder;
913 gMC->Gsvolu("EDS1","TRAP",idSolder,par,11);
923 gMC->Gsvolu("EDS2","TRAP",idSolder,par,11);
933 gMC->Gsvolu("EDS3","TRAP",idSolder,par,11);
943 gMC->Gsvolu("EDS4","TRAP",idSolder,par,11);
945 //////////////////////////////////
947 // OutCornerTrapFrame
960 gMC->Gsvolu("TCOR","TRAP",idFrameEpoxy,par,11);
967 gMC->Gsvolu("MIRE","TUBE",idFrameEpoxy,par,3);
970 // __________________Place volumes in the quadrant ____________
972 const Float_t BeamOX = 2.6;
973 const Float_t BeamOY = 2.6;
975 // Coordinates of the frame corner wrt the beam axis defined at (0,0)
981 posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyInVFrame;
983 gMC->Gspos("IVEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY");
986 posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxInHFrame;
989 gMC->Gspos("IHEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY");
992 posX = 2.*hxInVFrame+IAF+2.*hxInHFrame-hxOutVFrame+2.*hxV1mm;
993 posY = 2.*hyInHFrame+hyOutVFrame;
995 gMC->Gspos("OVEF",1,QuadrantName(chamber),posX, posY, posZ, 0, "ONLY");
996 // cout << " Outer vertical frame at " << posX << " " << posY << " "
997 // << posZ << " and half length " << hyOutVFrame << endl;
998 const Float_t TOPY = posY+hyOutVFrame;
999 const Float_t OUTX = posX;
1001 //Flat 1mm vertical section
1002 posX = 2.0*hxInVFrame+hxV1mm;
1003 posY = 2.0*hyInHFrame+2.*hyH1mm+IAF+hyV1mm;
1005 gMC->Gspos("FVMM",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY");
1007 // Flat 1mm horizontal section
1008 posX = 2.0*hxInVFrame+2.*hxV1mm+IAF+hxH1mm;
1009 posY = 2.0*hyInHFrame+hyH1mm;
1011 gMC->Gspos("FHMM",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY");
1014 posX = 2.0*hxInVFrame+2.*hxV1mm;
1015 posY = 2.0*hyInHFrame+2.*hyH1mm;
1017 gMC->Gspos("IAF1",1,QuadrantName(chamber),posX, posY, posZ,0, "ONLY");
1022 // Only place screws that are inside the sensitive volume.
1027 // Screws on IHEpoxyFrame
1029 const Int_t NumberOfScrewsIH = 14; // no. of screws on the IHEpoxyFrame
1030 const Float_t offX = 5.; // inter-screw distance
1032 // first screw coordinates
1035 // other screw coordinates
1036 for (Int_t i = 1;i<NumberOfScrewsIH;i++){
1037 scruX[i] = scruX[i-1]+offX;
1038 scruY[i] = scruY[0];
1040 // Position the volumes on the frames
1041 for (Int_t i = 0;i<NumberOfScrewsIH;i++){
1042 posX = BeamOX + scruX[i];
1043 posY = BeamOY + scruY[i];
1045 gMC->Gspos("SCRH",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1046 gMC->Gspos("SCRM",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY");
1047 gMC->Gspos("SCRN",i+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1049 // special screw coordinates
1052 posX = BeamOX + scruX[63];
1053 posY = BeamOY + scruY[63];
1055 gMC->Gspos("SCRH",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1056 gMC->Gspos("SCRM",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY");
1057 gMC->Gspos("SCRN",64,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1059 // Screws on the IVEpoxyFrame
1061 const Int_t NumberOfScrewsIV = 15; // no. of screws on the IVEpoxyFrame
1062 const Float_t offY = 5.; // inter-screw distance
1063 Int_t FirstScrew = 58;
1064 Int_t LastScrew = 44;
1066 // first (special) screw coordinates
1067 scruX[FirstScrew-1] = -2.23;
1068 scruY[FirstScrew-1] = 16.3;
1069 // second (repetitive) screw coordinates
1070 scruX[FirstScrew-2] = -2.23;
1071 scruY[FirstScrew-2] = 21.07;
1072 // other screw coordinates
1073 for (Int_t i = FirstScrew-3;i>LastScrew-2;i--){
1074 scruX[i] = scruX[FirstScrew-2];
1075 scruY[i] = scruY[i+1]+offY;
1078 for (Int_t i = 0;i<NumberOfScrewsIV;i++){
1079 posX = BeamOX + scruX[i+LastScrew-1];
1080 posY = BeamOY + scruY[i+LastScrew-1];
1082 gMC->Gspos("SCRH",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1083 gMC->Gspos("SCRM",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY");
1084 gMC->Gspos("SCRN",i+LastScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1087 // Screws on the OVEpoxyFrame
1089 const Int_t NumberOfScrewsOV = 10; // no. of screws on the OVEpoxyFrame
1094 // first (repetitive) screw coordinates
1095 scruX[FirstScrew-1] = 90.9;
1096 scruY[FirstScrew-1] = -2.23; // true value
1098 // other screw coordinates
1099 for (Int_t i = FirstScrew; i<LastScrew; i++ ){
1100 scruX[i] = scruX[FirstScrew-1];
1101 scruY[i] = scruY[i-1]+offY;
1103 for (Int_t i = 0;i<NumberOfScrewsOV;i++){
1104 posX = BeamOX + scruX[i+FirstScrew-1];
1105 posY = BeamOY + scruY[i+FirstScrew-1];
1107 gMC->Gspos("SCRH",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1108 gMC->Gspos("SCRM",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY");
1109 gMC->Gspos("SCRN",i+FirstScrew,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1112 // Inner Arc of Frame, screw positions and numbers-1
1113 scruX[62] = 16.009; scruY[62] = 1.401;
1114 scruX[61] = 14.564; scruY[61] = 6.791;
1115 scruX[60] = 11.363; scruY[60] = 11.363;
1116 scruX[59] = 6.791 ; scruY[59] = 14.564;
1117 scruX[58] = 1.401 ; scruY[58] = 16.009;
1119 for (Int_t i = 0;i<5;i++){
1120 posX = BeamOX + scruX[i+58];
1121 posY = BeamOY + scruY[i+58];
1123 gMC->Gspos("SCRH",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ-hzInHFrame-SCRUHLE, 0, "ONLY");
1124 gMC->Gspos("SCRM",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ, 0, "ONLY");
1125 gMC->Gspos("SCRN",i+58+1,QuadrantName(chamber),posX-QuadOX+0.1, posY-QuadOY+0.1, posZ+hzInHFrame+SCRUNLE, 0, "ONLY");
1130 posY = 2.*hyInHFrame+IAF+2.*hyInVFrame+hyOutHFrame+2.*hyH1mm;
1133 // place 3 layers of cuboids
1134 posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox);
1135 gMC->Gspos("OHEA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY");
1136 posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder;
1137 gMC->Gspos("OHSA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY");
1138 posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox;
1139 gMC->Gspos("OHIA",1,QuadrantName(chamber),posX, posY, posZ,0,"ONLY");
1141 // place 3 layers of trapezoid A
1146 posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox);
1147 gMC->Gspos("OHEB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1148 posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder;
1149 gMC->Gspos("OHSB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1150 posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox;
1151 gMC->Gspos("OHIB",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1153 // place 3 layers of trapezoid B
1158 posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox);
1159 gMC->Gspos("OHEC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1160 posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder;
1161 gMC->Gspos("OHSC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1162 posZ = posZ+hzOuterFrameSolder+hzOuterFrameInox;
1163 gMC->Gspos("OHIC",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1165 ///////////////////////////////////////////////////
1169 const Float_t refY = 70.13685;
1170 const Float_t refX = 71.43685;
1179 XCenter[0] = 72.7099 + 2.6;
1180 XCenter[1] = 77.5787 + 2.6;
1181 XCenter[2] = 82.2732 + 2.6;
1182 XCenter[3] = 86.7882 + 2.6;
1184 YCenter[0] = 67.6691 + 2.6;
1185 YCenter[1] = 62.4564 + 2.6;
1186 YCenter[2] = 57.0693 + 2.6;
1187 YCenter[3] = 51.5027 + 2.6;
1189 XCenter[4] = 67.6691 + 2.6;
1190 XCenter[5] = 62.4564 + 2.6;
1191 XCenter[6] = 57.0693 + 2.6;
1192 XCenter[7] = 51.5027 + 2.6;
1194 YCenter[4] = 72.7099 + 2.6;
1195 YCenter[5] = 77.5787 + 2.6;
1196 YCenter[6] = 82.2732 + 2.6;
1197 YCenter[7] = 86.7882 + 2.6;
1199 posZ = posZ-(hzOuterFrameSolder+hzOuterFrameInox);
1200 gMC->Gspos("EDE1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY");
1201 gMC->Gspos("EDE1",2,QuadrantName(chamber), XCenter[4], YCenter[4],posZ, idrotm[1105],"ONLY");
1204 gMC->Gspos("EDE2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY");
1205 gMC->Gspos("EDE2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY");
1207 gMC->Gspos("EDE3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY");
1208 gMC->Gspos("EDE3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY");
1211 gMC->Gspos("EDE4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY");
1212 gMC->Gspos("EDE4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY");
1216 posZ = posZ+hzOuterFrameEpoxy+hzOuterFrameInox;
1218 gMC->Gspos("EDI1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY");
1219 gMC->Gspos("EDI1",2,QuadrantName(chamber), XCenter[4], YCenter[4], posZ, idrotm[1105],"ONLY");
1221 gMC->Gspos("EDI2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY");
1222 gMC->Gspos("EDI2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY");
1224 gMC->Gspos("EDI3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY");
1225 gMC->Gspos("EDI3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY");
1227 gMC->Gspos("EDI4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY");
1228 gMC->Gspos("EDI4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY");
1231 posZ = posZ+hzOuterFrameInox+hzOuterFrameSolder;
1233 gMC->Gspos("EDS1",1,QuadrantName(chamber), XCenter[0], YCenter[0], posZ, idrotm[1104],"ONLY");
1234 gMC->Gspos("EDS1",2,QuadrantName(chamber), XCenter[4], YCenter[4], posZ, idrotm[1105],"ONLY");
1236 gMC->Gspos("EDS2",1,QuadrantName(chamber), XCenter[1], YCenter[1], posZ, idrotm[1104],"ONLY");
1237 gMC->Gspos("EDS2",2,QuadrantName(chamber), XCenter[5], YCenter[5], posZ, idrotm[1105],"ONLY");
1239 gMC->Gspos("EDS3",1,QuadrantName(chamber), XCenter[2], YCenter[2], posZ, idrotm[1104],"ONLY");
1240 gMC->Gspos("EDS3",2,QuadrantName(chamber), XCenter[6], YCenter[6], posZ, idrotm[1105],"ONLY");
1242 gMC->Gspos("EDS4",1,QuadrantName(chamber), XCenter[3], YCenter[3], posZ, idrotm[1104],"ONLY");
1243 gMC->Gspos("EDS4",2,QuadrantName(chamber), XCenter[7], YCenter[7], posZ, idrotm[1105],"ONLY");
1246 // OutCornerTrapFrame
1248 posY = TOPY+((bl1OCTF+tl1OCTF)/2.);
1250 gMC->Gspos("TCOR",1,QuadrantName(chamber),posX, posY, posZ, idrotm[1102],"ONLY");
1253 posX = OUTX+hxOutVFrame+1.3;
1256 gMC->Gspos("MIRE",1,QuadrantName(chamber),posX, posY, posZ, 0,"ONLY");
1260 //___________________________________________
1261 void AliMUONv2::CreateHole()
1263 // Create all the element inside a foam hole
1265 Int_t* idtmed = fIdtmed->GetArray()-1099;
1266 Int_t idAir = idtmed[1100]; // medium 1
1267 Int_t idCopper = idtmed[1109]; // medium 10 = copper
1270 GReal_t posX,posY,posZ;
1275 gMC->Gsvolu(fgkHoleName,"BOX",idAir,par,3);
1277 par[0] = fgkHxKapton;
1278 par[1] = fgkHyKapton;
1280 gMC->Gsvolu("SNPB", "BOX", idCopper, par, 3);
1283 posZ = -fgkHzFoam+fgkHzSnPb;
1284 gMC->Gspos("SNPB",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
1287 par[1] = fgkHyBergPlastic;
1288 par[2] = fgkHzKapton;
1289 gMC->Gsvolu("KAPT", "BOX", idCopper, par, 3);
1293 gMC->Gspos("KAPT",1,fgkHoleName, posX, posY, posZ, 0,"ONLY");
1296 //___________________________________________
1297 void AliMUONv2::CreateDaughterBoard()
1299 // Create all the elements in a daughter board
1301 Int_t* idtmed = fIdtmed->GetArray()-1099;
1302 Int_t idAir = idtmed[1100]; // medium 1
1303 Int_t idCopper = idtmed[1109]; // medium 10 = copper
1304 Int_t idPlastic =idtmed[1116]; // medium 17 = Plastic
1307 GReal_t posX,posY,posZ;
1309 par[0]=fgkHxDaughter;
1310 par[1]=fgkHyDaughter;
1311 par[2]=totalHzDaughter();
1312 gMC->Gsvolu(fgkDaughterName,"BOX",idAir,par,3);
1314 par[0]=fgkHxBergPlastic;
1315 par[1]=fgkHyBergPlastic;
1316 par[2]=fgkHzBergPlastic;
1317 gMC->Gsvolu("BRGP","BOX",idPlastic,par,3);
1320 posZ = -totalHzDaughter() + fgkHzBergPlastic;
1321 gMC->Gspos("BRGP",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
1323 par[0]=fgkHxBergCopper;
1324 par[1]=fgkHyBergCopper;
1325 par[2]=fgkHzBergCopper;
1326 gMC->Gsvolu("BRGC","BOX",idCopper,par,3);
1330 gMC->Gspos("BRGC",1,"BRGC",posX,posY,posZ,0,"ONLY");
1332 par[0]=fgkHxDaughter;
1333 par[1]=fgkHyDaughter;
1334 par[2]=fgkHzDaughter;
1335 gMC->Gsvolu("DGHT","BOX",idCopper,par,3);
1338 posZ = -totalHzDaughter() + 2.*fgkHzBergPlastic + fgkHzDaughter;
1339 gMC->Gspos("DGHT",1,fgkDaughterName,posX,posY,posZ,0,"ONLY");
1342 //___________________________________________
1343 void AliMUONv2::CreatePlaneBox(const char* name,const TVector2& dimensions)
1345 // create all the elements in the copper plane
1347 Int_t* idtmed = fIdtmed->GetArray()-1099;
1348 Int_t idAir = idtmed[1100]; // medium 1
1349 Int_t idCopper = idtmed[1109]; // medium 10 = copper
1350 Int_t idFoam = idtmed[1115]; // medium 16 = Foam
1351 Int_t idFR4 =idtmed[1114]; // medium 15 = FR4
1354 GReal_t posX,posY,posZ;
1357 par[0] = dimensions.X();
1358 par[1] = dimensions.Y();
1359 par[2] = totalHzPlane();
1360 gMC->Gsvolu(name,"BOX",idAir,par,3);
1363 char* planeName = strdup(name);
1365 par[0] = dimensions.X();
1366 par[1] = dimensions.Y();
1367 par[2] = fgkHzPadPlane;
1368 gMC->Gsvolu(planeName,"BOX",idCopper,par,3);
1371 posZ = -totalHzPlane()+fgkHzPadPlane;
1372 gMC->Gspos(planeName,1,name,posX,posY,posZ,0,"ONLY");
1375 char* foamName = strdup(name);
1376 foamName[3]=fgkFoamLayerSuffix;
1377 par[0] = dimensions.X();
1378 par[1] = dimensions.Y();
1380 gMC->Gsvolu(foamName,"BOX",idFoam,par,3);
1383 posZ = -totalHzPlane()+2.*fgkHzPadPlane+fgkHzFoam;
1384 gMC->Gspos(foamName,1,name,posX,posY,posZ,0,"ONLY");
1386 // mechanical plane FR4 layer
1387 char* fr4Name = strdup(name);
1389 par[0] = dimensions.X();
1390 par[1] = dimensions.Y();
1392 gMC->Gsvolu(fr4Name,"BOX",idFR4,par,3);
1395 posZ = -totalHzPlane()+2.*fgkHzPadPlane+2.*fgkHzFoam+fgkHzFR4;
1396 gMC->Gspos(fr4Name,1,name,posX,posY,posZ,0,"ONLY");
1399 //___________________________________________
1400 void AliMUONv2::CreatePlaneSegment(const char* name,const TVector2& dimensions
1403 // Create a segment of a plane (this includes a copper layer, foam, hole,
1404 // and kapton as well as the mother board.)
1406 static Int_t holeNum=1;
1408 GReal_t posX,posY,posZ;
1410 CreatePlaneBox(name,dimensions);
1412 strcpy(holeName,name);
1413 holeName[3]=fgkFoamLayerSuffix;
1414 // <dname> is a motif on the pad plane
1415 char* dname = strdup(name);
1417 gMC->Gsdvn(dname,holeName,nofHoles,1);
1421 posZ= fgkHzPadPlane;
1422 gMC->Gspos(fgkHoleName,holeNum++,dname,posX,posY,posZ,0,"ONLY");
1425 //___________________________________________
1426 void AliMUONv2::CreateDaughterSegment(const char* name,const TVector2& dimensions,
1429 // Create a segment of a daughter board layer
1431 static Int_t holeNum=1;
1432 Int_t* idtmed = fIdtmed->GetArray()-1099;
1433 Int_t idAir = idtmed[1100]; // medium 1
1436 GReal_t posX,posY,posZ;
1438 par[0] = dimensions.X();
1439 par[1] = dimensions.Y();
1440 par[2] = totalHzDaughter();
1441 gMC->Gsvolu(name,"BOX",idAir,par,3);
1443 // <dname> is a motif on pad plane
1444 char* dname = strdup(name);
1446 gMC->Gsdvn(dname,name,nofHoles,1);
1451 gMC->Gspos(fgkDaughterName,holeNum++,dname,posX,posY,posZ,0,"ONLY");
1454 //___________________________________________
1455 void AliMUONv2::PlaceSector(MSector* sector,TSpecialMap specialMap
1456 ,const TVector3& where,Int_t chamber)
1458 // Place all the segments in the mother volume, in the position defined
1459 // by the sector's data.
1461 static Int_t segNum=1;
1463 GReal_t posX,posY,posZ;
1465 vector<int> already_done;
1467 AliMatrix(rotNum, 90.,90.,90,180.,0.,0.);
1469 for (Int_t irow=0;irow<sector->GetNofRows();irow++){
1470 MRow* row = sector->GetRow(irow);
1471 for (Int_t iseg=0;iseg<row->GetNofRowSegments();iseg++){
1472 MVRowSegment* seg = row->GetRowSegment(iseg);
1475 TSpecialMap::iterator iter
1476 = specialMap.find(seg->GetMotifPositionId(0));
1477 if ( iter == specialMap.end()){
1478 segName = strdup(Form("%.3dM",segNum*2));
1479 CreatePlaneSegment(segName,seg->Dimensions()/10.,seg->GetNofMotifs());
1480 posX = where.X()+seg->Position().X()/10.-fgkOffsetX/2.;
1481 posY = where.Y()+seg->Position().Y()/10.-fgkOffsetY/2.;
1482 posZ = where.Z()-totalHz()+totalHzPlane();
1483 gMC->Gspos(segName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY");
1485 segName = strdup(Form("%.3dM",segNum*2+1));
1486 CreateDaughterSegment(segName,seg->Dimensions()/10.,seg->GetNofMotifs());
1487 posX = where.X()+seg->Position().X()/10.+fgkOffsetX/2.;
1488 posY = where.Y()+seg->Position().Y()/10.-+fgkOffsetY/2.;
1489 posZ = where.Z()-totalHz()+2.*totalHzPlane()+totalHzDaughter();
1490 gMC->Gspos(segName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY");
1493 for (Int_t motifNum=0;motifNum<seg->GetNofMotifs();motifNum++) {
1494 Int_t motifPosId = seg->GetMotifPositionId(motifNum);
1496 if (find(already_done.begin(),already_done.end(),motifPosId)
1497 != already_done.end()) continue;
1499 AliMUONSt1SpecialMotif spMot = specialMap[motifPosId];
1501 MMotifPosition* motifPos =
1502 sector->GetMotifMap()->FindMotifPosition(motifPosId);
1503 MMotifType* mType = motifPos->GetMotif()->GetMotifType();
1504 for (Int_t line=0;line<mType->GetNofPadsY();line++) {
1505 Int_t iMin=-1,iMax=-1,col;
1506 for (col=0;col<mType->GetNofPadsX();col++) {
1507 if (mType->HasPad(MIntPair(col,line))) {
1512 for (col=mType->GetNofPadsX()-1;col>=0;col--) {
1513 if (mType->HasPad(MIntPair(col,line))) {
1518 if ( (iMin>=0) && (iMax>=0) ) {
1520 motifPos->GetMotif()->GetPadDimensions(MIntPair(iMin,line))/10.;
1521 TVector2 lineDim(dim.X()*(iMax-iMin+1),dim.Y());
1522 char* boxName = strdup(Form("%.3dM",segNum*2));
1523 CreatePlaneBox(boxName,lineDim);
1524 TVector2 posLLline = TVector2(dim.X()*2.*iMin,dim.Y()*2.*line)
1525 +motifPos->Position()/10.-motifPos->Dimensions()/10.;
1526 TVector2 centerLine = posLLline + lineDim;
1527 posX = where.X()+centerLine.X()-fgkOffsetX/2.;
1528 posY = where.Y()+centerLine.Y()-fgkOffsetY/2.;
1529 posZ = where.Z()-totalHz()+totalHzPlane();
1530 gMC->Gspos(boxName,1,QuadrantName(chamber),posX,posY,posZ,0,"ONLY");
1536 Int_t rot = ( spMot.GetRotAngle()<0.1 ) ? 0:rotNum;
1538 posX = where.X()+motifPos->Position().X()/10.-fgkOffsetX/2.+spMot.GetDelta().X();
1539 posY = where.Y()+motifPos->Position().Y()/10.-fgkOffsetY/2.+spMot.GetDelta().Y();
1540 posZ = where.Z()-fgkHzPadPlane;
1541 gMC->Gspos(fgkHoleName,motifPosId,QuadrantName(chamber),posX,posY,posZ,rot,"ONLY");
1543 posX = where.X()+motifPos->Position().X()/10.+fgkOffsetX/2.-fgkDeltaFilleEtamX+spMot.GetDelta().X();
1544 posY = where.Y()+motifPos->Position().Y()/10.-+fgkOffsetY/2.-fgkDeltaFilleEtamY+spMot.GetDelta().Y();
1545 posZ = where.Z()-totalHz()+2.*totalHzPlane()+totalHzDaughter();
1546 gMC->Gspos(fgkDaughterName,motifPosId,QuadrantName(chamber),posX,posY,posZ,rot,"ONLY");
1548 already_done.push_back(motifPosId);