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

Public Member Functions

def serialiseValues (self)
 
def serialiseTypes (self)
 
def translateType (self, typeName)
 

Detailed Description

Definition at line 7 of file AFPDBBase.py.

Member Function Documentation

◆ serialiseTypes()

def AFPDBBase.AFPDBRecordBase.serialiseTypes (   self)

Definition at line 20 of file AFPDBBase.py.

20  def serialiseTypes (self):
21  output = '"folder_payloadspec": "'
22  for quantity in dir(self): # loop over all elements in class
23  if not callable(getattr(self, quantity)) and not quantity.startswith('__'): # select only user variables
24  output += quantity + ': ' + self.translateType(type(getattr(self, quantity))) + ', ' # append variable name and type
25 
26  output = output[:-2] # remove the last comma and space ", "
27  output += '"' # close parenthisis
28 
29  return output
30 

◆ serialiseValues()

def AFPDBBase.AFPDBRecordBase.serialiseValues (   self)

Definition at line 8 of file AFPDBBase.py.

8  def serialiseValues (self):
9  output = "["
10  for quantity in dir(self): # loop over all elements in class
11  if not callable(getattr(self, quantity)) and not quantity.startswith("__"): # select only user variables
12  # print ("Moj " + quantity + " wynosi: " + str(getattr(self, quantity)))
13  output += str(getattr(self, quantity)) + ", "
14 
15  output = output[:-2] # remove the last comma and space ", "
16  output += "]" # close bracket
17 
18  return output
19 

◆ translateType()

def AFPDBBase.AFPDBRecordBase.translateType (   self,
  typeName 
)

Definition at line 31 of file AFPDBBase.py.

31  def translateType (self, typeName):
32  if (typeName == int):
33  return "Int32"
34  elif (typeName == float):
35  return "Float"
36  elif (typeName == str):
37  return "String"
38  else:
39  raise ValueError ("Unknown type of field, typeName is %s. Need to update method translateType in AFPDBBase.py" % typeName)
40 
41 

The documentation for this class was generated from the following file:
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
beamspotman.dir
string dir
Definition: beamspotman.py:621
str
Definition: BTagTrackIpAccessor.cxx:11