Fixed overlaps of St1 quadrants (SQM1,2) with beam shield (YMOT)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Feb 2006 19:18:33 +0000 (19:18 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 1 Feb 2006 19:18:33 +0000 (19:18 +0000)
using TGeo composite shape

MUON/AliMUONSt1GeometryBuilderV2.cxx

index 63ca64d..2d98fa5 100644 (file)
 #include <Riostream.h>
 #include <TSystem.h>
 #include <TVirtualMC.h>
+#include <TGeoManager.h>
+#include <TGeoVolume.h>
+#include <TGeoTube.h>
+#include <TGeoCompositeShape.h>
 
 #include "AliMpFiles.h"
 #include "AliMpSectorReader.h"
@@ -1133,6 +1137,47 @@ void AliMUONSt1GeometryBuilderV2::CreateFrame(Int_t chamber)
   par[4] = fgkMotherPhiU1;
   gMC->Gsvolu(QuadrantMLayerName(chamber),"TUBS",idAir,par,5);
 
+// Replace the volume shape with a composite shape
+// with substracted overlap with beam shield (YMOT)
+
+  if ( gMC->IsRootGeometrySupported() &&
+       TString(gMC->ClassName()) != "TGeant4") { 
+
+    // Get shape
+    TGeoVolume* mlayer 
+      = gGeoManager->FindVolumeFast(QuadrantMLayerName(chamber));
+    if ( !mlayer ) {
+      AliErrorStream() 
+         << "Quadrant volume " << QuadrantMLayerName(chamber) << " not found" 
+        << endl;
+    }
+    else {
+      TGeoShape* quadrant = mlayer->GetShape();
+      quadrant->SetName("quadrant");    
+
+      // Beam shield recess
+      par[0] = 0;
+      par[1] = 15.4; 
+      par[2] = fgkMotherThick1;  
+      new TGeoTube("shield_tube", par[0], par[1], par[2]);
+  
+      // Displacement
+      posX = 2.6;
+      posY = 2.6;
+      posZ = 0;
+      TGeoTranslation* displacement 
+        = new TGeoTranslation("TR", posX, posY, posZ);
+      displacement->RegisterYourself();
+
+      // Composite shape
+      TGeoShape* composite
+      = new TGeoCompositeShape("composite", "quadrant-shield_tube:TR"); 
+      
+      // Reset shape to volume      
+      mlayer->SetShape(composite);
+    }
+  }    
+
 // Quadrant volume TUBS2, positioned at the end
   par[0] = fgkMotherIR2;
   par[1] = fgkMotherOR2;