]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - FMD/AliFMDGeometryBuilder.cxx
New AliPoissonCalculator class
[u/mrichter/AliRoot.git] / FMD / AliFMDGeometryBuilder.cxx
index e383291d80cdd0253753dba9dfae6255b45122ed..999bec8f3b5028dccae8046d7b6e18f9998f38dc 100644 (file)
@@ -154,6 +154,17 @@ TGeoShape*
 AliFMDGeometryBuilder::MakeXTRU(const TObjArray& verticies, 
                                Double_t thick) const
 {
+  // 
+  // Make a polygonic extrusion shape based on verticies passed in @a
+  // verticies 
+  // 
+  // Parameters:
+  //    verticies List of verticies
+  //    thick     Thickness
+  // 
+  // Return:
+  //    newly allocated polygonic extrusion shape
+  //
   TArrayD xs(6);
   TArrayD ys(6);
   for (Int_t i = 0; i < 3; i++) { 
@@ -173,7 +184,7 @@ AliFMDGeometryBuilder::MakeXTRU(const TObjArray& verticies,
 
 //____________________________________________________________________
 TGeoVolume*
-AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r) 
+AliFMDGeometryBuilder::RingGeometry(const AliFMDRing* r) 
 {
   // Setup the geometry of a ring.    The defined TGeoVolume is
   // returned, and should be used when setting up the rest of the
@@ -207,8 +218,8 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
   TGeoShape* sensorShape = MakeXTRU(r->GetSensorVerticies(), siThick);
   sensorShape->SetName(Form("FMD%c_physical_sensor", id));
   sensorShape->SetTitle(Form("FMD %s physical sensor", lName));
-  TGeoVolume* sensorVolume = new TGeoVolume(Form(fgkSensorName, id), 
-                                           sensorShape, fSi);
+  TString sensorName = TString::Format(fgkSensorName, id);
+  TGeoVolume* sensorVolume = new TGeoVolume(sensorName, sensorShape, fSi);
   sensorVolume->SetTitle(Form("FMD %s Sensor", lName));
   sensorVolume->VisibleDaughters(kFALSE);
   Int_t sid = sensorVolume->GetNumber();
@@ -231,11 +242,11 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
                                               + theta);
     activeShape->SetName(Form(fgkActiveName, id));
     activeShape->SetTitle(Form("FMD %s active area", lName));
-    TGeoVolume* activeVolume = new TGeoVolume(Form(fgkActiveName, id),
-                                             activeShape,fSi);
+    TString activeName = TString::Format(fgkActiveName, id);
+    TGeoVolume* activeVolume = new TGeoVolume(activeName,activeShape,fSi);
     activeVolume->SetTitle(Form("FMD %s active area", lName));
-    TGeoVolume* sectorVolume = activeVolume->Divide(Form(fgkSectorName,id), 
-                                                     2, 2, -theta,
+    TString sectorName = TString::Format(fgkSectorName,id);
+    TGeoVolume* sectorVolume = activeVolume->Divide(sectorName, 2, 2, -theta,
                                                    0,0,"N");
 
     Int_t    ns       = r->GetNStrips();
@@ -243,7 +254,8 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
     Double_t dstrip   = (r->GetHighR() - stripoff) / ns;
 
     sectorVolume->SetTitle(Form("FMD %s sector", lName));
-    TGeoVolume* stripVolume  = sectorVolume->Divide(Form(fgkStripName, id), 
+    TString stripName = TString::Format(fgkStripName, id);
+    TGeoVolume* stripVolume  = sectorVolume->Divide(stripName, 
                                                    1, ns, stripoff, dstrip, 
                                                    0, "SX");
     stripVolume->SetTitle(Form("FMD %s strip", lName));
@@ -262,21 +274,24 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
   TGeoShape* pcbShape = MakeXTRU(r->GetHybridVerticies(), pcbThick);
   pcbShape->SetName(Form("FMD%c_hybrid_pcb", id));
   pcbShape->SetTitle(Form("FMD %s hybrid PCB", lName));
-  TGeoVolume* pcbVolume = new TGeoVolume(Form(fgkPCBName, id), pcbShape, fPCB);
+  TString pcbName = TString::Format(fgkPCBName, id);
+  TGeoVolume* pcbVolume = new TGeoVolume(pcbName, pcbShape, fPCB);
   pcbVolume->SetTitle(Form("FMD %s hybrid PCB", lName));
 
   // Copper layer
   TGeoShape* cuShape = MakeXTRU(r->GetHybridVerticies(), cuThick);
   cuShape->SetName(Form("FMD%c_hybrid_copper", id));
   cuShape->SetTitle(Form("FMD %s hybrid copper", lName));
-  TGeoVolume* cuVolume    = new TGeoVolume(Form(fgkCuName,id),cuShape,fCopper);
+  TString cuName = TString::Format(fgkCuName,id);
+  TGeoVolume* cuVolume = new TGeoVolume(cuName,cuShape,fCopper);
   cuVolume->SetTitle(Form("FMD %s hybrid copper", lName));
 
   // Chip layer
   TGeoShape* chipShape = MakeXTRU(r->GetHybridVerticies(), chipThick);
   chipShape->SetName(Form("FMD%c_hybrid_chip", id));
   chipShape->SetTitle(Form("FMD %s hybrid chip", lName));
-  TGeoVolume* chipVolume = new TGeoVolume(Form(fgkChipName,id),chipShape,fChip);
+  TString chipName = TString::Format(fgkChipName,id);
+  TGeoVolume* chipVolume = new TGeoVolume(chipName,chipShape,fChip);
   chipVolume->SetTitle(Form("FMD %s hybrid chip", lName));
 
   //------------------------------------------------------------------
@@ -289,7 +304,8 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
   TGeoTube*   shortLegShape  = new TGeoTube(0, legr, (legl-lege) / 2);
   shortLegShape->SetName(Form(fgkShortLegName, id));
   shortLegShape->SetTitle(Form("FMD %s short support foot", lName));
-  TGeoVolume* shortLegVolume = new TGeoVolume(Form(fgkShortLegName, id), 
+  TString shortLegName = TString::Format(fgkShortLegName, id);
+  TGeoVolume* shortLegVolume = new TGeoVolume(shortLegName, 
                                              shortLegShape, fCopper);
   shortLegVolume->SetTitle(Form("FMD %s short support foot", lName));
   // Long leg shape
@@ -297,7 +313,8 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
                                            (legl - lege + modSpace) / 2);
   longLegShape->SetName(Form(fgkLongLegName, id));
   longLegShape->SetTitle(Form("FMD %s long support foot", lName));
-  TGeoVolume* longLegVolume  = new TGeoVolume(Form(fgkLongLegName, id), 
+  TString longLegName = TString::Format(fgkLongLegName, id);
+  TGeoVolume* longLegVolume = new TGeoVolume(longLegName, 
                                              longLegShape, fCopper);
   longLegVolume->SetTitle(Form("FMD %s long support foot", lName));
   
@@ -357,12 +374,12 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
   Double_t ddit = r->GetFMDDChipThickness();
   Double_t ddt  = ddpt + ddct + ddit;
   
-  TString    pcbName(Form(fgkFMDDPCBName, id));
-  TString    cuName(Form(fgkFMDDCuName, id));
-  TString    chipName(Form(fgkFMDDChipName, id));
-  new TGeoTubeSeg(Form("%s_inner", pcbName.Data()),  ddlr, ddhr, ddpt/2,0,180);
-  new TGeoTubeSeg(Form("%s_inner", cuName.Data()),   ddlr, ddhr, ddct/2,0,180);
-  new TGeoTubeSeg(Form("%s_inner", chipName.Data()), ddlr, ddhr, ddit/2,0,180);
+  TString    pcbdName(Form(fgkFMDDPCBName, id));
+  TString    cudName(Form(fgkFMDDCuName, id));
+  TString    chipdName(Form(fgkFMDDChipName, id));
+  new TGeoTubeSeg(Form("%s_inner", pcbdName.Data()),  ddlr, ddhr, ddpt/2,0,180);
+  new TGeoTubeSeg(Form("%s_inner", cudName.Data()),   ddlr, ddhr, ddct/2,0,180);
+  new TGeoTubeSeg(Form("%s_inner", chipdName.Data()), ddlr, ddhr, ddit/2,0,180);
   
   Double_t clipWX = 0;
   Double_t clipWY = 0;
@@ -377,40 +394,43 @@ AliFMDGeometryBuilder::RingGeometry(AliFMDRing* r)
     clipWY = ddhr/2;
   }
   
-  new TGeoBBox(Form("%s_clip",  pcbName.Data()), clipWX, clipWY, ddpt);
-  new TGeoBBox(Form("%s_clip",  cuName.Data()),  clipWX, clipWY, ddct);
-  new TGeoBBox(Form("%s_clip",  chipName.Data()),clipWX, clipWY, ddit);
+  new TGeoBBox(Form("%s_clip",  pcbdName.Data()), clipWX, clipWY, ddpt);
+  new TGeoBBox(Form("%s_clip",  cudName.Data()),  clipWX, clipWY, ddct);
+  new TGeoBBox(Form("%s_clip",  chipdName.Data()),clipWX, clipWY, ddit);
   TGeoTranslation* trans = new TGeoTranslation(Form("%s_trans",
-                                                   pcbName.Data()), 
+                                                   pcbdName.Data()), 
                                               0, clipWY+clipY, 0);
   trans->RegisterYourself();
   TGeoShape* fmddPcbShape = 
-    new TGeoCompositeShape(pcbName.Data(), 
+    new TGeoCompositeShape(pcbdName.Data(), 
                           Form("%s_inner*%s_clip:%s_trans",
-                               pcbName.Data(), 
-                               pcbName.Data(), 
-                               pcbName.Data())); 
+                               pcbdName.Data(), 
+                               pcbdName.Data(), 
+                               pcbdName.Data())); 
   TGeoShape* fmddCuShape = 
-    new TGeoCompositeShape(cuName.Data(), 
+    new TGeoCompositeShape(cudName.Data(), 
                           Form("%s_inner*%s_clip:%s_trans",
-                               cuName.Data(), 
-                               cuName.Data(), 
-                               pcbName.Data()));
+                               cudName.Data(), 
+                               cudName.Data(), 
+                               pcbdName.Data()));
   TGeoShape* fmddChipShape = 
-    new TGeoCompositeShape(chipName.Data(), 
+    new TGeoCompositeShape(chipdName.Data(), 
                           Form("%s_inner*%s_clip:%s_trans",
-                               chipName.Data(), 
-                               chipName.Data(), 
-                               pcbName.Data()));
+                               chipdName.Data(), 
+                               chipdName.Data(), 
+                               pcbdName.Data()));
   fmddPcbShape->SetTitle(Form("FMD %s digitiser PCB", lName));
   fmddCuShape->SetTitle(Form("FMD %s digitiser copper", lName));
   fmddChipShape->SetTitle(Form("FMD %s digitiser chip", lName));
 
-  TGeoVolume*  fmddPcbVolume = new TGeoVolume(Form(fgkFMDDPCBName, id),
+  TString fmddPcbName = TString::Format(fgkFMDDPCBName, id);
+  TGeoVolume* fmddPcbVolume = new TGeoVolume(fmddPcbName,
                                              fmddPcbShape, fPCB);
-  TGeoVolume*  fmddCuVolume  = new TGeoVolume(Form(fgkFMDDCuName, id),
+  TString fmddCuName = TString::Format(fgkFMDDCuName, id);
+  TGeoVolume* fmddCuVolume = new TGeoVolume(fmddCuName,
                                              fmddCuShape, fCopper);
-  TGeoVolume*  fmddChipVolume= new TGeoVolume(Form(fgkFMDDChipName, id),
+  TString fmddChipName = TString::Format(fgkFMDDChipName, id);
+  TGeoVolume* fmddChipVolume = new TGeoVolume(fmddChipName,
                                              fmddChipShape, fChip);
   fmddPcbVolume->SetTitle(Form("FMD %s digitiser PCB", lName));
   fmddCuVolume->SetTitle(Form("FMD %s digitiser copper", lName));
@@ -529,6 +549,13 @@ AliFMDGeometryBuilder::HoneycombShape(Int_t id, Char_t ring,
 TGeoVolume* 
 AliFMDGeometryBuilder::TensionBox()
 {
+  // 
+  // Get the tension box volume
+  // 
+  // 
+  // Return:
+  //    
+  //
   static TGeoVolumeAssembly* tensionBox = 0;
   if (tensionBox) return tensionBox;
   
@@ -549,7 +576,7 @@ AliFMDGeometryBuilder::TensionBox()
 
 //____________________________________________________________________
 TGeoVolume*
-AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d, 
+AliFMDGeometryBuilder::DetectorGeometry(const AliFMDDetector* d, 
                                        TGeoVolume* topMother, 
                                        TGeoVolume* botMother, 
                                        Double_t    zMother, 
@@ -641,7 +668,7 @@ AliFMDGeometryBuilder::DetectorGeometry(AliFMDDetector* d,
 
 //____________________________________________________________________
 TGeoVolume*
-AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1, 
+AliFMDGeometryBuilder::FMD1Geometry(const AliFMD1* fmd1, 
                                    TGeoVolume* innerTop, 
                                    TGeoVolume* innerBot) 
 {
@@ -654,11 +681,14 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
   AliFMDRing* r             = fmd1->GetInner();
   Double_t    z             = fmd1->GetInnerZ();  
   
-  TGeoVolume* fmd1TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd1->GetId(), 'T'));
+  // `Top' or `Outside' master volume
+  TString fmd1TopName = TString::Format(fgkFMDName, fmd1->GetId(), 'T');
+  TGeoVolume* fmd1TopVolume = new TGeoVolumeAssembly(fmd1TopName);
   fmd1TopVolume->SetTitle("FMD1 top half");
-  TGeoVolume* fmd1BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd1->GetId(), 'B'));
+
+  // `Bottom' or `Inside' master volume
+  TString fmd1BotName = TString::Format(fgkFMDName, fmd1->GetId(), 'B');
+  TGeoVolume* fmd1BotVolume = new TGeoVolumeAssembly(fmd1BotName);
   fmd1BotVolume->SetTitle("FMD1 bottom half");
   
   // Basic detector geometry 
@@ -677,9 +707,10 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
                         {  6.80, 24.50, 24.65 },
                         {  6.80, 24.50, 26.00 },
                         {  6.95, 24.50, 26.00 } };
-  TGeoPcon* lidBaseS = new TGeoPcon("FMD1_lid_base", 0, 180, 12);
+  Double_t  lidZStart = lidP[11][0];
+  TGeoPcon* lidBaseS  = new TGeoPcon("FMD1_lid_base", 0, 180, 12);
   for (size_t i = 0; i < 12; i++) 
-    lidBaseS->DefineSection(i, lidP[i][0], lidP[i][1], lidP[i][2]);
+    lidBaseS->DefineSection(i, lidP[i][0] - lidZStart, lidP[i][1], lidP[i][2]);
   
   
   Double_t lidH[][2] = { {  7.84903, 24.15680  }, 
@@ -693,15 +724,15 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
   TString lidComp("FMD1_lid_base-(");
   TGeoTranslation* trans = 0;
   for (size_t i = 0; i < 4; i++) { 
-    trans = new TGeoTranslation(-lidH[i][0], lidH[i][1], 6.95-lidHL/2);
-    trans->SetName(Form("FMD1_lid_hole_mat%d", 2*i+0));
+    trans = new TGeoTranslation(-lidH[i][0], lidH[i][1], /*6.95*/-lidHL/2);
+    trans->SetName(Form("FMD1_lid_hole_mat%d", int(2*i+0)));
     trans->RegisterYourself();
-    trans = new TGeoTranslation(+lidH[i][0], lidH[i][1], 6.95-lidHL/2);
-    trans->SetName(Form("FMD1_lid_hole_mat%d", 2*i+1));
+    trans = new TGeoTranslation(+lidH[i][0], lidH[i][1], /*6.95*/-lidHL/2);
+    trans->SetName(Form("FMD1_lid_hole_mat%d", int(2*i+1)));
     trans->RegisterYourself();
     lidComp.Append(Form("FMD1_lid_hole:FMD1_lid_hole_mat%d+" 
                        "FMD1_lid_hole:FMD1_lid_hole_mat%d%c", 
-                       2 * i, 2 * i + 1, i == 3 ? ')' : '+'));
+                       int(2 * i), int(2 * i + 1), int(i == 3 ? ')' : '+')));
   }
   TGeoCompositeShape* lidS = new TGeoCompositeShape(lidComp.Data());
   lidS->SetName("FMD1_lid");
@@ -709,7 +740,8 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
   lidV->SetTransparency(63);
   
   // Place top cover
-  Double_t lidZ = -(3.3 - r->GetModuleDepth() - r->GetModuleSpacing() / 2);
+  Double_t lidZ = (lidZStart - 
+                  (3.3 - r->GetModuleDepth() - r->GetModuleSpacing() / 2));
   AliFMDDebug(1, ("FMD1 lid offset in Z=%f", lidZ));
 
   for (Int_t i = 0; i  < 2; i++) {
@@ -728,17 +760,63 @@ AliFMDGeometryBuilder::FMD1Geometry(AliFMD1* fmd1,
   TGeoRotation* rot = new TGeoRotation("FMD1 rotatation");
   rot->RotateZ(90);
   TGeoMatrix* matrix = new TGeoCombiTrans("FMD1 trans", 0, 0, z, rot);
+
   AliFMDDebug(5, ("Placing volumes %s and %s in ALIC at z=%f", 
                   fmd1TopVolume->GetName(), fmd1BotVolume->GetName(), z));
   top->AddNode(fmd1TopVolume, fmd1->GetId(), matrix);
   top->AddNode(fmd1BotVolume, fmd1->GetId(), matrix);
+
+
+  // Survey points on V0A (screw holes for the FMD) 
+  const Double_t icb[] = { +12.700, -21.997, 324.670 };
+  const Double_t ict[] = { +12.700, +21.997, 324.670 };
+  const Double_t ocb[] = { -12.700, -21.997, 324.670 };
+  const Double_t oct[] = { -12.700, +21.997, 324.670 };
+
+  TGeoTube* surveyShape = new TGeoTube("FMD1_survey_marker", 
+                                       0, .2, .001);
+
+  TGeoMatrix* outMat = matrix;
+#if 0
+  if (gGeoManager->cd("/ALIC_1/F1MT_1")) 
+    outMat = gGeoManager->GetCurrentMatrix();
+  else 
+    AliWarning("Couldn't cd to /ALIC_1/F1MT_1");
+#endif
+
+  Double_t loct[3], locb[3];
+  outMat->MasterToLocal(oct, loct);
+  outMat->MasterToLocal(ocb, locb);
+  TGeoVolume* vOct = new TGeoVolume("V0L_OCT", surveyShape, fPlastic);
+  TGeoVolume* vOcb = new TGeoVolume("V0L_OCB", surveyShape, fPlastic);
+  
+  fmd1TopVolume->AddNode(vOct, 1, new TGeoTranslation(loct[0],loct[1],loct[2]));
+  fmd1TopVolume->AddNode(vOcb, 1, new TGeoTranslation(locb[0],locb[1],locb[2]));
+    
+  
+  TGeoMatrix* inMat = matrix;
+#if 0
+  if (gGeoManager->cd("/ALIC_1/F1MT_1")) 
+    inMat = gGeoManager->GetCurrentMatrix();
+  else 
+    AliWarning("Couldn't cd to /ALIC_1/F1MT_1");
+#endif
+
+  Double_t lict[3], licb[3];
+  inMat->MasterToLocal(ict, lict);
+  inMat->MasterToLocal(icb, licb);
+  TGeoVolume* vIct = new TGeoVolume("V0L_ICT", surveyShape, fPlastic);
+  TGeoVolume* vIcb = new TGeoVolume("V0L_ICB", surveyShape, fPlastic);
   
+  fmd1BotVolume->AddNode(vIct, 1, new TGeoTranslation(lict[0],lict[1],lict[2]));
+  fmd1BotVolume->AddNode(vIcb, 1, new TGeoTranslation(licb[0],licb[1],licb[2]));
+
   return 0;
 }
 
 //____________________________________________________________________
 TGeoVolume*
-AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2, 
+AliFMDGeometryBuilder::FMD2Geometry(const AliFMD2* fmd2, 
                                    TGeoVolume* innerTop, 
                                    TGeoVolume* innerBot, 
                                    TGeoVolume* outerTop,
@@ -750,24 +828,25 @@ AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2,
   // See also AliFMDGeometryBuilder::DetectorGeometry 
   // 
   if (!fmd2 || !innerTop || !innerBot || !outerTop || !outerBot) return 0;
-  AliFMDRing* r          = fmd2->GetOuter();
+  AliFMDRing* ring          = fmd2->GetOuter();
   Double_t    z             = fmd2->GetOuterZ();  
   Double_t    framelr       = 32.01;  // fmd2->GetOuterHoneyHighR()+0.5;
   Double_t    framehr       = 33.611; // fmd2->GetOuterHoneyHighR()+1.8;
   Double_t    framel        = 14.8; // framehz - framelz;
-  Double_t    backth        = 0.3;
+  // Double_t    backth        = 0.3;
+  Double_t    backth        = 0.03;
   Double_t    framelz       = -(2.38 
-                               - r->GetModuleDepth() 
-                               - r->GetModuleSpacing() / 2);
+                               - ring->GetModuleDepth() 
+                               - ring->GetModuleSpacing() / 2);
   // Double_t    framelz       = -0.8;
   // Double_t    framehz       = framelz + backth + framel;
   Double_t    coverlr       = 4.3; // fmd2->GetInner()->GetLowR()+1;
   Double_t    coverhr       = framehr; //  - 1;
   
-  TGeoVolume* fmd2TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd2->GetId(), 'T'));
-  TGeoVolume* fmd2BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd2->GetId(), 'B'));
+  TString fmd2TopName = TString::Format(fgkFMDName, fmd2->GetId(), 'T');
+  TGeoVolume* fmd2TopVolume = new TGeoVolumeAssembly(fmd2TopName);
+  TString fmd2BotName = TString::Format(fgkFMDName, fmd2->GetId(), 'B');
+  TGeoVolume* fmd2BotVolume = new TGeoVolumeAssembly(fmd2BotName);
   fmd2TopVolume->SetTitle("FMD2 top half");
   fmd2BotVolume->SetTitle("FMD2 bottom half");
   
@@ -936,7 +1015,7 @@ AliFMDGeometryBuilder::FMD2Geometry(AliFMD2* fmd2,
   
 //____________________________________________________________________
 TGeoVolume*
-AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3, 
+AliFMDGeometryBuilder::FMD3Geometry(const AliFMD3* fmd3, 
                                    TGeoVolume* innerTop, 
                                    TGeoVolume* innerBot, 
                                    TGeoVolume* outerTop,
@@ -952,10 +1031,10 @@ AliFMDGeometryBuilder::FMD3Geometry(AliFMD3* fmd3,
 
   //__________________________________________________________________
   // Basic detector set-up.
-  TGeoVolume* fmd3TopVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd3->GetId(), 'T'));
-  TGeoVolume* fmd3BotVolume = new TGeoVolumeAssembly(Form(fgkFMDName, 
-                                                         fmd3->GetId(), 'B'));
+  TString fmd3TopName = TString::Format(fgkFMDName, fmd3->GetId(), 'T');
+  TGeoVolume* fmd3TopVolume = new TGeoVolumeAssembly(fmd3TopName);
+  TString fmd3BotName = TString::Format(fgkFMDName, fmd3->GetId(), 'B');
+  TGeoVolume* fmd3BotVolume = new TGeoVolumeAssembly(fmd3BotName);
   fmd3TopVolume->SetTitle("FMD3 top half");
   fmd3BotVolume->SetTitle("FMD3 bottom half");
   DetectorGeometry(fmd3, fmd3TopVolume, fmd3BotVolume, fmd3->GetInnerZ(),