Definition at line 32 of file atlas_oh.py.
◆ __init__()
def python.atlas_oh.OHInputModule.__init__ |
( |
|
self | ) |
|
◆ __iter__()
Iterable[HistObject] python.atlas_oh.OHInputModule.__iter__ |
( |
|
self | ) |
|
Definition at line 110 of file atlas_oh.py.
110 def __iter__(self) -> Iterable[HistObject]:
111 return self.iterate(dryrun=
False)
◆ configure()
None python.atlas_oh.OHInputModule.configure |
( |
|
self, |
|
|
Mapping[str, Any] |
options |
|
) |
| |
Configure this module. Potential elements of "options":
source: a string in the format partition/server
prefix: string to prepend to histogram names.
Definition at line 38 of file atlas_oh.py.
38 def configure(self, options: Mapping[str, Any]) ->
None:
40 Configure this module. Potential elements of "options":
41 source: a string in the format partition/server
42 prefix: string to prepend to histogram names.
44 from ispy
import IPCPartition
45 if 'source' not in options:
46 raise ValueError(
"Must specify 'source' as an "
47 "option to OHInputModule")
48 self.source = options[
'source']
49 self.partition, self.server, self.provider = self.source.
split(
';')
50 self.prefix = options.get(
'prefix',
'')
51 if not IPCPartition(self.partition).
isValid():
52 raise ValueError(f
'Input partition {self.partition} does not exist')
53 log = logging.getLogger(self.__class__.__name__)
54 log.info(f
'Using source {self.source}')
55 self.interval = options.get(
'interval', 5)
56 log.info(f
'Check interval is {self.interval} seconds')
◆ iterate()
Generator[HistObject, None, None] python.atlas_oh.OHInputModule.iterate |
( |
|
self, |
|
|
|
dryrun |
|
) |
| |
Connect to OH; iterate over matching histograms
Definition at line 62 of file atlas_oh.py.
62 def iterate(self, dryrun) -> Generator[HistObject, None, None]:
63 """ Connect to OH; iterate over matching histograms """
65 ROOT.TH1.AddDirectory(ROOT.kFALSE)
66 from oh
import OHSubscriber
67 from ispy
import IPCPartition, InfoReader
69 from collections
import deque
70 log = logging.getLogger(self.__class__.__name__)
71 opartition = IPCPartition(self.partition)
76 rec = Receiver(queue, f
'{self.server}.{self.provider}.{self.prefix}')
77 subs = OHSubscriber(opartition, self.server, rec,
True)
78 subs.subscribe_re2(self.server, self.provider,
'.*',
True)
80 reader = InfoReader(opartition, self.server, rf
'{self.provider}\..*')
82 log.debug(
'First pass update')
83 for k
in reader.objects:
84 toread = k.replace(f
'{self.server}.{self.provider}.',
'')
85 obj =
readobj(opartition, self.server, self.provider, toread, dryrun)
86 log.debug(
'OH input read '
87 f
'{k} as {toread.replace(self.prefix, "")}')
88 yield HistObject(toread.replace(self.prefix,
'', 1), obj)
91 log.info(
'First pass complete, entering update loop')
96 time.sleep(self.interval)
98 log.info(
'Update detected')
100 yield queue.popleft()
103 log.debug(
'Completed update')
105 subs.unsubscribe_re2(self.server, self.provider,
'.*')
◆ setSelectors()
None python.atlas_oh.OHInputModule.setSelectors |
( |
|
self, |
|
|
Collection[Pattern] |
selectors |
|
) |
| |
Do more later
Definition at line 58 of file atlas_oh.py.
58 def setSelectors(self, selectors: Collection[Pattern]) ->
None:
60 self.selectors = selectors
◆ warmup()
Iterable[HistObject] python.atlas_oh.OHInputModule.warmup |
( |
|
self | ) |
|
Definition at line 113 of file atlas_oh.py.
113 def warmup(self) -> Iterable[HistObject]:
114 return self.iterate(dryrun=
True)
◆ classwarnings
python.atlas_oh.OHInputModule.classwarnings |
◆ interval
python.atlas_oh.OHInputModule.interval |
◆ prefix
python.atlas_oh.OHInputModule.prefix |
◆ provider
python.atlas_oh.OHInputModule.provider |
◆ selectors
python.atlas_oh.OHInputModule.selectors |
◆ source
python.atlas_oh.OHInputModule.source |
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)
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.