Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
B02ScoringDetectorConstruction.cc
Go to the documentation of this file.
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 //
28 //
29 //
30 // $Id$
31 //
32 
33 #include "globals.hh"
34 
36 
37 #include "G4Material.hh"
38 #include "G4Tubs.hh"
39 #include "G4LogicalVolume.hh"
40 #include "G4ThreeVector.hh"
41 #include "G4PVPlacement.hh"
42 #include "G4PhysicalConstants.hh"
43 #include "G4SystemOfUnits.hh"
44 
46 {
48  // world score cylinder volume
50 
51  G4String name;
52 
54  G4double pressure = 3.e-18*pascal;
55  G4double temperature = 2.73*kelvin;
56  G4double z,A;
57  G4Material *Galactic =
58  new G4Material(name="Galactic", z=1., A=1.01*g/mole, density,
59  kStateGas,temperature,pressure);
60  G4Material *WorldMaterial = Galactic;
61 
62  // world solid
63 
64  G4double innerRadiusCylinder = 0*cm;
65  G4double outerRadiusCylinder = 101*cm;
66  G4double hightCylinder = 16*cm;
67  G4double startAngleCylinder = 0*deg;
68  G4double spanningAngleCylinder = 360*deg;
69 
70 
71  G4Tubs *score_worldCylinder = new G4Tubs("score_worldCylinder",
72  innerRadiusCylinder,
73  outerRadiusCylinder,
74  hightCylinder,
75  startAngleCylinder,
76  spanningAngleCylinder);
77 
78  // logical score world
79 
80  G4LogicalVolume *score_worldCylinder_log =
81  new G4LogicalVolume(score_worldCylinder, WorldMaterial, "score_worldCylinder_log");
82 
83  // physical world
84 
85  name = "score_world_phys";
86  G4VPhysicalVolume* score_worldCylinder_phys =
87  new G4PVPlacement(0, G4ThreeVector(0,0,0), score_worldCylinder_log,
88  name, 0, false, 0);
89 
90 
92  // score M1, D1, M2, D2
94 
96 
97  G4double innerRadiusShield = 0*cm;
98  G4double outerRadiusShield = 101*cm;
99  G4double MhightShield = 7.5002*cm;
100  G4double startAngleShield = 0*deg;
101  G4double spanningAngleShield = 360*deg;
102 
103  G4Tubs *tube_M = new G4Tubs("tube_M",
104  innerRadiusShield,
105  outerRadiusShield,
106  MhightShield,
107  startAngleShield,
108  spanningAngleShield);
109 
110  G4LogicalVolume *M1_log =
111  new G4LogicalVolume(tube_M, Galactic, "M1_log");
112 
113  name = "scorecell: M1";
114  G4double pos_x = 0*cm;
115  G4double pos_y = 0*cm;
116  G4double pos_z = -1*MhightShield;
117 
118 // G4VPhysicalVolume *pM1 =
119  new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z),
120  M1_log, name, score_worldCylinder_log, false, 0);
121 
122 
124 
125  innerRadiusShield = 0*cm;
126  outerRadiusShield = 101*cm;
127  G4double DhightShield = 2*cm;
128  startAngleShield = 0*deg;
129  spanningAngleShield = 360*deg;
130 
131 
132  G4Tubs *tube_D = new G4Tubs("tube_D",
133  innerRadiusShield,
134  outerRadiusShield,
135  DhightShield,
136  startAngleShield,
137  spanningAngleShield);
138 
139  G4LogicalVolume *D1_log =
140  new G4LogicalVolume(tube_D, Galactic, "D1_log");
141 
142  name ="scorecell: D1";
143 
144 // G4VPhysicalVolume *pD1 =
145  new G4PVPlacement(0, G4ThreeVector(0, 0, 0),
146  D1_log, name, M1_log, false, 0);
147 
149 
150  G4LogicalVolume *M2_log =
151  new G4LogicalVolume(tube_M, Galactic, "M2_log");
152 
153  name = "scorecell: M2";
154  pos_x = 0*cm;
155  pos_y = 0*cm;
156  pos_z = MhightShield;
157 // G4VPhysicalVolume *pM2 =
158  new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z),
159  M2_log, name, score_worldCylinder_log, false, 0);
160 
162 
163  G4LogicalVolume *D2_log =
164  new G4LogicalVolume(tube_D, Galactic, "D2_log");
165 
166  name ="scorecell: D2";
167 
168 // G4VPhysicalVolume *pD2 =
169  new G4PVPlacement(0, G4ThreeVector(0, 0, 0),
170  D2_log, name, M2_log, false, 0);
171 
174 
175  return score_worldCylinder_phys;
176 }