Example #1
0
def run():
    """ Run the macro
    """

    # This input generates empty spills, to be filled by the beam maker later on
    input_file = open('maus_output.json', 'r')
    #
    my_input = MAUS.InputPyJSON(input_file)
    #my_input = MAUS.InputPySpillGenerator()

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    #my_map.append(MAUS.MapPyBeamMaker()) # beam construction
    #my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation
    my_map.append(
        MAUS.MapCppTrackerMCDigitization())  # SciFi electronics model
    my_map.append(MAUS.MapCppTrackerRecon())  # SciFi recon
    # can specify datacards here or by using appropriate command line calls
    datacards = io.StringIO(u"")

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

    output_file = open("recon_mc", 'w')  #  Uncompressed
    # Then construct a MAUS output component
    my_output = MAUS.OutputPyJSON(output_file)

    # The Go() drives all the components you pass in, then check the file
    # (default simulation.out) for output

    MAUS.Go(my_input, my_map, reducer, my_output, datacards)
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)
Example #3
0
def run():
    """ Run the macro
    """

    # This input generates empty spills, to be filled by the beam maker later on
    my_input = MAUS.InputPySpillGenerator()
    # my_input = MAUS.InputCppRoot()

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    my_map.append(MAUS.MapPyBeamMaker()) # beam construction
    my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation
    # my_map.append(MAUS.MapCppTrackerMCNoise())  # SciFi noise
    my_map.append(MAUS.MapCppTrackerMCDigitization())  # SciFi electronics
    my_map.append(MAUS.MapCppTrackerRecon())  # SciFi recon
    # can specify datacards here or by using appropriate command line calls
    datacards = io.StringIO(u"")

    # reducer = MAUS.ReduceCppPatternRecognition() # Turn on event display
    reducer = MAUS.ReducePyDoNothing()

    # Then construct a MAUS output component - filename comes from datacards
    # my_output = MAUS.OutputPyJSON()
    my_output = MAUS.OutputCppRoot()

    # The Go() drives all the components you pass in, then check the file
    # (default simulation.out) for output

    MAUS.Go(my_input, my_map, reducer, my_output, datacards)
Example #4
0
def run():
    """ Run the macro
    """

    # This input generates empty spills, to be filled by the beam maker later on
    my_input = MAUS.InputPySpillGenerator()

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

    # GEANT4
    my_map.append(MAUS.MapPyBeamMaker())  # beam construction
    my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation

    # Pre detector set up
    # my_map.append(MAUS.MapPyMCReconSetup())  #  geant4 simulation
    my_map.append(MAUS.MapCppMCReconSetup())  #  geant4 simulation

    # SciFi
    my_map.append(
        MAUS.MapCppTrackerVirtualsDigitization())  # SciFi electronics model
    my_map.append(MAUS.MapCppTrackerRecon())  # SciFi Recon

    # 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)
Example #5
0
def run():
    """ Run the macro
    """

    # This input generates empty spills, to be filled by the beam maker later on
    my_input = MAUS.InputPySpillGenerator()

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

    # GEANT4
    my_map.append(MAUS.MapPyBeamMaker()) # beam construction
    my_map.append(MAUS.MapCppSimulation())  #  geant4 simulation

    # Pre detector set up
    my_map.append(MAUS.MapPyMCReconSetup())  #  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

    # SciFi
    my_map.append(MAUS.MapCppTrackerMCDigitization()) # SciFi electronics model
    my_map.append(MAUS.MapCppTrackerRecon()) # SciFi Recon

    # KL
    my_map.append(MAUS.MapCppKLMCDigitizer())  # KL MC Digitizer
    my_map.append(MAUS.MapCppKLCellHits())  # KL CellHit Reco

    # EMR
    my_map.append(MAUS.MapCppEMRMCDigitization())  # EMR MC Digitization
    my_map.append(MAUS.MapCppEMRSpacePoints())
    my_map.append(MAUS.MapCppEMRRecon()) # EMR Recon

    # Ckov
    my_map.append(MAUS.MapCppCkovMCDigitizer())

    # Global
    my_map.append(MAUS.MapCppGlobalReconImport())
    my_map.append(MAUS.MapCppGlobalTrackMatching())

    my_reduce = MAUS.ReducePyDoNothing()

    # Then construct a MAUS output component - filename comes from datacards
    #~ my_output = MAUS.OutputCppRoot()
    my_output = MAUS.OutputPyDoNothing()

    # 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, my_reduce, my_output, datacards)
 def tearDownClass(cls):  # pylint: disable = C0103
     """Sets a mapper and configuration,
     and checks that we can death() MapCppTrackerRecon"""
     cls.mapper = MAUS.MapCppTrackerRecon()
     if maus_cpp.globals.has_instance():
         maus_cpp.globals.death()
     if cls.test_config != "":
         maus_cpp.globals.birth(cls.test_config)
     # Check we death() the mapper
     cls.mapper.death()
     cls.mapper = None
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" % 1)
    # 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")

    # 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.InputCppDAQOnlineData()  # pylint: disable = E1101

    # Create an empty array of mappers, then populate it
    # with the functionality you want to use.
    my_map = MAUS.MapPyGroup()
    # add ReconSetup map -- analyze_data_offline seems to have it already
    my_map.append(MAUS.MapCppReconSetup())
    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())
    my_map.append(MAUS.MapCppTrackerRecon())
    #my_map.append(MAUS.MapCppSingleStationRecon())
    # Histogram reducer.
    reducer = MAUS.ReducePyDoNothing()
    # write out json
    output_worker = MAUS.OutputPyJSON()

    # Run the workflow.
    MAUS.Go(my_input, my_map, reducer, output_worker, data_cards)
Example #8
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)
def run():
    """
    Analyze data from the MICE experiment
    """

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

    # 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())
    my_map.append(MAUS.MapCppTrackerRecon())

    my_map.append(MAUS.MapCppEMRPlaneHits())
    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())