def run():
    """
    Analyze data from the MICE experiment
    This reads in and processes data taken from the MICE
    experiment.
    """
    # Set up data cards.
    data_cards_list = []
    data_cards_list.append("output_file_name='scalers'\n")
    # Convert data_cards to string.
    data_cards = io.StringIO(unicode("".join(data_cards_list)))
    # Set up the input that reads from DAQ
    my_input = MAUS.InputCppDAQOfflineData()

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    my_map.append(MAUS.MapCppTOFDigits())
    my_map.append(MAUS.MapCppTOFSlabHits())
    my_map.append(MAUS.MapCppTOFSpacePoints())
    # Histogram reducer.
    reducer = MAUS.ReducePyScalersTable()
    # Save images as EPS and meta-data as JSON.
    output_worker = MAUS.OutputPyFile()

    # Run the workflow.
    MAUS.Go(my_input, my_map, reducer, output_worker, data_cards)
Example #2
0
def run(data_path, run_num):
    """Analyze data from the MICE experiment

    This will read in and process data taken from the MICE experiment. It will
    eventually include things like cabling information, calibrations, and fits.
    """

    # Here you specify the path to the data and also the file you want to
    # analyze.

    my_input = MAUS.InputCppDAQOfflineData(data_path, data_file)

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    my_map.append(MAUS.MapCppTrackerDigits())
    my_map.append(MAUS.MapCppTrackerRecon())

    reducer = MAUS.ReduceCppTracker()
    #reducer = MAUS.ReducePyDoNothing()
    # reducer = MAUS.ReduceCppTrackerErrorLog()

    output_file = open("unpacked_1901", 'w')  #  Uncompressed
    my_output = MAUS.OutputPyJSON(output_file)

    # The Go() drives all the components you pass in then put all the output
    # into a file called 'mausput'
    MAUS.Go(my_input, my_map, reducer, my_output)
def run():
    """
    Analyze data from the MICE experiment
    This reads in and processes data taken from the MICE
    experiment.
    """
    # Set up data cards.
    data_cards_list = []
    # batch mode = runs ROOT in batch mode so that canvases are not displayed
    # 1 = True, Batch Mode
    # 0 = False, Interactive Mode
    # setting it to false/0 will cause canvases to pop up on screen and
    # will get refreshed every N spills set by the refresh_rate data
    # card.
    data_cards_list.append("root_batch_mode=%d\n" % 1)
    # refresh_rate = once in how many spills should canvases be updated
    data_cards_list.append("refresh_rate=%d\n" % 5)
    # Add auto-numbering to the image tags. If False then each
    # histogram output for successive spills will have the same tag
    # so there are no spill-specific histograms. This is the
    # recommended use for online reconstruction.
    data_cards_list.append("histogram_auto_number=%s\n" % False)
    # Default image type is eps. For online use, use PNG.
    data_cards_list.append("histogram_image_type=\"png\"\n")
    # Directory for images. Default: $MAUS_WEB_MEDIA_RAW if set
    # else the current directory is used.
    # Uncomment and change the following if you want to hard
    # code a different default path.
    #data_cards_list.append("image_directory='%s'\n" % os.getcwd())

    # Convert data_cards to string.
    data_cards = io.StringIO(unicode("".join(data_cards_list)))

    # Set up the input that reads from DAQ
    #    my_input = MAUS.InputCppDAQData()
    my_input = MAUS.InputCppDAQOfflineData()
    #    my_input = MAUS.InputCppDAQOnlineData() # pylint: disable = E1101

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    my_map.append(MAUS.MapCppReconSetup())
    my_map.append(MAUS.MapCppEMRPlaneHits())
    my_map.append(MAUS.MapCppEMRSpacePoints())
    my_map.append(MAUS.MapCppEMRRecon())

    # Histogram reducer.
    #reducer = MAUS.ReducePyDoNothing()
    reducer = MAUS.ReduceCppEMRPlot()

    # Save images as eps and meta-data as JSON.
    #output_worker = MAUS.OutputPyDoNothing()
    output_worker = MAUS.OutputPyRootImage()

    # Run the workflow.
    MAUS.Go(my_input, my_map, reducer, output_worker, data_cards)
def run():
    """
    Analyze data from the MICE experiment
    """

    # Set up the input that reads from DAQ
    my_input = MAUS.InputCppDAQOfflineData()

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()

    # Trigger
    my_map.append(MAUS.MapCppReconSetup())

    # Detectors
    my_map.append(MAUS.MapCppTOFDigits())
    my_map.append(MAUS.MapCppTOFSlabHits())
    my_map.append(MAUS.MapCppTOFSpacePoints())

    my_map.append(MAUS.MapCppCkovDigits())

    my_map.append(MAUS.MapCppKLDigits())
    my_map.append(MAUS.MapCppKLCellHits())

    my_map.append(MAUS.MapCppTrackerDigits()) # SciFi real data digitization
    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

    my_map.append(MAUS.MapCppEMRPlaneHits())
    my_map.append(MAUS.MapCppEMRSpacePoints())
    my_map.append(MAUS.MapCppEMRRecon())

    my_reduce = MAUS.ReducePyDoNothing()

    #  The Go() drives all the components you pass in then put all the output
    #  into a file called 'mausput'
    MAUS.Go(my_input, my_map, my_reduce, MAUS.OutputCppRoot())
Example #5
0
    def test_something(self):
        """ Check against different issues"""
        inputter = MAUS.InputCppDAQOfflineData(self._datapath, self._datafile)
        conf_json = json.loads(self._c.getConfigJSON())
        conf_json["DAQ_cabling_by"] = "date"
        inputter.birth(json.dumps(conf_json))

        success = self.mapper.birth("{}")
        self.assertFalse(success)

        success = self.mapper.add("")
        self.assertFalse(success)

        success = self.mapper.add("{}")
        self.assertFalse(success)

        success = self.mapper.dump()
        self.assertTrue(success)

        result = self.mapper.process("{}")
        self.assertEqual(len(result), 2)
Example #6
0
def run():
    """ Run the macro """

    my_input = MAUS.InputCppDAQOfflineData()
    # my_input = MAUS.InputPyJSON()

    my_map = MAUS.MapPyGroup()

    my_map.append(MAUS.MapCppTrackerDigits())

    my_map.append(MAUS.MapCppTrackerRecon())  # SciFi recon

    datacards = io.StringIO(u"")

    # my_output = MAUS.OutputPyJSON()
    my_output = MAUS.OutputCppRoot()

    # my_reduce = MAUS.ReducePyDoNothing()
    my_reduce = MAUS.ReduceCppPatternRecognition()

    MAUS.Go(my_input, my_map, my_reduce, my_output, datacards)
Example #7
0
def run():
    """Analyze data from the MICE experiment

    This will read in and process data taken from the MICE experiment. It will
    eventually include things like cabling information, calibrations, and fits.
    """

    # Set up the input that reads from DAQ
    #my_input = MAUS.InputCppDAQData()
    my_input = MAUS.InputCppDAQOfflineData()

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    my_map.append(MAUS.MapCppTOFDigits())
    my_map.append(MAUS.MapCppTOFSlabHits())
    my_map.append(MAUS.MapCppTOFSpacePoints())
    my_map.append(MAUS.MapCppCkovDigits())
    reducer = MAUS.ReducePyCkov()
    #  The Go() drives all the components you pass in then put all the output
    #  into a file called 'mausput'
    MAUS.Go(my_input, my_map, reducer, MAUS.OutputPyImage())