Q-Pix / qpixg4

4 stars 11 forks source link

Bugs found with develop branch in CVMFS #23

Open guigoruiz1 opened 9 months ago

guigoruiz1 commented 9 months ago
pushd /cvmfs/geant4.cern.ch/geant4/10.7.p04a/x86_64-centos7-gcc9-optdeb-MT/share/Geant4-10.7.4/geant4make/
source geant4make.sh
popd

Geant4 v4.11.1 is not backwards compatible and G4StrUtil will not work with v4.10.7.

guigoruiz1 commented 8 months ago

The first event always has a random extremely large number of hits and particles (~O(18)). The only way I could find to fix it was adding event.EventReset(); to EventAction::BeginOfEventAction

kkeefe commented 8 months ago

Can you point to, or proivde, the macro file that causes this issue?

guigoruiz1 commented 8 months ago
# set verbosity
/control/verbose 1
/run/verbose 1
/tracking/verbose 0

# output path
/inputs/output_file ./output/alpha.root

# initialize run
/run/initialize
/random/setSeeds 0 31

# limit radioactive decays
/process/had/rdm/nucleusLimits 1 35 1 17  # aMin aMax zMin zMax

# particle type
# e-, e+, mu-, mu+, neutron, proton, anti_proton, pi-, pi+, pi0, kaon-, kaon+,
# gamma, opticalphoton, ...
/gps/particle alpha

# point source
/gps/pos/type Point
/gps/pos/centre 115 475 150 cm

# angular distribution
# initial momentum in the -y direction
/gps/ang/type iso
/gps/ang/rot1 -1 0 0
/gps/ang/rot2 0 0 1
/gps/ang/mintheta 0 deg
/gps/ang/maxtheta 0 deg  # opening angle of cone

# energy distribution
/gps/ene/type Lin
/gps/ene/gradient 0
/gps/ene/intercept 5000
/gps/ene/max 50 MeV
/gps/ene/min 5 MeV

# run
/run/beamOn 5
kkeefe commented 8 months ago

I've not yet personally tested anything on geant4.11+, and right now all I get are seg faults regardless of what I try to run.. I've not personally paid too much attention to the qpixg4.

Maybe someone who actually knows (and cares about) geant4 can provide a better resolution.. @kelseymh ?

kelseymh commented 8 months ago

Hi, Kevin. It sounds like y'all probably really want to move forward to Geant4 11. We will need to do that ourselves at A&M (we don't have a Geant4 11.* module built here, which we will need in order to move forward).

Once we have that, then we can work on the migration. Geant4 introduced a very large number of breaking changes, which makes the migration difficult, and not reversible. So we will need locally to get our students in a position to migrate their own work (I think that should be easy), and also make sure that any other Q-Pix folks who are using qpixg4 are ready to move from G4 10.7 to G4 11.

Would you be able to take care of the second half of that? If the answer is "nobody is trying to build, or to edit code," that's great! If there are developers, then the question would be "when would be a convenient time for people to pause and migrate?"

                -- Mike Kelsey
guigoruiz1 commented 8 months ago

Unfortunately I have one more bug to add to the list. I am not sure whether it is a problem with Geant4 4.11 or the changes implemented in version 3.0.0, but I am unable to run simulations which use particle_type SUPERNOVA. The supernova class is initialised before the ConfigManager has the correct values from the macro.

Here is a macro for testing:

# set verbosity
/control/verbose 1
/run/verbose 1
/tracking/verbose 0

# configure supernova
/inputs/particle_type SUPERNOVA

# output path
/inputs/output_file ./output/radiogenic_Ar42_background.root

# initialize run
/run/initialize
/random/setSeeds 137 100

# event ID offset
/event/offset 0

# Supernova configs
/supernova/Event_Window 10 s
/supernova/Event_Cutoff 10 s

/supernova/N_Ar42_Decays 1

# run
/run/beamOn 10
kkeefe commented 8 months ago

Hi, Kevin. It sounds like y'all probably really want to move forward to Geant4 11. We will need to do that ourselves at A&M (we don't have a Geant4 11.* module built here, which we will need in order to move forward). Once we have that, then we can work on the migration. Geant4 introduced a very large number of breaking changes, which makes the migration difficult, and not reversible. So we will need locally to get our students in a position to migrate their own work (I think that should be easy), and also make sure that any other Q-Pix folks who are using qpixg4 are ready to move from G4 10.7 to G4 11. Would you be able to take care of the second half of that? If the answer is "nobody is trying to build, or to edit code," that's great! If there are developers, then the question would be "when would be a convenient time for people to pause and migrate?" -- Mike Kelsey

There might be a couple developers on the manchester side, but I am not sure. I pinged them today, and am waiting to hear back.

However, I'm fairly certain they're also cvfms users, and as such likely also want geant4.11* to be stable/supported.

kelseymh commented 8 months ago

Hi, Guilherme! Could you please report the Supernova problem as a separate GitHub issue? It's much easier to track and fix problems, define branches and tags, if there's one item per ticket.

                -- Mike
Eikenbcr commented 8 months ago

@kelseymh I'll work on getting G4 11 setup on the A&M computers (foss/2022b).

kelseymh commented 8 months ago

@guigoruiz1 wrote:

The first event always has a random extremely large number of hits and particles (~O(18)). The only way I could find to fix it was adding event.EventReset(); to EventAction::BeginOfEventAction

This sounds like the event constructor does not include all of the initializers (or simpler, a call to EventReset() in the ctor body) required to ensure that the data members aren't randomly populated.