Bug #1405
Warning message when simulating protons
0%
Description
When running simulate_mice.py for a proton beam, occasionally get the message "Warning: invalid value encountered in double_scalars". In attached log this is first seen at processing event 328 (line 365 in log file). Datacard and maus_output.root also attached as per Chris' request.
Files
Updated by Rogers, Chris over 9 years ago
Which MAUS version (what is the output of bzr info
, bzr revision-info
, what is the version number at the top of the readme file?)
I understand you are also struggling with no TOF hits?
Updated by Pidcott, Celeste over 9 years ago
- File proton_sim_log.txt proton_sim_log.txt added
I'm running a version of MAUS that was my development branch, merged with changes from the merge branch.
The output of bzr info:
Standalone tree (format: 2a)
Location:
branch root: .
Related branches:
parent branch: /home/celeste/MICE/MAUS/devel
submit branch: bzr+ssh://bazaar.launchpad.net/%2Bbranch/maus/merge/
The output of bzr revision-info:
694 c.e.pidcott@warwick.ac.uk-20140107150557-l0uns23mvurnsnpc
And the version number in the README file is 0.7.7
Also I've just realised that I forgot to set verbose level to 0 for the log, the new log is now attached. The warning now appears for the first time at line 5734 after 356 events have been processed.
Updated by Pidcott, Celeste over 9 years ago
Sorry, completely overlooked the TOF question, I thought I was missing TOF hits but I do actually have them for TOF0, so I was mistaken on that point.
Updated by Rogers, Chris over 9 years ago
- Status changed from Open to Rejected
This is a sqrt of a negative numpy float type.
When generating a beam, MAUS will generate a new primary; and then check whether the new primary has (total) energy < mass. MAUS will keep throwing new primaries until it finds one with energy > mass. This process can produce the warning you have highlighted, but in fact nothing bad happened.
The relevant lines are src/map/MapPyBeamMaker/beam.py:321
def make_one_primary(self):
"""
Make a primary particle.
Returns an dict formatted for insertion into the json tree as a primary.
See json data tree documentation for further information
Note that if the dice give us a particle that has "negative" total
momentum we throw again.
"""
hit = xboa.Hit.Hit.new_from_dict({'pid':-13, "energy":float('nan')})
while math.isnan(hit["energy"]) or math.isnan(hit["pz"]) or \
hit["energy"] < hit["mass"]:
particle_array = self.__process_get_particle_array()
hit = self.__process_array_to_hit(particle_array,
self.reference["pid"], self.momentum_defined_by)
primary = self.__process_hit_to_primary(hit)
return primary