All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SBNDutils.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 
4 __doc__ = """
5 Collection of utilities to interface SBND with python, gallery and LArSoft.
6 
7 This module requires ROOT.
8 """
9 
10 __all__ = [
11  'loadSBNDgeometry',
12  'justLoadSBNDgeometry',
13 ]
14 
15 import LArSoftUtils
16 from ROOTutils import ROOT
17 
18 
19 ################################################################################
20 ### Geometry
21 ###
22 def loadSBNDgeometry(config = None, registry = None):
23  """Loads and returns SBND geometry with the standard SBND channel mapping.
24 
25  See `loadGeometry()` for the meaning of the arguments.
26  """
27  SourceCode = LArSoftUtils.SourceCode # alias
28 
29  SourceCode.loadHeaderFromUPS('sbndcode/Geometry/ChannelMapSBNDAlg.h')
30  SourceCode.loadLibrary('sbndcode_Geometry')
31  return LArSoftUtils.loadGeometry \
32  (config=config, registry=registry, mapping=ROOT.geo.ChannelMapSBNDAlg)
33 # loadSBNDgeometry()
34 
35 
36 def justLoadSBNDgeometry(configFile, mapping = None):
37  """Loads and returns SBND geometry from the specified configuration file.
38 
39  This is a one-stop procedure recommended only when running interactively.
40  """
41  if mapping is not None:
42  raise NotImplementedError("Support for non-standard mapping not implemented yet.")
43  return loadSBNDgeometry(config=LArSoftUtils.ConfigurationClass(configFile))
44 # justLoadSBNDgeometry()
45 
46 
47 ################################################################################
def justLoadSBNDgeometry
Definition: SBNDutils.py:36
def loadSBNDgeometry
Geometry.
Definition: SBNDutils.py:22