All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
triggeredEventList.EventTagCache Class Reference

Public Member Functions

def __init__
 
def prepareFor
 
def __call__
 
def addTriggerInfo
 

Public Attributes

 eventTag
 
 run
 
 subrun
 
 event
 
 trigTime
 
 sourceFile
 
 human
 
 short
 
 separator
 
 eventObj
 

Private Member Functions

def _makeTag
 

Detailed Description

Definition at line 20 of file triggeredEventList.py.

Constructor & Destructor Documentation

def triggeredEventList.EventTagCache.__init__ (   self,
  run = False,
  subRun = False,
  event = True,
  sourceFile = False,
  human = False,
  short = False,
  trigTime = False,
  separator = " " 
)

Member Function Documentation

def triggeredEventList.EventTagCache.__call__ (   self,
  trigInfo,
  event = None 
)

Definition at line 42 of file triggeredEventList.py.

42 
43  def __call__(self, trigInfo, event = None):
44  if self.eventTag is None or event is not self.eventObj:
45  self.eventTag = self._makeTag(event)
return self.addTriggerInfo(self.eventTag, trigInfo)
def triggeredEventList.EventTagCache._makeTag (   self,
  event = None 
)
private

Definition at line 54 of file triggeredEventList.py.

54 
55  def _makeTag(self, event=None):
56  if event is not None: self.eventObj = event
57  assert self.eventObj, "Needs to prepareFor(event) this object first!"
58  eventAux = self.eventObj.eventAuxiliary()
59  eventID = []
60  if self.run:
61  run = eventAux.run()
62  if self.human: eventID.append(f"run {run}")
63  elif self.short: eventID.append(f"R:{run}")
64  else: eventID.append(str(run))
65  # if print run
66  if self.subrun:
67  subrun = eventAux.subRun()
68  if self.human: eventID.append(f"subrun {subrun}")
69  elif self.short: eventID.append(f"S:{subrun}")
70  else: eventID.append(str(subrun))
71  # if print subrun
72  if self.event:
73  evt = eventAux.event()
74  if self.human: eventID.append(f"event {evt}")
75  elif self.short: eventID.append(f"E:{evt}")
76  else: eventID.append(str(evt))
77  # if print event
78  if self.sourceFile:
79  sourceFile = self.eventObj.getTFile()
80  fileName = sourceFile.GetName() if sourceFile else "<unknown>"
81  eventInFile = self.eventObj.eventEntry()
82  if self.human: eventID.append(f"from file {fileName} entry {eventInFile}")
83  elif self.short: eventID.append(f"F:{fileName!r}@{eventInFile}")
84  else:
85  eventID.append(repr(fileName))
86  eventID.append(str(eventInFile))
87  # if print event
return self.separator.join(eventID)
def triggeredEventList.EventTagCache.addTriggerInfo (   self,
  tag,
  trigInfo 
)

Definition at line 48 of file triggeredEventList.py.

48 
49  def addTriggerInfo(self, tag, trigInfo):
50  info = [ tag, ]
51  if self.trigTime: info.append(f"{trigInfo['trigTime']:.3f}") # to nanosecond
return self.separator.join(info)
def triggeredEventList.EventTagCache.prepareFor (   self,
  event 
)

Definition at line 38 of file triggeredEventList.py.

38 
39  def prepareFor(self, event):
40  self.eventObj = event
41  self.eventTag = None

Member Data Documentation

triggeredEventList.EventTagCache.event

Definition at line 30 of file triggeredEventList.py.

triggeredEventList.EventTagCache.eventObj

Definition at line 39 of file triggeredEventList.py.

triggeredEventList.EventTagCache.eventTag

Definition at line 27 of file triggeredEventList.py.

triggeredEventList.EventTagCache.human

Definition at line 33 of file triggeredEventList.py.

triggeredEventList.EventTagCache.run

Definition at line 28 of file triggeredEventList.py.

triggeredEventList.EventTagCache.separator

Definition at line 35 of file triggeredEventList.py.

triggeredEventList.EventTagCache.short

Definition at line 34 of file triggeredEventList.py.

triggeredEventList.EventTagCache.sourceFile

Definition at line 32 of file triggeredEventList.py.

triggeredEventList.EventTagCache.subrun

Definition at line 29 of file triggeredEventList.py.

triggeredEventList.EventTagCache.trigTime

Definition at line 31 of file triggeredEventList.py.


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