~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

Viewing changes to bin/Global/GlobalPID.py

  • Committer: Chris Rogers
  • Date: 2014-04-16 11:48:45 UTC
  • mfrom: (707 merge)
  • mto: This revision was merged to the branch mainline in revision 711.
  • Revision ID: chris.rogers@stfc.ac.uk-20140416114845-h3u3q7pdcxkxvovs
Update to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
"""
 
4
Produce the MC probability density functions for the particle hypothesis
 
5
given in the specified datacard.
 
6
"""
 
7
 
 
8
import io   #  generic python library for I/O
 
9
 
 
10
import MAUS # MAUS libraries
 
11
 
 
12
def run():
 
13
    """ Run the macro
 
14
    """
 
15
 
 
16
    # Take as input spills from pre-existing json document, as defined in
 
17
    # datacard
 
18
    my_input = MAUS.InputPyJSON()
 
19
 
 
20
    my_output = MAUS.OutputPyJSON()
 
21
 
 
22
    # can specify datacards here or by using appropriate command line calls
 
23
    datacards = io.StringIO(u"")
 
24
 
 
25
    # The Go() drives all the components you pass in, then check the file
 
26
    # (default simulation.out) for output
 
27
    MAUS.Go(my_input, MAUS.MapCppGlobalPID(), MAUS.ReducePyDoNothing(),
 
28
            my_output, datacards)
 
29
 
 
30
if __name__ == '__main__':
 
31
    run()