Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Par01ParallelWorldForPion.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 //
28 //
29 // $Id: Par01ParallelWorldForPion.cc 100936 2016-11-03 11:07:41Z gcosmo $
30 //
32 #include "Par01PionShowerModel.hh"
33 
34 #include "G4Box.hh"
35 #include "G4LogicalVolume.hh"
36 #include "G4Region.hh"
37 #include "G4PVPlacement.hh"
38 #include "G4ThreeVector.hh"
39 #include "G4SystemOfUnits.hh"
40 #include "G4NistManager.hh"
41 
42 #include "G4RegionStore.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
47  : G4VUserParallelWorld(worldName)
48 {;}
49 
50 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
51 
53 {;}
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56 
57 void Par01ParallelWorldForPion::Construct()
58 {
59  // -- Get nist material manager
60  G4NistManager* nistManager = G4NistManager::Instance();
61 
62  // Build materials
63  G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
64 
65  // -------------------------------
66  // Build parallel/ghost geometry:
67  // -------------------------------
68 
69  // -- Obtain clone of mass geometry world from GetWorld() base class utility:
70  G4VPhysicalVolume* ghostWorld = GetWorld();
71  // -- Why needed ? No default ?
72  ghostWorld->GetLogicalVolume()->SetMaterial(air);
73  G4Region* parallelWorldRegion = new G4Region("ParallelWorldRegion");
74  parallelWorldRegion->AddRootLogicalVolume(ghostWorld->GetLogicalVolume());
75 
76  // -- Create box for encompassing Elec.+Had. calorimeters together:
77  G4double detectSize = 125*cm;
78  G4Box *ghostBox
79  = new G4Box("GhostBox", detectSize+5*cm, detectSize+5*cm, 80*cm);
80  // -- Build the subsequent logical volume:
81  G4LogicalVolume* ghostLogical
82  = new G4LogicalVolume(ghostBox,
83  air, // -- no material : IMPOSSIBLE !!!
84  "GhostLogical",
85  0, 0, 0);
86  // -- And place this logical volume in the parallel geometry:
87  new G4PVPlacement(0,G4ThreeVector(0., 0., 175*cm),
88  "GhostPhysical",
89  ghostLogical,
90  ghostWorld,false,0);
91 
92  // -----------------------
93  // Setup fast simulation:
94  // -----------------------
95 
96  // -- Make Elec+Had logical volume becoming a region:
97  G4cout << "Declaring region..." << G4endl;
98  G4Region* ghostRegion = new G4Region("GhostCalorimeterRegion");
99  G4cout << "... region declared. Setting it the ghostLogical volume..." << G4endl;
100  ghostRegion->AddRootLogicalVolume(ghostLogical);
101  G4cout << "... succes.\n" << G4endl;
102 
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
107 void Par01ParallelWorldForPion::ConstructSD()
108 {
109  G4RegionStore* regionStore = G4RegionStore::GetInstance();
110 
111  G4Region* ghostRegion = regionStore->GetRegion("GhostCalorimeterRegion");
112  // -- Attach fast simulation model (create the G4FastSimulationManager if needed):
113  new Par01PionShowerModel("ghostPionShowerModel",ghostRegion);
114 
115 }
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const
CLHEP::Hep3Vector G4ThreeVector
void AddRootLogicalVolume(G4LogicalVolume *lv)
Definition: G4Region.cc:290
G4VPhysicalVolume * GetWorld()
Definition of the Par01PionShowerModel class.
Definition: G4Box.hh:64
Par01ParallelWorldForPion(G4String worldName)
Definition of the Par01ParallelWorldForPion class.
static G4NistManager * Instance()
static G4RegionStore * GetInstance()
G4GLOB_DLL std::ostream G4cout
static constexpr double cm
Definition: G4SIunits.hh:119
G4LogicalVolume * GetLogicalVolume() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetMaterial(G4Material *pMaterial)