12 assert isinstance(modname, six.string_types),
'Argument to getmodule must be a string'
16 mod = __import__(modname)
17 components = modname.split(
'.')
18 for comp
in components[1:]:
19 mod = getattr(mod,comp)
26 return getattr(__import__(
'DataQualityConfigurations.'+modname), modname)
31 if (modname.endswith(
'GeV')
32 or modname.endswith(
'TeV')
33 or modname.endswith(
'_calib')
34 or modname.endswith(
'_comm')
35 or modname.endswith(
'_refcomm')):
36 from .
import base_data;
return base_data
37 if (modname.endswith(
'_hi')
38 or modname.endswith(
'_hicomm')
39 or modname.endswith(
'_hip')):
40 from .
import base_data_hi;
return base_data_hi
41 elif (modname.endswith(
'_1beam') ):
42 from .
import base_data_1beam;
return base_data_1beam
44 elif (modname.endswith(
'_cos')
45 or modname.endswith(
'_calocomm')
46 or modname.endswith(
'_idcomm')
47 or modname.endswith(
'_larcomm')
48 or modname.endswith(
'_muoncomm')
49 or modname.endswith(
'_tilecomm')):
50 from .
import base_data_cos;
return base_data_cos
54 m = re.match(
r'data\d{2}_hip', modname)
56 from .
import base_data_hi;
return base_data_hi
58 m = re.match(
r'data\d{2}$', modname)
60 from .
import base_data;
return base_data
62 raise ValueError(
'Unable to find a valid configuration for %s' % modname)