Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GB05DetectorConstruction Class Reference

#include <GB05DetectorConstruction.hh>

Inheritance diagram for GB05DetectorConstruction:
Collaboration diagram for GB05DetectorConstruction:

Public Member Functions

 GB05DetectorConstruction ()
 
 ~GB05DetectorConstruction ()
 
virtual G4VPhysicalVolumeConstruct ()
 
virtual void ConstructSDandField ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Definition at line 41 of file GB05DetectorConstruction.hh.

Constructor & Destructor Documentation

GB05DetectorConstruction::GB05DetectorConstruction ( )
GB05DetectorConstruction::~GB05DetectorConstruction ( )

Definition at line 58 of file GB05DetectorConstruction.cc.

59 {}

Member Function Documentation

G4VPhysicalVolume * GB05DetectorConstruction::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 63 of file GB05DetectorConstruction.cc.

64 {
65  // -- Collect a few materials from NIST database:
66  auto nistManager = G4NistManager::Instance();
67  G4Material* worldMaterial = nistManager->FindOrBuildMaterial("G4_Galactic");
68  G4Material* defaultMaterial = nistManager->FindOrBuildMaterial("G4_CONCRETE");
69 
70 
71  G4VSolid* solidWorld = new G4Box("World", 10*m, 10*m, 10*m );
72 
73  G4LogicalVolume* logicWorld = new G4LogicalVolume(solidWorld, // its solid
74  worldMaterial, // its material
75  "World"); // its name
76 
77  G4PVPlacement* physiWorld = new G4PVPlacement(0, // no rotation
78  G4ThreeVector(), // at (0,0,0)
79  logicWorld, // its logical volume
80  "World", // its name
81  0, // its mother volume
82  false, // no boolean operation
83  0); // copy number
84 
85  // -----------------------------------
86  // -- volume where biasing is applied:
87  // -----------------------------------
88  G4double halfXY = 5.0*m;
89  G4double halfZ = 1.0*m;
90  G4VSolid* solidShield = new G4Box("shield.solid", halfXY, halfXY, halfZ );
91 
92  G4LogicalVolume* logicShield = new G4LogicalVolume( solidShield, // its solid
93  defaultMaterial, // its material
94  "shield.logical"); // its name
95 
96  new G4PVPlacement(0, // no rotation
97  G4ThreeVector(0,0, halfZ), // volume entrance at (0,0,0)
98  logicShield, // its logical volume
99  "shield.phys", // its name
100  logicWorld, // its mother volume
101  false, // no boolean operation
102  0); // copy number
103 
104  // --------------------------------------------------------------------
105  // -- dummy volume to print information on particle exiting the shield:
106  // --------------------------------------------------------------------
107  G4double halfz = 1*cm;
108  G4VSolid* solidMeasurement = new G4Box("meas.solid", halfXY, halfXY, halfz );
109 
110  G4LogicalVolume* logicMeasurement = new G4LogicalVolume(solidMeasurement,// its solid
111  worldMaterial, // its material
112  "meas.logical"); // its name
113 
114  new G4PVPlacement(0, // no rotation
115  G4ThreeVector(0,0, 2*halfZ + halfz), // volume entrance at (0,0,0)
116  logicMeasurement, // its logical volume
117  "meas.phys", // its name
118  logicWorld, // its mother volume
119  false, // no boolean operation
120  0); // copy number
121 
122 
123  return physiWorld;
124 }
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:64
static G4NistManager * Instance()
static constexpr double m
Definition: G4SIunits.hh:129
static constexpr double cm
Definition: G4SIunits.hh:119
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

void GB05DetectorConstruction::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 127 of file GB05DetectorConstruction.cc.

128 {
129  // -- Fetch volume for biasing:
130  G4LogicalVolume* logicShield =
131  G4LogicalVolumeStore::GetInstance()->GetVolume("shield.logical");
132 
133  // -------------------------------------------------------------
134  // -- operator creation, configuration and attachment to volume:
135  // -------------------------------------------------------------
136  GB05BOptrSplitAndKillByCrossSection* biasingOperator =
138  // -- Now, we declare to our biasing operator all the processes we
139  // -- their disapperance effect on neutrons to be counterbalanced
140  // -- by the splitting by cross-section :
141  biasingOperator->AddProcessToEquipoise("Decay");
142  biasingOperator->AddProcessToEquipoise("nCapture");
143  biasingOperator->AddProcessToEquipoise("neutronInelastic");
144 
145  biasingOperator->AttachTo(logicShield);
146 
147  G4cout << " Attaching biasing operator " << biasingOperator->GetName()
148  << " to logical volume " << biasingOperator->GetName()
149  << G4endl;
150 
151  // ------------------------------------------------------------------------------------
152  // -- Attach a sensitive detector to print information on particles exiting the shield:
153  // ------------------------------------------------------------------------------------
154  // -- create and register sensitive detector code module:
156  G4VSensitiveDetector* sd = new GB05SD("Scorer");
157  SDman->AddNewDetector(sd);
158  // -- Fetch volume for sensitivity and attach sensitive module to it:
159  G4LogicalVolume* logicSD =
160  G4LogicalVolumeStore::GetInstance()->GetVolume("meas.logical");
161  logicSD->SetSensitiveDetector(sd);
162 
163 }
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true) const
G4GLOB_DLL std::ostream G4cout
Definition: GB05SD.hh:36
static G4LogicalVolumeStore * GetInstance()
void AttachTo(const G4LogicalVolume *)
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
#define G4endl
Definition: G4ios.hh:61
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
const G4String GetName() const

Here is the call graph for this function:


The documentation for this class was generated from the following files: