Project

General

Profile

Bug #1183 » run_1.py

Taylor, Ian, 04 December 2012 12:01

 
1
#!/usr/bin/env python
2

    
3
#################################################################
4
###!!! YOU ARE NOT ALLOWED TO MODIFY THIS FILE DIRECTLY    !!!###
5
###!!! PLEASE MAKE A COPY OF THIS FILE WITH THE CP COMMAND !!!###
6
#################################################################
7

    
8
"""Simulate the MICE experiment
9

    
10
This will simulate 'number_of_spills' MICE events through the entirity
11
of MICE using Geant4.  At present, TOF and Tracker hits will be digitized.
12
"""
13

    
14
import io   #  generic python library for I/O
15
import gzip #  For compressed output # pylint: disable=W0611
16

    
17
import MAUS
18

    
19
def run():
20
    """ Run the macro
21
    """
22

    
23
    # This input generates empty spills, to be filled by the beam maker later on
24
    my_input = MAUS.InputPySpillGenerator()
25

    
26
    # Create an empty array of mappers, then populate it
27
    # with the functionality you want to use.
28
    my_map = MAUS.MapPyGroup()
29
    my_map.append(MAUS.MapPyBeamMaker()) # beam construction
30
    #my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation
31
    #my_map.append(MAUS.MapPyCkov()) # Cherenkov recon...
32
    #my_map.append(MAUS.MapCppTOFMCDigitizer()) # TOF electronics model
33
    #my_map.append(MAUS.MapCppTOFSlabHits()) # TOF construct slab hits
34
    #my_map.append(MAUS.MapCppTOFSpacePoints()) # TOF reconstruct space points
35
    #my_map.append(MAUS.MapCppTrackerMCDigitization())  # SciFi electronics model
36
    #my_map.append(MAUS.MapCppTrackerRecon())  # SciFi recon
37
    # can specify datacards here or by using appropriate command line calls
38
    datacards = open('datacard_1', 'r')
39

    
40
    # my_reduce = MAUS.ReduceCppPatternRecognition()
41
    my_reduce = MAUS.ReducePyDoNothing()
42

    
43
    # Then construct a MAUS output component - filename comes from datacards
44
    # my_output = MAUS.OutputCppRoot()
45
    my_output = MAUS.OutputPyJSON()
46

    
47
    # The Go() drives all the components you pass in, then check the file
48
    # (default simulation.out) for output
49

    
50
    MAUS.Go(my_input, my_map, my_reduce, my_output, datacards)
51

    
52
if __name__ == '__main__':
53
    run()
(1-1/5)