ATLAS Offline Software
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
share
testPMGTruthWeightsAlg.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
"""
4
Test to run PMGTruthWeightsAlg
5
"""
6
7
_input_help =
"with no inputs use ASG_TEST_FILE_MC"
8
9
from
argparse
import
ArgumentParser
10
import
os
11
12
from
GaudiKernel.Configurable
import
DEBUG
13
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
14
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
15
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
16
from
AsgAnalysisAlgorithms.PMGTruthWeightAlgConfig
import
PMGTruthWeightAlgCfg
17
18
def
get_parser
():
19
parser = ArgumentParser(description=__doc__)
20
parser.add_argument(
'input_files'
, nargs=
'*'
, help=_input_help)
21
parser.add_argument(
'-m'
,
'--max-events'
, type=int, const=10, nargs=
'?'
)
22
parser.add_argument(
'-d'
,
'--debug-logs'
, action=
'store_true'
)
23
return
parser.parse_args()
24
25
def
run
():
26
args =
get_parser
()
27
flags =
initConfigFlags
()
28
flags.Input.Files = args.input_files
or
[os.environ[
'ASG_TEST_FILE_MC'
]]
29
if
args.debug_logs:
30
flags.Exec.OutputLevel = DEBUG
31
if
args.max_events:
32
flags.Exec.MaxEvents = args.max_events
33
ca =
MainServicesCfg
(flags)
34
ca.merge(
PoolReadCfg
(flags))
35
36
ca.merge(
PMGTruthWeightAlgCfg
(flags))
37
38
ca.run()
39
40
if
__name__ ==
'__main__'
:
41
run
()
python.PMGTruthWeightAlgConfig.PMGTruthWeightAlgCfg
def PMGTruthWeightAlgCfg(flags, systematicsRegex='.*')
Definition:
PMGTruthWeightAlgConfig.py:25
testPMGTruthWeightsAlg.get_parser
def get_parser()
Definition:
testPMGTruthWeightsAlg.py:18
testPMGTruthWeightsAlg.run
def run()
Definition:
testPMGTruthWeightsAlg.py:25
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition:
MainServicesConfig.py:260
run
Definition:
run.py:1
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition:
AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition:
PoolReadConfig.py:69
Generated on Mon Mar 10 2025 21:19:48 for ATLAS Offline Software by
1.8.18