ATLAS Offline Software
Loading...
Searching...
No Matches
python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock Class Reference
Inheritance diagram for python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock:
Collaboration diagram for python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock:

Public Member Functions

 __init__ (self)
 instanceName (self)
Path get_output_path (self)
None makeAlgs (self, config)

Detailed Description

ConfigBlock for tool properties printing.

This class handles configuration for printing tool properties to a specified
output file.

Definition at line 9 of file PrintToolConfigAlgConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock.__init__ ( self)

Definition at line 16 of file PrintToolConfigAlgConfig.py.

16 def __init__(self):
17 super (PrintToolConfigAlgBlock, self).__init__ ()
18
19 self.addOption('OutputFile', 'tool_config.txt', type=str,
20 info="Name of the file where the tool configuration will be written.")
21 self.addOption('OutputDir', None, type=str,
22 info="Directory where the output file will be written. If 'None',"
23 " the current directory of the job.")
24

Member Function Documentation

◆ get_output_path()

Path python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock.get_output_path ( self)
Get the complete output file path.

Returns:
    Path object representing the full output file path.

Definition at line 29 of file PrintToolConfigAlgConfig.py.

29 def get_output_path(self) -> Path:
30 """Get the complete output file path.
31
32 Returns:
33 Path object representing the full output file path.
34 """
35 output_dir = self.OutputDir if self.OutputDir is not None else Path.cwd()
36 return Path(output_dir) / self.OutputFile
37

◆ instanceName()

python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock.instanceName ( self)
Return the instance name for this block

Definition at line 25 of file PrintToolConfigAlgConfig.py.

25 def instanceName (self) :
26 """Return the instance name for this block"""
27 return '' # no instance name needed for singleton block
28

◆ makeAlgs()

None python.PrintToolConfigAlgConfig.PrintToolConfigAlgBlock.makeAlgs ( self,
config )
Create and configure the PrintToolConfigAlg algorithm.

Args:
    config: Configuration object used to create the algorithm.

Definition at line 38 of file PrintToolConfigAlgConfig.py.

38 def makeAlgs(self, config) -> None:
39 """Create and configure the PrintToolConfigAlg algorithm.
40
41 Args:
42 config: Configuration object used to create the algorithm.
43 """
44 if isAthena and useComponentAccumulator:
45 # we leave the implementation for Athena/AthAnalysis to a future MR
46 # this will be based on https://gitlab.cern.ch/atlas/athena/-/merge_requests/77616
47 return
48
49 alg = config.createAlgorithm('CP::PrintToolConfigAlg', 'PrintToolConfigAlg')
50 alg.OutputFile = str(self.get_output_path())

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