ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.atlas_oh.OHOutputModule Class Reference
Inheritance diagram for python.atlas_oh.OHOutputModule:
Collaboration diagram for python.atlas_oh.OHOutputModule:

Public Member Functions

def __init__ (self)
 
None configure (self, Mapping[str, Any] options)
 
None publish (self, Union[HistObject, Iterable[HistObject]] obj)
 
None finalize (self)
 

Public Attributes

 target
 
 provider
 
 partition
 
 prefix
 
 queue
 

Detailed Description

Definition at line 117 of file atlas_oh.py.

Constructor & Destructor Documentation

◆ __init__()

def python.atlas_oh.OHOutputModule.__init__ (   self)

Definition at line 118 of file atlas_oh.py.

118  def __init__(self):
119  self.target = None
120 

Member Function Documentation

◆ configure()

None python.atlas_oh.OHOutputModule.configure (   self,
Mapping[str, Any]  options 
)
Configure this module. Potential elements of "options":
target: should be a ROOT-openable filename or URL which
    can be opened for writing.
prefix: directory path to place results under.
overwrite: boolean to indicate whether results should overwrite
    existing histograms in the file.
delay: only write histograms in finalize() (not during publish()).

Definition at line 121 of file atlas_oh.py.

121  def configure(self, options: Mapping[str, Any]) -> None:
122  """
123  Configure this module. Potential elements of "options":
124  target: should be a ROOT-openable filename or URL which
125  can be opened for writing.
126  prefix: directory path to place results under.
127  overwrite: boolean to indicate whether results should overwrite
128  existing histograms in the file.
129  delay: only write histograms in finalize() (not during publish()).
130  """
131  import oh
132  import ispy
133  if 'target' not in options:
134  raise ValueError("Must specify 'target' as an option "
135  "to OHInputModule")
136  self.target = options['target']
137  self.partition, self.server, self.provider = self.target.split(';')
138  self.partition = ispy.IPCPartition(self.partition)
139  if not self.partition.isValid():
140  raise ValueError(f'Output partition {self.partition.name()} is not valid')
141  self.prefix = options.get('prefix', '')
142  self.provider = oh.OHRootProvider(self.partition,
143  self.server, self.provider, None)
144  self.queue = set()
145  log = logging.getLogger(self.__class__.__name__)
146  log.info(f'Using target {self.target}')
147 

◆ finalize()

None python.atlas_oh.OHOutputModule.finalize (   self)
Writes outstanding HistObjects to file 

Definition at line 157 of file atlas_oh.py.

157  def finalize(self) -> None:
158  """ Writes outstanding HistObjects to file """
159  pass
160 
161 

◆ publish()

None python.atlas_oh.OHOutputModule.publish (   self,
Union[HistObject, Iterable[HistObject]]  obj 
)
Accepts a HistObject containing a ROOT object to write to file 

Definition at line 148 of file atlas_oh.py.

148  def publish(self, obj: Union[HistObject, Iterable[HistObject]]) -> None:
149  """ Accepts a HistObject containing a ROOT object to write to file """
150  import os
151  if isinstance(obj, HistObject):
152  obj = [obj]
153 
154  for o in obj:
155  self.provider.publish(o.hist, os.path.join(self.prefix, o.name))
156 

Member Data Documentation

◆ partition

python.atlas_oh.OHOutputModule.partition

Definition at line 138 of file atlas_oh.py.

◆ prefix

python.atlas_oh.OHOutputModule.prefix

Definition at line 141 of file atlas_oh.py.

◆ provider

python.atlas_oh.OHOutputModule.provider

Definition at line 137 of file atlas_oh.py.

◆ queue

python.atlas_oh.OHOutputModule.queue

Definition at line 144 of file atlas_oh.py.

◆ target

python.atlas_oh.OHOutputModule.target

Definition at line 119 of file atlas_oh.py.


The documentation for this class was generated from the following file:
python.tests.PyTestsLib.finalize
def finalize(self)
_info( "content of StoreGate..." ) self.sg.dump()
Definition: PyTestsLib.py:50
configure
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)
Definition: TrigGlobEffCorrValidation.cxx:514
isValid
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition: AtlasPID.h:620
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
Trk::split
@ split
Definition: LayerMaterialProperties.h:38