eic / npsim

DD4hep-based simulation plugins, front-end, and related utilities
0 stars 2 forks source link

npdet_to_step cannot handle TGeoTessellation #21

Open wdconinc opened 7 months ago

wdconinc commented 7 months ago

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

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

  1. In eic-shell, with /opt/detector/setup.sh
  2. npdet_to_step part -l 4 HcalBarrel -o bhcal $DETECTOR_PATH/epic_bhcal.xml

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

Should export STEP file.

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

nightly> wdconinc@menelaos:~/git/npsim$ npdet_to_step part -l 4 HcalBarrel -o bhcal $DETECTOR_PATH/epic_bhcal.xml 
Error in cling::AutoLoadingVisitor::InsertIntoAutoLoadingState:
   Missing FileEntry for include/TGeoToStep.h
   requested to autoload type TGeoToStep
terminate called after throwing an instance of 'std::domain_error'
  what():  Unknown Shape
Aborted (core dumped)

Due to https://github.com/eic/npsim/blob/c3bde047048b2d62e00844daafeda10bb020fa3e/src/geocad/src/TGeoToOCC.cxx#L223.

Two step resolution:

  1. catch exception in https://github.com/eic/npsim/blob/c3bde047048b2d62e00844daafeda10bb020fa3e/src/geocad/src/TOCCToStep.cxx#L93 and/or https://github.com/eic/npsim/blob/c3bde047048b2d62e00844daafeda10bb020fa3e/src/geocad/src/TOCCToStep.cxx#L119 (depending on which one causes it), and just bypass trying to convert and include it,
  2. add support for conversion in https://github.com/eic/npsim/blob/c3bde047048b2d62e00844daafeda10bb020fa3e/src/geocad/src/TGeoToOCC.cxx#L130.