ATLAS Offline Software
Loading...
Searching...
No Matches
AFPDBBase.AFPDBTableBase Class Reference
Inheritance diagram for AFPDBBase.AFPDBTableBase:
Collaboration diagram for AFPDBBase.AFPDBTableBase:

Public Types

typedef HLT::TypeInformation::for_each_type_c< typenameEDMLIST::map, my_functor, my_result<>, my_arg< HLT::TypeInformation::get_cont, CONTAINER > >::type result

Public Member Functions

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

Public Attributes

list records = []
int iovStartRun = 0
int iovStartLumiBlock = 0
int iovEndRun = 0
int iovEndLumiBlock = 0
str tag = "AFPTest-00-00-00"
str folderName = "/FWD/AFP/TEST"
 spec = cool.RecordSpecification()
str desc = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="40774348" /></addrHeader><typeName>AthenaAttributeList</typeName>'
 data = cool.Record(self.spec)
 folderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, self.spec)
 folder = db.getFolder(self.folderName)

Detailed Description

Definition at line 42 of file AFPDBBase.py.

Member Typedef Documentation

◆ result

Definition at line 90 of file EDM_MasterSearch.h.

Constructor & Destructor Documentation

◆ __init__()

AFPDBBase.AFPDBTableBase.__init__ ( self)

Definition at line 43 of file AFPDBBase.py.

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

Member Function Documentation

◆ createOrGetFolder()

AFPDBBase.AFPDBTableBase.createOrGetFolder ( self,
db )

Definition at line 109 of file AFPDBBase.py.

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

◆ saveToDB()

AFPDBBase.AFPDBTableBase.saveToDB ( self)

Definition at line 100 of file AFPDBBase.py.

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

◆ serialiseHeader()

AFPDBBase.AFPDBTableBase.serialiseHeader ( self)

Definition at line 62 of file AFPDBBase.py.

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

◆ serialiseRecords()

AFPDBBase.AFPDBTableBase.serialiseRecords ( self)

Definition at line 69 of file AFPDBBase.py.

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

◆ serialiseTable()

AFPDBBase.AFPDBTableBase.serialiseTable ( self)

Definition at line 88 of file AFPDBBase.py.

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

Member Data Documentation

◆ data

AFPDBBase.AFPDBTableBase.data = cool.Record(self.spec)

Definition at line 57 of file AFPDBBase.py.

◆ desc

str AFPDBBase.AFPDBTableBase.desc = '<timeStamp>run-lumi</timeStamp><addrHeader><address_header service_type="71" clid="40774348" /></addrHeader><typeName>AthenaAttributeList</typeName>'

Definition at line 56 of file AFPDBBase.py.

◆ folder

AFPDBBase.AFPDBTableBase.folder = db.getFolder(self.folderName)

Definition at line 112 of file AFPDBBase.py.

◆ folderName

AFPDBBase.AFPDBTableBase.folderName = "/FWD/AFP/TEST"

Definition at line 51 of file AFPDBBase.py.

◆ folderSpec

AFPDBBase.AFPDBTableBase.folderSpec = cool.FolderSpecification(cool.FolderVersioning.MULTI_VERSION, self.spec)

Definition at line 58 of file AFPDBBase.py.

◆ iovEndLumiBlock

int AFPDBBase.AFPDBTableBase.iovEndLumiBlock = 0

Definition at line 48 of file AFPDBBase.py.

◆ iovEndRun

AFPDBBase.AFPDBTableBase.iovEndRun = 0

Definition at line 47 of file AFPDBBase.py.

◆ iovStartLumiBlock

int AFPDBBase.AFPDBTableBase.iovStartLumiBlock = 0

Definition at line 46 of file AFPDBBase.py.

◆ iovStartRun

int AFPDBBase.AFPDBTableBase.iovStartRun = 0

Definition at line 45 of file AFPDBBase.py.

◆ records

AFPDBBase.AFPDBTableBase.records = []

Definition at line 44 of file AFPDBBase.py.

◆ spec

AFPDBBase.AFPDBTableBase.spec = cool.RecordSpecification()

Definition at line 52 of file AFPDBBase.py.

◆ tag

AFPDBBase.AFPDBTableBase.tag = "AFPTest-00-00-00"

Definition at line 50 of file AFPDBBase.py.


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