Hello, I’ve to draw a vacuum chamber and to put my targerts in it. The vacuum chamber is a cylinder with the inner empty. So I’m using the boolean solid.
G4double pSPhi = 0.;
G4double pDPhi = 2*pi;
// Vacuum chamber
G4double pRMaxCE = 30.*cm; //external radius
G4double ChambThickness = 0.1*cm; //Thickness of chamber
// G4double pRMaxCI = 2*pRMaxCE-ChambThickness; //Internal radius
G4double pRMaxCI = 29*cm; //Internal radius
G4double pDzCE = 60.*cm; //Height
//G4double pDzCI = pDzCE- 2.*ChambThickness; //Internal height
G4double pDzCI = 58*cm; //Internal height
//vacuum chamber
G4LogicalVolume* ChamblogicEnv;
G4Material* ChambMat = Mylar;
G4RotationMatrix* ChambRot = new G4RotationMatrix();
ChambRot->rotateX(90.*deg);
G4Tubs* ChambTubExt;
G4Tubs* ChambTubInt;
G4VSolid* ChambEnv;
G4ThreeVector positionChambInt(0,0,0);
if (fVacuumChambFlag) {
ChambTubExt = new G4Tubs("ChambTubExt", 0., fpRMaxCE, 0.5*fpDzCE, fpSPhi, fpDPhi);
ChambTubInt = new G4Tubs("ChambTubInt", 0., fpRMaxCI, 0.5*fpDzCI, fpSPhi, fpDPhi);
ChambEnv = new G4SubtractionSolid("ChambEnv", ChambTubExt, ChambTubInt, &identity, positionChambInt);
ChamblogicEnv= new G4LogicalVolume(ChambEnv, ChambMat, "VacuumChamber");
new G4PVPlacement(ChambRot, //rotation
G4ThreeVector(0,0,0), //at (0,0,fzFirDummyPos)
ChamblogicEnv, //its logical volume
"VacuumChamber", //its name
logicWorld, //its mother volume
false, //no boolean operation
0, //copy number
checkOverlaps); //overlaps checking
}
I’m drawing a first G4Tube then I’m drawing a second one with lower height and radius than the first one and Im subcrating the volume of the second one to the first one…i.e. I want a close cylinder with closed bottom and top surfaces, empty in the inner (just a low thickness of lateral surface).
This is the visualization
it looks like I’ve the two cylinders instead that only one of low thickness, I don’t know if I’m doing something wrong or it’s just an optical effect…
The reason because it’s important that I’m really subcrating the volume of the second cylinder is that the inner of the vacuum chamber must be vacuum…so…given that the world is made of vacuum and the vacuum chamber surface is made of myler, I need to delete the volume of the second G4tube to have vacuum
maybe @evc can help me to know if I’m doing it fine?
Thank you
exampleB1.cc (12.9 KB)
B1DetectorConstruction.cc (18.2 KB)