Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
examples/extended/medical/dna/icsd/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 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // J. Comput. Phys. 274 (2014) 841-882
31 // The Geant4-DNA web site is available at http://geant4-dna.org
32 //
33 // $Id$
34 //
37 
38 #include "DetectorConstruction.hh"
39 #include "G4SystemOfUnits.hh"
40 #include "G4ProductionCuts.hh"
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
43 
46  fpPhysiWorld(NULL), fpLogicWorld(NULL), fpSolidWorld(NULL)
47 {}
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
50 
52 {}
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
55 
57 
58 {
60  return ConstructDetector();
61 }
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
64 
66 {
67 // Water is defined from NIST material database
69  G4Material * H2O = man->FindOrBuildMaterial("G4_WATER");
70 
71 // Default materials in setup.
72  fpWaterMaterial = H2O;
73 
74 // needed variables
75 
76  G4double z, a, density;
77  G4String name, symbol;
78  G4int nComponents, nAtoms;
79 
80 
81  a = 12.0107*g/mole;
82  G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
83 
84  a = 1.00794*g/mole;
85  G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z=1., a);
86 
87  a = 15.9994*g/mole;
88  G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
89 
90 // Definition of Tetrahydrofurane (THF)
91 
92  density=1.346*g/cm3;
93 
94  fpTHFMaterial = new G4Material("THF", density, nComponents=3);
95  fpTHFMaterial->AddElement(elC, nAtoms=4);
96  fpTHFMaterial->AddElement(elH, nAtoms=8);
97  fpTHFMaterial->AddElement(elO, nAtoms=1);
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
102 {
103 // WORLD VOLUME
104 
105  fWorldSizeX = 10*nanometer;
106  fWorldSizeY = 10*nanometer;
107  fWorldSizeZ = 10*nanometer;
108 
109  fpSolidWorld = new G4Box("World", //its name
110  fWorldSizeX/2,fWorldSizeY/2,fWorldSizeZ/2); //its size
111 
112  fpLogicWorld = new G4LogicalVolume(fpSolidWorld, //its solid
113  fpWaterMaterial, //its material
114  "World"); //its name
115 
116  fpPhysiWorld = new G4PVPlacement(0, //no rotation
117  G4ThreeVector(), //at (0,0,0)
118  "World", //its name
119  fpLogicWorld, //its logical volume
120  0, //its mother volume
121  false, //no boolean operation
122  0); //copy number
123 
124  G4double diameter=2.3*nanometer;
125  G4double highz=3.4*nanometer;
126 
127  fpSolidTarget = new G4Tubs("Target",0, diameter/2., highz/2., 0*degree, 360*degree);
128 
129  G4LogicalVolume* logicTarget = new G4LogicalVolume(fpSolidTarget, //its solid
130  fpTHFMaterial, //its material
131  "Target"); //its name
132 
133  new G4PVPlacement(0, //no rotation
134  G4ThreeVector(), //at (0,0,0)
135  "Target", //its name
136  logicTarget, //its logical volume
137  fpPhysiWorld, //its mother volume
138  false, //no boolean operation
139  0); //copy number
140 
141 // Visualization attributes
142  G4VisAttributes* worldVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
143  worldVisAtt->SetVisibility(true);
144  fpLogicWorld->SetVisAttributes(worldVisAtt);
145 
146  G4VisAttributes* worldVisAtt1 = new G4VisAttributes(G4Colour(1.0,0.0,0.0));
147  worldVisAtt1->SetVisibility(true);
148  logicTarget->SetVisAttributes(worldVisAtt1);
149 
150  return fpPhysiWorld;
151 }
const XML_Char * name
Definition: expat.h:151
CLHEP::Hep3Vector G4ThreeVector
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
Definition: G4Tubs.hh:85
Double_t z
static constexpr double g
Definition: G4SIunits.hh:183
double G4double
Definition: G4Types.hh:76
Definition: G4Box.hh:64
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
void SetVisAttributes(const G4VisAttributes *pVA)
void SetVisibility(G4bool=true)
int G4int
Definition: G4Types.hh:78
void AddElement(G4Element *element, G4int nAtoms)
Definition: G4Material.cc:368
static constexpr double degree
Definition: G4SIunits.hh:144
static constexpr double mole
Definition: G4SIunits.hh:286
static constexpr double cm3
Definition: G4SIunits.hh:121
static constexpr double nanometer
Definition: G4SIunits.hh:101
static G4NistManager * Instance()