Definition at line 135 of file DQPostProcessingAlg.py.
◆ __init__()
def python.DQPostProcessingAlg.AthInputModule.__init__ |
( |
|
self | ) |
|
◆ __iter__()
Iterator[HistObject] python.DQPostProcessingAlg.AthInputModule.__iter__ |
( |
|
self | ) |
|
◆ _getklass()
def python.DQPostProcessingAlg.AthInputModule._getklass |
( |
|
self, |
|
|
|
k |
|
) |
| |
|
private |
Definition at line 161 of file DQPostProcessingAlg.py.
161 def _getklass(self, k):
163 hsvc = self.source.hsvc
164 if hsvc.existsHist(k):
165 hptr = ROOT.MakeNullPointer(ROOT.TH1)
166 if hsvc.getHist(k, hptr).isSuccess():
167 klass = getattr(ROOT, hptr.ClassName())
◆ configure()
None python.DQPostProcessingAlg.AthInputModule.configure |
( |
|
self, |
|
|
Mapping[str, Any] |
options |
|
) |
| |
Configure this module. Potential elements of "options":
source: should be a ROOT-openable filename or URL.
prefix: directory path to search under. Returned histogram names
will not include this.
Definition at line 142 of file DQPostProcessingAlg.py.
142 def configure(self, options: Mapping[str, Any]) ->
None:
144 Configure this module. Potential elements of "options":
145 source: should be a ROOT-openable filename or URL.
146 prefix: directory path to search under. Returned histogram names
147 will not include this.
149 if 'source' not in options:
150 raise ValueError(
"Must specify 'source' as an "
151 "option to AthInputModule")
152 self.source = options[
'source']
153 self.prefix = options.get(
'prefix',
'/')
154 self.cachednames =
set()
155 self.matchednames = {}
◆ iterate()
Generator[HistObject, None, None] python.DQPostProcessingAlg.AthInputModule.iterate |
( |
|
self, |
|
|
|
dryrun |
|
) |
| |
Iterate over all histograms in THistSvc
Definition at line 171 of file DQPostProcessingAlg.py.
171 def iterate(self, dryrun) -> Generator[HistObject, None, None]:
172 """ Iterate over all histograms in THistSvc """
174 log = self.source.msg
175 specprefix = self.prefix % {
'run': self.source._run }
176 log.debug(f
'Would like to match {specprefix}')
177 hsvc = self.source.hsvc
181 histnames = hsvc.getHists()
182 currenthists =
set(
str(histnames[_])
for _
in range(len(histnames)))
183 for k
in currenthists - self.cachednames:
185 if not k.startswith(specprefix):
187 shortk = k.replace(specprefix,
'', 1)
188 if self.selectors
is not None:
189 if not any(_.match(shortk)
for _
in self.selectors):
191 self.matchednames[k] =
None
192 self.cachednames.
update(currenthists)
193 log.debug(f
'We now have {len(self.cachednames)} entries in our cache, of {len(currenthists)} total plots')
194 log.debug(f
'There are {len(self.matchednames)} matches to be considered')
197 for k, klass
in self.matchednames.
items():
199 yield HistObject(k.replace(specprefix,
'', 1),
None)
201 log.debug(f
'THistSvc input trying to read {k}')
203 klass = self._getklass(k)
204 self.matchednames[k] = klass
205 hptr = ROOT.MakeNullPointer(klass)
206 if hsvc.getHist(k, hptr).isSuccess():
207 log.debug(f
'THistSvc input read {k} as {type(hptr)}')
209 ROOT.SetOwnership(obj,
False)
210 if k
in self.entries:
211 if obj.GetEntries() == self.entries[k]:
213 self.entries[k] = obj.GetEntries()
214 yield HistObject(k.replace(specprefix,
'', 1), obj)
216 log.error(f
'Cannot read {k}')
218 log.debug(
'Done on input side')
◆ setSelectors()
None python.DQPostProcessingAlg.AthInputModule.setSelectors |
( |
|
self, |
|
|
Collection[Pattern] |
selectors |
|
) |
| |
Do more later
Definition at line 157 of file DQPostProcessingAlg.py.
157 def setSelectors(self, selectors: Collection[Pattern]) ->
None:
158 """ Do more later """
159 self.selectors = selectors
◆ warmup()
Iterable[HistObject] python.DQPostProcessingAlg.AthInputModule.warmup |
( |
|
self | ) |
|
Definition at line 223 of file DQPostProcessingAlg.py.
223 def warmup(self) -> Iterable[HistObject]:
224 return self.iterate(dryrun=
True)
◆ cachednames
python.DQPostProcessingAlg.AthInputModule.cachednames |
◆ classwarnings
python.DQPostProcessingAlg.AthInputModule.classwarnings |
◆ entries
python.DQPostProcessingAlg.AthInputModule.entries |
◆ matchednames
python.DQPostProcessingAlg.AthInputModule.matchednames |
◆ prefix
python.DQPostProcessingAlg.AthInputModule.prefix |
◆ selectors
python.DQPostProcessingAlg.AthInputModule.selectors |
◆ source
python.DQPostProcessingAlg.AthInputModule.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.