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 8 of file AFPDBBase.py.

Member Function Documentation

◆ serialiseTypes()

def AFPDBBase.AFPDBRecordBase.serialiseTypes (   self)

Definition at line 21 of file AFPDBBase.py.

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

◆ serialiseValues()

def AFPDBBase.AFPDBRecordBase.serialiseValues (   self)

Definition at line 9 of file AFPDBBase.py.

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

◆ translateType()

def AFPDBBase.AFPDBRecordBase.translateType (   self,
  typeName 
)

Definition at line 32 of file AFPDBBase.py.

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

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