ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GB06DetectorConstruction.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file GB06DetectorConstruction.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 //
30 #include "G4SystemOfUnits.hh"
31 
32 #include "G4Material.hh"
33 #include "G4NistManager.hh"
34 
35 #include "G4Box.hh"
36 #include "G4LogicalVolume.hh"
37 #include "G4PVPlacement.hh"
38 #include "G4LogicalVolumeStore.hh"
39 
40 #include "G4NistManager.hh"
41 
42 #include "GB06SD.hh"
43 #include "G4SDManager.hh"
44 
45 
46 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
47 
50 {}
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 
55 {}
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 {
61  G4Material* worldMaterial =
63  G4Material* concreteMaterial =
65 
66 
67  G4VSolid* solidWorld = new G4Box("World.solid", 10*m, 10*m, 10*m );
68 
69  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, // its solid
70  worldMaterial, // its material
71  "World.logical");// its name
72 
73  G4PVPlacement* physiWorld = new G4PVPlacement(nullptr, // no rotation
74  G4ThreeVector(), // at (0,0,0)
75  logicWorld, // its logical volume
76  "World.physical",// its name
77  nullptr, // its mother volume
78  false, // no bool. operation
79  0); // copy number
80 
81  // ----------------------------------------------------
82  // -- volume of shield, made of concrete, in one block:
83  // ----------------------------------------------------
84  G4double halfXY = 1.5*m;
85  G4double halfZ = 2.5*m;
86  G4VSolid* solidShield = new G4Box("shield.solid", halfXY, halfXY, halfZ );
87 
88  G4LogicalVolume* logicTest = new G4LogicalVolume(solidShield, // its solid
89  concreteMaterial, // its material
90  "shield.logical"); // its name
91 
92  new G4PVPlacement(nullptr, // no rotation
93  G4ThreeVector(0, 0, halfZ), // volume entrance is set at (0,0,0)
94  logicTest, // its logical volume
95  "shield.physical", // its name
96  logicWorld, // its mother volume
97  false, // no boolean operation
98  0); // copy number
99 
100  // ------------------------------------------------------------
101  // -- dummy volume to display exiting neutron flux information:
102  // ------------------------------------------------------------
103  G4double halfz = 1*cm;
104  G4VSolid* solidMeasurement = new G4Box("meas.solid", halfXY, halfXY, halfz );
105 
106  G4LogicalVolume* logicMeasurement = new G4LogicalVolume(solidMeasurement,// its solid
107  worldMaterial, // its material
108  "meas.logical"); // its name
109 
110  new G4PVPlacement(nullptr, // no rotation
111  G4ThreeVector(0, 0, 2*halfZ + halfz), // entrance set after shield
112  logicMeasurement, // its logical volume
113  "meas.physical", // its name
114  logicWorld, // its mother volume
115  false, // no boolean operation
116  0); // copy number
117 
118 
119  // -- world volume pointer returned:
120  return physiWorld;
121 }
122 
123 
125 {
126 
127  // ---------------------------------------------------------------------------------
128  // -- Attach sensitive detector to print information on particle exiting the shield:
129  // ---------------------------------------------------------------------------------
130  // -- create and register sensitive detector code module:
132  G4VSensitiveDetector* sd = new GB06SD("Measurer");
133  SDman->AddNewDetector(sd);
134  // -- Fetch volume for sensitivity and attach sensitive module to it:
135  G4LogicalVolume* logicSD =
136  G4LogicalVolumeStore::GetInstance()->GetVolume("meas.logical");
137  logicSD->SetSensitiveDetector(sd);
138 
139 }