ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
python.folders.DefectsDBFoldersMixin Class Reference
Inheritance diagram for python.folders.DefectsDBFoldersMixin:
Collaboration diagram for python.folders.DefectsDBFoldersMixin:

Public Member Functions

None __init__ (self)
 
cool.IFolderSet parent_folderset (self)
 
cool.IFolder defects_folder (self)
 
cool.IFolder defect_logic_folder (self)
 

Private Member Functions

None _clear_connections (self)
 
Tuple[cool.IFolder, cool.Record] _load_folder (self, folder, create_function)
 
None _load_defects_folder (self)
 
cool.IFolder _create_defects_folder (self, cool.IDatabase db)
 
None _load_defect_logic_folder (self)
 
cool.IFolder _create_defect_logic_folder (self, cool.IDatabase db)
 

Private Attributes

 _defects_folder
 
 _defect_logic_folder
 
 _parent_folderset
 
 _connections
 
 _defect_payload
 
 _defect_logic_payload
 

Detailed Description

This mixin contains code for managing the defect folders

Definition at line 17 of file folders.py.

Constructor & Destructor Documentation

◆ __init__()

None python.folders.DefectsDBFoldersMixin.__init__ (   self)

Definition at line 22 of file folders.py.

22  def __init__(self) -> None:
23  self._defects_folder = None
24  self._defect_logic_folder = None
25  self._parent_folderset = None
26  self._connections = []
27  super(DefectsDBFoldersMixin, self).__init__()
28 

Member Function Documentation

◆ _clear_connections()

None python.folders.DefectsDBFoldersMixin._clear_connections (   self)
private

Definition at line 29 of file folders.py.

29  def _clear_connections(self) -> None:
30  log.debug("DefectsDB connections cleared")
31  for connection in self._connections:
32  connection.closeDatabase()
33  self._connections = []
34 

◆ _create_defect_logic_folder()

cool.IFolder python.folders.DefectsDBFoldersMixin._create_defect_logic_folder (   self,
cool.IDatabase  db 
)
private
Creates the COOL database/folder for virtual defect logic, if they don't exist.
Internal - use create=True in the constructor to create the COOL folder.

Definition at line 115 of file folders.py.

115  def _create_defect_logic_folder(self, db: cool.IDatabase) -> cool.IFolder:
116  """
117  Creates the COOL database/folder for virtual defect logic, if they don't exist.
118  Internal - use create=True in the constructor to create the COOL folder.
119  """
120  log.info("Creating defect logic folder")
121 
122  record_spec = cool.RecordSpecification()
123  record_spec.extend("clauses", ST.String4k)
124 
125  folder_spec = cool.FolderSpecification(FV.MULTI_VERSION, record_spec)
126  return db.createFolder(DEFECT_LOGIC_FOLDER, folder_spec,
127  DEFECT_LOGIC_FOLDER_DESC, True)

◆ _create_defects_folder()

cool.IFolder python.folders.DefectsDBFoldersMixin._create_defects_folder (   self,
cool.IDatabase  db 
)
private
Creates the COOL database/folder for defects, if they don't exist.
Internal - use create=True in the constructor to create the COOL folder.

Definition at line 82 of file folders.py.

82  def _create_defects_folder(self, db: cool.IDatabase) -> cool.IFolder:
83  """
84  Creates the COOL database/folder for defects, if they don't exist.
85  Internal - use create=True in the constructor to create the COOL folder.
86  """
87  log.info("Creating defects folder")
88 
89  record_spec = cool.RecordSpecification()
90  record_spec.extend("present", ST.Bool)
91  record_spec.extend("recoverable", ST.Bool)
92  record_spec.extend("user", ST.String255)
93  record_spec.extend("comment", ST.String255)
94 
95  folder_spec = cool.FolderSpecification(FV.MULTI_VERSION, record_spec)
96  return db.createFolder(DEFECTS_FOLDER, folder_spec,
97  DEFECT_FOLDER_DESC, True)
98 

◆ _load_defect_logic_folder()

None python.folders.DefectsDBFoldersMixin._load_defect_logic_folder (   self)
private
Internal function for populating the self._defect_logic_folder variable

Definition at line 107 of file folders.py.

107  def _load_defect_logic_folder(self) -> None:
108  """
109  Internal function for populating the self._defect_logic_folder variable
110  """
111  res = self._load_folder(DEFECT_LOGIC_FOLDER,
112  self._create_defect_logic_folder)
113  self._defect_logic_folder, self._defect_logic_payload = res
114 

◆ _load_defects_folder()

None python.folders.DefectsDBFoldersMixin._load_defects_folder (   self)
private
Internal function for populating the self._defects_folder variable

Definition at line 74 of file folders.py.

74  def _load_defects_folder(self) -> None:
75  """
76  Internal function for populating the self._defects_folder variable
77  """
78  log.debug("Loading defects folder")
79  res = self._load_folder(DEFECTS_FOLDER, self._create_defects_folder)
80  self._defects_folder, self._defect_payload = res
81 

◆ _load_folder()

Tuple[cool.IFolder, cool.Record] python.folders.DefectsDBFoldersMixin._load_folder (   self,
  folder,
  create_function 
)
private
Internal function used to load a COOL folder

Definition at line 46 of file folders.py.

46  def _load_folder(self, folder, create_function) -> Tuple[cool.IFolder, cool.Record]:
47  """
48  Internal function used to load a COOL folder
49  """
50  db_folder_string = "%s::%s" % (self.connection_string, folder)
51 
52  if not self._create:
53  create_function = None
54 
55  db, folder = Databases.get_folder(db_folder_string,
56  read_only=self._read_only,
57  create_function=create_function,
58  also_db=True)
59 
60  self._connections.append(db)
61 
62  payload = cool.Record(folder.payloadSpecification())
63 
64  return folder, payload
65 

◆ defect_logic_folder()

cool.IFolder python.folders.DefectsDBFoldersMixin.defect_logic_folder (   self)
Returns the folder containing the virtual defect logic, loading it if necessary

Definition at line 100 of file folders.py.

100  def defect_logic_folder(self) -> cool.IFolder:
101  """
102  Returns the folder containing the virtual defect logic, loading it if necessary
103  """
104  if self._defect_logic_folder is None: self._load_defect_logic_folder()
105  return self._defect_logic_folder
106 

◆ defects_folder()

cool.IFolder python.folders.DefectsDBFoldersMixin.defects_folder (   self)
Returns the folder containing the defects, loading it if necessary

Definition at line 67 of file folders.py.

67  def defects_folder(self) -> cool.IFolder:
68  """
69  Returns the folder containing the defects, loading it if necessary
70  """
71  if self._defects_folder is None: self._load_defects_folder()
72  return self._defects_folder
73 

◆ parent_folderset()

cool.IFolderSet python.folders.DefectsDBFoldersMixin.parent_folderset (   self)
Lazy-loads parent folderset (useful for heirarchical tag manipulation)

Definition at line 36 of file folders.py.

36  def parent_folderset(self) -> cool.IFolderSet:
37  """
38  Lazy-loads parent folderset (useful for heirarchical tag manipulation)
39  """
40  if self._parent_folderset is None:
41  db = Databases.get_instance(self.connection_string,
42  read_only=self._read_only)
43  self._parent_folderset = db.getFolderSet(PARENT_FOLDERSET)
44  return self._parent_folderset
45 

Member Data Documentation

◆ _connections

python.folders.DefectsDBFoldersMixin._connections
private

Definition at line 26 of file folders.py.

◆ _defect_logic_folder

python.folders.DefectsDBFoldersMixin._defect_logic_folder
private

Definition at line 24 of file folders.py.

◆ _defect_logic_payload

python.folders.DefectsDBFoldersMixin._defect_logic_payload
private

Definition at line 113 of file folders.py.

◆ _defect_payload

python.folders.DefectsDBFoldersMixin._defect_payload
private

Definition at line 80 of file folders.py.

◆ _defects_folder

python.folders.DefectsDBFoldersMixin._defects_folder
private

Definition at line 23 of file folders.py.

◆ _parent_folderset

python.folders.DefectsDBFoldersMixin._parent_folderset
private

Definition at line 25 of file folders.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18