Bug #1405

Warning message when simulating protons

Added by Pidcott, Celeste about 10 years ago. Updated about 10 years ago.

Target version:
Start date:
30 January 2014
Due date:
% Done:


Estimated time:
New Issue


When running 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.


maus_output.root (364 KB) maus_output.root Pidcott, Celeste, 30 January 2014 10:40 (2.38 KB) Datacard Pidcott, Celeste, 30 January 2014 10:40
proton_sim_log.txt (892 KB) proton_sim_log.txt updated verbose log Pidcott, Celeste, 30 January 2014 12:06

Updated by Rogers, Chris about 10 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 about 10 years ago

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)
branch root: .

Related branches:
parent branch: /home/celeste/MICE/MAUS/devel
submit branch: bzr+ssh://

The output of bzr revision-info:

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 about 10 years ago

  • File deleted (proton_sim_log.txt)

Updated by Pidcott, Celeste about 10 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 about 10 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/

    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