#include "SolidMaterials.hh" #include "SM1Table.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4UnionSolid.hh" #include #include #include "G4Box.hh" #include "G4SubtractionSolid.hh" #include "G4Tubs.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "G4SDManager.hh" SM1Table::SM1Table(G4int verboseLevel){ fverboseLevel = verboseLevel; TableThickness = 1.5*cm; TableLength = 200.*cm; TableWidth = 100.*cm; TableFootLength = 18.*cm; TableFootWidth = 2.*cm; } SM1Table::~SM1Table() { } G4LogicalVolume *SM1Table::TableConstruction() { G4Material * mate; // make colours ********************************************************* G4Colour white (1.0, 1.0, 1.0) ; G4Colour white_t (1.0, 1.0, 1.0, .95) ; G4Colour grey (0.5, 0.5, 0.5) ; G4Colour lgrey (.75, .75, .75) ; G4Colour red (1.0, 0.0, 0.0, 0.5) ; G4Colour blue (0.0, 0.0, 1.0) ; G4Colour blue_t (0.0, 0.0, 1.0, .75) ; G4Colour cyan (0.0, 1.0, 1.0, 0.5) ; G4Colour magenta (1.0, 0.0, 1.0) ; G4Colour yellow (1.0, 1.0, 0.0, 0.5) ; G4Colour lblue (0.0, 0.0, .75) ; G4Colour black (0.0, 0.0, 0.0) ; G4Colour green (0.0, 1.0, 0.0) ; G4Colour lgreen (0.0, .75, 0.0) ; G4double TableHeight = TableFootLength + TableThickness; // construct Table box G4Box* TableBoxFull = new G4Box("TableBoxFull",0.5*TableLength,0.5*TableHeight,0.5*TableWidth); G4Box* BottomSpace = new G4Box("LowerSpace", 0.5*(TableLength-TableFootWidth)-20*cm,0.5*TableHeight-TableThickness,0.5*TableWidth); G4SubtractionSolid* TableBox = new G4SubtractionSolid("TableBox",TableBoxFull, BottomSpace,0, G4ThreeVector(0,0,0)); mate = G4Material::GetMaterial("Air"); logTable = new G4LogicalVolume(TableBox, mate,"logTable",0,0,0); logTable->SetVisAttributes(G4VisAttributes::Invisible); mate = G4Material::GetMaterial("Iron"); //Set Color G4VisAttributes* vatTable= new G4VisAttributes(blue_t); vatTable->SetVisibility(true); vatTable->SetForceSolid(true); // Table top G4Box* TableTop = new G4Box("TableTop",0.5*TableLength,0.5*TableThickness,0.5*TableWidth); logTableTop = new G4LogicalVolume(TableTop, mate,"logTableTop",0,0,0); logTableTop->SetVisAttributes(vatTable); physTableTop = new G4PVPlacement(0, G4ThreeVector(0,0.5*TableHeight - 0.5*TableThickness,0), logTableTop, "physTableTop", logTable, false, 0); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "Table top: mass=" << logTableTop->GetMass()/g << ", volume=" << TableTop->GetCubicVolume()/cm3 << G4endl; } // Table Feet G4Tubs* TableFootBulk = new G4Tubs("TableFootBase",0,3.5*TableFootWidth,0.5*TableFootLength,0,360.*deg); G4Tubs* TableFootCut = new G4Tubs("TableFootBody",0.5*TableFootWidth,3.5*TableFootWidth+1*mm,0.5*(TableFootLength-TableThickness),0,360.*deg); G4SubtractionSolid* TableFoot = new G4SubtractionSolid("TableFoot",TableFootBulk, TableFootCut,0, G4ThreeVector(0,0,0.5*TableThickness)); G4RotationMatrix* rot = new G4RotationMatrix(); rot->rotateX(90*deg); logTableFoot = new G4LogicalVolume(TableFoot, mate,"logTableFoot",0,0,0); logTableFoot->SetVisAttributes(vatTable); if(fverboseLevel>0){ G4cout << "Table foot: mass=" << logTableFoot->GetMass()/g << ", volume=" << TableFoot->GetCubicVolume()/cm3 << G4endl; G4cout << "Table foot: TOTmass=" << 4.*logTableFoot->GetMass()/g << ", volume=" << 4.*TableFoot->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } physTableFoot = new G4PVPlacement(rot, G4ThreeVector(0.5*TableLength-20.*cm,-0.5*TableThickness,-0.5*TableWidth+20.*cm), logTableFoot, "physTableFoot", logTable, false, 0); physTableFoot = new G4PVPlacement(rot, G4ThreeVector(-0.5*TableLength+20.*cm,-0.5*TableThickness,-0.5*TableWidth+20.*cm), logTableFoot, "physTableFoot", logTable, false, 1); physTableFoot = new G4PVPlacement(rot, G4ThreeVector(0.5*TableLength-20.*cm,-0.5*TableThickness,0.5*TableWidth-20.*cm), logTableFoot, "physTableFoot", logTable, false, 3); physTableFoot = new G4PVPlacement(rot, G4ThreeVector(-0.5*TableLength+20.*cm,-0.5*TableThickness,0.5*TableWidth-20.*cm), logTableFoot, "physTableFoot", logTable, false, 4); return logTable; }