3
#################################################################
4
###!!! YOU ARE NOT ALLOWED TO MODIFY THIS FILE DIRECTLY !!!###
5
###!!! PLEASE MAKE A COPY OF THIS FILE WITH THE CP COMMAND !!!###
6
#################################################################
9
Online analysis to produce reconstructed events from the MICE Experiment
18
"""Analyze data from the MICE experiment
20
This will read in and process data taken from the MICE experiment. It will
21
eventually include things like cabling information, calibrations, and fits.
27
# batch mode = runs ROOT in batch mode so that canvases are not displayed
28
# 1 = True, Batch Mode
29
# 0 = False, Interactive Mode
30
# setting it to false will cause canvases to pop up on screen and
31
# will get refreshed every N spills set by the refresh_rate data card
32
data_cards_list.append("root_batch_mode='%d'\n" % 1)
33
# refresh_rate = once in how many spills should canvases be updated
34
data_cards_list.append("refresh_rate='%d'\n" % 1)
37
# Add auto-numbering to the image tags. If False then each
38
# histogram output by ReducePyMatplotlibHistogram will have
39
# tags "tdcadc" and so the end result will be just one histogram
40
# file. If True then there will be N files, one for each spill.
41
# data_cards_list.append("histogram_auto_number=%s\n" % True)
42
# Prefix for file names. Default: auto-generated UUID.
43
# data_cards_list.append("image_file_prefix='%s'\n" % "sample-image")
44
# Directory for images. Default: current directory.
45
# data_cards_list.append("image_directory='%s'\n" % os.getcwd())
46
# Update to use path join.
47
data_cards_list.append("image_directory='%s'\n" % \
48
(os.getenv('HOME') + "/MAUS/maus-apps/media/raw"))
50
data_cards = io.StringIO(unicode("".join(data_cards_list)))
52
# Set up the input that reads from DAQ
53
my_input = MAUS.InputCppDAQOnlineData()
54
# my_input = MAUS.InputCppDAQData()
56
# Create an empty array of mappers, then populate it
57
# with the functionality you want to use.
58
my_map = MAUS.MapPyGroup()
59
my_map.append(MAUS.MapCppTOFDigits())
60
my_map.append(MAUS.MapCppTOFSlabHits())
61
my_map.append(MAUS.MapCppTOFSpacePoints())
63
reducer = MAUS.ReducePyTOFPlot()
64
# reducer = MAUS.ReducePyHistogramTDCADCCounts()
66
output_worker = MAUS.OutputPyImage()
68
# The Go() drives all the components you pass in then put all the output
69
# into a file called 'mausput'
70
MAUS.Go(my_input, my_map, reducer,output_worker,data_cards)
72
if __name__ == '__main__':