Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/medical/dna/splitting/src/DetectorConstruction.cc
이 파일의 문서화 페이지로 가기
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 // $Id$
29 
30 #include "DetectorConstruction.hh"
31 
32 #include "DetectorMessenger.hh"
33 
34 #include "G4Box.hh"
35 #include "G4Colour.hh"
36 #include "G4LogicalVolume.hh"
37 #include "G4Material.hh"
38 #include "G4NistManager.hh"
39 #include "G4PVPlacement.hh"
40 #include "G4SystemOfUnits.hh"
41 #include "G4Tubs.hh"
42 #include "G4VisAttributes.hh"
43 #include "G4Region.hh"
44 #include "G4RegionStore.hh"
45 #include "G4PhysicalVolumeStore.hh"
46 #include "G4LogicalVolumeStore.hh"
47 #include "G4GeometryManager.hh"
48 #include "G4SolidStore.hh"
49 
50 #include "G4RunManager.hh"
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 : G4VUserDetectorConstruction(), fDiameter(6*nm), fLength(10*nm)
56 {
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 {
64  delete fDetectorMessenger;
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69  return ConstructVolumes();
70 }
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75 {
76  // Cleanup old geometry
77  //
82 
83  //
85 
86  // Geometry parameters
87  G4double worldSize = 150 * nanometer;
88 
89  G4VSolid* world = new G4Box("world", // its name
90  worldSize/2, worldSize/2, worldSize/2); // its size
91 
92  G4LogicalVolume* worldLog = new G4LogicalVolume(
93  world, // its solid
94  water, // its material
95  "world"); // its name
96 
98  worldLog->SetVisAttributes(vis);
99 
100  G4VPhysicalVolume* worldPhys = new G4PVPlacement(
101  0, // no rotation
102  G4ThreeVector(), // at (0,0,0)
103  worldLog, // its logical volume
104  "world", // its name
105  0, // its mother volume
106  false, // no boolean operation
107  0, // copy number
108  true); // checking overlaps forced to YES
109 
110  G4VSolid* target = new G4Tubs("target",
111  0, fDiameter/2, fLength/2, 0, 360*deg); //its size
112 
113  G4LogicalVolume* targetLog = new G4LogicalVolume(
114  target,
115  water,
116  "target");
117 
118  new G4PVPlacement(0, // no rotation
119  G4ThreeVector(), // at (0,0,0)
120  targetLog, // its logical volume
121  "target", // its name
122  worldLog, // its mother volume
123  false, // no boolean operation
124  0, // copy number
125  true); // checking overlaps force to YES
126 
127  // A region is needed as splitting is performed in regions
129  targetLog->SetRegion(aRegion);
130  aRegion->AddRootLogicalVolume(targetLog);
131 
133  visTarget->SetForceSolid(true);
134  visTarget->SetVisibility(true);
135  targetLog->SetVisAttributes(visTarget);
136 
137  return worldPhys;
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141 
143  fDiameter = diameter;
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150  fLength = length;
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
156 #include "G4RunManager.hh"
157 
159 {
161 }
162 
163 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:80
static void Clean()
Definition: G4SolidStore.cc:73
CLHEP::Hep3Vector G4ThreeVector
const XML_Char * target
Definition: expat.h:268
static constexpr double nm
Definition: G4SIunits.hh:112
Definition: G4Tubs.hh:85
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
double G4double
Definition: G4Types.hh:76
static G4Colour Blue()
Definition: G4Colour.hh:162
static constexpr double deg
Definition: G4SIunits.hh:152
static G4GeometryManager * GetInstance()
Definition: G4Box.hh:64
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void OpenGeometry(G4VPhysicalVolume *vol=0)
void SetVisAttributes(const G4VisAttributes *pVA)
void GeometryHasBeenModified(G4bool prop=true)
void SetRegion(G4Region *reg)
static G4SolidStore * GetInstance()
void SetForceSolid(G4bool=true)
void SetVisibility(G4bool=true)
static G4PhysicalVolumeStore * GetInstance()
static G4RegionStore * GetInstance()
G4Region * FindOrCreateRegion(const G4String &name)
static G4LogicalVolumeStore * GetInstance()
static constexpr double nanometer
Definition: G4SIunits.hh:101
static G4NistManager * Instance()