star-bnl / star-sw

Core software for STAR experiment
26 stars 63 forks source link

Import geant4maker. #659

Open klendathu2k opened 2 months ago

klendathu2k commented 2 months ago

Draft PR for geant4star. Supersedes #617.

Branch was rebased against current main (02/21/24). Plus few additional fixes to get it to run (up to loading G3) in the current environment.

NOTE: The code should be functional, but requires two modules which we don't currently have in spack, plus an update to a newer version of the geant4 library. Specifically, we need to add a GEANT3 VMC library, and update the Geant 4 VMC library to one which supports multi-engine simulations.

These versions have been tested together by the VMC team.

I should also mention that we are at a point of divergence in the ROOT / VMC development. Currently we are using the VMC version 1.1, which is built with ROOT. The next version is 2.0, which is shipped separately. The GEANT3 VMC 3.9p1 release includes fixes to sensitive volumes which we require, and is the last version able to run with VMC 1.1. Any move to a new version of ROOT, VMC and/or Geant (either G3 or G4) likely entails advancing to a new version of all of these packages... with the possible exception of ROOT.

geant4star

Code compiles against root 6.24 in our production environment... with the following additional modules.

setup 64bits starver SL23x config/v0.3.0-rhel7-root6.24.06 module load geant4-10.4.0 module load geant4-data-10.4.0 module load geant4-vmc-4-0-p3-root-6.24.06 module load clhep-2.4.5.1
setenv STAR . cons

Some additional comments.

StGeant4Maker should be excluded from all ROOT5 builds. StGeant4Maker should probably be excluded from 32 bit builds.

klendathu2k commented 2 months ago

does this mean we did not have btof and eemc in AgML format before? (I though we did)

I assume you are referring to the "volume ID" classes? No. These are new classes to support the geant4star application.

plexoos commented 1 month ago

If you have a chance please try to build with this dependencies

module load geant4-vmc-5-0-p5-root-6.24.06 geant4-10.5.1 geant3-3-8-root-6.24.06

Geant3-3-9-p1 is currently missing from the spack repo so, I'll need to add it

klendathu2k commented 1 month ago

Hi Dmitri,

Will do. The changes in Geant3-3-9-p1 are w/ respect to sensitive detector functionality, not interface, so building against it will at least allow me to test a pure G4 simulation.

Thanks, Jason

On 2024-03-06 09:28, Dmitri Smirnov wrote:

If you have a chance please try to build with this dependencies

module load geant4-vmc-5-0-p5-root-6.24.06 geant4-10.5.1 geant3-3-8-root-6.24.06

Geant3-3-9-p1 is currently missing from the spack repo so, I'll need to add it

-- Reply to this email directly, view it on GitHub [1], or unsubscribe [2]. You are receiving this because you authored the thread.Message ID: @.***>

Links:

[1] https://github.com/star-bnl/star-sw/pull/659#issuecomment-1980993430 [2] https://github.com/notifications/unsubscribe-auth/ANL4LVED3RAU7JXGIH4UKPDYW4RXBAVCNFSM6AAAAABDTP5ZLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQHE4TGNBTGA

plexoos commented 1 month ago

geant3@3-9-p1 is also available on the SDCC machines now. So, the following modules can be used for testing:

module load geant4-vmc-5-0-p5-root-6.24.06 geant4-10.5.1 geant3-3-9-p1-root-6.24.06
klendathu2k commented 1 month ago

With the last three pushes, code compiles and runs the TPC to completion. Albeit with no hits generated. Reason TBC.

klendathu2k commented 1 month ago

Short answer is no. G4 does not need G3 to compile or run.

Long answer... the G3 to G4 library provides support for exporting G3 geometry objects (materials, media, volumes, ...) to G4 geometry objects. Also ROOT geometries. VMC applications that use ROOT geometries for track navigation still need to export their material and tracking media to G4 for physics simulation.

On 2024-03-12 20:37, Gene Van Buren wrote:

@genevb commented on this pull request.

In StRoot/StBFChain/BigFullChain.h [1]:

@@ -1294,8 +1302,8 @@ Bfc_st BFC[] = { // standard chains {"g4geant3", "", "", "", "", "libG3toG4.so", "Load g3 to g4 support", false }, {"geant4", "", "", "g4physics,g4interfaces","","","Load G4 libs", false},

  • {"geant4vmc", "","", "geant4", "", "libVMC.so,libgeant4vmc.so", "Load G4 VMC libs", false},
  • {"geant4mk", "","", "stargen,geant4vmc", "", "StGeant4Maker.so,StarMagField.so", "Load G4 VMC libs", false},
  • {"geant4vmc", "","", "geant4", "", libVMC ",libgeant4vmc.so", "Load G4 VMC libs", false},
  • {"geant4mk", "","", "stargen,geant4vmc,geant3vmc", "", "StGeant4Maker.so,StarMagField.so", "Load G4 VMC libs", false},

Geant4 needs Geant3? Just making sure this wasn't a mistake.

-- Reply to this email directly, view it on GitHub [2], or unsubscribe [3]. You are receiving this because you authored the thread.Message ID: @.***>

Links:

[1] https://github.com/star-bnl/star-sw/pull/659#discussion_r1522311684 [2] https://github.com/star-bnl/star-sw/pull/659#pullrequestreview-1932975768 [3] https://github.com/notifications/unsubscribe-auth/ANL4LVAPKQEVTJBUK5JYYITYX6NUFAVCNFSM6AAAAABDTP5ZLOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTSMZSHE3TKNZWHA