ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Algorithms
AsgAnalysisAlgorithms
share
testPileupReweightingAlgConfig.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 PileupReweightingToolCfg
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.PileupReweightingAlgConfig
import
(
17
PileupReweightingAlgCfg
18
)
19
20
def
get_parser
():
21
parser = ArgumentParser(description=__doc__)
22
parser.add_argument(
'input_files'
, nargs=
'*'
, help=_input_help)
23
parser.add_argument(
'-m'
,
'--max-events'
, type=int, const=10, nargs=
'?'
)
24
parser.add_argument(
'-d'
,
'--debug-logs'
, action=
'store_true'
)
25
return
parser.parse_args()
26
27
def
run
():
28
args =
get_parser
()
29
flags = initConfigFlags()
30
flags.Input.Files = args.input_files
or
[os.environ[
'ASG_TEST_FILE_MC'
]]
31
if
args.debug_logs:
32
flags.Exec.OutputLevel = DEBUG
33
if
args.max_events:
34
flags.Exec.MaxEvents = args.max_events
35
ca = MainServicesCfg(flags)
36
ca.merge(PoolReadCfg(flags))
37
38
ca.merge(PileupReweightingAlgCfg(flags))
39
40
ca.run()
41
42
if
__name__ ==
'__main__'
:
43
run
()
testPileupReweightingAlgConfig.get_parser
get_parser()
Definition
testPileupReweightingAlgConfig.py:20
testPileupReweightingAlgConfig.run
run()
Definition
testPileupReweightingAlgConfig.py:27
Generated on
for ATLAS Offline Software by
1.17.0