Bug #1405
Warning message when simulating protons
Added by Pidcott, Celeste almost 10 years ago.
Updated almost 10 years ago.
Start date:
30 January 2014
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
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?
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.
- File deleted (
proton_sim_log.txt)
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.
- 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
Also available in: Atom
PDF