Bug #17869

Problem in the simulation of single particle using SingleGen_module

Added by Christian Farnese about 3 years ago. Updated almost 3 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Spent time:
Occurs In:


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 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!


#1 Updated by Lynn Garren about 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Gianluca Petrillo

#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 Configuration exception).
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.

#3 Updated by Gianluca Petrillo almost 3 years ago

  • Status changed from Work in progress to Resolved
  • % Done changed from 90 to 100

The fixing feature branch (larsim:77d5150 and following) has been merged into v06_54_00.

#4 Updated by Gianluca Petrillo almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF