ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IORTDetectorConstruction.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file IORTDetectorConstruction.hh
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 is the *BASIC* version of IORT, a Geant4-based application
27 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d)
28 // Contributor Authors: S.Guatelli(e)
29 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d)
30 //
31 // (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy
32 // (b) IBFM-CNR , Segrate (Milano), Italy
33 // (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy
34 // (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy
35 // (e) University of Wollongong, Australia
36 //
37 // *Corresponding author, email to carlo.casarino@polooncologicocefalu.it
39 
40 
41 #ifndef IORTDetectorConstruction_H
42 #define IORTDetectorConstruction_H 1
43 
44 #include "G4Box.hh"
45 #include "globals.hh"
46 #include "G4VisAttributes.hh"
47 #include "G4LogicalVolume.hh"
48 #include "G4UnitsTable.hh"
49 #include "G4Tubs.hh"
50 
51 class G4VPhysicalVolume;
52 class G4LogicalVolume;
54 
56 {
57 public:
58 
60 
62 
63  // G4VPhysicalVolume *detectorPhysicalVolume; aggiunto
64 
65 private:
66 
67  void ConstructPhantom();
68  void ConstructDetector();
69  // void ConstructDisc();
71  void ParametersCheck();
72 
73 public:
74 // Get detector position relative to WORLD
76  {
78  }
79 
81 // Get displacement between phantom and detector by detector position (center of), phantom (center of) and detector sizes
83 {
87  );
88 }
89 
91 // Calculate (and set) detector position by displacement, phantom and detector sizes
92 inline void SetDetectorPosition()
93  {
94  // Adjust detector position
98 
99  //G4cout << "*************** DetectorToPhantomPosition " << detectorToPhantomPosition/cm << "\n";
100  //G4cout << "*************** DetectorPosition " << detectorPosition/cm << "\n";
101  }
103 // Check whether detector is inside phantom
104 inline bool IsInside(G4double detectorX,
105  G4double detectorY,
106  G4double detectorZ,
107  G4double phantomX,
108  G4double phantomY,
109  G4double phantomZ,
110  G4ThreeVector detToPhantomPosition)
111 {
112 // Dimensions check... X Y and Z
113 // Firstly check what dimension we are modifying
114  {
115  if (detectorX > phantomX)
116  {
117  G4cout << "Error: Detector X dimension must be smaller or equal to the correspondent of the phantom" << G4endl;
118  return false;
119  }
120  if ( (phantomX - detectorX) < detToPhantomPosition.getX())
121  {
122  G4cout << "Error: X dimension doesn't fit with detector to phantom relative position" << G4endl;
123  return false;
124  }
125  }
126 
127  {
128  if (detectorY > phantomY)
129  {
130  G4cout << "Error: Detector Y dimension must be smaller or equal to the correspondent of the phantom" << G4endl;
131  return false;
132  }
133  if ( (phantomY - detectorY) < detToPhantomPosition.getY())
134  {
135  G4cout << "Error: Y dimension doesn't fit with detector to phantom relative position" << G4endl;
136  return false;
137  }
138  }
139 
140  {
141  if (detectorZ > phantomZ)
142  {
143  G4cout << "Error: Detector Z dimension must be smaller or equal to the correspondent of the phantom" << G4endl;
144  return false;
145  }
146  if ( (phantomZ - detectorZ) < detToPhantomPosition.getZ())
147  {
148  G4cout << "Error: Z dimension doesn't fit with detector to phantom relative position" << G4endl;
149  return false;
150  }
151  }
152 
153  return true;
154 }
156 
158  void SetVoxelSize(G4double sizeX, G4double sizeY, G4double sizeZ);
159  void SetDetectorSize(G4double sizeX, G4double sizeY, G4double sizeZ);
160  void SetPhantomSize(G4double sizeX, G4double sizeY, G4double sizeZ);
162  void SetDetectorToPhantomPosition(G4ThreeVector DetectorToPhantomPosition);
163  void UpdateGeometry();
164  void DeleteDisc();
165  void ConstructDisc();
166  void PrintParameters();
168 
170  void SetOuterRadiusDiscoIORT(G4double outerr);
171  void SetinnerRadiusDiscoIORT(G4double innerr);
172  void SetheightDiscoIORT(G4double height);
173  void SetDiscoXPositionIORT(G4double xpos);
174  void SetDiscoYPositionIORT(G4double ypos);
176 
178  void SetOuterRadiusDiscoIORT1(G4double outerr);
179  void SetinnerRadiusDiscoIORT1(G4double innerr);
180  void SetheightDiscoIORT1(G4double height);
181  void SetDiscoXPositionIORT1(G4double xpos);
182 
183  void SetAngleDiscoIORT0(G4double phi0);
184 
185 private:
186 
188 
190 
192 
196 
200 
204 
205  G4ThreeVector phantomPosition, detectorPosition, detectorToPhantomPosition; // phantom center, detector center, detector to phantom relative position
206 
209 
210  //Disco0 IORT
215 
216  // Disco1 IORT
230 
231  // Disco2 IORT
232 
241 };
242 #endif
243 
244 
245