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

Fix setting of run/event number offsets from the ddsim command line. #1093

Merged
merged 2 commits into from Apr 21, 2023

Conversation

scott-snyder
Copy link
Contributor

@scott-snyder scott-snyder commented Apr 20, 2023

The ddsim --meta.runNumberOffset command-line argument doesn't work correctly (and similarly for event number).

On a machine running

LSB Version:    :core-4.1-amd64:core-4.1-ia32:core-4.1-noarch
Distributor ID: Scientific
Description:    Scientific Linux release 7.3 (Nitrogen)
Release:        7.3
Codename:       Nitrogen

I do

. /cvmfs/sw.hsf.org/key4hep/setup.sh

The then command

ddsim  --compactFile $LCGEO/FCCee/compact/FCCee_o1_v05/FCCee_o1_v05.xml -G -N10 --outputFile out.edm4hep.root --meta.runNumberOffset 735001  2>&1|tee log

eventually crashes with the error

Geant4UI         INFO  +++ EventAction> Install Geant4 control directory:/ddg4/EventAction/
Traceback (most recent call last):
  File "/cvmfs/sw.hsf.org/spackages7/dd4hep/1.23/x86_64-centos7-gcc11.2.0-opt/q4qtg/bin/ddsim", line 25, in <module>
    RUNNER.run()
  File "/cvmfs/sw.hsf.org/spackages7/dd4hep/1.23/x86_64-centos7-gcc11.2.0-opt/q4qtg/lib/python3.10/site-packages/DDSim/DD4hepSimulation.py", line 368, in run
    e4Out.RunNumberOffset = self.meta.runNumberOffset if self.meta.runNumberOffset > 0 else 0
TypeError: '>' not supported between instances of 'str' and 'int'
 *** Break *** segmentation violation

The arguments are never converted from strings to integers. The change here fixes this.

BEGINRELEASENOTES

  • ddsim: Fix handling of --meta.runNumberOffset and --meta.eventNumberOffset command-line switches.

ENDRELEASENOTES

The ddsim --meta.runNumberOffset command-line argument doesn't work
correctly (and similarly for event number).

On a machine running

```
LSB Version:    :core-4.1-amd64:core-4.1-ia32:core-4.1-noarch
Distributor ID: Scientific
Description:    Scientific Linux release 7.3 (Nitrogen)
Release:        7.3
Codename:       Nitrogen
```

I do

```
. /cvmfs/sw.hsf.org/key4hep/setup.sh
```

The then command

```
ddsim  --compactFile $LCGEO/FCCee/compact/FCCee_o1_v05/FCCee_o1_v05.xml -G -N10 --outputFile out.edm4hep.root --meta.runNumberOffset 735001  2>&1|tee log
```

eventually crashes with the error

```
Geant4UI         INFO  +++ EventAction> Install Geant4 control directory:/ddg4/EventAction/
Traceback (most recent call last):
  File "/cvmfs/sw.hsf.org/spackages7/dd4hep/1.23/x86_64-centos7-gcc11.2.0-opt/q4qtg/bin/ddsim", line 25, in <module>
    RUNNER.run()
  File "/cvmfs/sw.hsf.org/spackages7/dd4hep/1.23/x86_64-centos7-gcc11.2.0-opt/q4qtg/lib/python3.10/site-packages/DDSim/DD4hepSimulation.py", line 368, in run
    e4Out.RunNumberOffset = self.meta.runNumberOffset if self.meta.runNumberOffset > 0 else 0
TypeError: '>' not supported between instances of 'str' and 'int'
 *** Break *** segmentation violation
```

The arguments are never converted from strings to integers.
The change here fixes this.
Copy link
Member

@andresailer andresailer left a comment

Choose a reason for hiding this comment

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

Thanks!

@andresailer andresailer enabled auto-merge (rebase) April 21, 2023 08:15
DDSim,Meta: Fix formatting for dict
@andresailer andresailer merged commit 223a4ca into AIDASoft:master Apr 21, 2023
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants