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p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/brachytherapy/src/BrachyDetectorConstructionTG186.cc (Version 11.3.0) and /examples/advanced/brachytherapy/src/BrachyDetectorConstructionTG186.cc (Version 9.2.p4)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 //                                                
 27 // -------------------------------------------    
 28 //                 GEANT 4 - Brachytherapy exa    
 29 // -------------------------------------------    
 30 //                                                
 31 // Code developed by:                             
 32 // D. Cutajar                                     
 33 //                                                
 34 //    ****************************************    
 35 //    *                                      *    
 36 //    *    BrachyDetectorConstructionTG186.cc     
 37 //    *                                      *    
 38 //    ****************************************    
 39 //                                                
 40 //                                                
 41 #include "BrachyDetectorConstructionTG186.hh"     
 42 #include "globals.hh"                             
 43 #include "G4SystemOfUnits.hh"                     
 44 #include "G4Sphere.hh"                            
 45 #include "G4RunManager.hh"                        
 46 #include "G4Box.hh"                               
 47 #include "G4Tubs.hh"                              
 48 #include "G4LogicalVolume.hh"                     
 49 #include "G4ThreeVector.hh"                       
 50 #include "G4PVPlacement.hh"                       
 51 #include "G4Transform3D.hh"                       
 52 #include "G4RotationMatrix.hh"                    
 53 #include "G4TransportationManager.hh"             
 54 #include "G4VisAttributes.hh"                     
 55 #include "G4Colour.hh"                            
 56 #include "G4NistManager.hh"                       
 57                                                   
 58 BrachyDetectorConstructionTG186::BrachyDetecto    
 59    fTG186capsule(nullptr), fTG186capsuleLog(nu    
 60    fTG186capsulePhys(nullptr),                    
 61    fTG186capsuleTip(nullptr), fTG186capsuleTip    
 62    fTG186capsuleTipPhys(nullptr),                 
 63    fTG186iridiumCore(nullptr), fTG186iridiumCo    
 64    fTG186iridiumCorePhys(nullptr),                
 65    fTG186cable(nullptr), fTG186cableLog(nullpt    
 66    fTG186cablePhys(nullptr),                      
 67    fTG186simpleCapsuleVisAtt(nullptr), fTG186s    
 68    fTG186simpleCableVisAtt(nullptr)               
 69 {}                                                
 70                                                   
 71 void BrachyDetectorConstructionTG186::Construc    
 72 {                                                 
 73   G4Colour  red     (1.0, 0.0, 0.0) ;             
 74   G4Colour  magenta (1.0, 0.0, 1.0) ;             
 75                                                   
 76   G4NistManager* nist = G4NistManager::Instanc    
 77   auto iridium = nist -> FindOrBuildMaterial("    
 78                                                   
 79   // Stainless steel (Medical Physics, Vol 25,    
 80   constexpr G4double d = 8.02*g/cm3;              
 81   G4int Z; //atomic number of the element         
 82   G4Element* elMn = nist -> FindOrBuildElement    
 83   G4Element* elSi = nist -> FindOrBuildElement    
 84   G4Element* elCr = nist -> FindOrBuildElement    
 85   G4Element* elFe = nist -> FindOrBuildElement    
 86   G4Element* elNi = nist -> FindOrBuildElement    
 87   auto capsuleMat = new G4Material("Stainless     
 88   capsuleMat -> AddElement(elMn, 0.02);           
 89   capsuleMat -> AddElement(elSi, 0.01);           
 90   capsuleMat -> AddElement(elCr, 0.19);           
 91   capsuleMat -> AddElement(elNi, 0.10);           
 92   capsuleMat -> AddElement(elFe, 0.68);           
 93                                                   
 94                                                   
 95   // Capsule main body                            
 96   fTG186capsule = new G4Tubs("TG186-Capsule",0    
 97   fTG186capsuleLog = new G4LogicalVolume(fTG18    
 98   fTG186capsulePhys = new G4PVPlacement(nullpt    
 99                                  G4ThreeVector    
100                                  "TG186-Iridiu    
101                                  fTG186capsule    
102                                  mother,          
103                                  false,           
104                                  0, true);        
105                                                   
106   // Capsule tip                                  
107   fTG186capsuleTip = new G4Sphere("Tg186-Capsu    
108                             0.*mm,                
109                             0.5*mm,               
110                             0.*deg,               
111                             360.*deg,             
112                             0.*deg,               
113                             90.*deg);             
114                                                   
115   fTG186capsuleTipLog = new G4LogicalVolume(fT    
116                                       capsuleM    
117                                       "Capsule    
118                                                   
119   fTG186capsuleTipPhys = new G4PVPlacement(nul    
120                                      G4ThreeVe    
121                                      "TG186-Ca    
122                                      fTG186cap    
123                                      mother,      
124                                      false,       
125                                      0, true);    
126                                                   
127   fTG186cable = new G4Tubs("TG186-cable",         
128                             0.*mm,                
129                             0.5*mm,               
130                             1.0*mm,               
131                             0.*deg,               
132                             360.*deg);            
133                                                   
134   fTG186cableLog = new G4LogicalVolume(fTG186c    
135                                       capsuleM    
136                                       "TG186-c    
137                                                   
138   fTG186cablePhys = new G4PVPlacement(nullptr,    
139                                      G4ThreeVe    
140                                      "TG186-Ca    
141                                      fTG186cab    
142                                      mother,      
143                                      false,       
144                                      0, true);    
145                                                   
146   // Iridium core                                 
147   fTG186iridiumCore = new G4Tubs("TG186-IrCore    
148                                                   
149   fTG186iridiumCoreLog = new G4LogicalVolume(f    
150                                        iridium    
151                                        "TG186-    
152                                                   
153   fTG186iridiumCorePhys = new G4PVPlacement(nu    
154                                       G4ThreeV    
155                                       "TG186-I    
156                                       fTG186ir    
157                                       fTG186ca    
158                                       false,      
159                                       0, true)    
160                                                   
161   fTG186simpleCapsuleVisAtt = new G4VisAttribu    
162   fTG186simpleCapsuleVisAtt -> SetVisibility(t    
163   fTG186simpleCapsuleVisAtt -> SetForceWirefra    
164   fTG186capsuleLog -> SetVisAttributes(fTG186s    
165                                                   
166   fTG186simpleCapsuleTipVisAtt = new G4VisAttr    
167   fTG186simpleCapsuleTipVisAtt -> SetVisibilit    
168   fTG186simpleCapsuleTipVisAtt -> SetForceSoli    
169   fTG186capsuleTipLog -> SetVisAttributes(fTG1    
170                                                   
171   fTG186simpleIridiumVisAtt = new G4VisAttribu    
172   fTG186simpleIridiumVisAtt -> SetVisibility(t    
173   fTG186simpleIridiumVisAtt -> SetForceWirefra    
174   fTG186iridiumCoreLog -> SetVisAttributes(fTG    
175                                                   
176   fTG186simpleCableVisAtt = new G4VisAttribute    
177   fTG186simpleCableVisAtt -> SetVisibility(tru    
178   fTG186simpleCableVisAtt -> SetForceSolid(tru    
179   fTG186cableLog -> SetVisAttributes(fTG186sim    
180 }                                                 
181                                                   
182 void BrachyDetectorConstructionTG186::CleanTG1    
183 {                                                 
184                                                   
185   delete fTG186simpleIridiumVisAtt;               
186   fTG186simpleIridiumVisAtt = nullptr;            
187                                                   
188   delete fTG186iridiumCorePhys;                   
189   fTG186iridiumCorePhys = nullptr;                
190                                                   
191   delete fTG186iridiumCore;                       
192   fTG186iridiumCore = nullptr;                    
193                                                   
194   delete fTG186iridiumCoreLog;                    
195   fTG186iridiumCoreLog = nullptr ;                
196                                                   
197   delete fTG186simpleCapsuleTipVisAtt;            
198   fTG186simpleCapsuleTipVisAtt = nullptr;         
199                                                   
200   delete fTG186capsuleTipPhys;                    
201   fTG186capsuleTipPhys = nullptr;                 
202                                                   
203   delete fTG186capsuleTip;                        
204   fTG186capsuleTip = nullptr;                     
205                                                   
206   delete fTG186capsuleTipLog;                     
207   fTG186capsuleTipLog = nullptr;                  
208                                                   
209   delete fTG186simpleCapsuleVisAtt;               
210   fTG186simpleCapsuleVisAtt = nullptr;            
211                                                   
212   delete fTG186capsulePhys;                       
213   fTG186capsulePhys = nullptr;                    
214                                                   
215   delete fTG186capsule;                           
216   fTG186capsule = nullptr;                        
217                                                   
218   delete fTG186capsuleLog;                        
219   fTG186capsuleLog = nullptr;                     
220                                                   
221   delete fTG186cable;                             
222   fTG186cable = nullptr;                          
223                                                   
224   delete fTG186cableLog;                          
225   fTG186cableLog = nullptr;                       
226                                                   
227   delete fTG186cablePhys;                         
228   fTG186cablePhys = nullptr;                      
229                                                   
230   delete fTG186simpleCableVisAtt;                 
231   fTG186simpleCableVisAtt = nullptr;              
232                                                   
233   G4RunManager::GetRunManager() -> GeometryHas    
234 }                                                 
235