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

Public Member Functions

def __init__ (self)
 
def serialiseHeader (self)
 
def serialiseRecords (self)
 
def serialiseTable (self)
 
def saveToDB (self)
 
def createOrGetFolder (self, db)
 

Public Attributes

 records
 
 iovStartRun
 
 iovStartLumiBlock
 
 iovEndRun
 
 iovEndLumiBlock
 
 tag
 
 folderName
 
 spec
 
 desc
 
 data
 
 folderSpec
 
 folder
 

Detailed Description

Definition at line 43 of file AFPDBBase.py.

Constructor & Destructor Documentation

◆ __init__()

def AFPDBBase.AFPDBTableBase.__init__ (   self)

Definition at line 44 of file AFPDBBase.py.

44  def __init__ (self):
45  self.records = []
46  self.iovStartRun = 0
47  self.iovStartLumiBlock = 0
48  self.iovEndRun = 0
49  self.iovEndLumiBlock = 0
50 
51  self.tag = "AFPTest-00-00-00"
52  self.folderName = "/FWD/AFP/TEST"
53  self.spec = cool.RecordSpecification()
54 # self.spec.extend("data", cool.StorageType.Blob64k)
55  self.spec.extend("data", cool.StorageType.String16M)
56 # self.desc = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader><typeName>CondAttrListCollection</typeName>'
57  self.desc = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="40774348" /></addrHeader><typeName>AthenaAttributeList</typeName>'
58  self.data = cool.Record(self.spec)
59  self.folderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, self.spec)
60 
61 
62 

Member Function Documentation

◆ createOrGetFolder()

def AFPDBBase.AFPDBTableBase.createOrGetFolder (   self,
  db 
)

Definition at line 110 of file AFPDBBase.py.

110  def createOrGetFolder (self, db):
111  print (self.folderSpec)
112  if(db.existsFolder(self.folderName)):
113  self.folder=db.getFolder(self.folderName)
114  else:
115  self.folder=db.createFolder(self.folderName, self.folderSpec, self.desc, True)
116 
117 

◆ saveToDB()

def AFPDBBase.AFPDBTableBase.saveToDB (   self)

Definition at line 101 of file AFPDBBase.py.

101  def saveToDB (self):
102  self.data['data'] = self.serialiseTable()
103  iovStart=(self.iovStartRun<<32) + self.iovStartLumiBlock
104  print ("before self.iovEndRun=" + str(self.iovEndRun))
105  iovEnd=(self.iovEndRun<<32) + self.iovEndLumiBlock
106  print ("after self.iovEndRun=" + str(self.iovEndRun))
107 
108  self.folder.storeObject(iovStart, iovEnd, self.data, 0, self.tag)
109 

◆ serialiseHeader()

def AFPDBBase.AFPDBTableBase.serialiseHeader (   self)

Definition at line 63 of file AFPDBBase.py.

63  def serialiseHeader (self):
64  output = '"node_description": '
65 # output += '"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="1238547719" /></addrHeader<typeName>CondAttrListCollection</typeName>"'
66  output += '"<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type=\\"71\\" clid=\\"40774348\\" /></addrHeader><typeName>AthenaAttributeList</typeName> "'
67 
68  return output
69 

◆ serialiseRecords()

def AFPDBBase.AFPDBTableBase.serialiseRecords (   self)

Definition at line 70 of file AFPDBBase.py.

70  def serialiseRecords (self):
71  output = '"data_array": ['
72  if (len(self.records) > 0):
73  channelID = 1
74 
75  for entry in self.records:
76  output += '{'
77  output += '"' + str(channelID) + '" : '
78  output += entry.serialiseValues()
79  output += '}, '
80  channelID += 1
81 
82  # remove the last comma and space ", "
83  output = output[:-2]
84  # close bracket
85  output += ']'
86 
87  return output
88 

◆ serialiseTable()

def AFPDBBase.AFPDBTableBase.serialiseTable (   self)

Definition at line 89 of file AFPDBBase.py.

89  def serialiseTable (self):
90  if (len(self.records) < 1):
91  raise ValueError ("Empty records list. Please, fill records before serialising table.")
92 
93  output = '{'
94  output += self.serialiseHeader() + ', '
95  output += self.records[0].serialiseTypes() + ', '
96  output += self.serialiseRecords()
97  output += '}'
98 
99  return output
100 

Member Data Documentation

◆ data

AFPDBBase.AFPDBTableBase.data

Definition at line 58 of file AFPDBBase.py.

◆ desc

AFPDBBase.AFPDBTableBase.desc

Definition at line 57 of file AFPDBBase.py.

◆ folder

AFPDBBase.AFPDBTableBase.folder

Definition at line 113 of file AFPDBBase.py.

◆ folderName

AFPDBBase.AFPDBTableBase.folderName

Definition at line 52 of file AFPDBBase.py.

◆ folderSpec

AFPDBBase.AFPDBTableBase.folderSpec

Definition at line 59 of file AFPDBBase.py.

◆ iovEndLumiBlock

AFPDBBase.AFPDBTableBase.iovEndLumiBlock

Definition at line 49 of file AFPDBBase.py.

◆ iovEndRun

AFPDBBase.AFPDBTableBase.iovEndRun

Definition at line 48 of file AFPDBBase.py.

◆ iovStartLumiBlock

AFPDBBase.AFPDBTableBase.iovStartLumiBlock

Definition at line 47 of file AFPDBBase.py.

◆ iovStartRun

AFPDBBase.AFPDBTableBase.iovStartRun

Definition at line 46 of file AFPDBBase.py.

◆ records

AFPDBBase.AFPDBTableBase.records

Definition at line 45 of file AFPDBBase.py.

◆ spec

AFPDBBase.AFPDBTableBase.spec

Definition at line 53 of file AFPDBBase.py.

◆ tag

AFPDBBase.AFPDBTableBase.tag

Definition at line 51 of file AFPDBBase.py.


The documentation for this class was generated from the following file:
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569
str
Definition: BTagTrackIpAccessor.cxx:11