next-exp / nexus

Geant4 simulation framework of the NEXT Collaboration
5 stars 55 forks source link

Polygon sampler #249

Closed kvjmistry closed 4 months ago

kvjmistry commented 6 months ago

This PR adds the option of generating events in a polygon with n sides. This is useful for generating in geometries such as the light tube. As an example I have used this generator as the default in DEMO.

The plots below show generation of Kr83 events in the INSIDE (gas), VOLUME (in the teflon) and INNER_SURF (on teflon surface)

image image image

I mark as draft as I don't think the translations or rotations are working and needs speed benchmarking.

paolafer commented 6 months ago

Does this class replace also HexagonPointSampler? I think we can remove the class in that case. It is only used in Next1EL with two regions, ACTIVE and RESTRICTED. The first region should be covered by your new sampler, and the second one is just a particular case of the first one, I think. At any rate, it is an obsolete class and we can remove the RESTRICTED region, if needed.

kvjmistry commented 6 months ago

The speed improvement is not that different than what is currently done in NEXT-100. So, I will leave that as it is (the volume checker in NEXT-100 code ensures the right region is sampled anyway). Removed the hexagon point sampler in place of this code. Ready for review!