ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
python.hltResultMT.EDMCollection Class Reference
Collaboration diagram for python.hltResultMT.EDMCollection:

Public Member Functions

def __init__ (self, name_vec, size_words, words=None)
 
def __str__ (self)
 
def name (self)
 
def is_xAOD_interface_container (self)
 
def is_xAOD_aux_container (self)
 
def is_xAOD_decoration (self)
 
def is_TP_container (self)
 
def deserialise (self)
 

Public Attributes

 name_persistent
 
 name_key
 
 size_words
 
 size_bytes
 
 words
 
 parent
 

Detailed Description

A python representation of a serialised EDM collection

Definition at line 25 of file hltResultMT.py.

Constructor & Destructor Documentation

◆ __init__()

def python.hltResultMT.EDMCollection.__init__ (   self,
  name_vec,
  size_words,
  words = None 
)

Definition at line 28 of file hltResultMT.py.

28  def __init__(self, name_vec, size_words, words=None):
29  self.name_persistent = name_vec[0]
30  self.name_key = name_vec[1]
31  self.size_words = size_words
32  self.size_bytes = size_words*4
33  self.words = words
34  self.parent = None
35 

Member Function Documentation

◆ __str__()

def python.hltResultMT.EDMCollection.__str__ (   self)

Definition at line 36 of file hltResultMT.py.

36  def __str__(self):
37  return '{:s}, Size: {:d} bytes'.format(self.name(), self.size_bytes)
38 

◆ deserialise()

def python.hltResultMT.EDMCollection.deserialise (   self)

Definition at line 59 of file hltResultMT.py.

59  def deserialise(self):
60  if not self.words:
61  log.error('No payload stored, cannot deserialise')
62  return None
63 
64  # Lazily import modules needed for deserialisation
65  import cppyy
66  import ROOT
67  import array
68  import struct
69  from ctypes import c_uint
70 
71  # Reinterpret words: Python int list -> C unsigned int list -> C char (Python bytes) array
72  cwords = [c_uint(w) for w in self.words]
73  bwords = [struct.pack('@I',cw.value) for cw in cwords]
74  bwords_merged = b''.join(bwords)
75  bwords_array = array.array('b', bwords_merged)
76 
77  # ROOT deserialisation
78  cltype = ROOT.RootType.ByNameNoQuiet(self.name_persistent)
79  buffer = ROOT.TBufferFile(ROOT.TBuffer.kRead, len(bwords_array), bwords_array, False)
80  obj_ptr = buffer.ReadObjectAny(cltype.Class())
81  obj = cppyy.bind_object(obj_ptr, self.name_persistent)
82  return obj
83 
84 

◆ is_TP_container()

def python.hltResultMT.EDMCollection.is_TP_container (   self)

Definition at line 56 of file hltResultMT.py.

56  def is_TP_container(self):
57  return '_p' in self.name_persistent
58 

◆ is_xAOD_aux_container()

def python.hltResultMT.EDMCollection.is_xAOD_aux_container (   self)

Definition at line 48 of file hltResultMT.py.

48  def is_xAOD_aux_container(self):
49  return self.name_persistent.startswith('xAOD') and self.name_key.endswith('Aux.')
50 

◆ is_xAOD_decoration()

def python.hltResultMT.EDMCollection.is_xAOD_decoration (   self)

Definition at line 51 of file hltResultMT.py.

51  def is_xAOD_decoration(self):
52  return 'vector' in self.name_persistent and \
53  not self.is_xAOD_interface_container() and \
54  not self.is_xAOD_aux_container()
55 

◆ is_xAOD_interface_container()

def python.hltResultMT.EDMCollection.is_xAOD_interface_container (   self)

Definition at line 45 of file hltResultMT.py.

45  def is_xAOD_interface_container(self):
46  return self.name_persistent.startswith('xAOD') and not self.name_key.endswith('Aux.')
47 

◆ name()

def python.hltResultMT.EDMCollection.name (   self)

Definition at line 39 of file hltResultMT.py.

39  def name(self):
40  if not self.parent:
41  return '{:s}#{:s}'.format(self.name_persistent, self.name_key)
42  else:
43  return '{:s}#{:s}{:s}'.format(self.name_persistent, self.parent.name_key, self.name_key)
44 

Member Data Documentation

◆ name_key

python.hltResultMT.EDMCollection.name_key

Definition at line 30 of file hltResultMT.py.

◆ name_persistent

python.hltResultMT.EDMCollection.name_persistent

Definition at line 29 of file hltResultMT.py.

◆ parent

python.hltResultMT.EDMCollection.parent

Definition at line 34 of file hltResultMT.py.

◆ size_bytes

python.hltResultMT.EDMCollection.size_bytes

Definition at line 32 of file hltResultMT.py.

◆ size_words

python.hltResultMT.EDMCollection.size_words

Definition at line 31 of file hltResultMT.py.

◆ words

python.hltResultMT.EDMCollection.words

Definition at line 33 of file hltResultMT.py.


The documentation for this class was generated from the following file:
vtune_athena.format
format
Definition: vtune_athena.py:14
RoiUtil::deserialise
void deserialise(const roiserial_type &s, std::vector< const IRoiDescriptor * > &rois)
deserialise uint32_t vector into a full vector of IRoiDescriptors
Definition: RoiSerialise.cxx:62
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18