[834] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | #include "SharedSolidDetectorConstruction.hh" |
---|
| 28 | |
---|
| 29 | #include "G4Box.hh" |
---|
| 30 | #include "G4LogicalVolume.hh" |
---|
| 31 | #include "G4PVPlacement.hh" |
---|
| 32 | #include "G4VisAttributes.hh" |
---|
| 33 | |
---|
| 34 | SharedSolidDetectorConstruction::SharedSolidDetectorConstruction() {} |
---|
| 35 | |
---|
| 36 | SharedSolidDetectorConstruction::~SharedSolidDetectorConstruction() {} |
---|
| 37 | |
---|
| 38 | G4VPhysicalVolume* SharedSolidDetectorConstruction::Construct() |
---|
| 39 | { |
---|
| 40 | //------------------------------ experimental hall |
---|
| 41 | G4Box * experimentalHall_box |
---|
| 42 | = new G4Box("expHall_b",10.*m,10.*m,10.*m); |
---|
| 43 | G4LogicalVolume * experimentalHall_log |
---|
| 44 | = new G4LogicalVolume(experimentalHall_box,0,"expHall_L",0,0,0); |
---|
| 45 | G4VPhysicalVolume * experimentalHall_phys |
---|
| 46 | = new G4PVPlacement(0,G4ThreeVector(),"expHall_P", |
---|
| 47 | experimentalHall_log,0,false,0); |
---|
| 48 | experimentalHall_log -> SetVisAttributes (G4VisAttributes::Invisible); |
---|
| 49 | |
---|
| 50 | G4Box* solidVoxel = new G4Box("Voxel", |
---|
| 51 | 3.6*mm/2, |
---|
| 52 | 3.6*mm/2, |
---|
| 53 | 3.6*mm/2); |
---|
| 54 | |
---|
| 55 | G4LogicalVolume* logicLung = new G4LogicalVolume(solidVoxel, |
---|
| 56 | 0, |
---|
| 57 | "Lung"); |
---|
| 58 | G4LogicalVolume* logicHeart = new G4LogicalVolume(solidVoxel, |
---|
| 59 | 0, |
---|
| 60 | "Heart"); |
---|
| 61 | |
---|
| 62 | new G4PVPlacement(0, |
---|
| 63 | G4ThreeVector(0.,0.,-100.*mm), |
---|
| 64 | logicLung, |
---|
| 65 | "Lung", |
---|
| 66 | experimentalHall_log, |
---|
| 67 | false, |
---|
| 68 | 0); |
---|
| 69 | new G4PVPlacement(0, |
---|
| 70 | G4ThreeVector(0.,0.,+100.*mm), |
---|
| 71 | logicHeart, |
---|
| 72 | "Heart", |
---|
| 73 | experimentalHall_log, |
---|
| 74 | false, |
---|
| 75 | 0); |
---|
| 76 | logicLung->SetVisAttributes(new |
---|
| 77 | G4VisAttributes(G4Colour(0.0,0.0,1.0))); |
---|
| 78 | logicHeart->SetVisAttributes(new |
---|
| 79 | G4VisAttributes(G4Colour(1.0,0.0,0.0))); |
---|
| 80 | |
---|
| 81 | return experimentalHall_phys; |
---|
| 82 | } |
---|