Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
nptool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
np
nptool
Commits
19e4eebb
Commit
19e4eebb
authored
9 years ago
by
adrien-matta
Browse files
Options
Downloads
Patches
Plain Diff
* Allow compilation with Geant4 9.x
- Skip the missing include depending on G4 version
parent
362093c4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NPSimulation/CMakeLists.txt
+18
-1
18 additions, 1 deletion
NPSimulation/CMakeLists.txt
NPSimulation/Core/PhysicsList.cc
+8
-2
8 additions, 2 deletions
NPSimulation/Core/PhysicsList.cc
NPSimulation/Core/PhysicsList.hh
+2
-0
2 additions, 0 deletions
NPSimulation/Core/PhysicsList.hh
with
28 additions
and
3 deletions
NPSimulation/CMakeLists.txt
+
18
−
1
View file @
19e4eebb
...
...
@@ -16,8 +16,22 @@ set(CMAKE_INSTALL_MESSAGE LAZY)
# Finding Geant 4
find_package
(
Geant4 REQUIRED ui_all vis_all
)
message
(
${
Geant4_USE_FILE
}
)
# Rely on name of the file to set the version
string
(
REGEX MATCH
"Geant4-*.*.*/"
G4Version
"
${
Geant4_USE_FILE
}
"
)
string
(
REPLACE
"Geant4-"
""
G4Version
"
${
G4Version
}
"
)
string
(
REPLACE
"/"
""
G4Version
"
${
G4Version
}
"
)
string
(
FIND
"
${
G4Version
}
"
"."
pos
)
string
(
SUBSTRING
"
${
G4Version
}
"
"0"
"
${
pos
}
"
NPS_GEANT4_VERSION_MAJOR
)
string
(
REPLACE
"
${
NPS_GEANT4_VERSION_MAJOR
}
."
""
G4Version
"
${
G4Version
}
"
)
string
(
FIND
"
${
G4Version
}
"
"."
pos
)
string
(
SUBSTRING
"
${
G4Version
}
"
"0"
"
${
pos
}
"
NPS_GEANT4_VERSION_MINOR
)
string
(
REPLACE
"
${
NPS_GEANT4_VERSION_MINOR
}
."
""
G4Version
"
${
G4Version
}
"
)
set
(
NPS_GEANT4_VERSION_PATCH
"
${
G4Version
}
"
)
message
(
"Geant4 found, Version :
${
NPS_GEANT4_VERSION_MAJOR
}
.
${
NPS_GEANT4_VERSION_MINOR
}
.
${
NPS_GEANT4_VERSION_PATCH
}
"
)
include
(
${
Geant4_USE_FILE
}
)
add_definitions
(
${
Geant4_DEFINITIONS
}
)
# Finding NPLib
find_package
(
NPLib
)
...
...
@@ -75,6 +89,9 @@ if(Geant4_gdml_FOUND)
endif
()
# set the Geant4 version info
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DNPS_GEANT4_VERSION_MAJOR=
${
NPS_GEANT4_VERSION_MAJOR
}
"
)
# If the compiler is Clang, silence the unrecognised flags
if
(
${
CMAKE_CXX_COMPILER_ID
}
MATCHES
".*Clang.*"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Qunused-arguments -fcolor-diagnostics -Wno-deprecated-register -Wno-shadow"
)
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Core/PhysicsList.cc
+
8
−
2
View file @
19e4eebb
...
...
@@ -85,9 +85,15 @@ PhysicsList::PhysicsList() : G4VModularPhysicsList(){
if
(
m_StoppingPhysics
)
m_PhysList
[
"StoppingPhysics"
]
=
new
G4StoppingPhysics
();
if
(
m_HadronPhysicsQGSP_BIC_HP
)
m_PhysList
[
"HadronPhysicsQGSP_BIC_HP"
]
=
new
G4HadronPhysicsQGSP_BIC_HP
();
if
(
m_HadronPhysicsQGSP_BIC_HP
){
#if NPS_GEANT4_VERSION_MAJOR > 9
m_PhysList
[
"HadronPhysicsQGSP_BIC_HP"
]
=
new
G4HadronPhysicsQGSP_BIC_HP
();
#else
std
::
cout
<<
"
\r\032
[1;31m Warning: physics list HadronPhysicsQGSP_BIC_HP require Geant4 10, process not activated
\033
[0m"
<<
std
::
endl
;
#endif
m_PhysList
[
"HadronPhysicsQGSP_BIC_HP"
]
=
new
G4HadronPhysicsQGSP_BIC_HP
();
}
// Optical Photon for scintillator simulation
if
(
m_OpticalPhysics
){
opticalPhysicsList
=
new
G4OpticalPhysics
(
0
);
...
...
This diff is collapsed.
Click to expand it.
NPSimulation/Core/PhysicsList.hh
+
2
−
0
View file @
19e4eebb
...
...
@@ -56,7 +56,9 @@
#include
"G4HadronElasticPhysics.hh"
#include
"G4HadronElasticPhysicsHP.hh"
#include
"G4IonBinaryCascadePhysics.hh"
#if NPS_GEANT4_VERSION_MAJOR > 9
#include
"G4HadronPhysicsQGSP_BIC_HP.hh"
#endif
#include
"G4HadronPhysicsQGSP_BIC.hh"
class
G4VPhysicsConstructor
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment