|
| def | __init__ (self, gmpComponent) |
| |
| def | localCmp (self, tupA, tupB) |
| |
| def | SendFileRecords (self) |
| |
| def | Receive (self) |
| |
| def | Rebuild (self) |
| |
| def | MergeFSRobject (self, sourceNode, path, ob) |
| |
| def | ProcessTimeSpanFSR (self, path, ob) |
| |
| def | ProcessEventCountFSR (self, path, ob) |
| |
| def | MergeLumiFSR (self, path, keyedC) |
| |
Definition at line 240 of file pTools.py.
◆ __init__()
| def GaudiMP.pTools.FileRecordsAgent.__init__ |
( |
|
self, |
|
|
|
gmpComponent |
|
) |
| |
Definition at line 241 of file pTools.py.
241 def __init__(self, gmpComponent):
242 self._gmpc = gmpComponent
243 self.fsr = self._gmpc.fsr
244 self.q = self._gmpc.fq
245 self.log = self._gmpc.log
◆ localCmp()
| def GaudiMP.pTools.FileRecordsAgent.localCmp |
( |
|
self, |
|
|
|
tupA, |
|
|
|
tupB |
|
) |
| |
Definition at line 249 of file pTools.py.
249 def localCmp(self, tupA, tupB):
◆ MergeFSRobject()
| def GaudiMP.pTools.FileRecordsAgent.MergeFSRobject |
( |
|
self, |
|
|
|
sourceNode, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 394 of file pTools.py.
394 def MergeFSRobject(self, sourceNode, path, ob):
396 if path ==
"/FileRecords/TimeSpanFSR":
398 self.ProcessTimeSpanFSR(path, ob)
399 elif path ==
"/FileRecords/EventCountFSR":
401 self.ProcessEventCountFSR(path, ob)
404 "KeyedContainer" in ob.__class__.__name__
405 and "LumiFSR" in ob.__class__.__name__
408 self.MergeLumiFSR(path, ob)
410 self.log.info(
"Skipping Merge of %s at %s" % (ob.__class__.__name__, path))
◆ MergeLumiFSR()
| def GaudiMP.pTools.FileRecordsAgent.MergeLumiFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
keyedC |
|
) |
| |
Definition at line 438 of file pTools.py.
438 def MergeLumiFSR(self, path, keyedC):
439 from ROOT
import string
442 keyedContainer = self.fsr.retrieveObject(path)
444 assert keyedContainer.numberOfObjects() == 1
445 l = keyedContainer.containedObject(0)
448 nCont = keyedC.numberOfObjects()
449 for i
in range(nCont):
450 obj = keyedC.containedObject(i)
452 baseLumi.merge(nextLumi)
454 newLumi = gbl.LHCb.LumiFSR()
455 for r
in baseLumi.runs:
456 newLumi.addRunNumber(r)
457 for f
in baseLumi.files:
458 newLumi.addFileID(string(f))
459 for k
in baseLumi.keys:
460 increment, integral = baseLumi.info[k]
461 newLumi.addInfo(k, increment, integral)
463 self.fsr[path].clear()
465 self.fsr[path].
add(newLumi)
◆ ProcessEventCountFSR()
| def GaudiMP.pTools.FileRecordsAgent.ProcessEventCountFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 434 of file pTools.py.
434 def ProcessEventCountFSR(self, path, ob):
435 self.log.debug(
"Event Count Input Addition")
436 self.fsr[path].setInput(self.fsr[path].input() + ob.input())
◆ ProcessTimeSpanFSR()
| def GaudiMP.pTools.FileRecordsAgent.ProcessTimeSpanFSR |
( |
|
self, |
|
|
|
path, |
|
|
|
ob |
|
) |
| |
Definition at line 412 of file pTools.py.
412 def ProcessTimeSpanFSR(self, path, ob):
413 ob2 = self.fsr.retrieveObject(path)
414 if ob.containedObjects().
size():
415 sz = ob.containedObjects().
size()
416 cob = ob2.containedObjects()[0]
420 cob = ob.containedObjects()[j]
421 self.log.debug(
"Adding TimeSpanFSR")
422 if cob.earliest() < min:
424 if cob.latest() > max:
428 tsfsr = gbl.LHCb.TimeSpanFSR()
429 tsfsr.setEarliest(min)
431 self.fsr[path].clear()
432 self.fsr[path].
add(tsfsr)
◆ Rebuild()
| def GaudiMP.pTools.FileRecordsAgent.Rebuild |
( |
|
self | ) |
|
Definition at line 345 of file pTools.py.
347 for sourceNode, path, serialob
in self.objectsIn:
348 self.log.debug(
"Working with %s" % (path))
349 ob = pickle.loads(serialob)
350 if hasattr(ob,
"update"):
352 if hasattr(ob,
"numberOfObjects"):
353 nCont = ob.numberOfObjects()
355 "\t %s has containedObjects : %i" % (
type(ob).__name__, nCont)
358 self.log.debug(
"Registering Object to : %s" % (path))
359 self.fsr.registerObject(path, ob)
361 self.log.debug(
"Merging Object to : %s" % (path))
362 self.MergeFSRobject(sourceNode, path, ob)
367 self.log.info(
"FSR Store Rebuilt. Correcting EventCountFSR")
368 if bool(self.fsr._idp):
369 ecount =
"/FileRecords/EventCountFSR"
371 self.fsr[ecount].setOutput(self._gmpc.nIn)
373 "Event Counter Output set : %s : %i"
374 % (ecount, self.fsr[ecount].
output())
377 self.log.debug(
"FSR store reconstructed!")
378 lst = self.fsr.getHistoNames()
381 ob = self.fsr.retrieveObject(l)
382 if hasattr(ob,
"configureDirectAccess"):
383 ob.configureDirectAccess()
384 if hasattr(ob,
"containedObjects"):
387 "\t%s (cont. objects : %i)" % (l, ob.numberOfObjects())
390 self.log.debug(
"\t%s" % (l))
391 self.log.info(
"FSR Store fully rebuilt.")
◆ Receive()
| def GaudiMP.pTools.FileRecordsAgent.Receive |
( |
|
self | ) |
|
Definition at line 325 of file pTools.py.
327 self.log.info(
"Receiving FSR store data...")
328 nc = self._gmpc.nWorkers
330 objects = self.q.
get()
331 if objects ==
"END_FSR":
338 self.objectsIn.append(o)
341 self.objectsIn.sort(cmp=self.localCmp)
342 self.log.info(
"All FSR data received")
◆ SendFileRecords()
| def GaudiMP.pTools.FileRecordsAgent.SendFileRecords |
( |
|
self | ) |
|
Definition at line 262 of file pTools.py.
262 def SendFileRecords(self):
274 self.log.info(
"Sending FileRecords...")
275 lst = self.fsr.getHistoNames()
279 self.log.info(
"No FileRecords Data to send to Writer.")
280 self.q.
put(
"END_FSR")
284 if "/FileRecords" in lst:
285 lst.remove(
"/FileRecords")
288 o = self.fsr.retrieveObject(l)
289 if hasattr(o,
"configureDirectAccess"):
290 o.configureDirectAccess()
292 if self._gmpc.nodeID == 0:
293 self.objectsOut.append((0, l, pickle.dumps(o)))
297 if l ==
"/FileRecords/EventCountFSR":
298 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
299 self.objectsOut.append(tup)
300 elif "KeyedContainer" in o.__class__.__name__:
302 nObjects = o.numberOfObjects()
305 "Keyed Container %s with %i objects" % (l, nObjects)
307 tup = (self._gmpc.nodeID, l, pickle.dumps(o))
308 self.objectsOut.append(tup)
310 self.log.info(
"Ignoring %s in FSR" % o.__class__.__name__)
312 self.log.debug(
"Done with FSR store, just to send to Writer.")
315 self.log.debug(
"%i FSR objects to Writer" % (len(self.objectsOut)))
316 for ob
in self.objectsOut:
317 self.log.debug(
"\t%s" % (ob[0]))
318 self.q.
put(self.objectsOut)
320 self.log.info(
"Valid FSR Store, but no data to send to Writer")
321 self.log.info(
"SendFSR complete")
322 self.q.
put(
"END_FSR")
◆ _gmpc
| GaudiMP.pTools.FileRecordsAgent._gmpc |
|
private |
◆ fsr
| GaudiMP.pTools.FileRecordsAgent.fsr |
◆ log
| GaudiMP.pTools.FileRecordsAgent.log |
◆ objectsIn
| GaudiMP.pTools.FileRecordsAgent.objectsIn |
◆ objectsOut
| GaudiMP.pTools.FileRecordsAgent.objectsOut |
| GaudiMP.pTools.FileRecordsAgent.q |
The documentation for this class was generated from the following file: