ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
ForwardDetectors
ZDC
ZdcNtuple
scripts
runZdcNtuple_OO.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
4
from
glob
import
glob
5
6
#from AthenaCommon.Logging import logging
7
#from AthenaCommon.Constants import DEBUG, INFO, VERBOSE
8
from
AthenaCommon.Constants
import
DEBUG
9
10
def
GetCustomAthArgs
():
11
from
argparse
import
ArgumentParser
12
parser = ArgumentParser(description=
'Parser for IDPVM configuration'
)
13
parser.add_argument(
"--filesInput"
, required=
True
)
14
parser.add_argument(
"--maxEvents"
, help=
"Maximum number of events to process"
, default=-1, type=int)
15
parser.add_argument(
"--skipEvents"
, help=
"Skip this number of events. Default: no events are skipped"
, default=0, type=int)
16
parser.add_argument(
"--outputFile"
, help=
"Name of output file"
, default=
"ZdcNtuple.outputs.root"
, type=str)
17
return
parser.parse_args()
18
19
# Parse the arguments
20
MyArgs =
GetCustomAthArgs
()
21
22
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
23
flags = initConfigFlags()
24
25
26
flags.Input.Files = []
27
for
path
in
MyArgs.filesInput.split(
','
):
28
flags.Input.Files += glob(path)
29
30
flags.Exec.SkipEvents = MyArgs.skipEvents
31
flags.Exec.MaxEvents = MyArgs.maxEvents
32
flags.Trigger.triggerConfig=
"DB"
33
34
flags.lock()
35
36
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
37
acc = MainServicesCfg(flags)
38
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
39
acc.merge(PoolReadCfg(flags))
40
41
from
ZdcNtuple.ZdcNtupleConfig
import
ZdcNtupleCfg
42
acc.merge(ZdcNtupleCfg(flags, name =
"AnalysisAlg"
,
43
zdcConfig =
"OONeNe2025"
,
44
lhcf2022 =
False
,
45
lhcf2022zdc =
False
,
46
lhcf2022afp =
False
,
47
pbpb2023 =
False
,
48
oo2025 =
True
,
49
zdcOnly =
False
,
50
useGRL =
True
,
51
grlFilename =
"$ROOTCOREBIN/data/data25_hi.OxygenOxygen_DetStatus-v137-pro49-01_MERGED_PHYS_HeavyIonP_All_Good_IgnoreBSPOT_INVALID.xml"
,
52
zdcCalib =
False
,
53
reprocZdc =
True
,
54
doZdcCalib =
True
,
55
auxSuffix =
"rerun"
,
56
enableOutputTree =
True
,
57
enableOutputSamples =
True
,
58
enableTrigger =
True
,
59
enableID =
True
,
60
enableTracks =
True
,
61
trackLimit = 1500,
62
enableClusters =
True
,
63
enableCalo =
True
,
64
writeOnlyTriggers =
True
))
65
66
from
AthenaConfiguration.ComponentFactory
import
CompFactory
67
acc.addService(CompFactory.THistSvc(
68
Output = [
"ANALYSIS DATAFILE='%s' OPT='RECREATE'"
% MyArgs.outputFile]))
69
70
acc.printConfig(withDetails=
True
)
71
72
acc.foreach_component(
"*Zdc*"
).OutputLevel=DEBUG
73
74
# Execute and finish
75
sc = acc.run()
76
77
# Success should be 0
78
import
sys
79
sys.exit(
not
sc.isSuccess())
Constants
runZdcNtuple_OO.GetCustomAthArgs
GetCustomAthArgs()
Definition
runZdcNtuple_OO.py:10
Generated on
for ATLAS Offline Software by
1.17.0