Skip to content

Commit

Permalink
Adding new example21 which uses G4VTrackingManager (#266)
Browse files Browse the repository at this point in the history
* adding new example based on custom tracking

* fixing wrong instanciation of AdePT which was not one per thread

* moving initialization of AdePT to BuildPhysicsTable and other cleanup

* cleanup of macros and moving data to common dir

* removing not needed asserts for GPU region and some clean up

* clean up

* moving GDML files to the common data directory

* adding the flag to switch off AdePT

* fixing check for the Geant4 version

* Modified scoring on CPU and GPU
  * Reduced the size of the scoring arrays to just the number of sensitive PVols
  * G4 Physical Volume ID to Hit mapping in geant4
  * VecGeom Placed Volume ID to Hit mapping + VecGeom PV to Geant4 PV ID mapping in AdePT
  * Removed unused code
  * Fixes for initialization issues in multithreaded mode

* adding missing licence info

* fixing example number in cmake file

---------

Co-authored-by: Witold Pokorski <[email protected]>
Co-authored-by: JuanGonzalezCaminero <[email protected]>
  • Loading branch information
3 people authored Nov 6, 2023
1 parent 063dc45 commit 12253c0
Show file tree
Hide file tree
Showing 76 changed files with 1,319,781 additions and 94 deletions.
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ add_subdirectory(Example17)
add_subdirectory(Example18)
add_subdirectory(Example19)
add_subdirectory(Example20)
add_subdirectory(Example21)
add_subdirectory(TestEm3)
add_subdirectory(TestEm3MT)
add_subdirectory(TestEm3Compact)
Expand Down
1 change: 1 addition & 0 deletions examples/Example17/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ configure_file("macros/testEm3.gdml" "${CMAKE_BINARY_DIR}/testEm3.gdml")
configure_file("macros/testEm3.mac.in" "${CMAKE_BINARY_DIR}/testEm3_e17.mac")
configure_file("macros/testEm3G4.mac.in" "${CMAKE_BINARY_DIR}/testEm3G4_e17.mac")
configure_file("macros/example17.mac.in" "${CMAKE_BINARY_DIR}/example17.mac")
configure_file("macros/example17_ttbar.mac.in" "${CMAKE_BINARY_DIR}/example17_ttbar.mac")
configure_file("macros/example17_validation.mac.in" "${CMAKE_BINARY_DIR}/example17_validation.mac")
configure_file("macros/LHCb_Upgrade_fullLHCb.gdml" "${CMAKE_BINARY_DIR}/LHCb_Upgrade_fullLHCb.gdml")
configure_file("macros/lhcb.mac.in" "${CMAKE_BINARY_DIR}/lhcb_e17.mac")
Expand Down
2 changes: 1 addition & 1 deletion examples/Example17/macros/example17.mac.in
Original file line number Diff line number Diff line change
Expand Up @@ -165,4 +165,4 @@
# run events with full (detailed) simulation
/param/InActivateModel AdePT
#/analysis/setFileName example17_fullsim_100events.root
/run/beamOn 1
/run/beamOn 1
157 changes: 157 additions & 0 deletions examples/Example17/macros/example17_ttbar.mac.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
# SPDX-FileCopyrightText: 2022 CERN
# SPDX-License-Identifier: Apache-2.0
# example17.in
#

## =============================================================================
## Geant4 macro for modelling simplified sampling calorimeters
## =============================================================================
##
/run/numberOfThreads 16
/control/verbose 0
/run/verbose 0
/process/verbose 0
/tracking/verbose 0
##
/example17/setSeed 1

/example17/detector/filename @CMS2018_GDML@
/example17/detector/regionname EcalRegion
/example17/adept/verbose 0
## Threshold for buffering tracks before sending to GPU
/example17/adept/threshold 5000
## Total number of GPU track slots (not per thread)
/example17/adept/milliontrackslots 15

/example17/detector/addsensitivevolume EAPD_01
/example17/detector/addsensitivevolume EAPD_02
/example17/detector/addsensitivevolume EAPD_03
/example17/detector/addsensitivevolume EAPD_04
/example17/detector/addsensitivevolume EAPD_05
/example17/detector/addsensitivevolume EAPD_06
/example17/detector/addsensitivevolume EAPD_07
/example17/detector/addsensitivevolume EAPD_08
/example17/detector/addsensitivevolume EAPD_09
/example17/detector/addsensitivevolume EAPD_10
/example17/detector/addsensitivevolume EAPD_11
/example17/detector/addsensitivevolume EAPD_12
/example17/detector/addsensitivevolume EAPD_13
/example17/detector/addsensitivevolume EAPD_14
/example17/detector/addsensitivevolume EAPD_15
/example17/detector/addsensitivevolume EAPD_16
/example17/detector/addsensitivevolume EAPD_17

/example17/detector/sensitivegroup EAPD

/example17/detector/addsensitivevolume EBRY_01
/example17/detector/addsensitivevolume EBRY_02
/example17/detector/addsensitivevolume EBRY_03
/example17/detector/addsensitivevolume EBRY_04
/example17/detector/addsensitivevolume EBRY_05
/example17/detector/addsensitivevolume EBRY_06
/example17/detector/addsensitivevolume EBRY_07
/example17/detector/addsensitivevolume EBRY_08
/example17/detector/addsensitivevolume EBRY_09
/example17/detector/addsensitivevolume EBRY_10
/example17/detector/addsensitivevolume EBRY_11
/example17/detector/addsensitivevolume EBRY_12
/example17/detector/addsensitivevolume EBRY_13
/example17/detector/addsensitivevolume EBRY_14
/example17/detector/addsensitivevolume EBRY_15
/example17/detector/addsensitivevolume EBRY_16
/example17/detector/addsensitivevolume EBRY_17

/example17/detector/sensitivegroup EBRY_01
/example17/detector/sensitivegroup EBRY_02
/example17/detector/sensitivegroup EBRY_03
/example17/detector/sensitivegroup EBRY_04
/example17/detector/sensitivegroup EBRY_05
/example17/detector/sensitivegroup EBRY_06
/example17/detector/sensitivegroup EBRY_07
/example17/detector/sensitivegroup EBRY_08
/example17/detector/sensitivegroup EBRY_09
/example17/detector/sensitivegroup EBRY_10
/example17/detector/sensitivegroup EBRY_11
/example17/detector/sensitivegroup EBRY_12
/example17/detector/sensitivegroup EBRY_13
/example17/detector/sensitivegroup EBRY_14
/example17/detector/sensitivegroup EBRY_15
/example17/detector/sensitivegroup EBRY_16
/example17/detector/sensitivegroup EBRY_17

/example17/detector/addsensitivevolume EATJ_01
/example17/detector/addsensitivevolume EATJ_02
/example17/detector/addsensitivevolume EATJ_03
/example17/detector/addsensitivevolume EATJ_04
/example17/detector/addsensitivevolume EATJ_05
/example17/detector/addsensitivevolume EATJ_06
/example17/detector/addsensitivevolume EATJ_07
/example17/detector/addsensitivevolume EATJ_08
/example17/detector/addsensitivevolume EATJ_09
/example17/detector/addsensitivevolume EATJ_10
/example17/detector/addsensitivevolume EATJ_11
/example17/detector/addsensitivevolume EATJ_12
/example17/detector/addsensitivevolume EATJ_13
/example17/detector/addsensitivevolume EATJ_14
/example17/detector/addsensitivevolume EATJ_15
/example17/detector/addsensitivevolume EATJ_16
/example17/detector/addsensitivevolume EATJ_17

/example17/detector/sensitivegroup EATJ

/example17/detector/addsensitivevolume EFRY

/example17/detector/sensitivegroup EFRY

## -----------------------------------------------------------------------------
## Optionally, set a constant magnetic filed:
## -----------------------------------------------------------------------------
/example17/detector/setField 0 0 0 tesla
#/example17/detector/setField 0 0 3.8 tesla

##
## -----------------------------------------------------------------------------
## Set the physics list (more exactly, the EM physics constructor):
## = 'HepEm' : the G4HepEm EM physics c.t.r.
## = 'G4Em' : the G4 EM physics c.t.r. that corresponds to G4HepEm
## = 'emstandard_opt0' : the original, G4 EM-Opt0 physics c.t.r.
## -----------------------------------------------------------------------------
##/testem/phys/addPhysics HepEm
##/testem/phys/addPhysics G4Em
##
## -----------------------------------------------------------------------------
## Set secondary production threshold, init. the run and set primary properties
## -----------------------------------------------------------------------------
/run/setCut 0.7 mm
/run/initialize

## Event verbosity: 1 = total edep, 2 = energy deposit per placed sensitive volume
/example17/event/verbose 2

/example17/gun/hepmc
/generator/hepmcAscii/maxevents 256
#/generator/hepmcAscii/firstevent 0
/generator/hepmcAscii/open ppttbar.hepmc3
/generator/hepmcAscii/verbose 0

##
## -----------------------------------------------------------------------------
## Run the simulation with the given number of events and print list of processes
## -----------------------------------------------------------------------------
##/tracking/verbose 1
##/process/list

#/example17/setSeed 1

# run events with parametrised simulation
# by default all created models are active
#/param/ActivateModel AdePT
#/analysis/setFileName example17_fastsim_100events.root
#/run/beamOn 128

/example17/setSeed 1

# run events with full (detailed) simulation
/param/InActivateModel AdePT
#/analysis/setFileName example17_fullsim_100events.root
/run/beamOn 128
Loading

0 comments on commit 12253c0

Please sign in to comment.