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 78 of file ConditionsContainerAccess.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 79 of file ConditionsContainerAccess.py.

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

Member Function Documentation

◆ getMultiCondContainer()

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

Definition at line 141 of file ConditionsContainerAccess.py.

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

◆ getSingleCondContainer()

def python.ConditionsContainerAccess.ConditionsContainerAccess.getSingleCondContainer (   self)

Definition at line 122 of file ConditionsContainerAccess.py.

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

◆ pyroot_typedef_bug_workaround()

def python.ConditionsContainerAccess.ConditionsContainerAccess.pyroot_typedef_bug_workaround (   self)

Definition at line 94 of file ConditionsContainerAccess.py.

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

◆ setDescription()

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

Definition at line 110 of file ConditionsContainerAccess.py.

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

Member Data Documentation

◆ dbCast

python.ConditionsContainerAccess.ConditionsContainerAccess.dbCast

Definition at line 92 of file ConditionsContainerAccess.py.

◆ descr

python.ConditionsContainerAccess.ConditionsContainerAccess.descr

Definition at line 111 of file ConditionsContainerAccess.py.

◆ header

python.ConditionsContainerAccess.ConditionsContainerAccess.header

Definition at line 117 of file ConditionsContainerAccess.py.

◆ iaddr

python.ConditionsContainerAccess.ConditionsContainerAccess.iaddr

Definition at line 89 of file ConditionsContainerAccess.py.

◆ icnv

python.ConditionsContainerAccess.ConditionsContainerAccess.icnv

Definition at line 85 of file ConditionsContainerAccess.py.

◆ type

python.ConditionsContainerAccess.ConditionsContainerAccess.type

Definition at line 115 of file ConditionsContainerAccess.py.

◆ typeName

python.ConditionsContainerAccess.ConditionsContainerAccess.typeName

Definition at line 114 of file ConditionsContainerAccess.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZj_MiNNLO.ZZj_MiNNLO.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZj_MiNNLO.py:18
CondAttrListCollAddress
This class provides the an IOpaqueAddress/GenericAddress which can hold a pointer to an CondAttrListC...
Definition: CondAttrListCollAddress.h:27
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26