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

Public Member Functions

 __init__ (self)
 cfg (self)
 addCustomArguments (self)
 makeAlgSequence (self)
 initServiceCfg (self)
 run (self)

Public Attributes

 flags

Protected Attributes

 _cfg = None

Detailed Description

Definition at line 6 of file AthenaCPRunScript.py.

Constructor & Destructor Documentation

◆ __init__()

python.AthenaCPRunScript.AthenaCPRunScript.__init__ ( self)

Definition at line 7 of file AthenaCPRunScript.py.

7 def __init__(self):
8 super().__init__()
9 self.logger.info("AthenaCPRunScript initialized")
10 self._cfg = None
11 self.addCustomArguments()
12 # Avoid putting call to parse_args() here! Otherwise it is hard to retrieve the parser infos
13

Member Function Documentation

◆ addCustomArguments()

python.AthenaCPRunScript.AthenaCPRunScript.addCustomArguments ( self)

Definition at line 20 of file AthenaCPRunScript.py.

20 def addCustomArguments(self):
21 # derivedGroup = self.parser.add_argument_group('Athena specific arguments') # commented out for now to avoid compilation warning in Athena, add it back when needed
22 # add arguments here derivedGroup.add_argument(...)
23 return
24

◆ cfg()

python.AthenaCPRunScript.AthenaCPRunScript.cfg ( self)

Definition at line 15 of file AthenaCPRunScript.py.

15 def cfg(self):
16 if self._cfg is None:
17 raise ValueError('Service configuration not initialized, use initServiceCfg()')
18 return self._cfg
19

◆ initServiceCfg()

python.AthenaCPRunScript.AthenaCPRunScript.initServiceCfg ( self)

Definition at line 39 of file AthenaCPRunScript.py.

39 def initServiceCfg(self):
40 if not self.flags.locked():
41 raise ValueError('Flags must be locked before initializing services')
42 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
43 self._cfg = MainServicesCfg(self.flags)
44

◆ makeAlgSequence()

python.AthenaCPRunScript.AthenaCPRunScript.makeAlgSequence ( self)

Definition at line 25 of file AthenaCPRunScript.py.

25 def makeAlgSequence(self):
26 from AthenaConfiguration.ComponentFactory import CompFactory
27 algSeq = CompFactory.AthSequencer()
28 self.logger.info("Configuring algorithms based on YAML file")
29 configSeq = self.config.configure()
30 self.logger.info("Configuring common services")
31 from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
32 configAccumulator = ConfigAccumulator(autoconfigFromFlags=self.flags,
33 algSeq=algSeq,
34 noSystematics=self.args.no_systematics)
35 self.logger.info("Configuring algorithms")
36 configSeq.fullConfigure(configAccumulator)
37 return configAccumulator.CA
38
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)

◆ run()

python.AthenaCPRunScript.AthenaCPRunScript.run ( self)

Definition at line 45 of file AthenaCPRunScript.py.

45 def run(self):
46 self.setup()
47 self.flags.lock()
48 self.printFlags()
49
50 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
51 from EventBookkeeperTools.EventBookkeeperToolsConfig import CutFlowSvcCfg
52 self.initServiceCfg()
53 self.cfg.merge(PoolReadCfg(self.flags))
54 self.cfg.merge(CutFlowSvcCfg(self.flags))
55
56 outputFile = f"ANALYSIS DATAFILE='{self.outputName}.root' OPT='RECREATE'"
57 from AthenaConfiguration.ComponentFactory import CompFactory
58 self.cfg.addService(CompFactory.THistSvc(Output=[outputFile]))
59 self.cfg.merge(self.makeAlgSequence())
60 self.cfg.printConfig()
61
62 sc = self.cfg.run(self.flags.Exec.MaxEvents)
63 sys.exit(sc.isFailure())
64
Definition merge.py:1
Definition run.py:1

Member Data Documentation

◆ _cfg

python.AthenaCPRunScript.AthenaCPRunScript._cfg = None
protected

Definition at line 10 of file AthenaCPRunScript.py.

◆ flags

python.AthenaCPRunScript.AthenaCPRunScript.flags

Definition at line 53 of file AthenaCPRunScript.py.


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