Belle II Software light-2406-ragdoll
AddCovarianceFlags.py
1#!/usr/bin/env python3
2
3
10
11# Add covariance and generation flags to BeamParameters
12# for run-independent MC.
13
14from ROOT import Belle2, TMatrixDSym
15import basf2
16
17basf2.conditions.prepend_globaltag('B2BII_MC')
18
20
21cov = TMatrixDSym(3)
22
23# Experiments with run-independent MC.
24exp_list = [7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 31, 33, 35, 37, 39,
25 41, 43, 45, 47, 49, 51, 53, 55, 61, 63, 65, 67, 69, 71]
26
27for exp in exp_list:
28 beam_parameters = db.getData('BeamParameters', exp, 0)
29 cov[0][0] = 0.00513 * 0.00513
30 beam_parameters.setCovHER(cov)
31 cov[0][0] = 0.002375 * 0.002375
32 beam_parameters.setCovLER(cov)
33 beam_parameters.setGenerationFlags(Belle2.MCInitialParticles.c_smearALL)
34 iov = Belle2.IntervalOfValidity(exp, 0, exp, 0)
35 db.storeData('BeamParameters', beam_parameters, iov)
A class that describes the interval of experiments/runs for which an object in the database is valid.
static Database & Instance()
Instance of a singleton Database.
Definition: Database.cc:42