Example #1
0
def main():
    parser = ArgumentParser(description='Scan over ROOT files to find those '+ \
                            'belonging to a lumisection interval.')
    parser.add_argument('-b', action='store_true', help='enable batch mode')
    parser.add_argument('--dataset', required=True, choices=['PromptReco2015', \
                        'ReRecoOct2015', 'ReRecoDec2015', 'PromptReco2016', \
                        '2015ReRecoJan2017', '2016ReRecoJan2017', 'PromptReco2017'], \
                        help='specify data-taking period and reconstruction')
    parser.add_argument('-mini', dest='actions', action='append_const', \
                        const='minitrees', help='look for minitrees')
    parser.add_argument('-full', dest='actions', action='append_const', \
                        const='fulltrees', help='look for full trees')
    args = parser.parse_args()

    from importlib import import_module
    from lsctools import config, prepare
    getattr(config, 'PCC'+args.dataset)()
    for action in args.actions:
        prepare.findRootFiles(action)
Example #2
0
    b-a for a,b in zip(posBeam1, posBeam2)
] for scanname in config.options['scans']]))

run = {
    'prepare': False,
    'gather': False,
    'fit': True,
    'analyze': True,
    'plot': True,
}
scans = ('Y1', 'X1')

# Find ROOT files (needs to be executed only once)
if run['prepare']:
    from lsctools import prepare
    prepare.findRootFiles('fulltrees')

# Prepare data from ROOT files
if run['gather']:
    from lsctools import gather
    for scan in scans:
        gather.vertexPositionPerBxStep(scan, alternative=False, all=True)
        gather.vertexPositionPerBxStep(scan, alternative=True, all=True)

# Fit data at each scan step
if run['fit']:
    from lsctools import fit
    for scan in scans:
        fit.vertexPosition(scan, fitmethod='L', alternative=False, all=True)
        fit.vertexPosition(scan, fitmethod='L', alternative=True, all=True)