Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Robust surface matching for Geant4 #3169

Conversation

asalzburger
Copy link
Contributor

@asalzburger asalzburger commented May 2, 2024

This PR fixes:

#3165

It first creates a std::multimap that relates the G4VPhysVolume to the possible Acts::Surface objects (there can be more due to the replica mechanism).

In the Stepping action, the right one will then be picked.

The output performance change in geant_hits is expected.

Digitisation configuration file:
odd-digi-geometric-config.json

Example how to run full simulation with this:

python <path_to_your_acts_source_dir>Examples/Scripts/Python/sim_digi_odd.py --digi-config odd-digi-geometric-config.json --geant4 --gun-multiplicity 10 --gun-pt-range 100 100 -n100 -o g4_mu_100GeV_m10

Options are:

usage: sim_digi_odd.py [-h] [--output OUTPUT] [--events EVENTS] [--skip SKIP] [--edm4hep EDM4HEP] [--geant4] [--ttbar] [--ttbar-pu TTBAR_PU] [--gun-multiplicity GUN_MULTIPLICITY] [--gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]] [--gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]] [--rnd-seed RND_SEED]
                       [--digi-config DIGI_CONFIG]

Sim-digi chain with the OpenDataDetector

options:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output directory
  --events EVENTS, -n EVENTS
                        Number of events
  --skip SKIP, -s SKIP  Number of events
  --edm4hep EDM4HEP     Use edm4hep inputs
  --geant4              Use Geant4 instead of fatras
  --ttbar               Use Pythia8 (ttbar, pile-up 200) instead of particle gun
  --ttbar-pu TTBAR_PU   Number of pile-up events for ttbar
  --gun-multiplicity GUN_MULTIPLICITY
                        Multiplicity of the particle gun
  --gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]
                        Eta range of the particle gun
  --gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]
                        Pt range of the particle gun (GeV)
  --rnd-seed RND_SEED   Random seed
  --digi-config DIGI_CONFIG
                        Digitization configuration file

@asalzburger asalzburger added this to the next milestone May 2, 2024
@asalzburger asalzburger requested a review from andiwand May 2, 2024 10:24
@github-actions github-actions bot added the Component - Examples Affects the Examples module label May 2, 2024
@andiwand andiwand changed the title feat: new robust matching to Acts::Surfaces feat: Robust surface matching for Geant4 May 2, 2024
andiwand
andiwand previously approved these changes May 2, 2024
Copy link
Contributor

@andiwand andiwand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of suggestions not thing critical

I would like to try see if G4VPVParameterisation can be used for ID together with the volume after this is in.

@asalzburger asalzburger requested a review from andiwand May 2, 2024 11:42
@kodiakhq kodiakhq bot merged commit 58a036b into acts-project:main May 2, 2024
56 checks passed
@github-actions github-actions bot removed the automerge label May 2, 2024
@krasznaa
Copy link
Member

krasznaa commented May 3, 2024

🤔 I ran a set of simulations with this latest version of the code this morning. It seems to mostly work... But there are some worrisome things that I observed.

First off, I ran 25 simulation jobs with the following:

# Run all the muon simulations.
for NMUON in 1 5 10 50 100
do
    for PT in 1 5 10 50 100
    do
	python3 "${ACTS_DIR}/Examples/Scripts/Python/sim_digi_odd.py" \
		--digi-config odd-digi-geometric-config.json \
		--geant4 \
		--gun-multiplicity ${NMUON} \
		--gun-pt-range ${PT} ${PT} \
		--events 100 \
		--output geant4_${NMUON}muon_${PT}GeV 2>&1 | \
	    tee geant4_${NMUON}muon_${PT}GeV.log
    done
done

(This is part of a script that I'll share in the PR collecting the new files into traccc.)

Most of these simulations went through without a visible issue. But some of them produced some humongous log files. 🤔

[bash][celeborn]:acts > ls -lhS geant4_*.log
-rw-r--r-- 1 root root  32M May  3 11:17 geant4_100muon_100GeV.log
-rw-r--r-- 1 root root  28M May  3 11:00 geant4_5muon_100GeV.log
-rw-r--r-- 1 root root  25M May  3 11:08 geant4_50muon_100GeV.log
-rw-r--r-- 1 root root 8.9M May  3 11:06 geant4_50muon_50GeV.log
-rw-r--r-- 1 root root 271K May  3 11:12 geant4_100muon_10GeV.log
-rw-r--r-- 1 root root 271K May  3 11:02 geant4_10muon_100GeV.log
-rw-r--r-- 1 root root 271K May  3 11:09 geant4_100muon_1GeV.log
-rw-r--r-- 1 root root 271K May  3 11:11 geant4_100muon_5GeV.log
-rw-r--r-- 1 root root 271K May  3 11:01 geant4_10muon_10GeV.log
-rw-r--r-- 1 root root 271K May  3 11:02 geant4_10muon_50GeV.log
-rw-r--r-- 1 root root 271K May  3 10:58 geant4_1muon_100GeV.log
-rw-r--r-- 1 root root 271K May  3 11:05 geant4_50muon_10GeV.log
-rw-r--r-- 1 root root 271K May  3 11:14 geant4_100muon_50GeV.log
-rw-r--r-- 1 root root 271K May  3 11:01 geant4_10muon_1GeV.log
-rw-r--r-- 1 root root 271K May  3 11:01 geant4_10muon_5GeV.log
-rw-r--r-- 1 root root 271K May  3 10:58 geant4_1muon_10GeV.log
-rw-r--r-- 1 root root 271K May  3 10:58 geant4_1muon_50GeV.log
-rw-r--r-- 1 root root 271K May  3 11:03 geant4_50muon_1GeV.log
-rw-r--r-- 1 root root 271K May  3 11:04 geant4_50muon_5GeV.log
-rw-r--r-- 1 root root 271K May  3 10:59 geant4_5muon_10GeV.log
-rw-r--r-- 1 root root 271K May  3 11:00 geant4_5muon_50GeV.log
-rw-r--r-- 1 root root 271K May  3 10:57 geant4_1muon_1GeV.log
-rw-r--r-- 1 root root 271K May  3 10:58 geant4_1muon_5GeV.log
-rw-r--r-- 1 root root 271K May  3 10:59 geant4_5muon_1GeV.log
-rw-r--r-- 1 root root 271K May  3 10:59 geant4_5muon_5GeV.log
[bash][celeborn]:acts >

With the large sizes coming from a lot of warnings like:

09:15:25    Geant4Partic   WARNING   Particle ID for track ID 361043 not registered. Skip
09:15:25    Geant4Partic   WARNING   Particle ID for track ID 361044 not registered. Skip
09:15:25    Geant4Partic   WARNING   Particle ID for track ID 361045 not registered. Skip
09:15:25    Geant4Partic   WARNING   Particle ID collision with 33|0|1|12|145 detected for initial particles. Skip particle
09:15:25    Geant4Partic   WARNING   Particle ID for track ID 361042 not registered. Skip

Should I be worried about all those warnings?

EleniXoch pushed a commit to EleniXoch/acts that referenced this pull request May 6, 2024
This PR fixes:

acts-project#3165

It first creates a `std::multimap`  that relates the `G4VPhysVolume` to the possible `Acts::Surface` objects (there can be more due to the replica mechanism).

In the Stepping action, the right one will then be picked.

The output performance change in geant_hits is expected.

Digitisation configuration file:
[odd-digi-geometric-config.json](https://github.com/acts-project/acts/files/15188041/odd-digi-geometric-config.json)

Example how to run full simulation with this:
```sh
python <path_to_your_acts_source_dir>Examples/Scripts/Python/sim_digi_odd.py --digi-config odd-digi-geometric-config.json --geant4 --gun-multiplicity 10 --gun-pt-range 100 100 -n100 -o g4_mu_100GeV_m10
```

Options are:
```sh
usage: sim_digi_odd.py [-h] [--output OUTPUT] [--events EVENTS] [--skip SKIP] [--edm4hep EDM4HEP] [--geant4] [--ttbar] [--ttbar-pu TTBAR_PU] [--gun-multiplicity GUN_MULTIPLICITY] [--gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]] [--gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]] [--rnd-seed RND_SEED]
                       [--digi-config DIGI_CONFIG]

Sim-digi chain with the OpenDataDetector

options:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output directory
  --events EVENTS, -n EVENTS
                        Number of events
  --skip SKIP, -s SKIP  Number of events
  --edm4hep EDM4HEP     Use edm4hep inputs
  --geant4              Use Geant4 instead of fatras
  --ttbar               Use Pythia8 (ttbar, pile-up 200) instead of particle gun
  --ttbar-pu TTBAR_PU   Number of pile-up events for ttbar
  --gun-multiplicity GUN_MULTIPLICITY
                        Multiplicity of the particle gun
  --gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]
                        Eta range of the particle gun
  --gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]
                        Pt range of the particle gun (GeV)
  --rnd-seed RND_SEED   Random seed
  --digi-config DIGI_CONFIG
                        Digitization configuration file
```
@andiwand andiwand removed this from the next milestone May 17, 2024
@andiwand andiwand added this to the v35.0.0 milestone May 17, 2024
asalzburger added a commit to asalzburger/acts that referenced this pull request May 21, 2024
This PR fixes:

acts-project#3165

It first creates a `std::multimap`  that relates the `G4VPhysVolume` to the possible `Acts::Surface` objects (there can be more due to the replica mechanism).

In the Stepping action, the right one will then be picked.

The output performance change in geant_hits is expected.

Digitisation configuration file:
[odd-digi-geometric-config.json](https://github.com/acts-project/acts/files/15188041/odd-digi-geometric-config.json)

Example how to run full simulation with this:
```sh
python <path_to_your_acts_source_dir>Examples/Scripts/Python/sim_digi_odd.py --digi-config odd-digi-geometric-config.json --geant4 --gun-multiplicity 10 --gun-pt-range 100 100 -n100 -o g4_mu_100GeV_m10
```

Options are:
```sh
usage: sim_digi_odd.py [-h] [--output OUTPUT] [--events EVENTS] [--skip SKIP] [--edm4hep EDM4HEP] [--geant4] [--ttbar] [--ttbar-pu TTBAR_PU] [--gun-multiplicity GUN_MULTIPLICITY] [--gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]] [--gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]] [--rnd-seed RND_SEED]
                       [--digi-config DIGI_CONFIG]

Sim-digi chain with the OpenDataDetector

options:
  -h, --help            show this help message and exit
  --output OUTPUT, -o OUTPUT
                        Output directory
  --events EVENTS, -n EVENTS
                        Number of events
  --skip SKIP, -s SKIP  Number of events
  --edm4hep EDM4HEP     Use edm4hep inputs
  --geant4              Use Geant4 instead of fatras
  --ttbar               Use Pythia8 (ttbar, pile-up 200) instead of particle gun
  --ttbar-pu TTBAR_PU   Number of pile-up events for ttbar
  --gun-multiplicity GUN_MULTIPLICITY
                        Multiplicity of the particle gun
  --gun-eta-range GUN_ETA_RANGE [GUN_ETA_RANGE ...]
                        Eta range of the particle gun
  --gun-pt-range GUN_PT_RANGE [GUN_PT_RANGE ...]
                        Pt range of the particle gun (GeV)
  --rnd-seed RND_SEED   Random seed
  --digi-config DIGI_CONFIG
                        Digitization configuration file
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants