Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/hadronic/FissionFragment/src/FFDetectorConstruction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.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/hadronic/FissionFragment/src/FFDetectorConstruction.cc (Version 11.3.0) and /examples/extended/hadronic/FissionFragment/src/FFDetectorConstruction.cc (Version 11.1.3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // -------------------------------------------     26 // -------------------------------------------------------------
 27 //  =============== Begin Documentation Commen     27 //  =============== Begin Documentation Comments ===============
 28 //!                                                28 //!
 29 //! \file       FFDetectorConstruction.cc          29 //! \file       FFDetectorConstruction.cc
 30 //! \author     B. Wendt (brycen.linn.wendt@ce     30 //! \author     B. Wendt (brycen.linn.wendt@cern.ch)
 31 //! \date       June 06, 2014                      31 //! \date       June 06, 2014
 32 //!                                                32 //!
 33 //! \brief      Implementation of the FFDetect     33 //! \brief      Implementation of the FFDetectorConstruction class
 34 //!                                                34 //!
 35 //! \details    The model simulated is based o     35 //! \details    The model simulated is based off a subcritical assembly design
 36 //!             with 20% enriched meat             36 //!             with 20% enriched meat
 37 //!                                                37 //!
 38 //  ================ End Documentation Comment     38 //  ================ End Documentation Comments ================
 39 //                                                 39 //
 40 //  Modified:                                      40 //  Modified:
 41 //                                                 41 //
 42 //  23-06-14                                       42 //  23-06-14                                              BWendt
 43 //  Fixed issue with the automatic placement o     43 //  Fixed issue with the automatic placement of the meat not working. Solution
 44 //      was to use the correct units "inch" in     44 //      was to use the correct units "inch" in the y-direction as well.
 45 //  Coincidentally eliminated the need to usin     45 //  Coincidentally eliminated the need to using the 'std::abs()" from the
 46 //      "cmath" library.                           46 //      "cmath" library.
 47 //  Implemented method "PlaceFuelPlates"           47 //  Implemented method "PlaceFuelPlates"
 48 //                                                 48 //
 49 // -------------------------------------------     49 // -------------------------------------------------------------
 50                                                    50 
 51 #include "FFDetectorConstruction.hh"           <<  51 #include "globals.hh"
 52                                                    52 
 53 #include "G4Box.hh"                                53 #include "G4Box.hh"
 54 #include "G4Element.hh"                            54 #include "G4Element.hh"
 55 #include "G4Isotope.hh"                            55 #include "G4Isotope.hh"
 56 #include "G4LogicalVolume.hh"                      56 #include "G4LogicalVolume.hh"
 57 #include "G4NistManager.hh"                        57 #include "G4NistManager.hh"
 58 #include "G4PVPlacement.hh"                        58 #include "G4PVPlacement.hh"
 59 #include "G4SystemOfUnits.hh"                      59 #include "G4SystemOfUnits.hh"
 60 #include "G4Tubs.hh"                               60 #include "G4Tubs.hh"
 61 #include "G4VPhysicalVolume.hh"                    61 #include "G4VPhysicalVolume.hh"
 62 #include "globals.hh"                          <<  62 
                                                   >>  63 #include "FFDetectorConstruction.hh"
                                                   >>  64 
 63                                                    65 
 64 static const G4double inch = 2.54 * cm;            66 static const G4double inch = 2.54 * cm;
 65                                                    67 
                                                   >>  68 
 66 //....oooOO0OOooo........oooOO0OOooo........oo     69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 67 FFDetectorConstruction::FFDetectorConstruction <<  70 FFDetectorConstruction::
                                                   >>  71 FFDetectorConstruction()
                                                   >>  72 :   G4VUserDetectorConstruction()
 68 {                                                  73 {
 69   DefineMaterials();                           <<  74     DefineMaterials();
 70 }                                                  75 }
 71                                                    76 
 72 //....oooOO0OOooo........oooOO0OOooo........oo     77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 73 G4VPhysicalVolume* FFDetectorConstruction::Con <<  78 G4VPhysicalVolume* FFDetectorConstruction::
                                                   >>  79 Construct()
 74 {                                                  80 {
 75   G4ThreeVector position;                      <<  81     G4ThreeVector position;
 76 #ifdef NDEBUG                                      82 #ifdef NDEBUG
 77   G4bool const overlapChecking = false;        <<  83     G4bool const overlapChecking = false;
 78 #else                                              84 #else
 79   G4bool const overlapChecking = true;         <<  85     G4bool const overlapChecking = true;
 80 #endif  // NDEBUG                              <<  86 #endif // NDEBUG
 81                                                <<  87     
 82   //                                           <<  88     //
 83   // Create the world                          <<  89     // Create the world
 84   //                                           <<  90     //
 85   const G4double worldSize = 40.0 * inch;      <<  91     const G4double worldSize = 40.0 * inch;
 86   G4Box* const solidWorld = new G4Box("World", <<  92     G4Box* const solidWorld = new G4Box("World",        // the name
 87                                       worldSiz <<  93                                         worldSize,      // x size
 88                                       worldSiz <<  94                                         worldSize,      // y size
 89                                       worldSiz <<  95                                         worldSize);     // z size
 90   G4LogicalVolume* const logicalWorld = new G4 <<  96     G4LogicalVolume* const logicalWorld
 91                                                <<  97         = new G4LogicalVolume(solidWorld,               // the solid volume
 92                                                <<  98                               fAir,                     // the material
 93   // Center at the origin                      <<  99                               solidWorld->GetName());   // the name
 94   position.set(0.0, 0.0, 0.0);                 << 100     // Center at the origin
 95   G4VPhysicalVolume* const physicalWorld =     << 101     position.set(0.0, 0.0, 0.0); 
 96     new G4PVPlacement(NULL,  // no rotation    << 102     G4VPhysicalVolume* const physicalWorld
 97                       position,  // must be at << 103         = new G4PVPlacement(NULL,                       // no rotation
 98                       logicalWorld,  // the lo << 104                             position,                   // must be at origin
 99                       logicalWorld->GetName(), << 105                             logicalWorld,               // the logical volume
100                       NULL,  // no mother volu << 106                             logicalWorld->GetName(),    // the name
101                       false,  // no boolean op << 107                             NULL,                       // no mother volume
102                       0,  // copy number       << 108                             false,                      // no boolean ops
103                       overlapChecking);  // ch << 109                             0,                          // copy number
104                                                << 110                             overlapChecking);           // check for overlaps
105   //                                           << 111     
106   // Create the graphite pile that the subcrit << 112     //
107   //                                           << 113     // Create the graphite pile that the subcritical assembly rests on.
108   const G4double floorH = 30.0 * inch;         << 114     //
109   const G4ThreeVector floorPosition(0.0, 0.0,  << 115     const G4double floorH = 30.0 * inch;
110   G4Box* const solidFloor = new G4Box("Floor", << 116     const G4ThreeVector floorPosition(0.0, 0.0, 0.0);
111                                       worldSiz << 117     G4Box* const solidFloor = new G4Box("Floor",        // the name
112                                       worldSiz << 118                                         worldSize,      // x size
113                                       floorH * << 119                                         worldSize,      // y size
114   G4LogicalVolume* const logicalFloor = new G4 << 120                                         floorH * 0.5);  // z size
115                                                << 121     G4LogicalVolume* const logicalFloor
116                                                << 122         = new G4LogicalVolume(solidFloor,               // the solid volume
117   // Shift down so the top is at the origin    << 123                               fGraphite,                // the material
118   position.set(0.0, 0.0, -floorH * 0.5);       << 124                               solidFloor->GetName());   // the name
119   new G4PVPlacement(NULL,  // no rotation      << 125     // Shift down so the top is at the origin
120                     position,  // position     << 126     position.set(0.0, 0.0, -floorH * 0.5); 
121                     logicalFloor,  // the logi << 127     new G4PVPlacement(NULL,                             // no rotation
122                     logicalFloor->GetName(),   << 128                       position,                         // position
123                     logicalWorld,  // the moth << 129                       logicalFloor,                     // the logical volume
124                     false,  // no boolean ops  << 130                       logicalFloor->GetName(),          // the name
125                     0,  // copy number         << 131                       logicalWorld,                     // the mother volume
126                     overlapChecking);  // chec << 132                       false,                            // no boolean ops
127                                                << 133                       0,                                // copy number
128   //                                           << 134                       overlapChecking);                 // check for overlaps
129   // Create the tank                           << 135     
130   //                                           << 136     //
131   const G4double tankWallThickness = 0.25 * in << 137     // Create the tank
132   const G4double tankOR = 18.0 * inch;         << 138     //
133   const G4double tankH = 39.0 * inch;          << 139     const G4double tankWallThickness = 0.25 * inch;
134   G4Tubs* const solidTank = new G4Tubs("Tank_W << 140     const G4double tankOR = 18.0 * inch;
135                                        0.0,  / << 141     const G4double tankH = 39.0 * inch;
136                                        tankOR, << 142     G4Tubs* const solidTank
137                                        tankH * << 143         = new G4Tubs("Tank_Wall",                       // the name
138                                        0.0 * d << 144                      0.0,                               // inner radius
139                                        360.0 * << 145                      tankOR,                            // outer radius
140   G4LogicalVolume* const logicalTank = new G4L << 146                      tankH * 0.5,                       // half height
141                                                << 147                      0.0 * deg,                         // start angle
142                                                << 148                      360.0 * deg);                      // end angle
143   // Shift up so the base is at the origin     << 149     G4LogicalVolume* const logicalTank
144   position.set(0.0, 0.0, tankH * 0.5);         << 150         = new G4LogicalVolume(solidTank,                // the solid volume
145   new G4PVPlacement(NULL,  // no rotation      << 151                               fAluminum,                // the material
146                     position,  // shift up     << 152                               solidTank->GetName());    // the name
147                     logicalTank,  // the logic << 153     // Shift up so the base is at the origin
148                     logicalTank->GetName(),  / << 154     position.set(0.0, 0.0, tankH * 0.5);
149                     logicalWorld,  // the moth << 155     new G4PVPlacement(NULL,                             // no rotation
150                     false,  // no boolean ops  << 156                       position,                         // shift up
151                     0,  // copy number         << 157                       logicalTank,                      // the logical volume
152                     overlapChecking);  // chec << 158                       logicalTank->GetName(),           // the name
153   // Top 3 inches are air                      << 159                       logicalWorld,                     // the mother volume
154   const G4double tankAirH = 3.0 * inch;        << 160                       false,                            // no boolean ops
155   G4Tubs* const solidTankAir = new G4Tubs("Tan << 161                       0,                                // copy number
156                                           0.0, << 162                       overlapChecking);                 // check for overlaps
157                                           tank << 163     // Top 3 inches are air
158                                           tank << 164     const G4double tankAirH = 3.0 * inch;
159                                           0.0  << 165     G4Tubs* const solidTankAir
160                                           360. << 166         = new G4Tubs("Tank_Air",                        // the name
161   G4LogicalVolume* const logicalTankAir = new  << 167                      0.0,                               // inner radius
162                                                << 168                      tankOR - tankWallThickness,        // outer radius
163                                                << 169                      tankAirH * 0.5,                    // half height
164   // Shift up so that the top of the air is th << 170                      0.0 * deg,                         // start angle
165   position.set(0.0, 0.0, (tankH - tankAirH) *  << 171                      360.0 * deg);                      // end angle
166   new G4PVPlacement(NULL,  // no rotation      << 172     G4LogicalVolume* const logicalTankAir
167                     position,  // shift ip     << 173         = new G4LogicalVolume(solidTankAir,             // the solid volume
168                     logicalTankAir,  // the lo << 174                               fAir,                     // the material
169                     logicalTankAir->GetName(), << 175                               solidTankAir->GetName()); // the name
170                     logicalTank,  // the mothe << 176     // Shift up so that the top of the air is the same as the top of the tank
171                     false,  // no boolean ops  << 177     position.set(0.0, 0.0, (tankH - tankAirH) * 0.5);
172                     0,  // copy number         << 178     new G4PVPlacement(NULL,                             // no rotation
173                     overlapChecking);  // chec << 179                       position,                         // shift ip
174   // Fill remaining area with water            << 180                       logicalTankAir,                   // the logical volume
175   const G4double tankH2OH = (tankH - (tankAirH << 181                       logicalTankAir->GetName(),        // the name
176   G4Tubs* const solidTankH2O = new G4Tubs("Tan << 182                       logicalTank,                      // the mother volume
177                                           0.0, << 183                       false,                            // no boolean ops
178                                           tank << 184                       0,                                // copy number
179                                           tank << 185                       overlapChecking);                 // check for overlaps
180                                           0.0  << 186     // Fill remaining area with water
181                                           360. << 187     const G4double tankH2OH = (tankH - (tankAirH + tankWallThickness));
182   G4LogicalVolume* const logicalTankH2O = new  << 188     G4Tubs* const solidTankH2O
183                                                << 189         = new G4Tubs("Tank_H2O",                        // the name
184                                                << 190                      0.0,                               // inner radius
185   // Shift up so that the top of the water is  << 191                      tankOR - tankWallThickness,        // outer radius
186   const G4double centerOfH2O = (tankH - tankH2 << 192                      tankH2OH * 0.5,                    // half height
187   position.set(0.0, 0.0, centerOfH2O);         << 193                      0.0 * deg,                         // start angle
188   new G4PVPlacement(NULL,  // no rotation      << 194                      360.0 * deg);                      // end angle
189                     position,  // shift to ori << 195     G4LogicalVolume* const logicalTankH2O
190                     logicalTankH2O,  // the lo << 196         = new G4LogicalVolume(solidTankH2O,             // the solid volume
191                     logicalTankH2O->GetName(), << 197                               fAluminum,                // the material
192                     logicalTank,  // the mothe << 198                               solidTankH2O->GetName()); // the name
193                     false,  // no boolean ops  << 199     // Shift up so that the top of the water is at the bottom of the air
194                     0,  // copy number         << 200     const G4double centerOfH2O = (tankH - tankH2OH) * 0.5 - tankAirH;
195                     overlapChecking);  // chec << 201     position.set(0.0, 0.0, centerOfH2O);
196                                                << 202     new G4PVPlacement(NULL,                             // no rotation
197   //                                           << 203                       position,                         // shift to origin
198   // Fuel plates                               << 204                       logicalTankH2O,                   // the logical volume
199   //                                           << 205                       logicalTankH2O->GetName(),        // the name
200   const G4double plateX = 3.0 * inch;          << 206                       logicalTank,                      // the mother volume
201   const G4double plateY = 0.08 * inch;         << 207                       false,                            // no boolean ops
202   const G4double plateZ = 26.0 * inch;         << 208                       0,                                // copy number
203   const G4double meatX = 2.75 * inch;          << 209                       overlapChecking);                 // check for overlaps
204   const G4double meatY = 0.04 * inch;          << 210     
205   const G4double meatZ = 24.0 * inch;          << 211     //
206   const G4double xSpacing = 5.0 * inch;        << 212     // Fuel plates
207   const G4double ySpacing = 0.3 * inch;        << 213     //
208   const G4double plateRadius = 12.0 * inch;    << 214     const G4double plateX = 3.0 * inch;
209   // Define the aluminim claddiing             << 215     const G4double plateY = 0.08 * inch;
210   G4Box* const solidPlate = new G4Box("Plate_C << 216     const G4double plateZ = 26.0 * inch;
211                                       plateX * << 217     const G4double meatX = 2.75 * inch;
212                                       plateY * << 218     const G4double meatY = 0.04 * inch;
213                                       plateZ * << 219     const G4double meatZ = 24.0 * inch;
214   G4LogicalVolume* const logicalPlate = new G4 << 220     const G4double xSpacing = 5.0 * inch;
215                                                << 221     const G4double ySpacing = 0.3 * inch;
216                                                << 222     const G4double plateRadius = 12.0 * inch;
217   // Place the meat inside the cladding        << 223     // Define the aluminim claddiing
218   G4Box* const solidMeat = new G4Box("Plate_Me << 224     G4Box* const solidPlate
219                                      meatX * 0 << 225         = new G4Box("Plate_Cladding",                   // the name
220                                      meatY * 0 << 226                     plateX * 0.5,                       // x size
221                                      meatZ * 0 << 227                     plateY * 0.5,                       // y size
222   G4LogicalVolume* const logicalMeat = new G4L << 228                     plateZ * 0.5);                      // z size
223                                                << 229     G4LogicalVolume* const logicalPlate
224                                                << 230         = new G4LogicalVolume(solidPlate,               // the solid volume
225   // The meat goes into the exact center of th << 231                               fAluminum,                // the material
226   position.set(0.0, 0.0, 0.0);                 << 232                               solidPlate->GetName());   // the name
227   new G4PVPlacement(NULL,  // no rotation      << 233     // Place the meat inside the cladding
228                     position,  // position     << 234     G4Box* const solidMeat
229                     logicalMeat,  // the logic << 235         = new G4Box("Plate_Meat",                       // the name
230                     logicalMeat->GetName(),  / << 236                     meatX * 0.5,                        // x size
231                     logicalPlate,  // the moth << 237                     meatY * 0.5,                        // y size
232                     false,  // no boolean ops  << 238                     meatZ * 0.5);                       // z size
233                     0,  // copy number         << 239     G4LogicalVolume* const logicalMeat
234                     overlapChecking);  // chec << 240         = new G4LogicalVolume(solidMeat,                // the solid volume
235   // The plate will be centered in the z-direc << 241                               fUO2_20E,                 // the material
236   // Simulate a subcritical assembly loading w << 242                               solidMeat->GetName());    // the name
237   bool placeMe;                                << 243     // The meat goes into the exact center of the plate
238                                                << 244     position.set(0.0, 0.0, 0.0); 
239   position.setZ(0.0);                          << 245     new G4PVPlacement(NULL,                             // no rotation
240   fCopyNumber = 0;                             << 246                       position,                         // position
241   for (double x = 0.0; x <= plateRadius; x +=  << 247                       logicalMeat,                      // the logical volume
242     // 5 rows of plates                        << 248                       logicalMeat->GetName(),           // the name
243     for (double y = 0.0; y <= plateRadius; y + << 249                       logicalPlate,                     // the mother volume
244       placeMe = false;                         << 250                       false,                            // no boolean ops
245                                                << 251                       0,                                // copy number
246       // Fuel plate must be completely within  << 252                       overlapChecking);                 // check for overlaps
247       if (std::sqrt(x * x + y * y) < plateRadi << 253     // The plate will be centered in the z-direction within the water
248         // Leave a 1 inch radius opening in th << 254     // Simulate a subcritical assembly loading within a radius of 12 inches
249         // source                              << 255     bool placeMe;
250         if (std::sqrt(x * x + y * y) > 1.0 * i << 256     
251           placeMe = true;                      << 257     position.setZ(0.0);
                                                   >> 258     fCopyNumber = 0;
                                                   >> 259     for(double x = 0.0;
                                                   >> 260         x <= plateRadius;
                                                   >> 261         x += xSpacing)
                                                   >> 262     {
                                                   >> 263         // 5 rows of plates
                                                   >> 264         for(double y = 0.0;
                                                   >> 265             y <= plateRadius;
                                                   >> 266             y += ySpacing)
                                                   >> 267         {
                                                   >> 268             placeMe = false;
                                                   >> 269             
                                                   >> 270             // Fuel plate must be completely within the radius to be placed
                                                   >> 271             if(std::sqrt(x * x + y * y) < plateRadius)
                                                   >> 272             {
                                                   >> 273                 // Leave a 1 inch radius opening in the middle for the neutron
                                                   >> 274                 // source
                                                   >> 275                 if(std::sqrt(x * x + y * y) > 1.0 * inch)
                                                   >> 276                 {
                                                   >> 277                     placeMe = true;
                                                   >> 278                 }
                                                   >> 279             }
                                                   >> 280             
                                                   >> 281             if(placeMe)
                                                   >> 282             {
                                                   >> 283                 PlaceFuelPlate(x,
                                                   >> 284                                y,
                                                   >> 285                                logicalPlate,
                                                   >> 286                                logicalTankH2O);
                                                   >> 287                 PlaceFuelPlate(x,
                                                   >> 288                                -y,
                                                   >> 289                                logicalPlate,
                                                   >> 290                                logicalTankH2O);
                                                   >> 291                 if(x > 0.0)
                                                   >> 292                 {
                                                   >> 293                     PlaceFuelPlate(-x,
                                                   >> 294                                    y,
                                                   >> 295                                    logicalPlate,
                                                   >> 296                                    logicalTankH2O);
                                                   >> 297                     PlaceFuelPlate(-x,
                                                   >> 298                                    -y,
                                                   >> 299                                    logicalPlate,
                                                   >> 300                                    logicalTankH2O);
                                                   >> 301                 }
                                                   >> 302             }
252         }                                         303         }
253       }                                        << 
254                                                << 
255       if (placeMe) {                           << 
256         PlaceFuelPlate(x, y, logicalPlate, log << 
257         PlaceFuelPlate(x, -y, logicalPlate, lo << 
258         if (x > 0.0) {                         << 
259           PlaceFuelPlate(-x, y, logicalPlate,  << 
260           PlaceFuelPlate(-x, -y, logicalPlate, << 
261         }                                      << 
262       }                                        << 
263     }                                             304     }
264   }                                            << 305     G4cout << fCopyNumber << " plates were added to the subcritical assembly"
265   G4cout << fCopyNumber << " plates were added << 306            << G4endl;
266                                                << 307     
267   //                                           << 308     //
268   // Neutron Source                            << 309     // Neutron Source
269   //                                           << 310     //
270   // TODO create the AmBe material in DefineMa << 311     // TODO create the AmBe material in DefineMaterials() and use it here
271   //      For now steel is used, but the logic << 312     //      For now steel is used, but the logical volume is used in the
272   //      PrimaryGeneratorAction to know where << 313     //      PrimaryGeneratorAction to know where to emit the neutrons from
273   const G4double sourceH = 2 * inch;           << 314     const G4double sourceH = 2 * inch;
274   const G4double sourceR = 0.2 * inch;         << 315     const G4double sourceR = 0.2 * inch;
275   G4Tubs* const solidSource = new G4Tubs("Neut << 316     G4Tubs* const solidSource
276                                          0.0,  << 317         = new G4Tubs("NeutronSource",                   // the name
277                                          sourc << 318                      0.0,                               // inner radius
278                                          sourc << 319                      sourceR,                           // outer radius
279                                          0.0 * << 320                      sourceH * 0.5,                     // half height
280                                          360.0 << 321                      0.0 * deg,                         // start angle
281   G4LogicalVolume* const logicalSource = new G << 322                      360.0 * deg);                      // end angle
282                                                << 323     G4LogicalVolume* const logicalSource
283                                                << 324         = new G4LogicalVolume(solidSource,              // the solid volume
284   // Place in the exact center of the water ta << 325                               fStainlessSteel,          // the material
285   position.set(0.0, 0.0, 0.0);                 << 326                               solidSource->GetName());  // the name
286   new G4PVPlacement(NULL,  // no rotation      << 327     // Place in the exact center of the water tank
287                     position,  // shift to ori << 328     position.set(0.0, 0.0, 0.0);
288                     logicalSource,  // the log << 329     new G4PVPlacement(NULL,                             // no rotation
289                     logicalSource->GetName(),  << 330                       position,                         // shift to origin
290                     logicalTankH2O,  // the mo << 331                       logicalSource,                    // the logical volume
291                     false,  // no boolean ops  << 332                       logicalSource->GetName(),         // the name
292                     0,  // copy number         << 333                       logicalTankH2O,                   // the mother volume
293                     overlapChecking);  // chec << 334                       false,                            // no boolean ops
294                                                << 335                       0,                                // copy number
295   //                                           << 336                       overlapChecking);                 // check for overlaps
296   // Detector Tower                            << 337     
297   //                                           << 338     //
298   const G4double polyS = 3.0 * inch;           << 339     // Detector Tower
299   const G4double polyH = 18.0 * inch;          << 340     //
300   G4Box* const solidPoly = new G4Box("Poly",   << 341     const G4double polyS = 3.0 * inch;
301                                      polyS,  / << 342     const G4double polyH = 18.0 * inch;
302                                      polyS,  / << 343     G4Box* const solidPoly
303                                      polyH);   << 344         = new G4Box("Poly",                             // the name
304   G4LogicalVolume* const logicalPoly = new G4L << 345                     polyS,                              // x size
305                                                << 346                     polyS,                              // y size
306                                                << 347                     polyH);                             // z size
307   // The polyethylene detector tower goes just << 348     G4LogicalVolume* const logicalPoly
308   G4double radiusToPolyCenter = (tankOR / std: << 349         = new G4LogicalVolume(solidPoly,                // the solid volume
309   position.set(-radiusToPolyCenter, radiusToPo << 350                               fPolyethylene,            // the material
310   new G4PVPlacement(NULL,  // no rotation      << 351                               solidPoly->GetName());    // the name
311                     position,  // position     << 352     // The polyethylene detector tower goes just outside the tank at 45 deg
312                     logicalPoly,  // the logic << 353     G4double radiusToPolyCenter = (tankOR / std::sqrt(2.0)) + std::sqrt(2.0) * polyS;
313                     logicalPoly->GetName(),  / << 354     position.set(-radiusToPolyCenter, radiusToPolyCenter, polyH);
314                     logicalWorld,  // the moth << 355     new G4PVPlacement(NULL,                             // no rotation
315                     false,  // no boolean ops  << 356                       position,                         // position
316                     0,  // copy number         << 357                       logicalPoly,                      // the logical volume
317                     overlapChecking);  // chec << 358                       logicalPoly->GetName(),           // the name
318   // Create the detector shell                 << 359                       logicalWorld,                     // the mother volume
319   G4double shellR = 0.3 * inch;                << 360                       false,                            // no boolean ops
320   G4double shellH = 6.5 * inch;                << 361                       0,                                // copy number
321   G4Tubs* const solidShell = new G4Tubs("Detec << 362                       overlapChecking);                 // check for overlaps
322                                         0.0,   << 363     // Create the detector shell
323                                         shellR << 364     G4double shellR = 0.3 * inch;
324                                         shellH << 365     G4double shellH = 6.5 * inch;
325                                         0.0 *  << 366     G4Tubs* const solidShell
326                                         360.0  << 367         = new G4Tubs("Detector_Shell",                  // the name
327   G4LogicalVolume* const logicalShell = new G4 << 368                      0.0,                               // inner radius
328                                                << 369                      shellR,                            // outer radius
329                                                << 370                      shellH * 0.5,                      // half height
330   // Place in the exact center of the polyethy << 371                      0.0 * deg,                         // start angle
331   position.set(0.0, 0.0, 0.0);                 << 372                      360.0 * deg);                      // end angle
332   new G4PVPlacement(NULL,  // no rotation      << 373     G4LogicalVolume* const logicalShell
333                     position,  // shift to ori << 374         = new G4LogicalVolume(solidShell,               // the solid volume
334                     logicalShell,  // the logi << 375                               fStainlessSteel,          // the material
335                     logicalShell->GetName(),   << 376                               solidShell->GetName());   // the name
336                     logicalPoly,  // the mothe << 377     // Place in the exact center of the polyethylene tower
337                     false,  // no boolean ops  << 378     position.set(0.0, 0.0, 0.0);
338                     0,  // copy number         << 379     new G4PVPlacement(NULL,                             // no rotation
339                     overlapChecking);  // chec << 380                       position,                         // shift to origin
340   // Create the BF3 detector                   << 381                       logicalShell,                     // the logical volume
341   G4double BF3R = 0.2 * inch;                  << 382                       logicalShell->GetName(),          // the name
342   G4double BF3H = 6.0 * inch;                  << 383                       logicalPoly,                      // the mother volume
343   G4Tubs* const solidBF3 = new G4Tubs("Detecto << 384                       false,                            // no boolean ops
344                                       0.0,  // << 385                       0,                                // copy number
345                                       BF3R,  / << 386                       overlapChecking);                 // check for overlaps
346                                       BF3H * 0 << 387     // Create the BF3 detector
347                                       0.0 * de << 388     G4double BF3R = 0.2 * inch;
348                                       360.0 *  << 389     G4double BF3H = 6.0 * inch;
349   G4LogicalVolume* const logicalBF3 = new G4Lo << 390     G4Tubs* const solidBF3
350                                                << 391         = new G4Tubs("Detector_BF3_Core",               // the name
351                                                << 392                      0.0,                               // inner radius
352   // Place in the exact center of the shell    << 393                      BF3R,                              // outer radius
353   position.set(0.0, 0.0, 0.0);                 << 394                      BF3H * 0.5,                        // half height
354   new G4PVPlacement(NULL,  // no rotation      << 395                      0.0 * deg,                         // start angle
355                     position,  // shift to ori << 396                      360.0 * deg);                      // end angle
356                     logicalBF3,  // the logica << 397     G4LogicalVolume* const logicalBF3
357                     logicalBF3->GetName(),  // << 398         = new G4LogicalVolume(solidBF3,                 // the solid volume
358                     logicalShell,  // the moth << 399                               fBF3_96E,                 // the material
359                     false,  // no boolean ops  << 400                               solidBF3->GetName());     // the name
360                     0,  // copy number         << 401     // Place in the exact center of the shell
361                     overlapChecking);  // chec << 402     position.set(0.0, 0.0, 0.0);
362                                                << 403     new G4PVPlacement(NULL,                             // no rotation
363   return physicalWorld;                        << 404                       position,                         // shift to origin
                                                   >> 405                       logicalBF3,                       // the logical volume
                                                   >> 406                       logicalBF3->GetName(),            // the name
                                                   >> 407                       logicalShell,                     // the mother volume
                                                   >> 408                       false,                            // no boolean ops
                                                   >> 409                       0,                                // copy number
                                                   >> 410                       overlapChecking);                 // check for overlaps
                                                   >> 411     
                                                   >> 412     return physicalWorld;
364 }                                                 413 }
365                                                   414 
366 //....oooOO0OOooo........oooOO0OOooo........oo    415 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
367 void FFDetectorConstruction::DefineMaterials(v << 416 void FFDetectorConstruction::
                                                   >> 417 DefineMaterials(void)
368 {                                                 418 {
369   static G4NistManager* const nist = G4NistMan << 419     static G4NistManager* const nist = G4NistManager::Instance();
370                                                << 420     
371   fAir = nist->FindOrBuildMaterial("G4_AIR");  << 421     fAir = nist->FindOrBuildMaterial("G4_AIR");
372   fAluminum = nist->FindOrBuildMaterial("G4_Al << 422     fAluminum = nist->FindOrBuildMaterial("G4_Al");
373   fGraphite = nist->FindOrBuildMaterial("G4_GR << 423     fGraphite = nist->FindOrBuildMaterial("G4_GRAPHITE");
374   fPolyethylene = nist->FindOrBuildMaterial("G << 424     fPolyethylene = nist->FindOrBuildMaterial("G4_POLYETHYLENE");
375   fStainlessSteel = nist->FindOrBuildMaterial( << 425     fStainlessSteel = nist->FindOrBuildMaterial("G4_STAINLESS-STEEL");
376   fWater = nist->FindOrBuildMaterial("G4_WATER << 426     fWater = nist->FindOrBuildMaterial("G4_WATER");
377                                                << 427     
378   /*// List available materials                << 428     /*// List available materials
379   std::vector< G4String > materials = nist->Ge << 429     std::vector< G4String > materials = nist->GetNistMaterialNames();
380   for(unsigned int i = 0;                      << 430     for(unsigned int i = 0;
381       i < materials.size();                    << 431         i < materials.size();
382       ++i)                                     << 432         ++i)
383   {                                            << 433     {
384       G4cout << materials[i] << G4endl;        << 434         G4cout << materials[i] << G4endl;
385   }*/                                          << 435     }*/
386                                                << 436     
387   //                                           << 437     //
388   // Define the 20% enriched UO2               << 438     // Define the 20% enriched UO2
389   //                                           << 439     //
390   // First we need to start by creating the is << 440     // First we need to start by creating the isotopes
391   G4double const U235Enrichment = 0.2;         << 441     G4double const U235Enrichment = 0.2;
392   G4double const U238Enrichment = 0.8;         << 442     G4double const U238Enrichment = 0.8;
393   G4Isotope* const iU235 = new G4Isotope("iU23 << 443     G4Isotope* const iU235
394                                          92,   << 444         = new G4Isotope("iU235",                        // name
395                                          235,  << 445                         92,                             // ZZZ
396                                          235.0 << 446                         235,                            // AAA
397   G4Isotope* const iU238 = new G4Isotope("iU23 << 447                         235.053930 * (g / mole));       // molecular weight
398                                          92,   << 448     G4Isotope* const iU238
399                                          238,  << 449         = new G4Isotope("iU238",                        // name
400                                          238.0 << 450                         92,                             // ZZZ
401   // Now create the elements and add the isoto << 451                         238,                            // AAA
402   G4Element* const U235 = new G4Element("U235" << 452                         238.050788 * (g / mole));       // molecular weight
403                                         "U235" << 453     // Now create the elements and add the isotopes
404                                         1);  / << 454     G4Element* const U235
405   U235->AddIsotope(iU235,  // isotope          << 455         = new G4Element("U235",                         // name
406                    1.0);  // abundance         << 456                         "U235",                         // symbol
407   G4Element* const U238 = new G4Element("U238" << 457                         1);                             // number of isotopes
408                                         "U238" << 458     U235->AddIsotope(iU235,                             // isotope
409                                         1);  / << 459                      1.0);                              // abundance
410   U238->AddIsotope(iU238,  // isotope          << 460     G4Element* const U238
411                    1.0);  // abundance         << 461         = new G4Element("U238",                         // name
412   G4Element* const oxygen = nist->FindOrBuildE << 462                         "U238",                         // symbol
413   // Calculate the mass fractions              << 463                         1);                             // number of isotopes
414   const G4double UO2MolecularWeight =          << 464     U238->AddIsotope(iU238,                             // isotope
415     U235->GetA() * U235Enrichment + U238->GetA << 465                      1.0);                              // abundance
416   const G4double U235MassFraction = (U235->Get << 466     G4Element* const oxygen = nist->FindOrBuildElement("O");
417   const G4double U238MassFraction = (U238->Get << 467     // Calculate the mass fractions
418   const G4double oxygenMassFraction = (oxygen- << 468     const G4double UO2MolecularWeight = U235->GetA() * U235Enrichment
419   // create the material and add the elements  << 469                                         + U238->GetA() * U238Enrichment
420   fUO2_20E = new G4Material("UO2_20E",  // nam << 470                                         + oxygen->GetA() * 2;
421                             10.97 * (g / cm3), << 471     const G4double U235MassFraction = (U235->GetA() * U235Enrichment)
422                             3);  // number of  << 472                                       / UO2MolecularWeight;
423   fUO2_20E->AddElement(U235,  // element       << 473     const G4double U238MassFraction = (U238->GetA() * U238Enrichment)
424                        U235MassFraction);  //  << 474                                       / UO2MolecularWeight;
425   fUO2_20E->AddElement(U238,  // element       << 475     const G4double oxygenMassFraction = (oxygen->GetA() * 2)
426                        U238MassFraction);  //  << 476                                         / UO2MolecularWeight;
427   fUO2_20E->AddElement(oxygen,  // element     << 477     // create the material and add the elements
428                        oxygenMassFraction);  / << 478     fUO2_20E = new G4Material("UO2_20E",                // name
429                                                << 479                               10.97 * (g / cm3),        // density
430   //                                           << 480                               3);                       // number of components
431   // Define the BF3                            << 481     fUO2_20E->AddElement(U235,                          // element
432   //                                           << 482                          U235MassFraction);             // mass fraction
433   // The BF3 is B-10 enriched                  << 483     fUO2_20E->AddElement(U238,                          // element
434   // http://www.orau.org/ptp/collection/propor << 484                          U238MassFraction);             // mass fraction
435   G4double const B10Enrichment = 0.96;         << 485     fUO2_20E->AddElement(oxygen,                        // element
436   G4double const B11Enrichment = 0.04;         << 486                          oxygenMassFraction);           // mass fraction
437   G4Isotope* const iB10 = new G4Isotope("iB10" << 487     
438                                         5,  // << 488     //
439                                         10,  / << 489     // Define the BF3
440                                         10.012 << 490     //
441   G4Isotope* const iB11 = new G4Isotope("iB11" << 491     // The BF3 is B-10 enriched
442                                         5,  // << 492     // http://www.orau.org/ptp/collection/proportional%20counters/bf3info.htm
443                                         11,  / << 493     G4double const B10Enrichment = 0.96;
444                                         11.009 << 494     G4double const B11Enrichment = 0.04;
445   // Now create the elements and add the isoto << 495     G4Isotope* const iB10
446   G4Element* const B10 = new G4Element("B10",  << 496         = new G4Isotope("iB10",                         // name
447                                        "B10",  << 497                         5,                              // ZZZ
448                                        1);  // << 498                         10,                             // AAA
449   B10->AddIsotope(iB10,  // isotope            << 499                         10.0129370 * (g / mole));       // molecular weight
450                   1.0);  // abundance          << 500     G4Isotope* const iB11
451   G4Element* const B11 = new G4Element("B11",  << 501         = new G4Isotope("iB11",                         // name
452                                        "B11",  << 502                         5,                              // ZZZ
453                                        1);  // << 503                         11,                             // AAA
454   B11->AddIsotope(iB11,  // isotope            << 504                         11.0093054 * (g / mole));       // molecular weight
455                   1.0);  // abundance          << 505     // Now create the elements and add the isotopes
456   G4Element* const flouride = nist->FindOrBuil << 506     G4Element* const B10
457   // Calculate the mass fractions              << 507         = new G4Element("B10",                          // name
458   const G4double BF3MolecularWeight =          << 508                         "B10",                          // symbol
459     B10->GetA() * B10Enrichment + B11->GetA()  << 509                         1);                             // number of isotopes
460   const G4double B10MassFraction = (B10->GetA( << 510     B10->AddIsotope(iB10,                               // isotope
461   const G4double B11MassFraction = (B11->GetA( << 511                      1.0);                              // abundance
462   const G4double flourideMassFraction = (flour << 512     G4Element* const B11
463   // create the material and add the elements  << 513         = new G4Element("B11",                          // name
464   fBF3_96E = new G4Material("BF3_96E",  // nam << 514                         "B11",                          // symbol
465                             2.5 * (kg / m3),   << 515                         1);                             // number of isotopes
466                             3);  // number of  << 516     B11->AddIsotope(iB11,                               // isotope
467   fBF3_96E->AddElement(B10,  // element        << 517                      1.0);                              // abundance
468                        B10MassFraction);  // m << 518     G4Element* const flouride = nist->FindOrBuildElement("F");
469   fBF3_96E->AddElement(B11,  // element        << 519     // Calculate the mass fractions
470                        B11MassFraction);  // m << 520     const G4double BF3MolecularWeight = B10->GetA() * B10Enrichment
471   fBF3_96E->AddElement(flouride,  // element   << 521                                         + B11->GetA() * B11Enrichment
472                        flourideMassFraction);  << 522                                         + flouride->GetA() * 3;
                                                   >> 523     const G4double B10MassFraction = (B10->GetA() * B10Enrichment)
                                                   >> 524                                      / BF3MolecularWeight;
                                                   >> 525     const G4double B11MassFraction = (B11->GetA() * B11Enrichment)
                                                   >> 526                                      / BF3MolecularWeight;
                                                   >> 527     const G4double flourideMassFraction = (flouride->GetA() * 3)
                                                   >> 528                                           / BF3MolecularWeight;
                                                   >> 529     // create the material and add the elements
                                                   >> 530     fBF3_96E = new G4Material("BF3_96E",                // name
                                                   >> 531                               2.5 * (kg / m3),          // density
                                                   >> 532                               3);                       // number of components
                                                   >> 533     fBF3_96E->AddElement(B10,                           // element
                                                   >> 534                          B10MassFraction);              // mass fraction
                                                   >> 535     fBF3_96E->AddElement(B11,                           // element
                                                   >> 536                          B11MassFraction);              // mass fraction
                                                   >> 537     fBF3_96E->AddElement(flouride,                      // element
                                                   >> 538                          flourideMassFraction);         // mass fraction
473 }                                                 539 }
474                                                   540 
475 //....oooOO0OOooo........oooOO0OOooo........oo    541 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
476 void FFDetectorConstruction::PlaceFuelPlate(do << 542 void FFDetectorConstruction::
477                                             G4 << 543 PlaceFuelPlate(double x,
478                                             G4 << 544                double y,
                                                   >> 545                G4LogicalVolume* const myLogicalVolume,
                                                   >> 546                G4LogicalVolume* const parentLogicalVolume)
479 {                                                 547 {
480   G4ThreeVector position(x, y);                << 548     G4ThreeVector position(x, y);
481   std::ostringstream copyName;                 << 549     std::ostringstream copyName;
482   copyName << "Plate@Location    X:" << std::s << 550     copyName << "Plate@Location    X:" << std::setprecision(2) << x / inch << "    Y:" << y / inch; 
483                                                << 551     
484   new G4PVPlacement(NULL,  // no rotation      << 552     new G4PVPlacement(NULL,                 // no rotation
485                     position,  // position     << 553                       position,             // position
486                     myLogicalVolume,  // the l << 554                       myLogicalVolume,      // the logical volume
487                     copyName.str(),  // the na << 555                       copyName.str(),       // the name
488                     parentLogicalVolume,  // t << 556                       parentLogicalVolume,  // the mother volume
489                     false,  // no boolean ops  << 557                       false,                // no boolean ops
490                     fCopyNumber++,  // copy nu << 558                       fCopyNumber++,        // copy number
491                     true);  // check for overl << 559                       true);                // check for overlaps
492 }                                                 560 }
493                                                   561 
494 //....oooOO0OOooo........oooOO0OOooo........oo    562 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
495 FFDetectorConstruction::~FFDetectorConstructio << 563 FFDetectorConstruction::
                                                   >> 564 ~FFDetectorConstruction()
496 {                                                 565 {
497   // Nothing here                              << 566     // Nothing here
498 }                                                 567 }
                                                   >> 568 
                                                   >> 569 
499                                                   570