Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExN05ParallelWorldForPion.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
27 #include "ExN05PionShowerModel.hh"
28 
29 #include "G4Box.hh"
30 #include "G4LogicalVolume.hh"
31 #include "G4Region.hh"
32 #include "G4PVPlacement.hh"
33 #include "G4ThreeVector.hh"
34 #include "G4SystemOfUnits.hh"
35 
37  : G4VUserParallelWorld(worldName)
38 {;}
39 
41 {;}
42 
43 void ExN05ParallelWorldForPion::Construct()
44 {
45  // -- fake material:
46  G4double a, iz, density;
48  G4int nel;
49  a = 14.01*g/mole;
50  G4Element* elN = new G4Element(name="Nitrogen", symbol="N", iz=7., a);
51  a = 16.00*g/mole;
52  G4Element* elO = new G4Element(name="Oxigen", symbol="O", iz=8., a);
53  density = 1.29e-03*g/cm3;
54  G4Material* Air = new G4Material(name="Air", density, nel=2);
55  Air->AddElement(elN, .7);
56  Air->AddElement(elO, .3);
57 
58  // -------------------------------
59  // Build parallel/ghost geometry:
60  // -------------------------------
61 
62  // -- Obtain clone of mass geometry world from GetWorld() base class utility:
63  G4VPhysicalVolume* ghostWorld = GetWorld();
64  // -- Why needed ? No default ?
65  ghostWorld->GetLogicalVolume()->SetMaterial(Air);
66  G4Region* parallelWorldRegion = new G4Region("ParallelWorldRegion");
67  parallelWorldRegion->AddRootLogicalVolume(ghostWorld->GetLogicalVolume());
68 
69  // -- Create box for encompassing Elec.+Had. calorimeters together:
70  G4double detectSize = 125*cm;
71  G4Box *ghostBox
72  = new G4Box("GhostBox", detectSize+5*cm, detectSize+5*cm, 80*cm);
73  // -- Build the subsequent logical volume:
74  G4LogicalVolume* ghostLogical
75  = new G4LogicalVolume(ghostBox,
76  Air, // -- no material : IMPOSSIBLE !!!
77  "GhostLogical",
78  0, 0, 0);
79  // -- And place this logical volume in the parallel geometry:
80  new G4PVPlacement(0,G4ThreeVector(0., 0., 175*cm),
81  "GhostPhysical",
82  ghostLogical,
83  ghostWorld,false,0);
84 
85  // -----------------------
86  // Setup fast simulation:
87  // -----------------------
88 
89  // -- Make Elec+Had logical volume becoming a region:
90  G4cout << "Declaring region..." << G4endl;
91  G4Region* ghostRegion = new G4Region("GhostCalorimeterRegion");
92  G4cout << "... region declared. Setting it the ghostLogical volume..." << G4endl;
93  ghostRegion->AddRootLogicalVolume(ghostLogical);
94  G4cout << "... succes.\n" << G4endl;
95 
96  // // -- Create fast simulation manager, which will handle the physics fast simulation model(s):
97  // new G4FastSimulationManager(ghostRegion);
98 
99  // -- Attach fast simulation model (create the G4FastSimulationManager if needed):
100  new ExN05PionShowerModel("ghostPionShowerModel",ghostRegion);
101 
102 }