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

Public Member Functions

def __init__ (self, theApp)
 
def pyroot_typedef_bug_workaround (self)
 
def setDescription (self, descr)
 
def getSingleCondContainer (self)
 
def getMultiCondContainer (self, channels, attrListColl, iovs)
 

Public Attributes

 icnv
 
 iaddr
 
 dbCast
 
 descr
 
 typeName
 
 type
 
 header
 

Detailed Description

Definition at line 79 of file ConditionsContainerAccess.py.

Constructor & Destructor Documentation

◆ __init__()

def python.ConditionsContainerAccess.ConditionsContainerAccess.__init__ (   self,
  theApp 
)

Definition at line 80 of file ConditionsContainerAccess.py.

80  def __init__(self, theApp) :
81  # PersistencySvc
82  pers = theApp.service('EventPersistencySvc')
83 
84  # PersistencySvc via its IConverter interface
85  iConverter = InterfaceRDS('IConverter')
86  self.icnv = iConverter.cast(pers)
87 
88  # PersistencySvc via its IAddressCreator interface
89  iAddrCreator = InterfaceRDS('IAddressCreator')
90  self.iaddr = iAddrCreator.cast(pers)
91 
92  # Create instance of cast object
93  self.dbCast = PyLCGDict.makeClass('DataBucketCast')
94 

Member Function Documentation

◆ getMultiCondContainer()

def python.ConditionsContainerAccess.ConditionsContainerAccess.getMultiCondContainer (   self,
  channels,
  attrListColl,
  iovs 
)

Definition at line 142 of file ConditionsContainerAccess.py.

142  def getMultiCondContainer(self, channels, attrListColl, iovs) :
143 
144  # Args:
145  # channels - list of channels from COOL
146  # attrListColl - collection of AttributeLists with string address from COOL for each channel
147  # iovs - list of IOVs for each channel
148  # cont - the LArConditionsContainer object
149 
150  # Print out channels and IOV
151  print("Channels, IOV, and string addresses")
152  i = 0
153  for chan in channels :
154  iov = iovs[i]
155  print("added chan/iov: ", chan, iov.iovPrint())
156  i += 1
157 
158  # print out collection
159  #attrListColl.dump()
160 
161  # Must set dummy string address to include type name for
162  # AthenaPoolCnvSvc statistics gathering
163  strAddress = self.header
164 
165  # Get IOpaqueAddress
166  print("Create IOpaqueAddress pointer")
167  ioa = PyLCGDict.libPyROOT.MakeNullPointer('GenericAddress')
168 
169  # Get DataBucketBase pointer
170  print("Create DataBucketBase pointer")
171  dbb = PyLCGDict.libPyROOT.MakeNullPointer('DataBucketBase')
172 
173  # Create IOA from string address
174  print("Create IOpaqueAddress for address list")
175  sc = self.iaddr.createAddress( 0, 0, strAddress, ioa )
176  print("Status code: ", sc)
177 
178  # Create CondAttrListCollAddress and add in attribute list
179  CondAttrListCollAddress = PyLCGDict.makeClass('CondAttrListCollAddress')
180  collAddr = CondAttrListCollAddress(ioa)
181  collAddr.setAttrListColl(attrListColl)
182 
183 
184  # Read in object as DataObject (or DatabucketBase)
185  print("Retrieve data object for IOA")
186  sc = self.icnv.createObj(collAddr, dbb)
187  print("Status code: ", sc)
188  if sc.isFailure(): raise RuntimeError("Cannot read object")
189 
190  # Cast to correct type and return it
191  print("cast data object to correct type: ",self.typeName)
192  result = PyLCGDict.libPyROOT.MakeNullPointer(self.type)
193  self.dbCast.castObject(self.typeName, dbb, result)
194 
195  # Reset iterator to allow a new type - bug in pyroot
196  #self.pyroot_typedef_bug_workaround()
197 
198  return result
199 

◆ getSingleCondContainer()

def python.ConditionsContainerAccess.ConditionsContainerAccess.getSingleCondContainer (   self)

Definition at line 123 of file ConditionsContainerAccess.py.

123  def getSingleCondContainer(self) :
124  # Get IOpaqueAddress
125  ioa = PyLCGDict.libPyROOT.MakeNullPointer('IOpaqueAddress')
126 
127  # Get DataBucketBase pointer
128  dbb = PyLCGDict.libPyROOT.MakeNullPointer('DataBucketBase')
129 
130  # Create IOA from string address
131  self.iaddr.createAddress( 0, 0, self.header, ioa )
132 
133  # Read in object as DataObject (or DatabucketBase)
134  self.icnv.createObj(ioa, dbb)
135 
136  # Cast to correct type and return it
137  result = PyLCGDict.libPyROOT.MakeNullPointer(self.type)
138  self.dbCast.castObject(self.typeName, dbb, result)
139 
140  return result
141 

◆ pyroot_typedef_bug_workaround()

def python.ConditionsContainerAccess.ConditionsContainerAccess.pyroot_typedef_bug_workaround (   self)

Definition at line 95 of file ConditionsContainerAccess.py.

95  def pyroot_typedef_bug_workaround(self):
96  # This method is temporary until we migrate to ROOT
97  # delete iterator types to prevent spurious typedeffing
98  import libPyROOT
99 
100  try:
101  del libPyROOT.const_iterator
102  except AttributeError:
103  pass
104 
105  try:
106  del libPyROOT.iterator
107  except AttributeError:
108  pass
109 
110 

◆ setDescription()

def python.ConditionsContainerAccess.ConditionsContainerAccess.setDescription (   self,
  descr 
)

Definition at line 111 of file ConditionsContainerAccess.py.

111  def setDescription(self, descr) :
112  self.descr = descr
113  # extract type name and type
114  decoder = DescriptionDecoder(descr)
115  self.typeName = decoder.extract('<typeName>','</typeName>')
116  self.type = PyLCGDict.makeClass(self.typeName)
117  # extract the address header
118  self.header = decoder.extract('<addrHeader>','</addrHeader>')
119  self.header += 'POOLContainer_CondAttrListCollection][CLID=x'
120 
121  print("Type name, type, header ",self.typeName,self.type,self.header)
122 

Member Data Documentation

◆ dbCast

python.ConditionsContainerAccess.ConditionsContainerAccess.dbCast

Definition at line 93 of file ConditionsContainerAccess.py.

◆ descr

python.ConditionsContainerAccess.ConditionsContainerAccess.descr

Definition at line 112 of file ConditionsContainerAccess.py.

◆ header

python.ConditionsContainerAccess.ConditionsContainerAccess.header

Definition at line 118 of file ConditionsContainerAccess.py.

◆ iaddr

python.ConditionsContainerAccess.ConditionsContainerAccess.iaddr

Definition at line 90 of file ConditionsContainerAccess.py.

◆ icnv

python.ConditionsContainerAccess.ConditionsContainerAccess.icnv

Definition at line 86 of file ConditionsContainerAccess.py.

◆ type

python.ConditionsContainerAccess.ConditionsContainerAccess.type

Definition at line 116 of file ConditionsContainerAccess.py.

◆ typeName

python.ConditionsContainerAccess.ConditionsContainerAccess.typeName

Definition at line 115 of file ConditionsContainerAccess.py.


The documentation for this class was generated from the following file:
CondAttrListCollAddress
This class provides the an IOpaqueAddress/GenericAddress which can hold a pointer to an CondAttrListC...
Definition: CondAttrListCollAddress.h:27
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70