Definition at line 226 of file DQPostProcessingAlg.py.
◆ __init__()
def python.DQPostProcessingAlg.AthOutputModule.__init__ |
( |
|
self | ) |
|
◆ _write()
None python.DQPostProcessingAlg.AthOutputModule._write |
( |
|
self | ) |
|
|
private |
write obj to THistSvc
Definition at line 274 of file DQPostProcessingAlg.py.
274 def _write(self) -> None:
275 """ write obj to THistSvc """
280 log = self.target.msg
281 hsvc = self.target.hsvc
282 for _, o
in self.queue.
items():
283 fulltargetname = os.path.join(self.prefix, o.name) % {
'run': self.target._run }
284 log.debug(f
"Attempt to publish {fulltargetname} of type {type(o.hist)}")
287 if isinstance(o.hist, ROOT.TH1):
288 funcs = self._hsvc_funcs[
'hist']
289 parenttype = ROOT.TH1
290 elif isinstance(o.hist, ROOT.TGraph):
291 funcs = self._hsvc_funcs[
'graph']
292 parenttype = ROOT.TGraph
293 elif isinstance(o.hist, ROOT.TEfficiency):
294 funcs = self._hsvc_funcs[
'eff']
295 parenttype = ROOT.TEfficiency
297 log.warning(f
'Do not know how to handle object {fulltargetname} of type {type(o.hist)}; skipping')
299 o.hist.SetName(os.path.basename(fulltargetname))
300 if funcs[
'exists'](fulltargetname):
302 hptr = ROOT.MakeNullPointer(parenttype)
303 if funcs[
'get'](fulltargetname, hptr).isSuccess():
305 ROOT.SetOwnership(hptr,
True)
306 if not funcs[
'reg'](fulltargetname, o.hist).isSuccess():
307 log.error(f
"Unable to register {fulltargetname}")
309 ROOT.SetOwnership(o.hist,
False)
310 log.debug(
"Published")
◆ configure()
None python.DQPostProcessingAlg.AthOutputModule.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 230 of file DQPostProcessingAlg.py.
230 def configure(self, options: Mapping[str, Any]) ->
None:
232 Configure this module. Potential elements of "options":
233 target: should be a ROOT-openable filename or URL which
234 can be opened for writing.
235 prefix: directory path to place results under.
236 overwrite: boolean to indicate whether results should overwrite
237 existing histograms in the file.
238 delay: only write histograms in finalize() (not during publish()).
240 if 'target' not in options:
241 raise ValueError(
"Must specify 'target' as an option "
243 self.target = options[
'target']
244 self.overwrite =
bool(options.get(
'overwrite',
True))
245 self.prefix = options.get(
'prefix',
'/')
246 self.delay =
bool(options.get(
'delay',
True))
247 self.queue: Optional[Dict[str, HistObject]] = {}
248 self._hsvc_funcs = {
'hist': {
'exists': self.target.hsvc.existsHist,
249 'get': self.target.hsvc.getHist,
250 'reg': self.target.hsvc._cpp_regHist },
251 'graph': {
'exists': self.target.hsvc.existsGraph,
252 'get': self.target.hsvc.getGraph,
253 'reg': self.target.hsvc._cpp_regGraph },
254 'eff': {
'exists': self.target.hsvc.existsEfficiency,
255 'get': self.target.hsvc.getEfficiency,
256 'reg': self.target.hsvc._cpp_regEfficiency },
◆ finalize()
None python.DQPostProcessingAlg.AthOutputModule.finalize |
( |
|
self | ) |
|
Outputs outstanding HistObjects
Definition at line 313 of file DQPostProcessingAlg.py.
314 """ Outputs outstanding HistObjects """
◆ publish()
None python.DQPostProcessingAlg.AthOutputModule.publish |
( |
|
self, |
|
|
Union[HistObject, Iterable[HistObject]] |
obj |
|
) |
| |
Accepts a HistObject containing a ROOT object to write to file
Definition at line 259 of file DQPostProcessingAlg.py.
259 def publish(self, obj: Union[HistObject, Iterable[HistObject]]) ->
None:
260 """ Accepts a HistObject containing a ROOT object to write to file """
261 if isinstance(obj, HistObject):
263 d_obj = { _.name: _
for _
in obj }
◆ _hsvc_funcs
python.DQPostProcessingAlg.AthOutputModule._hsvc_funcs |
|
private |
◆ delay
python.DQPostProcessingAlg.AthOutputModule.delay |
◆ overwrite
python.DQPostProcessingAlg.AthOutputModule.overwrite |
◆ prefix
python.DQPostProcessingAlg.AthOutputModule.prefix |
◆ queue
python.DQPostProcessingAlg.AthOutputModule.queue |
◆ target
python.DQPostProcessingAlg.AthOutputModule.target |
The documentation for this class was generated from the following file:
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)