source: trunk/examples/extended/biasing/B02/src/B02ScoringDetectorConstruction.cc @ 1320

Last change on this file since 1320 was 1230, checked in by garnier, 14 years ago

update to geant4.9.3

File size: 5.6 KB
Line 
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// $Id: B02ScoringDetectorConstruction.cc,v 1.7 2006/06/29 16:34:57 gunter Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
29//
30
31#include "globals.hh"
32
33#include "B02ScoringDetectorConstruction.hh"
34
35#include "G4Material.hh"
36#include "G4Tubs.hh"
37#include "G4LogicalVolume.hh"
38#include "G4ThreeVector.hh"
39#include "G4PVPlacement.hh"
40
41G4VPhysicalVolume* B02ScoringDetectorConstruction::Construct()
42{ 
43  /////////////////////////////
44  // world score cylinder volume
45  ////////////////////////////
46
47  G4String name;
48
49  G4double density     = universe_mean_density;
50  G4double pressure    = 3.e-18*pascal;
51  G4double temperature = 2.73*kelvin;
52  G4double z,A;
53  G4Material *Galactic = 
54    new G4Material(name="Galactic", z=1., A=1.01*g/mole, density,
55                   kStateGas,temperature,pressure);
56  G4Material *WorldMaterial = Galactic;
57
58  // world solid
59
60  G4double innerRadiusCylinder = 0*cm;
61  G4double outerRadiusCylinder = 101*cm;
62  G4double hightCylinder       = 16*cm;
63  G4double startAngleCylinder  = 0*deg;
64  G4double spanningAngleCylinder    = 360*deg;
65
66
67  G4Tubs *score_worldCylinder = new G4Tubs("score_worldCylinder",
68                                     innerRadiusCylinder,
69                                     outerRadiusCylinder,
70                                     hightCylinder,
71                                     startAngleCylinder,
72                                     spanningAngleCylinder);
73
74  // logical score world
75
76  G4LogicalVolume *score_worldCylinder_log = 
77    new G4LogicalVolume(score_worldCylinder, WorldMaterial, "score_worldCylinder_log");
78 
79  // physical world
80
81  name = "score_world_phys";
82  G4VPhysicalVolume* score_worldCylinder_phys =
83    new G4PVPlacement(0, G4ThreeVector(0,0,0), score_worldCylinder_log,
84                      name, 0, false, 0);
85
86
87  ///////////////////////////////////////////////
88  // score M1, D1, M2, D2
89  ////////////////////////////////////////////////
90
91  ///////////////////// M1 ///////////////////////
92
93  G4double innerRadiusShield = 0*cm;
94  G4double outerRadiusShield = 101*cm;
95  G4double MhightShield       = 7.5002*cm;
96  G4double startAngleShield  = 0*deg;
97  G4double spanningAngleShield    = 360*deg;
98
99  G4Tubs *tube_M = new G4Tubs("tube_M",
100                              innerRadiusShield,
101                              outerRadiusShield,
102                              MhightShield,
103                              startAngleShield,
104                              spanningAngleShield);
105 
106  G4LogicalVolume *M1_log = 
107    new G4LogicalVolume(tube_M, Galactic, "M1_log");
108 
109  name = "scorecell: M1";
110  G4double pos_x = 0*cm;
111  G4double pos_y = 0*cm;
112  G4double pos_z = -1*MhightShield;
113 
114//  G4VPhysicalVolume *pM1 =
115    new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z),
116                      M1_log, name, score_worldCylinder_log, false, 0);
117 
118
119  /////////////////// D1 ///////////////////////////
120
121  innerRadiusShield = 0*cm;
122  outerRadiusShield = 101*cm;
123  G4double DhightShield       = 2*cm;
124  startAngleShield  = 0*deg;
125  spanningAngleShield    = 360*deg;
126 
127
128  G4Tubs *tube_D = new G4Tubs("tube_D",
129                              innerRadiusShield,
130                              outerRadiusShield,
131                              DhightShield,
132                              startAngleShield,
133                              spanningAngleShield);
134 
135  G4LogicalVolume *D1_log = 
136    new G4LogicalVolume(tube_D, Galactic, "D1_log");
137 
138  name ="scorecell: D1";
139 
140//  G4VPhysicalVolume *pD1 =
141    new G4PVPlacement(0, G4ThreeVector(0, 0, 0),
142                      D1_log, name, M1_log, false, 0);
143
144  /////////////////////// M2 //////////////////////////////////
145 
146  G4LogicalVolume *M2_log = 
147    new G4LogicalVolume(tube_M, Galactic, "M2_log");
148 
149  name = "scorecell: M2";
150  pos_x = 0*cm;
151  pos_y = 0*cm;
152  pos_z = MhightShield;
153//  G4VPhysicalVolume *pM2 =
154    new G4PVPlacement(0, G4ThreeVector(pos_x, pos_y, pos_z),
155                      M2_log, name, score_worldCylinder_log, false, 0);
156 
157  //////////////////// D2 /////////////////////////////////
158
159  G4LogicalVolume *D2_log = 
160    new G4LogicalVolume(tube_D, Galactic, "D2_log");
161 
162  name ="scorecell: D2";
163 
164//  G4VPhysicalVolume *pD2 =
165    new G4PVPlacement(0, G4ThreeVector(0, 0, 0),
166                      D2_log, name, M2_log, false, 0);
167 
168  /////////////////////////////////////////////////////////////////////
169  ////////////////////////////////////////////////////////////////////
170 
171  return score_worldCylinder_phys;
172}
Note: See TracBrowser for help on using the repository browser.