Problem in the simulation of single particle using SingleGen_module
I was trying to simulate single particle in the ICARUS detector starting from the singles.fcl file. In particular I want to simulate particles with a gaussian energy distribution and also with an gaussian angular distribution. For this reason I set the fcl parameters PDist and AngleDist to 1. But at the end I found that the produced distributions result to be flat.
Looking to the SingleGen_module.cc file, I understand that the problem is related to the lines 240-241: since I'm not using an histogram file fThetaXzYzHist.size() and fPHist.size() are equal to 0 and so fAngleDist and fPDist are set to 0 even if, at the beginning, they are set to 1, preventing the possibility to have a gaussian distribution...
For the moment (following the suggestions from Gianluca) I resolve the problem introducing in the fcl file the definition of the PHist and ThetaXzYzHist variables, even if they are not needed since I'm not using these histogram files..
Can this issue be fixed in some way, without the use of additional (not needed) parameters?
Thanks for the help!
#2 Updated by Gianluca Petrillo about 3 years ago
- Category set to Simulation
- Status changed from Assigned to Work in progress
- % Done changed from 0 to 90
A new version of
SingleGen producer is in branch feature/gp_Issue17869 of larsim.
It not only includes the resolution to this issue, but also a complete revamp of the configuration of the module.
In particular, configuration validation has been introduced, which is both a bug fixer and a breaking change (because if your configuration is wrong now art will stop with some
Another addition is the ability to specify some options with meaningful keywords instead of magic numbers; for example, a uniform distribution may be requested not only with the magic number
0 (legacy) but also with the word
uniform (case unsensitive).
The functions used for this feature may be moved out to
larcorealg when proven successful.