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

npsim does not run correctly with steering files #8

Open
c-dilks opened this issue May 16, 2023 · 0 comments
Open

npsim does not run correctly with steering files #8

c-dilks opened this issue May 16, 2023 · 0 comments

Comments

@c-dilks
Copy link
Member

c-dilks commented May 16, 2023

Environment: (where does this bug occur, have you tried other environments)

  • Which branch (often main for latest released): main
  • Which version (or HEAD for the most recent on git): 1.1.0

Steps to reproduce: (give a step by step account of how to trigger the bug)

1. Compare the following two npsim calls:

(a) Using CLI options directly:
npsim \
  --runType        batch                                              \
  --compactFile    ${DETECTOR_PATH}/${DETECTOR_CONFIG}_drich_only.xml \
  --outputFile     sim.edm4hep.root                                   \
  --enableGun                                                         \
  --numberOfEvents 10                                                 \
  --gun.particle   "pi+"                                              \
  --gun.energy     "20.0*GeV"                                         \
  --gun.direction  "(0.399, 0.0, 0.917)"
(b) Using a steering file:

Steering file steer.py:

from DDSim.DD4hepSimulation import DD4hepSimulation
from g4units import GeV

SIM = DD4hepSimulation()
SIM.enableGun      = True
SIM.numberOfEvents = 10
SIM.gun.particle   = "pi+"
SIM.gun.energy     = 20.0*GeV
SIM.gun.direction  = (0.399, 0.0, 0.917)

with npsim call:

npsim \
  --runType        batch                                              \
  --compactFile    ${DETECTOR_PATH}/${DETECTOR_CONFIG}_drich_only.xml \
  --outputFile     sim.edm4hep.root                                   \
  --steeringFile   steer.py

2. Check the output, e.g.:

root -l sim.edm4hep.root -e 'events->Draw("DRICHHits.position.y:DRICHHits.position.x")'

Expected Result: (what do you expect when you execute the steps above)

Both 1(a) and 1(b) produce the same results, and plotting with step 2 returns:
c1

Actual Result: (what do you get when you execute the steps above)

Running with 1(b) returns no DRICHHits and the plot is therefore empty. This is also happens when running with ddsim as opposed to npsim, since ddsim does not have the additional settings required for RICH detectors.

Additional Context

The diff of output from 1(a) to 1(b) has some clues (irrelevant differences removed):

50c50
< DDSim.Helper.Filter INFO ReqFilt {'edep0', 'opticalphotons'}
---
> DDSim.Helper.Filter INFO ReqFilt {'edep1kev', 'edep0'}

53d52
< DDSim            INFO        replace default action with : Geant4OpticalTrackerAction

56c55
< DDSim.Helper.Filter INFO Adding filter 'opticalphotons' matched with 'DRICH' to sensitive detector for 'DRICH' 
---
> DDSim.Helper.Filter INFO Adding default filter 'edep1kev' to sensitive detector for 'DRICH' 

65,66d63
< Geant4UI         INFO  +++ CerenkovPhys> Install Geant4 control directory:/ddg4/CerenkovPhys/
< Geant4UI         INFO  +++ OpticalGammaPhys> Install Geant4 control directory:/ddg4/OpticalGammaPhys/

105,107d101
< CerenkovPhys     INFO  +++ Constructing: maxNumPhotonsPerStep:10 maxBeta:10.000000 track secondaries:NO  stack photons:YES track secondaries:NO 
< OpticalGammaPhys INFO  +++ Constructing optical_photon processes:
< OpticalGammaPhys INFO  +++              G4OpAbsorption G4OpRayleigh G4OpMieHG G4OpBoundaryProcess
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

No branches or pull requests

1 participant