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.
17
Analyze data from the MICE experiment
18
This reads in and processes data taken from the MICE
23
# batch mode = runs ROOT in batch mode so that canvases are not displayed
24
# 1 = True, Batch Mode
25
# 0 = False, Interactive Mode
26
# setting it to false/0 will cause canvases to pop up on screen and
27
# will get refreshed every N spills set by the refresh_rate data
29
data_cards_list.append("root_batch_mode='%d'\n" % 1)
30
# refresh_rate = once in how many spills should canvases be updated
31
data_cards_list.append("refresh_rate='%d'\n" % 5)
32
# Add auto-numbering to the image tags. If False then each
33
# histogram output for successive spills will have the same tag
34
# so there are no spill-specific histograms. This is the
35
# recommended use for online reconstruction.
36
data_cards_list.append("histogram_auto_number=%s\n" % False)
37
# Default image type is eps. For online use, use PNG.
38
data_cards_list.append("histogram_image_type=\"png\"\n")
39
# Directory for images. Default: $MAUS_WEB_MEDIA_RAW if set
40
# else the current directory is used.
41
# Uncomment and change the following if you want to hard
42
# code a different default path.
43
#data_cards_list.append("image_directory='%s'\n" % os.getcwd())
45
# Convert data_cards to string.
46
data_cards = io.StringIO(unicode("".join(data_cards_list)))
48
# Set up the input that reads from DAQ
49
my_input = MAUS.InputCppDAQOnlineData() # pylint: disable = E1101
51
# Create an empty array of mappers, then populate it
52
# with the functionality you want to use.
53
my_map = MAUS.MapPyGroup()
54
my_map.append(MAUS.MapCppKLDigits())
55
my_map.append(MAUS.MapCppKLCellHits())
57
reducer = MAUS.ReducePyKLPlot()
58
#reducer = MAUS.ReducePyDoNothing()
59
# Save images as EPS and meta-data as JSON.
60
#output_worker = MAUS.OutputPyDoNothing()
61
output_worker = MAUS.OutputPyImage()
64
MAUS.Go(my_input, my_map, reducer, output_worker, data_cards)
66
if __name__ == '__main__':