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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/extended/biasing/ReverseMC01/src/RMC01DetectorConstruction.cc (Version 11.3.0) and /examples/extended/biasing/ReverseMC01/src/RMC01DetectorConstruction.cc (Version 5.0)


  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 /// \file biasing/ReverseMC01/src/RMC01Detecto    
 27 /// \brief Implementation of the RMC01Detector    
 28 //                                                
 29 //                                                
 30 //////////////////////////////////////////////    
 31 //      Class Name:        RMC01DetectorConstr    
 32 //        Author:               L. Desorgher      
 33 //         Organisation:         SpaceIT GmbH     
 34 //        Contract:        ESA contract 21435/    
 35 //         Customer:             ESA/ESTEC        
 36 //////////////////////////////////////////////    
 37                                                   
 38 //....oooOO0OOooo........oooOO0OOooo........oo    
 39 //....oooOO0OOooo........oooOO0OOooo........oo    
 40                                                   
 41 #include "RMC01DetectorConstruction.hh"           
 42                                                   
 43 #include "RMC01DetectorMessenger.hh"              
 44 #include "RMC01SD.hh"                             
 45                                                   
 46 #include "G4Box.hh"                               
 47 #include "G4Colour.hh"                            
 48 #include "G4GeometryManager.hh"                   
 49 #include "G4LogicalVolume.hh"                     
 50 #include "G4LogicalVolumeStore.hh"                
 51 #include "G4Material.hh"                          
 52 #include "G4Orb.hh"                               
 53 #include "G4PVPlacement.hh"                       
 54 #include "G4PhysicalConstants.hh"                 
 55 #include "G4PhysicalVolumeStore.hh"               
 56 #include "G4RunManager.hh"                        
 57 #include "G4SDManager.hh"                         
 58 #include "G4SolidStore.hh"                        
 59 #include "G4SystemOfUnits.hh"                     
 60 #include "G4Tubs.hh"                              
 61 #include "G4VisAttributes.hh"                     
 62                                                   
 63 //....oooOO0OOooo........oooOO0OOooo........oo    
 64                                                   
 65 RMC01DetectorConstruction::RMC01DetectorConstr    
 66   : G4VUserDetectorConstruction(),                
 67     fDetectorMessenger(0),                        
 68     fShield_Thickness(5. * mm),                   
 69     fSensitive_cylinder_H(1. * mm),               
 70     fSensitive_cylinder_Rout(1. * mm)             
 71 {                                                 
 72   fDetectorMessenger = new RMC01DetectorMessen    
 73 }                                                 
 74                                                   
 75 //....oooOO0OOooo........oooOO0OOooo........oo    
 76                                                   
 77 RMC01DetectorConstruction::~RMC01DetectorConst    
 78 {                                                 
 79   delete fDetectorMessenger;                      
 80 }                                                 
 81                                                   
 82 //....oooOO0OOooo........oooOO0OOooo........oo    
 83                                                   
 84 G4VPhysicalVolume* RMC01DetectorConstruction::    
 85 {                                                 
 86   DefineMaterials();                              
 87   return ConstructSimpleGeometry();               
 88 }                                                 
 89                                                   
 90 //....oooOO0OOooo........oooOO0OOooo........oo    
 91                                                   
 92 void RMC01DetectorConstruction::DefineMaterial    
 93 {                                                 
 94   G4String symbol;  // a=mass of a mole;          
 95   G4double a, z, density;  // z=mean number of    
 96   G4double fractionmass;                          
 97   G4int ncomponents;                              
 98                                                   
 99   //                                              
100   // define Elements                              
101   //                                              
102                                                   
103   G4Element* N = new G4Element("Nitrogen", sym    
104   G4Element* O = new G4Element("Oxygen", symbo    
105                                                   
106   //                                              
107   // define simple materials                      
108   //                                              
109                                                   
110   new G4Material("Aluminum", z = 13., a = 26.9    
111   new G4Material("Silicon", z = 14., a = 28.09    
112   new G4Material("Tantalum", z = 73., a = 180.    
113                                                   
114   //                                              
115   // define air                                   
116   //                                              
117                                                   
118   G4Material* Air = new G4Material("Air", dens    
119   Air->AddElement(N, fractionmass = 0.7);         
120   Air->AddElement(O, fractionmass = 0.3);         
121                                                   
122   //                                              
123   // Example of Vacuum                            
124   //                                              
125                                                   
126   new G4Material("Vacuum", z = 1., a = 1.01 *     
127                  3.e-18 * pascal, 2.73 * kelvi    
128 }                                                 
129                                                   
130 //....oooOO0OOooo........oooOO0OOooo........oo    
131                                                   
132 G4VPhysicalVolume* RMC01DetectorConstruction::    
133 {                                                 
134   // Clean old geometry, if any                   
135                                                   
136   G4GeometryManager::GetInstance()->OpenGeomet    
137   G4PhysicalVolumeStore::GetInstance()->Clean(    
138   G4LogicalVolumeStore::GetInstance()->Clean()    
139   G4SolidStore::GetInstance()->Clean();           
140                                                   
141   // World                                        
142   //-----------                                   
143                                                   
144   G4Box* solidWorld = new G4Box("World", 15. *    
145   G4LogicalVolume* logicWorld =                   
146     new G4LogicalVolume(solidWorld, G4Material    
147                                                   
148   G4VPhysicalVolume* physiWorld = new G4PVPlac    
149                                                   
150                                                   
151                                                   
152                                                   
153                                                   
154                                                   
155                                                   
156   // Shielding Aluminum Sphere                    
157   //-------------------                           
158                                                   
159   G4double radiusShieldingSphere = 10. * cm;      
160                                                   
161   G4Orb* solidShieldingSphere = new G4Orb("Shi    
162   G4LogicalVolume* logicShieldingSphere =         
163     new G4LogicalVolume(solidShieldingSphere,     
164                         "Shielding");  // its     
165                                                   
166   new G4PVPlacement(0,  // no rotation            
167                     G4ThreeVector(),  // at (0    
168                     logicShieldingSphere,  //     
169                     "Shielding",  // its name     
170                     logicWorld,  // its mother    
171                     false,  // no boolean oper    
172                     0);                           
173                                                   
174   // Bulk Sphere                                  
175   //-------------------                           
176                                                   
177   G4Orb* solidBulkSphere = new G4Orb("Bulk", r    
178   G4LogicalVolume* logicBulkSphere =              
179     new G4LogicalVolume(solidBulkSphere,  // i    
180                         G4Material::GetMateria    
181                         "Bulk");  // its name;    
182                                                   
183   new G4PVPlacement(0,  // no rotation            
184                     G4ThreeVector(),  // at (0    
185                     logicBulkSphere,  // its l    
186                     "Bulk",  // its name          
187                     logicShieldingSphere,  //     
188                     false,  // no boolean oper    
189                     0);                           
190                                                   
191   // Detecting cylinder                           
192   //-------------------                           
193                                                   
194   G4Tubs* solidDetecting = new G4Tubs("Sensiti    
195                                       fSensiti    
196                                                   
197   G4LogicalVolume* logicDetectingCylinder =       
198     new G4LogicalVolume(solidDetecting, G4Mate    
199                                                   
200   new G4PVPlacement(0,  // no rotation            
201                     G4ThreeVector(0., 0., 0.),    
202                     logicDetectingCylinder,  /    
203                     "SensitiveVolume",  // its    
204                     logicBulkSphere,  // its m    
205                     false,  // no boolean oper    
206                     0);                           
207                                                   
208   RMC01SD* theSensitiveDetector = new RMC01SD(    
209                                                   
210   G4SDManager::GetSDMpointer()->AddNewDetector    
211   logicDetectingCylinder->SetSensitiveDetector    
212                                                   
213   // Tantalum Plates on the top and beside        
214   //-------------------------------------         
215   G4Box* solidPlate = new G4Box("TantalumPlate    
216   G4LogicalVolume* logicPlate =                   
217     new G4LogicalVolume(solidPlate,  // its so    
218                         G4Material::GetMateria    
219                         "TantalumPlate");  //     
220                                                   
221   new G4PVPlacement(0,  // no rotation            
222                     G4ThreeVector(0., 0., 6. *    
223                     logicPlate,  // its logica    
224                     "TantalumPlate1",  // its     
225                     logicBulkSphere,  // its m    
226                     false,  // no boolean oper    
227                     0);                           
228                                                   
229   new G4PVPlacement(0,  // no rotation            
230                     G4ThreeVector(0., 0., -6.     
231                     logicPlate,  // its logica    
232                     "TantalumPlate2",  // its     
233                     logicBulkSphere,  // its m    
234                     false,  // no boolean oper    
235                     0);                           
236                                                   
237   return physiWorld;                              
238 }                                                 
239                                                   
240 //....oooOO0OOooo........oooOO0OOooo........oo    
241                                                   
242 void RMC01DetectorConstruction::SetSensitiveVo    
243 {                                                 
244   fSensitive_cylinder_Rout = r;                   
245 }                                                 
246                                                   
247 //....oooOO0OOooo........oooOO0OOooo........oo    
248                                                   
249 void RMC01DetectorConstruction::SetSensitiveVo    
250 {                                                 
251   fSensitive_cylinder_H = h;                      
252 }                                                 
253                                                   
254 //....oooOO0OOooo........oooOO0OOooo........oo    
255                                                   
256 void RMC01DetectorConstruction::SetShieldingTh    
257 {                                                 
258   fShield_Thickness = d;                          
259 }                                                 
260                                                   
261 //....oooOO0OOooo........oooOO0OOooo........oo    
262