10 from argparse
import ArgumentParser
13 parser = ArgumentParser(
"egammaMonitoring")
14 parser.add_argument(
"-m",
"--maxEvents", default=60000, type=int,
15 help=
"The number of events to run. -1 runs all events.")
16 parser.add_argument(
"-p",
"--particleType", default=
'electron', type=str,
17 help=
"The particle type. electron or gamma")
18 parser.add_argument(
"-fwd",
"--addFwd", default=
'False', type=str,
19 help=
"Also run on fwd electrons")
20 parser.add_argument(
"-i",
"--inputFiles", default=
'Nightly_AOD.pool.root',
21 help=
'Comma separated list of input AOD files')
22 parser.add_argument(
"-o",
"--outputFileName", default=
'Nightly-monitoring.hist', type=str,
23 help=
"The output file name")
25 args = parser.parse_args()
27 addFwd =
True if args.addFwd ==
'True' else False
28 if args.particleType ==
'gamma' and addFwd:
29 print(
'Fwd electrons can only be read in an electron run')
33 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
34 from AthenaConfiguration.Enums
import ProductionStep
36 flags.Common.ProductionStep = ProductionStep.Simulation
37 isDir = os.path.isdir(args.inputFiles)
39 flags.Input.Files = [ args.inputFiles +
'/' + f
for f
in os.listdir(args.inputFiles) ]
41 flags.Input.Files = [ f
for f
in args.inputFiles.split(
',') ]
42 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
48 flags.LAr.doAlign =
False
49 flags.GeoModel.Align.LegacyConditionsAccess =
False
53 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
55 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
57 from TileGeoModel.TileGMConfig
import TileGMCfg
59 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
61 from egammaValidation.egammaMonitoringConfig
import egammaMonitoringCfg
63 particleType = args.particleType, \
64 outputFileName = args.outputFileName, \
68 sc = acc.run(maxEvents=args.maxEvents)
71 sys.exit(
not sc.isSuccess())