options = vars(args)

    mask = args.vfatmask

    # Open rpc connection to hw
    from gempython.tools.vfat_user_functions_xhal import *
    from gempython.vfatqc.utils.qcutilities import getCardName
    cardName = getCardName(args.shelf, args.slot)
    vfatBoard = HwVFAT(cardName, args.ohN, args.debug, args.gemType,
                       args.detType)
    print 'opened connection'

    # Check options
    from gempython.vfatqc.utils.qcutilities import inputOptionsValid
    import os
    if not inputOptionsValid(options, vfatBoard.parentOH.parentAMC.fwVersion):
        exit(os.EX_USAGE)

    # Configure the amc13
    print("initializing amc13")
    import uhal
    if args.debug:
        uhal.setLogLevelTo(uhal.LogLevel.INFO)
    else:
        uhal.setLogLevelTo(uhal.LogLevel.ERROR)
    import amc13
    connection_file = "%s/connections.xml" % (
        os.getenv("GEM_ADDRESS_TABLE_PATH"))
    amc13base = "gem.shelf%02d.amc13" % (args.shelf)
    amc13board = amc13.AMC13(connection_file, "%s.T1" % (amc13base),
                             "%s.T2" % (amc13base))
示例#2
0
        exit(os.EX_USAGE)

    # Open rpc connection to hw
    from gempython.vfatqc.utils.qcutilities import getCardName, inputOptionsValid
    cardName = getCardName(args.shelf, args.slot)
    from gempython.tools.vfat_user_functions_xhal import *
    vfatBoard = HwVFAT(cardName, 0, args.debug, args.gemType,
                       args.detType)  # Assign link 0; we will update later
    print 'opened connection'
    amcBoard = vfatBoard.parentOH.parentAMC
    if amcBoard.fwVersion < 3:
        printRed("DAC Scan of v2b electronics is not supported, exiting!!!")
        exit(os.EX_USAGE)

    # Check options
    if not inputOptionsValid(args, amcBoard.fwVersion):
        exit(os.EX_USAGE)
        pass

    # Make output files
    import ROOT as r
    outF = r.TFile(args.filename, "RECREATE")
    from gempython.vfatqc.utils.scanUtils import dacScanAllLinks, dacScanSingleLink
    from gempython.vfatqc.utils.treeStructure import gemDacCalTreeStructure
    calTree = gemDacCalTreeStructure(
        name="dacScanTree",
        nameX="dummy",  # temporary name, will be over-ridden
        nameY=("ADC1" if args.extRefADC else "ADC0"),
        dacSelect=-1,  #temporary value, will be over-ridden
        description="GEM DAC Calibration of VFAT3 DAC")