Belle II Software development
basf2_rootinit.py
1#!/usr/bin/env python3
2
3
10
11import sys
12# By default "import ROOT" parses the arguments *sigh* so the most convenient
13# way to make sure that basf2 does not import ROOT is to add a --help and make
14# sure the program does not stop there
15from ROOT import PyConfig
16PyConfig.IgnoreCommandLineOptions = False # noqa
17sys.argv.append("--help") # noqa
18
19import basf2 # noqa
20from basf2 import _constwrapper
21
22# if the program is still alive make sure that the constants we use in basf2.py
23# are still the same
24PyConfig.IgnoreCommandLineOptions = True # noqa
25import ROOT
26assert ROOT.kIsStatic == _constwrapper._ROOT_kIsStatic, "kIsStatic has changed its value"
27assert ROOT.kIsConstMethod == _constwrapper._ROOT_kIsConstMethod, "kIsConstMethod has changed its value"
28assert ROOT.kIsPublic == _constwrapper._ROOT_kIsPublic, "kIsPublic has changed its value"