Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ it in future.
* Bump minimum ROOT version to 6.36
* Bump minimum CMake version to 3.20 (same as ROOT)
* Change naming convention for simulation files to `{sim,geo,params}_{uuid4}.root`, with optional `--tag` parameter to specify custom identifier
* Use g4Config.yaml instead of deprecated .C macro for Geant4 VMC configuration

### Fixed

Expand Down Expand Up @@ -82,6 +83,10 @@ it in future.
- The geometry configuration and detector setup (`geometry/geometry_config.py`, `python/shipDet_conf.py`) have been updated to instantiate all requested SND detectors.
- This enables running with multiple SND subdetectors simultaneously and is future-proof for additional SND designs.
* Added the hole for SND in the Muon Shield, that is created automatically if SND key is enabled (works so far for SND_design == 2)
* Added YAML configuration files for Geant4 VMC setup (`g4Config.yaml`, `g4Config_basic.yaml`) to replace deprecated C macros
- Includes physics lists, Monte Carlo processes/cuts, and Geant4 macro commands
- Maintains full compatibility with original C configuration functionality
* Add SHiP::VMCConfig class to setup VMC from the YAML configuration

#### Geometry and Target Station

Expand Down Expand Up @@ -393,7 +398,9 @@ it in future.
* Remove reloading of the `geometry_config.py` in `shipDet_conf.py`
* Removed unused run_simPgun.py
* Remove TTCluster.py
* Removed deprecated Geant4 VMC configuration files (`g4Config.C`, `g4Config_basic.C`, `g4config.in`, `g4config_basic.in`)
* Remove pid class
* Remove GCUTS (replaced by CUTGAM in Geant4)

#### Build System

Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ include(ShipMacros)
find_package2(PUBLIC Pythia8 REQUIRED)
find_package2(PUBLIC EvtGen REQUIRED)
# (GENERATORS REQUIRED)
find_package2(PUBLIC GEANT4)
# FairRoot::MCConfigurator has transitive dependencies on Geant4 CMake targets
# (via FairRoot::FastSim -> Geant4::G4processes), so Geant4 must be found first.
find_package2(PUBLIC GEANT4 REQUIRED)
find_package2(PUBLIC GEANT4DATA)
find_package2(PUBLIC GEANT4VMC)
find_package2(PUBLIC HEPMC)
Expand Down
61 changes: 0 additions & 61 deletions gconfig/g4Config.C

This file was deleted.

45 changes: 45 additions & 0 deletions gconfig/g4Config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Geant4_UserGeometry: "geomRoot"
Geant4_PhysicsList: "FTFP_BERT_HP_EMZ"
Geant4_SpecialProcess: "stepLimiter+specialCuts+specialControls"
Geant4_SpecialStacking: false
Geant4_Multithreaded: false

#Geant4_MaxNStep: 10000 #default is 30000
Geant4_Commands:
- /mcVerbose/all 0
- /mcTracking/loopVerbose 0
- /mcPhysics/g4HadronicProcessStoreVerbose 0
- /physics_lists/em/PositronToMuons true
- /physics_lists/em/GammaToMuons true
- /process/em/UseGeneralProcess false
- /process/em/verbose 0
- /process/eLoss/verbose 0
- /mcDet/setIsLocalMagField true
- /mcPhysics/setExtDecayerSelection J/psi

MonteCarlo_Process:
PAIR: 1 #pair production
COMP: 1 #Compton scattering
PHOT: 1 #photo electric effect
PFIS: 0 #photofission
DRAY: 1 #delta-ray
ANNI: 1 #annihilation
BREM: 1 #bremsstrahlung
HADR: 1 #hadronic process
MUNU: 1 #muon nuclear interaction
DCAY: 1 #decay
LOSS: 1 #energy loss
MULS: 1 #multiple scattering

MonteCarlo_Cut:
CUTGAM: 1.0E-3 #gammas (GeV)
CUTELE: 1.0E-3 #electrons (GeV)
CUTNEU: 1.0E-3 #neutral hadrons (GeV)
CUTHAD: 1.0E-3 #charged hadrons (GeV)
CUTMUO: 1.0E-3 #muons (GeV)
BCUTE: 1.0E-3 #electron bremsstrahlung (GeV)
BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV)
DCUTE: 1.0E-3 #electron delta-rays (GeV)
DCUTM: 1.0E-3 #muon and hadron delta-rays (GeV)
PPCUTM: 1.0E-3 #direct pair production by muons (GeV)
TOFMAX: 1.E10 #time of flight cut (s)
60 changes: 0 additions & 60 deletions gconfig/g4Config_basic.C

This file was deleted.

41 changes: 41 additions & 0 deletions gconfig/g4Config_basic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Geant4_UserGeometry: "geomRoot"
Geant4_PhysicsList: "emStandard"
Geant4_SpecialProcess: ""
Geant4_SpecialStacking: false
Geant4_Multithreaded: false

#Geant4_MaxNStep: 10000 #default is 30000
Geant4_Commands:
- /mcVerbose/all 0
- /mcTracking/loopVerbose 0
- /mcPhysics/g4HadronicProcessStoreVerbose 0
- /process/em/verbose 0
- /process/eLoss/verbose 0
- /mcDet/setIsLocalMagField true

MonteCarlo_Process:
PAIR: 1 #pair production
COMP: 1 #Compton scattering
PHOT: 1 #photo electric effect
PFIS: 0 #photofission
DRAY: 1 #delta-ray
ANNI: 1 #annihilation
BREM: 1 #bremsstrahlung
HADR: 1 #hadronic process
MUNU: 1 #muon nuclear interaction
DCAY: 1 #decay
LOSS: 1 #energy loss
MULS: 1 #multiple scattering

MonteCarlo_Cut:
CUTGAM: 1.0E-3 #gammas (GeV)
CUTELE: 1.0E-3 #electrons (GeV)
CUTNEU: 1.0E-3 #neutral hadrons (GeV)
CUTHAD: 1.0E-3 #charged hadrons (GeV)
CUTMUO: 1.0E-3 #muons (GeV)
BCUTE: 1.0E-3 #electron bremsstrahlung (GeV)
BCUTM: 1.0E-3 #muon and hadron bremsstrahlung (GeV)
DCUTE: 1.0E-3 #electron delta-rays (GeV)
DCUTM: 1.0E-3 #muon and hadron delta-rays (GeV)
PPCUTM: 1.0E-3 #direct pair production by muons (GeV)
TOFMAX: 1.E10 #time of flight cut (s)
39 changes: 0 additions & 39 deletions gconfig/g4config.in

This file was deleted.

28 changes: 0 additions & 28 deletions gconfig/g4config_basic.in

This file was deleted.

5 changes: 4 additions & 1 deletion macro/ShipAna.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@
run = ROOT.FairRunSim()
run.SetName("TGeant4") # Transport engine
run.SetSink(ROOT.FairRootFileSink(ROOT.TMemFile("output", "recreate"))) # Dummy output file
run.SetUserConfig("g4Config_basic.C") # geant4 transport not used, only needed for the mag field
# geant4 transport not used, only needed for the mag field
ROOT.gInterpreter.ProcessLine(
'FairRunSim::Instance()->SetSimulationConfig(std::make_unique<SHiP::VMCConfig>("g4Config", "g4Config_basic.yaml"));'
)
rtdb = run.GetRuntimeDb()
# -----Create geometry----------------------------------------------
modules = shipDet_conf.configure(run, ShipGeo)
Expand Down
4 changes: 3 additions & 1 deletion macro/ShipReco.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ def mem_monitor():
run = ROOT.FairRunSim()
run.SetName("TGeant4") # Transport engine
run.SetSink(ROOT.FairRootFileSink(ROOT.TMemFile("output", "recreate"))) # Dummy output file
run.SetUserConfig("g4Config_basic.C") # geant4 transport not used, only needed for creating VMC field
ROOT.gInterpreter.ProcessLine(
'FairRunSim::Instance()->SetSimulationConfig(std::make_unique<SHiP::VMCConfig>("g4Config", "g4Config_basic.yaml"));'
) # geant4 transport not used, only needed for creating VMC field
rtdb = run.GetRuntimeDb()
# -----Create geometry----------------------------------------------
modules = shipDet_conf.configure(run, ShipGeo)
Expand Down
7 changes: 5 additions & 2 deletions macro/create_field_perturbation.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ def create_csv_field_map(options):
run = r.FairRunSim()
run.SetName("TGeant4") # Transport engine
run.SetSink(r.FairRootFileSink("tmp_file")) # Output file
# user configuration file default g4Config.C
run.SetUserConfig("g4Config.C")
# Use SHiP::VMCConfig for YAML configuration
r.gInterpreter.ProcessLine(
'FairRunSim::Instance()->SetSimulationConfig(std::make_unique<SHiP::VMCConfig>("g4Config", "g4Config.yaml"));'
)
shipDet_conf.configure(run, ship_geo)
primGen = r.FairPrimaryGenerator()
primGen.SetTarget(ship_geo.target.z0 + 70.845 * u.m, 0.0)
#
run.SetGenerator(primGen)
run.SetStoreTraj(r.kFALSE)
# ShipStack is now automatically created by SHiP::VMCConfig
run.Init()
fieldMaker = geomGeant4.addVMCFields(ship_geo, "", True)

Expand Down
6 changes: 5 additions & 1 deletion macro/inspectGeant4Geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@
run = ROOT.FairRunSim()
ShipGeo = load_from_root_file(fgeo, "ShipGeo")
modules = shipDet_conf.configure(run, ShipGeo)
run.SetUserConfig("g4Config.C")
# Use SHiP::VMCConfig for YAML configuration
ROOT.gInterpreter.ProcessLine(
'FairRunSim::Instance()->SetSimulationConfig(std::make_unique<SHiP::VMCConfig>("g4Config", "g4Config.yaml"));'
)
run.SetName("TGeant4")
run.SetSink(ROOT.FairRootFileSink(ROOT.TMemFile("output", "recreate")))
# ShipStack is now automatically created by SHiP::VMCConfig
run.Init()
run.Run(0)
import geomGeant4
Expand Down
4 changes: 3 additions & 1 deletion macro/run_fixedTarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ def get_work_dir(run_number, tag=None):
run = ROOT.FairRunSim()
run.SetName(mcEngine) # Transport engine
run.SetSink(ROOT.FairRootFileSink(outFile)) # Output file
run.SetUserConfig("g4Config.C") # user configuration file default g4Config.C
# Use SHiP::VMCConfig for YAML configuration
run.SetSimulationConfig(ROOT.std.make_unique[ROOT.SHiP.VMCConfig]("g4Config", "g4Config.yaml"))
rtdb = run.GetRuntimeDb()

# -----Materials----------------------------------------------
Expand Down Expand Up @@ -385,6 +386,7 @@ def get_work_dir(run_number, tag=None):
run.SetGenerator(primGen)

# -----Initialize simulation run------------------------------------
# ShipStack is now automatically created by SHiP::VMCConfig
run.Init()

gMC = ROOT.TVirtualMC.GetMC()
Expand Down
Loading
Loading