Definition at line 5 of file EventLoopCPRunScript.py.
◆ __init__()
def python.EventLoopCPRunScript.EventLoopCPRunScript.__init__ |
( |
|
self | ) |
|
◆ addCustomArguments()
def python.EventLoopCPRunScript.EventLoopCPRunScript.addCustomArguments |
( |
|
self | ) |
|
Definition at line 12 of file EventLoopCPRunScript.py.
12 def addCustomArguments(self):
14 derivedGroup = self.parser.add_argument_group(
'EventLoop specific arguments')
15 derivedGroup.add_argument(
'--direct-driver', dest=
'direct_driver',
16 action=
'store_true', help=
'Run the job with the direct driver')
17 derivedGroup.add_argument(
'--strip', dest=
'strip', action=
'store_true', help=
'Move the analysis root file to the top level, and delete the work directory.'
18 ' Mainly useful for standardizing the output with the Athena framework.')
19 derivedGroup.add_argument(
'--work-dir', dest=
'work_dir', default=
'workDir', help=
'The work directory for the EL job')
◆ driverSubmit()
def python.EventLoopCPRunScript.EventLoopCPRunScript.driverSubmit |
( |
|
self, |
|
|
|
driver |
|
) |
| |
Important if you want to run code after submitting the job, with external driver e.g., ExecDriver.
Assistant function to call driver submit. Move the submission to a child process to avoid the main process being terminated.
Directly calling external driver submission will not return controls to the main process, the main thread will be terminated.
Definition at line 55 of file EventLoopCPRunScript.py.
55 def driverSubmit(self, driver):
57 Important if you want to run code after submitting the job, with external driver e.g., ExecDriver.
58 Assistant function to call driver submit. Move the submission to a child process to avoid the main process being terminated.
59 Directly calling external driver submission will not return controls to the main process, the main thread will be terminated.
62 if (pid := os.fork()) == 0:
63 driver.submit(self.job, self.args.work_dir)
◆ makeAlgSequence()
def python.EventLoopCPRunScript.EventLoopCPRunScript.makeAlgSequence |
( |
|
self | ) |
|
Definition at line 22 of file EventLoopCPRunScript.py.
22 def makeAlgSequence(self):
23 from AnaAlgorithm.AlgSequence
import AlgSequence
25 self.logger.
info(
"Configuring algorithms based on YAML file")
27 self.logger.
info(
"Configuring common services")
28 configAccumulator = ConfigAccumulator(autoconfigFromFlags=self.flags,
30 noSystematics=self.args.no_systematics)
31 self.logger.
info(
"Configuring algorithms")
32 configSeq.fullConfigure(configAccumulator)
◆ readSamples()
def python.EventLoopCPRunScript.EventLoopCPRunScript.readSamples |
( |
|
self | ) |
|
Definition at line 35 of file EventLoopCPRunScript.py.
35 def readSamples(self):
37 self.sampleHandler = ROOT.SH.SampleHandler()
38 sampleFiles = ROOT.SH.SampleLocal(f
"{self.args.output_name}")
39 self.logger.
info(
"Adding files to the sample handler")
40 for file
in self.inputList:
42 self.sampleHandler.
add(sampleFiles)
◆ run()
def python.EventLoopCPRunScript.EventLoopCPRunScript.run |
( |
|
self | ) |
|
Definition at line 69 of file EventLoopCPRunScript.py.
78 self.job = ROOT.EL.Job()
79 self.job.sampleHandler(self.sampleHandler)
80 self.job.
options().setDouble(ROOT.EL.Job.optMaxEvents, self.flags.Exec.MaxEvents)
81 self.job.
options().setString(ROOT.EL.Job.optSubmitDirMode,
'unique-link')
82 for alg
in self.makeAlgSequence():
84 self.job.outputAdd(ROOT.EL.OutputStream(
'ANALYSIS'))
86 driver = ROOT.EL.DirectDriver()
if self.args.direct_driver
else ROOT.EL.ExecDriver()
87 self.driverSubmit(driver)
88 if self.args.strip: self.stripPath()
◆ stripPath()
def python.EventLoopCPRunScript.EventLoopCPRunScript.stripPath |
( |
|
self | ) |
|
Definition at line 44 of file EventLoopCPRunScript.py.
47 self.logger.
info(
"Moving the analysis root file to the top level, and deleting the work directory. (--strip option)")
48 workDir = os.path.realpath(self.args.work_dir)
49 rootfilePath = os.path.realpath(os.path.join(workDir,
'data-ANALYSIS', f
'{self.args.output_name}.root'))
50 currentDir = os.getcwd()
51 shutil.move(rootfilePath, os.path.join(currentDir, f
"{self.args.output_name}.root"))
52 shutil.rmtree(workDir)
53 os.remove(os.path.join(currentDir, self.args.work_dir))
◆ job
python.EventLoopCPRunScript.EventLoopCPRunScript.job |
◆ sampleHandler
python.EventLoopCPRunScript.EventLoopCPRunScript.sampleHandler |
The documentation for this class was generated from the following file:
bool configure(asg::AnaToolHandle< ITrigGlobalEfficiencyCorrectionTool > &tool, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronEffToolsHandles, ToolHandleArray< IAsgElectronEfficiencyCorrectionTool > &electronSFToolsHandles, ToolHandleArray< CP::IMuonTriggerScaleFactors > &muonToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonEffToolsHandles, ToolHandleArray< IAsgPhotonEfficiencyCorrectionTool > &photonSFToolsHandles, const std::string &triggers, const std::map< std::string, std::string > &legsPerTool, unsigned long nToys, bool debug)