2 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from argparse
import ArgumentParser
7 parser = ArgumentParser()
8 parser.add_argument(
"--threads",
"-t", type=int, help=
"number of threads", default=1)
9 parser.add_argument(
"--outputFile", default=
"IsoCloseByTestFile.root", help=
"File name of the output file", metavar=
"FILE")
10 parser.add_argument(
"--inputFile",
"-i", default=[], help=
"Input file to run on ", nargs=
"+")
11 parser.add_argument(
"--dir",
"-d", default=[], help=
"List of directories containing the root files", nargs=
"+")
12 parser.add_argument(
"--maxEvents", default=-1, type=int, help=
"How many events shall be run maximally")
13 parser.add_argument(
"--skipEvents", default=0, type=int, help=
"How many events shall be skipped at the beginning of the job")
16 if __name__ ==
"__main__":
17 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
20 flags.Concurrency.NumThreads = args.threads
21 flags.Concurrency.NumConcurrentEvents = args.threads
22 flags.Input.Files = [iii
for ii
in [i.split(
',')
for i
in args.inputFile]
for iii
in ii]
23 from os
import listdir
24 for direc
in args.dir:
25 flags.Input.Files += [
"%s/%s" % (direc, x)
for x
in listdir(direc)
if x[x.rfind(
".") + 1:]
in [
"root",
"1"]]
26 if len(flags.Input.Files) == 0:
27 logging.warning(
"No input files were parsed")
28 flags.Exec.MaxEvents = args.maxEvents
29 flags.Exec.SkipEvents = args.skipEvents
33 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
35 msgService = cfg.getService(
'MessageSvc')
36 msgService.Format =
"S:%s E:%e % F%128W%S%7W%R%T %0W%M"
38 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
42 from IsolationAlgs.DerivationTrackIsoConfig
import DerivationTrackIsoCfg
43 from IsolationSelection.IsolationSelectionConfig
import (IsoCloseByCorrSkimmingAlgCfg, TestIsoCloseByCorrectionCfg,
44 IsolationSelectionToolCfg, IsoCloseByCorrectionToolCfg, IsoCloseByCaloDecorCfg)
47 listofTTVAWP = [
'Nonprompt_All_MaxWeight' ]
49 from DerivationFrameworkInDet.InDetCommonConfig
import InDetCommonCfg
51 DoVertexFinding =
False,
52 AddPseudoTracks=
False,
55 for WP
in listofTTVAWP:
58 OutContainerKey=
"AssocCloseByTracks"))
60 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
62 from IsolationAlgs.IsolationSteeringDerivConfig
import IsolationSteeringDerivCfg
65 from MuonMomentumCorrections.MCastCfg
import setupCalibratedMuonProviderCfg
67 from ElectronPhotonFourMomentumCorrection.EgammaCalibCfg
import setupEgammaCalibProviderCfg
71 ElectronWP=
"PflowTight_FixedRad",
72 MuonWP=
"PflowTight_FixedRad",
73 InMuonContainer =
"Muons",
74 InElecContainer =
"Electrons"))
76 BackupPrefix=
"vanilla",
77 IsolationSelectionTool = iso_tool,
78 SelectionDecorator =
"considerInCorrection",
79 IsolationSelectionDecorator =
"correctedIsol"))
82 containers = [
"Electrons",
"Muons",
"Photons"] ))
85 BackupPrefix=
"vanilla",
86 MuonContainer =
"CalibratedMuons",
87 EleContainer =
"CalibElectrons",
89 TrackKey =
"AssocCloseByTracks",
90 IsolationSelectionTool = iso_tool,
91 SelectionDecorator =
"considerInCorrection",
92 IsolationDecorator =
"defaultIso",
93 UpdatedIsoDecorator=
"correctedIsol",
94 IsoCloseByCorrTool = iso_corr_tool))
96 histSvc = CompFactory.THistSvc(Output=[
"ISOCORRECTION DATAFILE='%s', OPT='RECREATE'"%(args.outputFile)])
97 cfg.addService(histSvc)
99 sc = cfg.run(flags.Exec.MaxEvents)
100 if not sc.isSuccess():