AIDASoft / DD4hep

Detector Description Toolkit for High Energy Physics
http://dd4hep.cern.ch
GNU Lesser General Public License v3.0
49 stars 95 forks source link

ddsim: support non-cylindrical tracking region #1302

Closed Zehvogel closed 1 month ago

Zehvogel commented 1 month ago

I would like to have a non-cylindrical tracking region as introduced in https://github.com/AIDASoft/DD4hep/pull/384, particularly because in the naive cylindrical approach the lumi cal of my detector is inside the tracking volume.

When I add such a tracking region to my detector and remove the previous definition of the tracking region:

        <constant name="tracker_region_zmax" value="OuterTracker_half_length"/>
        <constant name="tracker_region_rmax" value="OuterTracker_outer_radius"/>

ddsim stops here:

https://github.com/AIDASoft/DD4hep/blob/7967bdfc64246f4d698616a9469e46ffbdad49c4/DDG4/python/DDSim/Helper/ParticleHandler.py#L129-L139

(If I don't remove it the cylinder is still used as the tracking region as far as I can tell.)

The TrackingRegion example in the examples/ClientTests seems to not use ddsim: https://github.com/AIDASoft/DD4hep/blob/master/examples/ClientTests/scripts/TrackingRegion.py

andresailer commented 1 month ago

I think one would need to implement a Geant4TVUserParticleHandler, where TV is for tracking_volume? (Or TR for tracking region?). Maybe I missed the use of the tracking_volume?

Zehvogel commented 1 month ago

Aaah ok, the TC in Geant4TCUserParticleHandler stands for tracking cylinder... so there is no way yet to use this feature?

andresailer commented 1 month ago

As far as I saw there isn't one yet. Do you want to give it a go to implement the new handler?

Zehvogel commented 1 month ago

In principle that looks simple. I just don't know how I would retrieve that volume in ParticleHandler.py to pass it to the handler... and I don't really know where to look to figure that out in this interesting c++ and python mixture :(

Zehvogel commented 1 month ago

nvm. I think I found a way :) I will prepare a PR