The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiMP.pTools.LumiFSR Class Reference

Public Member Functions

 __init__ (self, lumi)
 merge (self, otherLumi)
 __repr__ (self)

Public Attributes

list runs = []
list files = []
dict info = {}
list keys = []

Detailed Description

Definition at line 463 of file pTools.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiMP.pTools.LumiFSR.__init__ ( self,
lumi )

Definition at line 464 of file pTools.py.

464 def __init__(self, lumi):
465 # lumi looks like :
466 # { runs : 69857 69858
467 # files : root:/castor/cer.../069857_0000000006.raw
468 # info (key/incr/integral) : 0 8 0 / 1 8 259 / 2 8 76 ... }
469
470 # class variables
471 self.runs = []
472 self.files = []
473 self.info = {}
474 self.keys = []
475
476 # get run numbers
477 for r in lumi.runNumbers():
478 self.runs.append(r)
479 # get file ids
480 for f in lumi.fileIDs():
481 self.files.append(f)
482 # Now the tricky bit, the info is not accessible via Python
483 # except as a string
484 s = str(lumi)
485 sa = s.split("info (key/incr/integral) : ")[-1]
486 sa = sa.split("/")[:-1]
487 for rec in sa:
488 k, i, t = rec.split()
489 k = int(k)
490 i = int(i)
491 t = int(t)
492 self.info[k] = (i, t)
493 self.keys = self.info.keys()
494

Member Function Documentation

◆ __repr__()

GaudiMP.pTools.LumiFSR.__repr__ ( self)

Definition at line 522 of file pTools.py.

522 def __repr__(self):
523 s = "LumiFSR Python class\n"
524 s += "\tRuns : \n"
525 for r in self.runs:
526 s += f"\t\t{r}\n"
527 s += "\tFiles : \n"
528 for f in self.files:
529 s += f"\t\t{f}\n"
530 s += "\tInfo : \n"
531 for k in self.keys:
532 increment, integral = self.info[k]
533 s += f"\t\t{k}\t{increment}\t{integral}\n"
534 return s
535
536
537# =============================================================================
538
539

◆ merge()

GaudiMP.pTools.LumiFSR.merge ( self,
otherLumi )

Definition at line 495 of file pTools.py.

495 def merge(self, otherLumi):
496 assert otherLumi.__class__.__name__ == "LumiFSR"
497 # add any extra runs
498 for r in otherLumi.runs:
499 if r in self.runs:
500 pass
501 else:
502 self.runs.append(r)
503 self.runs.sort()
504 # add any extra fileIDs
505 for f in otherLumi.files:
506 if f in self.files:
507 pass
508 else:
509 self.files.append(f)
510 self.files.sort()
511 # Now add any extra records
512 for k in otherLumi.keys:
513 increment, integral = otherLumi.info[k]
514 if k in self.keys:
515 myIncrement, myIntegral = self.info[k]
516 self.info[k] = (myIncrement + increment, myIntegral + integral)
517 else:
518 self.info[k] = (increment, integral)
519 # don't forget to update keys
520 self.keys = self.info.keys()
521
int merge(const char *target, const char *source, bool fixup=false, bool dbg=true)
Definition merge.C:417

Member Data Documentation

◆ files

list GaudiMP.pTools.LumiFSR.files = []

Definition at line 472 of file pTools.py.

◆ info

dict GaudiMP.pTools.LumiFSR.info = {}

Definition at line 473 of file pTools.py.

◆ keys

list GaudiMP.pTools.LumiFSR.keys = []

Definition at line 474 of file pTools.py.

◆ runs

list GaudiMP.pTools.LumiFSR.runs = []

Definition at line 471 of file pTools.py.


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