ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Par01ParallelWorldForPion.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Par01ParallelWorldForPion.cc
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 //
31 #include "Par01PionShowerModel.hh"
32 
33 #include "G4Box.hh"
34 #include "G4LogicalVolume.hh"
35 #include "G4Region.hh"
36 #include "G4PVPlacement.hh"
37 #include "G4ThreeVector.hh"
38 #include "G4SystemOfUnits.hh"
39 #include "G4NistManager.hh"
40 
41 #include "G4RegionStore.hh"
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
46  : G4VUserParallelWorld(worldName)
47 {;}
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52 {;}
53 
54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
55 
57 {
58  // -- Get nist material manager
59  G4NistManager* nistManager = G4NistManager::Instance();
60 
61  // Build materials
62  G4Material* air = nistManager->FindOrBuildMaterial("G4_AIR");
63 
64  // -------------------------------
65  // Build parallel/ghost geometry:
66  // -------------------------------
67 
68  // -- Obtain clone of mass geometry world from GetWorld() base class utility:
69  G4VPhysicalVolume* ghostWorld = GetWorld();
70  // -- Why needed ? No default ?
71  ghostWorld->GetLogicalVolume()->SetMaterial(air);
72  G4Region* parallelWorldRegion = new G4Region("ParallelWorldRegion");
73  parallelWorldRegion->AddRootLogicalVolume(ghostWorld->GetLogicalVolume());
74 
75  // -- Create box for encompassing Elec.+Had. calorimeters together:
76  G4double detectSize = 125*cm;
77  G4Box *ghostBox
78  = new G4Box("GhostBox", detectSize+5*cm, detectSize+5*cm, 80*cm);
79  // -- Build the subsequent logical volume:
80  G4LogicalVolume* ghostLogical
81  = new G4LogicalVolume(ghostBox,
82  air, // -- no material : IMPOSSIBLE !!!
83  "GhostLogical",
84  0, 0, 0);
85  // -- And place this logical volume in the parallel geometry:
86  new G4PVPlacement(0,G4ThreeVector(0., 0., 175*cm),
87  "GhostPhysical",
88  ghostLogical,
89  ghostWorld,false,0);
90 
91  // -----------------------
92  // Setup fast simulation:
93  // -----------------------
94 
95  // -- Make Elec+Had logical volume becoming a region:
96  G4cout << "Declaring region..." << G4endl;
97  G4Region* ghostRegion = new G4Region("GhostCalorimeterRegion");
98  G4cout << "... region declared. Setting it the ghostLogical volume..." << G4endl;
99  ghostRegion->AddRootLogicalVolume(ghostLogical);
100  G4cout << "... succes.\n" << G4endl;
101 
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
108  G4RegionStore* regionStore = G4RegionStore::GetInstance();
109 
110  G4Region* ghostRegion = regionStore->GetRegion("GhostCalorimeterRegion");
111  // -- Attach fast simulation model (create the G4FastSimulationManager if needed):
112  new Par01PionShowerModel("ghostPionShowerModel",ghostRegion);
113 
114 }