Skip to content

Commit 78b4c6b

Browse files
committed
- Replace Shielding with QGSP_INCLXX_HP, as it includes Radioactive Decay in later Geant4 versions
- Use correct Verbosity Setting to silence physics list spam - Fix wrong Material in Clover Detector setup (@ywang) - Use in C10H8O4 instead of C10H8O3 for PET material (@warr)
1 parent 46b9f6e commit 78b4c6b

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ cmake_minimum_required(VERSION 3.11 FATAL_ERROR)
33
project(G4Horus)
44

55
# Find Geant4 package, require all available UI and Vis drivers by default
6+
# set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
7+
# set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
68
find_package(Geant4 10.5 REQUIRED ui_all vis_all multithreaded)
79
# Unfortunately, Geant4 uses cmake ineptly and forces its settings upon us ...
810
include(${Geant4_USE_FILE})

G4Horus.cc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
#include "ActionInitialization.hh"
22
#include "DetectorConstruction.hh"
33

4+
#include "G4HadronicParameters.hh"
45
#include "G4HadronicProcessStore.hh"
56
#include "G4MTRunManager.hh"
67
#include "G4UIExecutive.hh"
78
#include "G4UImanager.hh"
9+
#include "G4Version.hh"
810
#include "G4VisExecutive.hh"
9-
#include "Shielding.hh"
10-
// #include "QGSP_INCLXX.hh"
11+
#include "QGSP_INCLXX_HP.hh"
1112

1213
inline std::string GetCmdOption(char** begin, char** end,
1314
const std::string& option,
@@ -53,16 +54,18 @@ int main(int argc, char* argv[])
5354

5455
G4Random::setTheEngine(new CLHEP::RanecuEngine);
5556

56-
// Silence hadronic processes summary
57-
G4HadronicProcessStore::Instance()->SetVerbose(0);
58-
5957
auto run_manager = new G4MTRunManager();
6058
run_manager->SetVerboseLevel(0);
6159
run_manager->SetUserInitialization(new DetectorConstruction());
62-
// run_manager->SetUserInitialization(new QGSP_INCLXX(0));
63-
run_manager->SetUserInitialization(new Shielding(0)); // includes G4RadioactiveDecay
60+
run_manager->SetUserInitialization(new QGSP_INCLXX_HP(0));
6461
run_manager->SetUserInitialization(new ActionInitialization(GetCmdOption(argv, argv + argc, "-k", "hist")));
6562
run_manager->SetNumberOfThreads(threads);
63+
// Silence hadronic processes summary
64+
#if G4VERSION_NUMBER < 1070
65+
G4HadronicProcessStore::Instance()->SetVerbose(0);
66+
#else
67+
G4HadronicParameters::Instance()->SetVerboseLevel(0);
68+
#endif
6669
run_manager->Initialize();
6770

6871
auto ui_manager = G4UImanager::GetUIpointer();

G4Horus.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ set -e
66
# On some systems, using the following option can improve
77
# the 3D performance of the detector visualization.
88
# On others, it will crash the Geant4 window.
9-
export LIBGL_ALWAYS_INDIRECT=y
9+
# export LIBGL_ALWAYS_INDIRECT=y
1010

1111
## Geant 4 Version
1212
# If a specific Geant4 version should be used, adapt and uncomment these lines.
13-
# source /data/jmayer/software/geant4.10.05/bin/geant4.sh
13+
# source /opt/Geant4/4.10.07.p01/bin/geant4.sh
1414
echo "Using Geant4 Version $(geant4-config --version) in $(dirname $(dirname $(geant4-config --prefix)))"
1515

1616
## Build Project
1717
# Remove previous build directory if it exists and recreate it
18-
#rm -rf build
18+
# rm -rf build
1919
mkdir -p build
2020
cd build
2121

src/DetectorConstruction.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void DetectorConstruction::DefineMaterials()
127127

128128
G4Material* PET = new G4Material("PET", 1.4 * g / cm3, 3);
129129
PET->AddElement(C, 10);
130-
PET->AddElement(O, 3);
130+
PET->AddElement(O, 4);
131131
PET->AddElement(H, 8);
132132

133133
G4Material* Brass = new G4Material("Brass", 8.5 * g / cm3, 2);

src/detectors/HPGeClover.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void HPGe::Clover::Leaf(const G4double mx, const G4double my, const G4double rot
187187
new G4PVPlacement(G4Transform3D(rm, crystalPO), crystalLV, leaf.name + "_crystalPV", fDetectorLV, false, 0, checkOverlap);
188188
}
189189

190-
// Todschicht Kristall
190+
// Totschicht Kristall
191191
{
192192
auto inactiveSV_Step1 = new G4Tubs("", 0., leaf.crystalRadius, leaf.deadlayerThickness / 2., 0. * deg, 360. * deg);
193193
auto inactiveSV_Step2 = new G4SubtractionSolid("", inactiveSV_Step1, cutbox, nullptr, G4ThreeVector(0, -(leaf.crystalOffset + cutbox_size), 0));
@@ -212,7 +212,7 @@ void HPGe::Clover::Leaf(const G4double mx, const G4double my, const G4double rot
212212
auto alabsSV_Step2 = new G4SubtractionSolid("", alabsSV_Step1, cutbox, nullptr, G4ThreeVector(0, -(leaf.crystalOffset + cutbox_size), 0));
213213
auto alabsSV = new G4SubtractionSolid(leaf.name + "_alAbsSV", alabsSV_Step2, cutbox, nullptr, G4ThreeVector((leaf.crystalOffset + cutbox_size), 0, 0));
214214

215-
auto alabsLV = new G4LogicalVolume(alabsSV, Ge, leaf.name + "_alAbsLV");
215+
auto alabsLV = new G4LogicalVolume(alabsSV, Al, leaf.name + "_alAbsLV");
216216
auto alabsVA = new G4VisAttributes(G4Colour(1.0, .0, .0));
217217
alabsVA->SetForceSolid(true);
218218
alabsLV->SetVisAttributes(alabsVA);

0 commit comments

Comments
 (0)