ATLAS Offline Software
Loading...
Searching...
No Matches
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
4from glob import glob
5
6#from AthenaCommon.Logging import logging
7#from AthenaCommon.Constants import DEBUG, INFO, VERBOSE
8from AthenaCommon.Constants import DEBUG
9
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
21
22from AthenaConfiguration.AllConfigFlags import initConfigFlags
23flags = initConfigFlags()
24
25
26flags.Input.Files = []
27for path in MyArgs.filesInput.split(','):
28 flags.Input.Files += glob(path)
29
30flags.Exec.SkipEvents = MyArgs.skipEvents
31flags.Exec.MaxEvents = MyArgs.maxEvents
32flags.Trigger.triggerConfig="DB"
33
34flags.lock()
35
36from AthenaConfiguration.MainServicesConfig import MainServicesCfg
37acc = MainServicesCfg(flags)
38from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
39acc.merge(PoolReadCfg(flags))
40
41from ZdcNtuple.ZdcNtupleConfig import ZdcNtupleCfg
42acc.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
66from AthenaConfiguration.ComponentFactory import CompFactory
67acc.addService(CompFactory.THistSvc(
68 Output = ["ANALYSIS DATAFILE='%s' OPT='RECREATE'" % MyArgs.outputFile]))
69
70acc.printConfig(withDetails=True)
71
72acc.foreach_component("*Zdc*").OutputLevel=DEBUG
73
74# Execute and finish
75sc = acc.run()
76
77# Success should be 0
78import sys
79sys.exit(not sc.isSuccess())