ATLAS Offline Software
Loading...
Searching...
No Matches
python.atlas_oh.OHOutputModule Class Reference
Inheritance diagram for python.atlas_oh.OHOutputModule:
Collaboration diagram for python.atlas_oh.OHOutputModule:

Public Member Functions

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

Public Attributes

 target = None
 partition
 server
 provider = self.target.split(';')
 prefix = options.get('prefix', '')
 queue = set()

Detailed Description

Definition at line 117 of file atlas_oh.py.

Constructor & Destructor Documentation

◆ __init__()

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
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
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)
STL class.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ 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 137 of file atlas_oh.py.

◆ prefix

python.atlas_oh.OHOutputModule.prefix = options.get('prefix', '')

Definition at line 141 of file atlas_oh.py.

◆ provider

python.atlas_oh.OHOutputModule.provider = self.target.split(';')

Definition at line 137 of file atlas_oh.py.

◆ queue

python.atlas_oh.OHOutputModule.queue = set()

Definition at line 144 of file atlas_oh.py.

◆ server

python.atlas_oh.OHOutputModule.server

Definition at line 137 of file atlas_oh.py.

◆ target

python.atlas_oh.OHOutputModule.target = None

Definition at line 119 of file atlas_oh.py.


The documentation for this class was generated from the following file: