~jan.greis/maus/1811

« back to all changes in this revision

Viewing changes to bin/simulate_mice.py

  • Committer: Chris Rogers
  • Date: 2011-09-28 06:22:41 UTC
  • mfrom: (340.1.235 devel)
  • mto: (614.1.29 maus)
  • mto: This revision was merged to the branch mainline in revision 635.
  • Revision ID: chris.rogers@stfc.ac.uk-20110928062241-ibx91tvbele6l2u2
Add json browser, beam maker, argparse functionality; plus few bug fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
    #
28
28
    # where the file format has a JSON document per line.  I just toss the file
29
29
    # in here for simplicity.
30
 
    input_file = io.StringIO(number_of_spills*u"""{"mc": [{"primary":{"position": { "x": 0.0, "y": -0.0, "z": -5000.0 },"particle_id" : 13,"energy" : 210.0, "random_seed" : 10, "momentum" : { "x":0.0, "y":0.0, "z":1.0 }, "time" : 0.0}}]}\n""") # pylint: disable=C0301  
 
30
    input_file = io.StringIO(number_of_spills*u"""{"mc": []}\n""") # pylint: disable=C0301  
31
31
 
32
32
    my_input = MAUS.InputPyJSON(input_file)
33
33
 
34
34
    # Create an empty array of mappers, then populate it
35
35
    # with the functionality you want to use.
36
36
    my_map = MAUS.MapPyGroup()
 
37
    my_map.append(MAUS.MapPyBeamMaker()) # beam construction
37
38
    my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation
38
39
    my_map.append(MAUS.MapCppTOFDigitization())  #  TOF electronics model
39
 
    my_map.append(MAUS.MapCppTrackerDigitization())  #   SCiFi electronics model
 
40
    my_map.append(MAUS.MapCppTrackerDigitization())  # SciFi electronics model
40
41
 
41
 
    datacards = io.StringIO(u"keep_tracks = False")
 
42
    datacards = io.StringIO(u"")
42
43
    #  You may specify datacards if you wish.  To do so you create a file object
43
44
    #  which can either be a StringIO object or a native python file.  If you
44
45
    #  want to store your datacards in a file 'datacards.dat' then uncomment: