16 A simple argument parser.
18 parser = argparse.ArgumentParser(description=__doc__)
19 parser.add_argument('-e',
'--exp',
22 help=
'experiment number',
24 parser.add_argument(
'-r',
'--run',
29 parser.add_argument(
'-g',
'--globaltags',
33 help=
'chain of globaltags to be checked',
38def set_experiment_and_run(exp_number, run_number):
40 Set the experiment and run numbers.
42 from ROOT
import Belle2
45 event_meta_data.registerInDataStore()
46 event_meta_data.create(
False)
47 event_meta_data.setEvent(0)
48 event_meta_data.setRun(run_number)
49 event_meta_data.setExperiment(exp_number)
53def set_database(globaltags, exp_number, run_number):
57 from ROOT
import Belle2
59 basf2.conditions.override_globaltags()
60 for globaltag
in globaltags:
61 basf2.conditions.append_globaltag(globaltag)
62 set_experiment_and_run(exp_number=int(exp_number),
63 run_number=int(run_number))
66if __name__ ==
"__main__":
68 args = argument_parser().parse_args()
71 globaltags = args.globaltags
74 from ROOT
import Belle2
75 set_database(globaltags, exp_number, run_number)
82 cdcpdf = oldpdfs.getCDCPDF(i,
False)
83 cdcpdfs.setPDF(cdcpdf, i,
False)
84 cdcpdf_truncated = oldpdfs.getCDCPDF(i,
True)
85 cdcpdfs.setPDF(cdcpdf_truncated, i,
True)
87 pxdpdf = oldpdfs.getPXDPDF(i,
False)
88 pxdpdfs.setPDF(pxdpdf, i,
False)
89 pxdpdf_truncated = oldpdfs.getPXDPDF(i,
True)
90 pxdpdfs.setPDF(pxdpdf_truncated, i,
True)
92 svdpdf = oldpdfs.getSVDPDF(i,
False)
93 svdpdfs.setPDF(svdpdf, i,
False)
94 svdpdf_truncated = oldpdfs.getSVDPDF(i,
True)
95 svdpdfs.setPDF(svdpdf_truncated, i,
True)
99 db.storeData(str(cdcpdfs.ClassName()).replace(
'Belle2::',
''), cdcpdfs, iov)
100 db.storeData(str(pxdpdfs.ClassName()).replace(
'Belle2::',
''), pxdpdfs, iov)
101 db.storeData(str(svdpdfs.ClassName()).replace(
'Belle2::',
''), svdpdfs, iov)
Specialized class for holding the CDC dE/dx PDFs.
static DataStore & Instance()
Instance of singleton Store.
A class that describes the interval of experiments/runs for which an object in the database is valid.
Specialized class for holding the PXD dE/dx PDFs.
Class to access a DBObjPtr from Python.
a (simplified) python wrapper for StoreObjPtr.
Specialized class for holding the SVD dE/dx PDFs.
static Database & Instance()
Instance of a singleton Database.
static DBStore & Instance()
Instance of a singleton DBStore.