~jan.greis/maus/1811

« back to all changes in this revision

Viewing changes to bin/user/simulate_recon_only.py

Merging start

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env python
 
2
 
 
3
"""
 
4
Simulate the MICE experiment
 
5
 
 
6
This will simulate MICE spills through the entirety of MICE using Geant4, then
 
7
digitize and reconstruct TOF and tracker hits to space points.
 
8
"""
 
9
 
 
10
import io   #  generic python library for I/O
 
11
 
 
12
import MAUS # MAUS libraries
 
13
 
 
14
def run():
 
15
    """ Run the macro
 
16
    """
 
17
 
 
18
    # This input generates empty spills, to be filled by the beam maker later on
 
19
#    my_input = MAUS.InputPySpillGenerator()
 
20
    my_input = MAUS.InputCppRoot()
 
21
 
 
22
    # Create an empty array of mappers, then populate it
 
23
    # with the functionality you want to use.
 
24
    my_map = MAUS.MapPyGroup()
 
25
 
 
26
    # G4beamline
 
27
    # my_map.append(MAUS.MapPyBeamlineSimulation())
 
28
 
 
29
    # GEANT4
 
30
#    my_map.append(MAUS.MapPyBeamMaker()) # beam construction
 
31
#    my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation
 
32
 
 
33
    # Pre detector set up
 
34
#    my_map.append(MAUS.MapPyMCReconSetup())  #  geant4 simulation
 
35
 
 
36
    # TOF
 
37
#    my_map.append(MAUS.MapCppTOFMCDigitizer())  # TOF MC Digitizer
 
38
#    my_map.append(MAUS.MapCppTOFSlabHits()) # TOF MC Slab Hits
 
39
#    my_map.append(MAUS.MapCppTOFSpacePoints()) # TOF Space Points
 
40
 
 
41
    # KL
 
42
#    my_map.append(MAUS.MapCppKLMCDigitizer())  # KL MC Digitizer
 
43
#    my_map.append(MAUS.MapCppKLCellHits())  # KL CellHit Reco
 
44
 
 
45
    # SciFi
 
46
    my_map.append(MAUS.MapCppTrackerMCDigitization()) # SciFi electronics model
 
47
    my_map.append(MAUS.MapCppTrackerRecon()) # SciFi Recon
 
48
 
 
49
    # Global Digits - post detector digitisation
 
50
 
 
51
    # Then construct a MAUS output component - filename comes from datacards
 
52
    my_output = MAUS.OutputCppRoot()
 
53
 
 
54
    # can specify datacards here or by using appropriate command line calls
 
55
    datacards = io.StringIO(u"")
 
56
 
 
57
    # The Go() drives all the components you pass in, then check the file
 
58
    # (default simulation.out) for output
 
59
    MAUS.Go(my_input, my_map, MAUS.ReducePyDoNothing(), my_output, datacards)
 
60
 
 
61
if __name__ == '__main__':
 
62
    run()