1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
#!/usr/bin/env python
"""
Simulate the MICE experiment
This will simulate MICE spills through the entirety of MICE using Geant4, then
digitize and reconstruct TOF and tracker hits to space points.
"""
import io # generic python library for I/O
import MAUS # MAUS libraries
def run():
""" Run the macro
"""
# Use the G4BL JSON chunks as an input to the simulation
my_input = MAUS.InputPyJSON()
# Create an empty array of mappers, then populate it
# with the functionality you want to use.
my_map = MAUS.MapPyGroup()
# No need for the beam maker, as we use G4BL chunks
# my_map.append(MAUS.MapPyBeamMaker()) # beam construction
# Run the GEANT4 simulation
my_map.append(MAUS.MapCppSimulation()) # geant4 simulation
# Pre detector set up
my_map.append(MAUS.MapCppMCReconSetup()) # geant4 simulation
# TOF
my_map.append(MAUS.MapCppTOFMCDigitizer()) # TOF MC Digitizer
my_map.append(MAUS.MapCppTOFSlabHits()) # TOF MC Slab Hits
my_map.append(MAUS.MapCppTOFSpacePoints()) # TOF Space Points
# KL
my_map.append(MAUS.MapCppKLMCDigitizer()) # KL MC Digitizer
my_map.append(MAUS.MapCppKLCellHits()) # KL CellHit Reco
# SciFi
my_map.append(MAUS.MapCppTrackerMCDigitization()) # SciFi electronics model
my_map.append(MAUS.MapCppTrackerClusterRecon()) # SciFi channel clustering
my_map.append(MAUS.MapCppTrackerSpacePointRecon()) # SciFi spacepoint recon
my_map.append(MAUS.MapCppTrackerPatternRecognition()) # SciFi track finding
my_map.append(MAUS.MapCppTrackerPRSeed()) # Set the Seed from PR
my_map.append(MAUS.MapCppTrackerTrackFit()) # SciFi track fit
# EMR
my_map.append(MAUS.MapCppEMRMCDigitization()) # EMR MC Digitization
my_map.append(MAUS.MapCppEMRSpacePoints()) # EMR MC Digitization
my_map.append(MAUS.MapCppEMRRecon()) # EMR Recon
# Ckov
my_map.append(MAUS.MapCppCkovMCDigitizer())
my_map.append(MAUS.MapCppGlobalReconImport()) # import tracks for global matching
my_map.append(MAUS.MapCppGlobalTrackMatching()) # global track matching
# Cuts
# my_map.append(MAUS.MapCppCuts())
# Global Digits - post detector digitisation
# Then construct a MAUS output component - filename comes from datacards
my_output = MAUS.OutputCppRoot()
# can specify datacards here or by using appropriate command line calls
datacards = io.StringIO(u"")
# The Go() drives all the components you pass in, then check the file
# (default simulation.out) for output
MAUS.Go(my_input, my_map, MAUS.ReducePyDoNothing(), my_output, datacards)
if __name__ == '__main__':
run()
|