示例#1
0
                       tc=None,
                       dut=None,
                       has_collection=True,
                       return_parser=True,
                       has_verbose=True)
    p.add_argument('-s', '--show', action='store_true', help='activate show')
    p.add_argument('-ms',
                   '--master_selection',
                   action='store_true',
                   help='run master selection')
    p.add_argument('-d',
                   '--diamond',
                   nargs='?',
                   default=None,
                   help='diamond for show runplans')
    args = p.parse_args()

    from src.analysis import Analysis
    z = RunSelector(Analysis.find_testcampaign(args.testcampaign),
                    args.runplan, args.dut, args.verbose)

    if args.show:
        if args.runplan is not None:
            print_banner(z.TCString)
            z.select_runs_from_runplan(args.runplan)
            z.show_selected_runs()
        else:
            z.show_run_plans(diamond=args.diamond)
    if args.master_selection:
        z.master_selection()
示例#2
0
    def run(self):
        if not len(self.Runs):
            return info('There are no runs to convert :-)')
        self.multi() if self.Multi else self.auto_convert()


if __name__ == '__main__':

    parser = ArgumentParser()
    parser.add_argument('-m', action='store_true', help='turn parallel processing ON')
    parser.add_argument('-tc', nargs='?', default=None)
    parser.add_argument('s', nargs='?', default=None, help='run number where to start, default [None], = stop if no end is provided', type=int)
    parser.add_argument('e', nargs='?', default=None, help='run number where to stop, default [None]')
    parser.add_argument('-v', action='store_false', help='turn verbose OFF')
    parser.add_argument('-t', action='store_true', help='turn test mode ON')
    parser.add_argument('-pad', action='store_true', help='convert only pad runs')
    parser.add_argument('-pixel', action='store_true', help='convert only pixel runs')

    args = parser.parse_args()

    from src.analysis import Analysis
    z = AutoConvert(args.m, args.s, args.e, Analysis.find_testcampaign(args.tc), 'pad' if args.pad else 'pixel' if args.pixel else None, args.v)
    if not args.t:
        if len(z.Runs):
            print_banner(f'Starting {"multi" if z.Multi else "auto"} conversion for runs {z.Runs[0]} - {z.Runs[-1]}', color='green')
            z.run()
            print_banner('Finished Conversion!', color='green')
        else:
            info('There is nothing to convert :-)\n', blank_lines=1)
示例#3
0
                           x_tit='Column DUT',
                           y_tit='Row DUT',
                           canvas=c.cd(2))

    # endregion DRAW
    # ----------------------------------------


if __name__ == '__main__':

    from pixel.run import PixelRun
    from src.converter import Converter
    from src.analysis import Analysis

    # eg. (489/490, 201610), (147, 201810)
    pp = init_argparser(return_parser=True)
    pp.add_argument('dut', nargs='?', default=None, type=int)
    pp.add_argument('-x', action='store_true')
    pp.add_argument('-y', action='store_true')
    pargs = pp.parse_args()
    this_tc = Analysis.find_testcampaign(pargs.testcampaign)

    zrun = PixelRun(pargs.run,
                    testcampaign=this_tc,
                    load_tree=False,
                    verbose=True)
    z = PixAlignment(Converter(zrun),
                     dut_plane=pargs.dut,
                     mode='x' if pargs.x else 'y' if pargs.y else '')
    z.reload()
示例#4
0
    plot.efficiency(arange(e.size), e, make_bins(e.size, n=n))


def get_efficiencies():
    return [get_raw_efficiency(i) for i in range(z.NPlanes)]


if __name__ == '__main__':

    parser = ArgumentParser()
    parser.add_argument('run')
    parser.add_argument('-tc', nargs='?', default=None)
    args = parser.parse_args()

    from src.analysis import Analysis
    tc = Analysis.find_testcampaign(args.tc)

    if isint(args.run):
        z = Run(int(args.run), tc)
        t = z.Tree
    else:
        rootfile = TFile(args.run)
        try:
            run = int(argv[1].split('/')[-1].strip('.root').split('00')[-1])
        except (IndexError, ValueError):
            if argv[1].endswith('Tracks.root'):
                run = int(argv[1].split('/')[-1].strip('_withTracks.roottest'))
            elif 'Tracked' in argv[1]:
                run = int(argv[1].split('/')[-1].strip('.root').strip('TrackedRun'))
                tc = remove_letters(Path(args.run).absolute().parts[3]).replace('_', '') if 'psi' in args.run else tc
            else: