Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VoxelLeftBreastROGeometry.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 //
26 // Authors: S. Guatelli and M. G. Pia, INFN Genova, Italy
27 //
28 // Based on code developed by the undergraduate student G. Guerrieri
29 // Note: this is a preliminary beta-version of the code; an improved
30 // version will be distributed in the next Geant4 public release, compliant
31 // with the design in a forthcoming publication, and subject to a
32 // design and code review.
33 //
35 
36 #include "G4SystemOfUnits.hh"
38 #include "G4LogicalVolume.hh"
39 #include "G4VPhysicalVolume.hh"
40 #include "G4PVPlacement.hh"
41 #include "G4PVReplica.hh"
42 #include "G4SDManager.hh"
43 #include "G4Box.hh"
44 #include "G4ThreeVector.hh"
45 #include "G4Material.hh"
46 #include "G4Tubs.hh"
47 
49  : G4VReadOutGeometry(aString), ROvoxel_phys(0)
50 {
51 }
52 
54 {
55 }
56 
57 G4VPhysicalVolume* G4VoxelLeftBreastROGeometry::Build()
58 {
59 
60  // A dummy material is used to fill the volumes of the readout geometry.
61  // (It will be allowed to set a NULL pointer in volumes of such virtual
62  // division in future, since this material is irrelevant for tracking.)
63 
64  G4Material* dummyMat = new G4Material(name="dummyMat",
65  1., 1.*g/mole, 1.*g/cm3);
66 
67  G4double worldSizeX = 2.0*m;
68  G4double worldSizeY = 2.0*m;
69  G4double worldSizeZ = 2.0*m;
70 
71  // world volume of ROGeometry ...
72  G4Box *ROWorld = new G4Box("ROWorld",
73  worldSizeX/2.,
74  worldSizeY/2.,
75  worldSizeZ/2.);
76 
77  G4LogicalVolume *ROWorldLog = new G4LogicalVolume(ROWorld,
78  dummyMat,
79  "ROWorldLog",
80  0,0,0);
81 
82  G4VPhysicalVolume *ROWorldPhys = new G4PVPlacement(0,
83  G4ThreeVector(),
84  "ROWorldPhys",
85  ROWorldLog,
86  0,false,0);
87 
88  // Breast Mother Volume
89  G4double rmin = 0.* cm;
90  G4double startPhi = 0.* degree;
91  G4double spanningPhi = 180. * degree;
92  G4double rmax = 5.5 *cm;
93  G4double zz = 5. *cm;
94 
95  // RO geometry is defined for the inner tube of the breast
96 
97  G4Tubs* ROinnerLeftBreast = new G4Tubs("innerVoxelLeftBreast",
98  rmin, rmax,
99  zz/2., startPhi, spanningPhi);
100 
101  G4LogicalVolume* ROinnerLeftBreast_log = new G4LogicalVolume(ROinnerLeftBreast,
102  dummyMat,
103  "InnerLeftBreast",
104  0, 0, 0);
105  G4RotationMatrix* matrix = new G4RotationMatrix();
106  matrix -> rotateX(-90.* degree);
107  matrix -> rotateY(180.* degree);
108  matrix -> rotateZ(-18. * degree);
109 
110 
111  G4VPhysicalVolume* ROphysInnerLeftBreast = new G4PVPlacement(matrix,
112  G4ThreeVector(10.*cm, 52.* cm, 8.7 *cm),
113  "physicalVoxelLeftBreast",
114  ROinnerLeftBreast_log,
115  ROWorldPhys,
116  false,
117  0);
118 
119  // Breast RO Geometry - slices along z axis
120  G4double rmin_voxelz = 0.* cm;
121  G4double rmax_voxelz = 5.5 * cm;
122  G4double zz_voxels = 5. * cm;
123  G4double startPhi_voxelz = 0.* degree;
124  G4double spanningPhi_voxelz = 180. * degree;
125  G4int nslice = 10;
126 
127  G4Tubs* ROvoxelz = new G4Tubs("voxel_z", rmin_voxelz, rmax_voxelz, zz_voxels/(2*nslice),startPhi_voxelz, spanningPhi_voxelz);
128 
129  G4LogicalVolume* ROvoxelz_log = new G4LogicalVolume(ROvoxelz, dummyMat, "voxelz_log",0 , 0, 0);
130 
131  G4VPhysicalVolume* ROvoxelz_phys = new G4PVReplica("LinearArray", ROvoxelz_log, ROphysInnerLeftBreast,
132  kZAxis, nslice, zz_voxels/nslice);
133 
134  G4double voxel_height = (zz_voxels/nslice);
135 
136 // Breast RO Geometry - slices along phi angle
137 
138  G4int n_voxels = 10;
139 
140  G4double voxel_phi = spanningPhi_voxelz/n_voxels;
141 
142 
143  G4Tubs* ROvoxel = new G4Tubs("voxel", rmin_voxelz, rmax_voxelz, voxel_height/2.,
144  startPhi_voxelz,voxel_phi);
145 
146  G4LogicalVolume* ROvoxel_log = new G4LogicalVolume(ROvoxel, dummyMat, "voxel_log", 0,0,0);
147 
148  ROvoxel_phys = new G4PVReplica("RZPhiSlices",
149  ROvoxel_log,
150  ROvoxelz_phys,
151  kPhi, n_voxels, voxel_phi,- (voxel_phi/2.));
152 
153  //delete matrix;
154 
156  ROvoxel_log -> SetSensitiveDetector(dummySD);
157 
158  return ROWorldPhys;
159 }
160 
161 
162