Belle II Software  release-08-01-10
SVDLocalCalibrationsCheck.py
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 """
13 SVD Local Calibration CHECK Script
14 usage:
15 > basf2 SVDLOcalCalibrationsCheck.py -- --ref REF --check CHECK
16 where:
17 """
18 
19 import basf2 as b2
20 
21 import argparse
22 
23 parser = argparse.ArgumentParser(description="SVD Calibration Check against a Reference")
24 parser.add_argument('--ref', metavar='reference', dest='ref', type=str, nargs=1, help='Reference rootfile')
25 parser.add_argument('--check', metavar='check', dest='check', type=str, nargs=1, help='Calibration to check rootfile')
26 
27 args = parser.parse_args()
28 
29 main = b2.create_path()
30 
31 the_ref = args.ref[0]
32 the_check = args.check[0]
33 
34 eventinfosetter = b2.register_module('EventInfoSetter')
35 eventinfosetter.param({'evtNumList': [1], 'expList': 0, 'runList': 0})
36 main.add_module(eventinfosetter)
37 main.add_module("Gearbox")
38 main.add_module("Geometry")
39 
40 mod = b2.register_module("SVDLocalCalibrationsCheck")
41 # mod.param('plotGoodAPVs', True) #default is false
42 mod.param('reference_root', str(the_ref))
43 mod.param('check_root', str(the_check))
44 mod.param('outputPdfName', 'SVDLocalCalibrationsCheck.pdf')
45 mod.param('cutN_outliers', 5)
46 mod.param('cutNoise_average', 0.1)
47 mod.param('cutNoise_outliers', 0.3)
48 mod.param('cutCalPeakADC_average', 0.015) # 0.025
49 mod.param('cutCalPeakADC_outliers', 0.3)
50 mod.param('cutPedestal_average', 0.02)
51 mod.param('cutPedestal_outliers', 0.3)
52 main.add_module(mod)
53 
54 # process single event
55 b2.print_path(main)
56 b2.process(main)