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 **************************************************************************/
16 /** @file AliFMDGeometryBuilder.cxx
17 @author Christian Holm Christensen <cholm@nbi.dk>
18 @date Mon Mar 27 12:41:17 2006
19 @brief Class to build the FMD geometry
21 //____________________________________________________________________
23 // Builder of FMD geometry.
25 // This class takes care of actually building the geometry using the
26 // TGeo classes. Various parameters are fecthed from the
27 // AliFMDGeometry manager.
28 // Forward Multiplicity Detector based on Silicon wafers. This class
29 // contains the base procedures for the Forward Multiplicity detector
30 // Detector consists of 3 sub-detectors FMD1, FMD2, and FMD3, each of
31 // which has 1 or 2 rings of silicon sensors.
35 #include <TArrayD.h> // ROOT_TArrayD
36 #include <TGeoManager.h> // ROOT_TGeoManager
37 #include <TGeoTube.h> // ROOT_TGeoTube
38 #include <TGeoTube.h> // ROOT_TGeoTube
39 #include <TGeoVolume.h> // ROOT_TGeoVolume
40 #include <TGeoXtru.h> // ROOT_TGeoXtru
42 #include <TVector2.h> // ROOT_TVector2
43 //#include <TGeoMaterial.h> // ROOT_TGeoMaterial
44 //#include <TGeoMedium.h> // ROOT_TGeoMedium
45 //#include <TGeoPcon.h> // ROOT_TGeoPcon
46 //#include <TGeoPolygon.h> // ROOT_TGeoPolygon
48 #include "AliFMDGeometryBuilder.h" // ALIFMDGEOSIMULATOR_H
49 #include "AliFMDGeometry.h" // ALIFMDGEOMETRY_H
50 #include "AliFMDDetector.h" // ALIFMDDETECTOR_H
51 #include "AliFMDRing.h" // ALIFMDRING_H
52 #include "AliFMD1.h" // ALIFMD1_H
53 #include "AliFMD2.h" // ALIFMD2_H
54 #include "AliFMD3.h" // ALIFMD3_H
55 // #include "AliFMD.h" // ALIFMD_H
56 #include "AliFMDDebug.h" // ALILOG_H
58 //====================================================================
59 ClassImp(AliFMDGeometryBuilder)
61 ; // This is here to keep Emacs for indenting the next line
64 //____________________________________________________________________
65 const Char_t* AliFMDGeometryBuilder::fgkActiveName = "F%cAC";
66 const Char_t* AliFMDGeometryBuilder::fgkSectorName = "F%cSC";
67 const Char_t* AliFMDGeometryBuilder::fgkStripName = "F%cST";
68 const Char_t* AliFMDGeometryBuilder::fgkSensorName = "F%cSE";
69 const Char_t* AliFMDGeometryBuilder::fgkPCBName = "F%cPB";
70 const Char_t* AliFMDGeometryBuilder::fgkCuName = "F%cCU";
71 const Char_t* AliFMDGeometryBuilder::fgkChipName = "F%cCH";
72 const Char_t* AliFMDGeometryBuilder::fgkLongLegName = "F%cLL";
73 const Char_t* AliFMDGeometryBuilder::fgkShortLegName = "F%cSL";
74 const Char_t* AliFMDGeometryBuilder::fgkFrontVName = "F%cFH";
75 const Char_t* AliFMDGeometryBuilder::fgkBackVName = "F%cBH";
76 const Char_t* AliFMDGeometryBuilder::fgkRingTopName = "F%cTV";
77 const Char_t* AliFMDGeometryBuilder::fgkRingBotName = "F%cBV";
78 const Char_t* AliFMDGeometryBuilder::fgkHCName = "F%dH%c";
79 const Char_t* AliFMDGeometryBuilder::fgkIHCName = "F%dI%c";
80 const Char_t* AliFMDGeometryBuilder::fgkNoseName = "F3SN";
81 const Char_t* AliFMDGeometryBuilder::fgkBackName = "F3SB";
82 const Char_t* AliFMDGeometryBuilder::fgkBeamName = "F3SL";
83 const Char_t* AliFMDGeometryBuilder::fgkFlangeName = "F3SF";
84 const Char_t* AliFMDGeometryBuilder::fgkFMDName = "F%dM%c";
86 //____________________________________________________________________
87 AliFMDGeometryBuilder::AliFMDGeometryBuilder()
88 : TTask("FMD", "Geomtry builder"),
105 // Default constructor
109 //____________________________________________________________________
110 AliFMDGeometryBuilder::AliFMDGeometryBuilder(Bool_t detailed)
111 : TTask("FMD", "Geometry builder"),
128 // Normal constructor
132 // fmd Pointer to AliFMD object
133 // detailed Whether to make a detailed simulation or not
139 //____________________________________________________________________
141 AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
143 // Setup the geometry of a ring. The defined TGeoVolume is
144 // returned, and should be used when setting up the rest of the
150 // r Pointer to ring geometry object
153 // pointer to ring volume
156 AliError("Didn't get a ring object");
159 Char_t id = r->GetId();
160 Double_t siThick = r->GetSiThickness();
161 const Int_t knv = r->GetNVerticies();
162 TVector2* a = r->GetVertex(5);
163 TVector2* b = r->GetVertex(3);
164 TVector2* c = r->GetVertex(4);
165 Double_t theta = r->GetTheta();
166 Double_t off = (TMath::Tan(TMath::Pi() * theta / 180)
167 * r->GetBondingWidth());
168 Double_t rmax = b->Mod();
169 Double_t rmin = r->GetLowR();
170 Double_t pcbThick = r->GetPrintboardThickness();
171 Double_t cuThick = r->GetCopperThickness();
172 Double_t chipThick= r->GetChipThickness();
173 Double_t modSpace = r->GetModuleSpacing();
174 Double_t legr = r->GetLegRadius();
175 Double_t legl = r->GetLegLength();
176 Double_t legoff = r->GetLegOffset();
177 Int_t ns = r->GetNStrips();
178 Double_t stripoff = a->Mod();
179 Double_t dstrip = (rmax - stripoff) / ns;
180 Double_t space = r->GetSpacing();
183 for (Int_t i = 0; i < knv; i++) {
185 TVector2* vv = r->GetVertex(knv - 1 - i);
187 AliError(Form("Failed to get vertex # %d", knv - 1 - i));
194 // Shape of actual sensor
195 TGeoXtru* sensorShape = new TGeoXtru(2);
196 sensorShape->DefinePolygon(knv, xs.fArray, ys.fArray);
197 sensorShape->DefineSection(0, - siThick/2);
198 sensorShape->DefineSection(1, siThick/2);
199 TGeoVolume* sensorVolume = new TGeoVolume(Form(fgkSensorName, id),
201 sensorVolume->VisibleDaughters(kFALSE);
202 Int_t sid = sensorVolume->GetNumber();
212 // Virtual volume shape to divide - This volume is only defined if
213 // the geometry is set to be detailed.
214 TGeoTubeSeg* activeShape = new TGeoTubeSeg(rmin, rmax, siThick/2,
216 TGeoVolume* activeVolume = new TGeoVolume(Form(fgkActiveName, id),
218 TGeoVolume* sectorVolume = activeVolume->Divide(Form(fgkSectorName,id),
219 2, 2, -theta,0,0,"N");
220 TGeoVolume* stripVolume = sectorVolume->Divide(Form(fgkStripName, id),
221 1, ns, stripoff, dstrip,
223 sid = stripVolume->GetNumber();
224 sensorVolume->AddNodeOverlap(activeVolume, 0);
228 case 'i': case 'I': fActiveId[0] = sid; break;
229 case 'o': case 'O': fActiveId[1] = sid; break;
232 // Shape of Printed circuit Board
233 for (Int_t i = 0; i < knv / 2; i++) ys[i] -= off;
234 for (Int_t i = knv / 2; i < knv; i++) ys[i] += off;
235 TGeoXtru* pcbShape = new TGeoXtru(2);
236 pcbShape->DefinePolygon(knv, xs.fArray, ys.fArray);
237 pcbShape->DefineSection(0, - pcbThick/2);
238 pcbShape->DefineSection(1, pcbThick/2);
239 TGeoVolume* pcbVolume = new TGeoVolume(Form(fgkPCBName, id),
243 TGeoXtru* cuShape = new TGeoXtru(2);
244 cuShape->DefinePolygon(6, xs.fArray, ys.fArray);
245 cuShape->DefineSection(0, - cuThick/2);
246 cuShape->DefineSection(1, cuThick/2);
247 TGeoVolume* cuVolume = new TGeoVolume(Form(fgkCuName,id),cuShape,fCopper);
250 TGeoXtru* chipShape = new TGeoXtru(2);
251 chipShape->DefinePolygon(6, xs.fArray, ys.fArray);
252 chipShape->DefineSection(0, - chipThick/2);
253 chipShape->DefineSection(1, chipThick/2);
254 TGeoVolume* chipVolume = new TGeoVolume(Form(fgkChipName,id),
258 TGeoTube* shortLegShape = new TGeoTube(0, legr, legl / 2);
259 TGeoVolume* shortLegVolume = new TGeoVolume(Form(fgkShortLegName, id),
260 shortLegShape, fPlastic);
263 TGeoTube* longLegShape = new TGeoTube(0, legr, (legl + modSpace) / 2);
264 TGeoVolume* longLegVolume = new TGeoVolume(Form(fgkLongLegName, id),
265 longLegShape, fPlastic);
268 // Back container volume
269 TGeoVolume* backVolume = new TGeoVolumeAssembly(Form(fgkBackVName, id));
272 Double_t z = pcbThick / 2;
273 backVolume->AddNode(pcbVolume, 0, new TGeoTranslation(x,y,z));
274 z += (pcbThick + cuThick) / 2;
275 backVolume->AddNode(cuVolume, 0, new TGeoTranslation(0, 0, z));
276 z += (cuThick + chipThick) / 2;
277 backVolume->AddNode(chipVolume, 0, new TGeoTranslation(0, 0, z));
278 x = a->X() + legoff + legr;
280 z += pcbThick / 2 + legl / 2;
281 backVolume->AddNode(shortLegVolume, 0, new TGeoTranslation(x,y,z));
283 y = c->Y() - legoff - legr - off;
284 backVolume->AddNode(shortLegVolume, 1, new TGeoTranslation(x,y,z));
286 backVolume->AddNode(shortLegVolume, 2, new TGeoTranslation(x,y,z));
288 // Front container volume
289 TGeoVolume* frontVolume = new TGeoVolumeAssembly(Form(fgkFrontVName, id));
293 frontVolume->AddNode(pcbVolume, 1, new TGeoTranslation(x,y,z));
294 z += (pcbThick + cuThick) / 2;
295 frontVolume->AddNode(cuVolume, 0, new TGeoTranslation(0, 0, z));
296 z += (cuThick + chipThick) / 2;
297 frontVolume->AddNode(chipVolume, 0, new TGeoTranslation(0, 0, z));
298 x = a->X() + legoff + legr;
300 z += pcbThick / 2 + (legl + modSpace)/ 2;
301 frontVolume->AddNode(longLegVolume, 0, new TGeoTranslation(x,y,z));
303 y = c->Y() - legoff - legr - off;
304 frontVolume->AddNode(longLegVolume, 1, new TGeoTranslation(x,y,z));
306 frontVolume->AddNode(longLegVolume, 2, new TGeoTranslation(x,y,z));
308 // Half ring mother volumes.
309 TGeoVolume* ringTopVolume = new TGeoVolumeAssembly(Form(fgkRingTopName,id));
310 TGeoVolume* ringBotVolume = new TGeoVolumeAssembly(Form(fgkRingBotName,id));
311 TGeoVolume* halfRing = ringTopVolume;
313 // Adding modules to half-rings
314 Int_t nmod = r->GetNModules();
315 AliFMDDebug(10, ("making %d modules in ring %c", nmod, id));
316 for (Int_t i = 0; i < nmod; i++) {
317 if (i == nmod / 2) halfRing = ringBotVolume;
318 Bool_t front = (i % 2 == 0);
319 Double_t z1 = siThick / 2 + (i % 2) * modSpace;
320 Double_t z2 = z1 + siThick / 2 + space;
321 Double_t th = (2 * i + 1) * theta;
322 TGeoVolume* vol = (front ? frontVolume : backVolume);
323 AliFMDDebug(20, ("Placing copy %d of %s and %s in %s at z=%f and %f, "
324 "and theta=%f", i, sensorVolume->GetName(),
325 vol->GetName(), halfRing->GetName(), z1, z2, th));
326 TGeoMatrix* mat1 = new TGeoCombiTrans(0,0,z1,0);
328 halfRing->AddNode(sensorVolume, i, mat1);
329 TGeoMatrix* mat2 = new TGeoCombiTrans(0,0,z2,0);
331 halfRing->AddNode(vol, i, mat2);
337 //____________________________________________________________________
339 AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d,
340 TGeoVolume* topMother,
341 TGeoVolume* botMother,
343 TGeoVolume* innerTop,
344 TGeoVolume* innerBot,
345 TGeoVolume* outerTop,
346 TGeoVolume* outerBot)
348 // Common stuff for setting up the FMD1, FMD2, and FMD3 geometries.
349 // This includes putting the Honeycomb support plates and the rings
350 // into the mother volumes.
353 // d The detector geometry to use
354 // mother The mother volume of the detector
355 // zmother The midpoint in global coordinates of detector vol.
356 // inner Pointer to inner ring volume
357 // outer Pointer to outer ring volume
360 // Pointer to mother (detector volume)
363 // Loop over the defined rings
364 for (int i = 0; i < 2; i++) {
369 TGeoVolume* tvol = 0;
370 TGeoVolume* bvol = 0;
374 lowr = d->GetInnerHoneyLowR();
375 highr = d->GetInnerHoneyHighR();
382 lowr = d->GetOuterHoneyLowR();
383 highr = d->GetOuterHoneyHighR();
390 Char_t c = r->GetId();
391 Int_t id = d->GetId();
392 Double_t hcThick = d->GetHoneycombThickness();
393 Double_t alThick = d->GetAlThickness();
394 Double_t z = TMath::Abs(rz - zMother);
396 // Place ring in mother volume
397 // TGeoMatrix*matrix=new TGeoTranslation(Form("FMD%d%c trans",id,c),0,0,0);
398 AliFMDDebug(5, ("Placing volumes %s and %s in %s and %s at z=%f",
399 tvol->GetName(), bvol->GetName(),
400 topMother->GetName(), botMother->GetName(), z));
401 topMother->AddNode(tvol, Int_t(c), new TGeoTranslation(0,0,z));
402 botMother->AddNode(bvol, Int_t(c), new TGeoTranslation(0,0,z));
405 TGeoTubeSeg* hcSha = new TGeoTubeSeg(lowr, highr, hcThick/2, 0, 180);
406 TGeoVolume* hcVol = new TGeoVolume(Form(fgkHCName,id,c),hcSha,fAl);
407 // Air in top of honeycomb
408 TGeoTubeSeg* ihcSha = new TGeoTubeSeg(lowr+alThick, highr - alThick,
409 (hcThick-alThick)/2, 0, 180);
410 TGeoVolume* ihcVol = new TGeoVolume(Form(fgkIHCName,id,c),ihcSha,fAir);
411 hcVol->AddNode(ihcVol, 0);
412 hcVol->VisibleDaughters(kFALSE);
413 hcVol->SetVisibility(kTRUE);
415 z += (r->GetSiThickness() +
417 r->GetPrintboardThickness() +
418 r->GetCopperThickness() +
419 r->GetChipThickness() +
420 r->GetModuleSpacing() +
424 AliFMDDebug(15, ("Placing a copy of %s in %s and %s at z=%f",
425 hcVol->GetName(), topMother->GetName(),
426 botMother->GetName(), z));
428 topMother->AddNode(hcVol, 0, new TGeoTranslation(0, 0, z));
431 TGeoMatrix* bhcMatrix = new TGeoCombiTrans(0,0,z,0);
432 bhcMatrix->RotateZ(180);
433 botMother->AddNode(hcVol, 1, bhcMatrix);
438 //____________________________________________________________________
440 AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
441 TGeoVolume* innerTop,
442 TGeoVolume* innerBot)
444 // Setup the FMD1 geometry. The FMD1 only has one ring, and no
445 // special support as it is at the momement.
447 // See also AliFMDGeometryBuilder::DetectorGeometry
449 if (!fmd1 || !innerTop || !innerBot) return 0;
450 Double_t z = fmd1->GetInnerZ();
451 TGeoVolume* fmd1TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
452 fmd1->GetId(), 'T'));
453 TGeoVolume* fmd1BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
454 fmd1->GetId(), 'B'));
456 // Basic detector geometry
457 DetectorGeometry(fmd1, fmd1TopVolume, fmd1BotVolume, z,
458 innerTop, innerBot, 0, 0);
460 // Must add this after filling the assembly.
461 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
462 TGeoMatrix* matrix = new TGeoTranslation("FMD1 trans", 0, 0, z);
463 AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f",
464 fmd1TopVolume->GetName(), fmd1BotVolume->GetName(), z));
465 top->AddNode(fmd1TopVolume, fmd1->GetId(), matrix);
466 top->AddNode(fmd1BotVolume, fmd1->GetId(), matrix);
471 //____________________________________________________________________
473 AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2,
474 TGeoVolume* innerTop,
475 TGeoVolume* innerBot,
476 TGeoVolume* outerTop,
477 TGeoVolume* outerBot)
479 // Setup the FMD2 geometry. The FMD2 has no
480 // special support as it is at the momement.
482 // See also AliFMDGeometryBuilder::DetectorGeometry
484 if (!fmd2 || !innerTop || !innerBot || !outerTop || !outerBot) return 0;
485 Double_t z = fmd2->GetOuterZ();
486 TGeoVolume* fmd2TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
487 fmd2->GetId(), 'T'));
488 TGeoVolume* fmd2BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
489 fmd2->GetId(), 'B'));
491 DetectorGeometry(fmd2, fmd2TopVolume, fmd2BotVolume, z,
492 innerTop, innerBot, outerTop, outerBot);
494 // Must be done after filling the assemblies
495 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
496 TGeoMatrix* matrix = new TGeoTranslation("FMD2 trans", 0, 0, z);
497 AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f",
498 fmd2TopVolume->GetName(), fmd2BotVolume->GetName(), z));
499 top->AddNode(fmd2TopVolume, fmd2->GetId(), matrix);
500 top->AddNode(fmd2BotVolume, fmd2->GetId(), matrix);
505 //____________________________________________________________________
507 AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3,
508 TGeoVolume* innerTop,
509 TGeoVolume* innerBot,
510 TGeoVolume* outerTop,
511 TGeoVolume* outerBot)
513 // Setup the FMD3 geometry. The FMD2 has a rather elaborate support
514 // structure, as the support will also support the vacuum
517 // See also AliFMDGeometryBuilder::DetectorGeometry
519 if (!fmd3 || !innerTop || !innerBot || !outerTop || !outerBot) return 0;
520 Double_t nlen = fmd3->GetNoseLength();
521 Double_t nz = fmd3->GetNoseZ();
522 Double_t noser1 = fmd3->GetNoseLowR();
523 Double_t noser2 = fmd3->GetNoseHighR();
524 Double_t conel = fmd3->GetConeLength();
525 Double_t backl = fmd3->GetBackLength();
526 Double_t backr1 = fmd3->GetBackLowR();
527 Double_t backr2 = fmd3->GetBackHighR();
528 Double_t zdist = conel - backl - nlen;
529 Double_t tdist = backr2 - noser2;
530 Double_t beaml = TMath::Sqrt(zdist * zdist + tdist * tdist);
531 Double_t theta = -180. * TMath::ATan2(tdist, zdist) / TMath::Pi();
532 Double_t flanger = fmd3->GetFlangeR();
533 Double_t z = fmd3->GetInnerZ(); // fmd3->GetZ();
536 TGeoVolume* fmd3TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
537 fmd3->GetId(), 'T'));
538 TGeoVolume* fmd3BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName,
539 fmd3->GetId(), 'B'));
542 DetectorGeometry(fmd3, fmd3TopVolume, fmd3BotVolume, z,
543 innerTop, innerBot, outerTop, outerBot);
547 TGeoTubeSeg* noseShape = new TGeoTubeSeg(noser1, noser2, nlen / 2, 0, 180);
548 TGeoVolume* noseVolume = new TGeoVolume(fgkNoseName, noseShape, fC);
549 zi = -nz + nlen / 2 + z;
551 fmd3TopVolume->AddNode(noseVolume, 0, new TGeoTranslation(0, 0, zi));
552 TGeoMatrix* nmatrix = new TGeoCombiTrans(0, 0, zi, 0);
553 nmatrix->RotateZ(180);
554 fmd3BotVolume->AddNode(noseVolume, 1, nmatrix);
557 TGeoTubeSeg* backShape = new TGeoTubeSeg(backr1, backr2, backl / 2, 0, 180);
558 TGeoVolume* backVolume = new TGeoVolume(fgkBackName, backShape, fC);
559 zi = -nz + conel - backl / 2 + z;
560 fmd3TopVolume->AddNode(backVolume, 0, new TGeoTranslation(0, 0, zi));
561 TGeoMatrix* bmatrix = new TGeoCombiTrans(0, 0, zi, 0);
562 bmatrix->RotateZ(180);
563 fmd3BotVolume->AddNode(backVolume, 1, bmatrix);
569 TGeoBBox* flangeShape = new TGeoBBox((flanger - backr2) / 2,
570 fmd3->GetBeamWidth() / 2,
572 TGeoVolume* flangeVolume = new TGeoVolume(fgkFlangeName, flangeShape, fC);
573 n = fmd3->GetNFlange();
574 r = backr2 + (flanger - backr2) / 2;
575 TGeoVolume* mother = fmd3TopVolume;
576 for (Int_t i = 0; i < n; i++) {
577 if (i >= n / 2) mother = fmd3BotVolume;
578 Double_t phi = 360. / n * i + 180. / n;
579 Double_t x = r * TMath::Cos(TMath::Pi() / 180 * phi);
580 Double_t y = r * TMath::Sin(TMath::Pi() / 180 * phi);
581 AliFMDDebug(15, ("Placing flange %d in %s at (%f,%f,%f) r=%f, phi=%f",
582 i, mother->GetName(), x, y, zi, r, phi));
583 TGeoRotation* rot = new TGeoRotation;
585 TGeoMatrix* matrix = new TGeoCombiTrans(x, y, zi, rot);
586 mother->AddNode(flangeVolume, i, matrix);
590 TGeoBBox* beamShape = new TGeoBBox(fmd3->GetBeamThickness() / 2,
591 fmd3->GetBeamWidth() / 2 - .1,
593 TGeoVolume* beamVolume = new TGeoVolume(fgkBeamName, beamShape, fC);
594 n = fmd3->GetNBeam();
595 r = noser2 + tdist / 2;
596 zi = - nz + nlen + zdist / 2 + z;
597 mother = fmd3TopVolume;
598 for (Int_t i = 0; i < n; i++) {
599 if (i >= n / 2) mother = fmd3BotVolume;
600 Double_t phi = 360. / n * i;
601 Double_t x = r * TMath::Cos(TMath::Pi() / 180 * phi);
602 Double_t y = r * TMath::Sin(TMath::Pi() / 180 * phi);
603 TGeoRotation* rot = new TGeoRotation(Form("FMD3 beam rotation %d", i));
604 // Order is important
605 rot->RotateY(-theta);
607 TGeoMatrix* matrix = new TGeoCombiTrans(Form("FMD3 beam trans %d", i),
609 mother->AddNode(beamVolume, i, matrix);
612 z = fmd3->GetInnerZ();
613 TGeoRotation* rot = new TGeoRotation("FMD3 rotatation");
615 TGeoVolume* top = gGeoManager->GetVolume("ALIC");
616 TGeoMatrix* mmatrix = new TGeoCombiTrans("FMD3 trans", 0, 0, z, rot);
617 AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f",
618 fmd3TopVolume->GetName(), fmd3BotVolume->GetName(), z));
619 top->AddNode(fmd3TopVolume, fmd3->GetId(), mmatrix);
620 top->AddNode(fmd3BotVolume, fmd3->GetId(), mmatrix);
625 //____________________________________________________________________
627 AliFMDGeometryBuilder::Exec(Option_t*)
629 // Setup up the FMD geometry.
630 AliFMDDebug(1, ("\tGeometry options: %s",
631 (fDetailed ? "divided into strips" : "one volume")));
633 AliFatal("No TGeoManager defined");
637 fSi = gGeoManager->GetMedium("FMD_Si$");
638 fC = gGeoManager->GetMedium("FMD_Carbon$");
639 fAl = gGeoManager->GetMedium("FMD_Aluminum$");
640 fChip = gGeoManager->GetMedium("FMD_Si Chip$");
641 fAir = gGeoManager->GetMedium("FMD_Air$");
642 fPCB = gGeoManager->GetMedium("FMD_PCB$");
643 fPlastic = gGeoManager->GetMedium("FMD_Plastic$");
644 fCopper = gGeoManager->GetMedium("FMD_Copper$");
646 if (!fSi||!fC||!fAl||!fChip||!fAir||!fPCB||!fPlastic||!fCopper) {
647 AliError("Failed to get some or all tracking mediums");
650 AliFMDGeometry* fmd = AliFMDGeometry::Instance();
651 AliFMDRing* inner = fmd->GetInner();
652 AliFMDRing* outer = fmd->GetOuter();
655 TGeoVolume* innerTop = gGeoManager->GetVolume(Form(fgkRingTopName,
657 TGeoVolume* innerBot = gGeoManager->GetVolume(Form(fgkRingBotName,
659 TGeoVolume* outerTop = gGeoManager->GetVolume(Form(fgkRingTopName,
661 TGeoVolume* outerBot = gGeoManager->GetVolume(Form(fgkRingBotName,
664 FMD1Geometry(fmd->GetFMD1(), innerTop, innerBot);
665 FMD2Geometry(fmd->GetFMD2(), innerTop, innerBot, outerTop, outerBot);
666 FMD3Geometry(fmd->GetFMD3(), innerTop, innerBot, outerTop, outerBot);
668 fmd->SetSectorOff(fSectorOff);
669 fmd->SetModuleOff(fModuleOff);
670 fmd->SetRingOff(fRingOff);
671 fmd->SetDetectorOff(fDetectorOff);
672 fmd->SetActive(fActiveId.fArray, fActiveId.fN);
674 // fmd->ExtractGeomInfo();
679 //____________________________________________________________________