4 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
5 from AthenaConfiguration.ComponentFactory
import CompFactory
9 from MuonSelectorTools.MuonSelectorToolsConfig
import MuonSelectionToolCfg
11 from AsgAnalysisAlgorithms.PileupReweightingAlgConfig
import PileupReweightingToolCfg
13 the_alg = CompFactory.CP.MuonScaleFactorTestAlg(name, **kwargs)
14 result.addEventAlgo(the_alg, primary =
True)
19 kwargs.setdefault(
"ApplyKinematicSystematic",
False)
20 eff_tool = CompFactory.CP.MuonEfficiencyScaleFactors(name, **kwargs)
21 result.setPrivateTools(eff_tool)
26 if len(out_file) == 0:
return result
27 histSvc = CompFactory.THistSvc(Output=[
"MUONEFFTESTER DATAFILE='{out_file}', OPT='RECREATE'".
format(out_file = out_file)])
28 result.addService(histSvc, primary=
True)
32 from argparse
import ArgumentParser
34 parser = ArgumentParser()
35 parser.add_argument(
"--threads", type=int, help=
"number of threads", default=1)
36 parser.add_argument(
"--inputFile",
"-i", default=[
37 "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/mc20_13TeV.361107.PowhegPythia8EvtGen_AZNLOCTEQ6L1_Zmumu.recon.AOD.e3601_s3681_r13167/AOD.27312826._000061.pool.root.1"
39 help=
"Input file to run on ", nargs=
"+")
40 parser.add_argument(
"--outRootFile", default=
"EffiDump.root", help=
"Output ROOT file to dump the geomerty")
41 parser.add_argument(
"--maxEvents", type=int, help=
"Maximum events to run on", default = -1)
46 if __name__ ==
"__main__":
47 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
52 flags.Concurrency.NumThreads = args.threads
53 flags.Concurrency.NumConcurrentEvents = args.threads
54 flags.Input.Files = args.inputFile
55 flags.Scheduler.ShowDataDeps =
True
56 flags.Scheduler.ShowDataFlow =
True
58 flags.dump(evaluate=
True)
61 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
64 from AthenaConfiguration.Enums
import Format
65 if flags.Input.Format == Format.POOL:
66 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
71 WorkingPoint=
"Loose"))]
74 cfg.printConfig(withDetails=
True, summariseProps=
True)
76 sc = cfg.run(args.maxEvents)
77 if not sc.isSuccess():
79 sys.exit(
"Execution failed")