9 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
11 flags.Input.isMC =
True
13 flags.Input.Files = [
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"]
16 flags.Concurrency.NumThreads = 1
18 flags.Scheduler.ShowDataDeps =
True
19 flags.Scheduler.ShowDataFlow =
True
20 flags.Scheduler.ShowControlFlow =
True
21 flags.Concurrency.NumConcurrentEvents = 1
29 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
32 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
36 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
41 from AthenaConfiguration.ComponentFactory
import CompFactory
48 sequencename =
"JetInputSeq"
50 inputcfg.addSequence( CompFactory.AthSequencer(sequencename, ModeOR=
True) )
53 from xAODBase.xAODType
import xAODType
57 jetmodseq = CompFactory.JetConstituentModSequence(
"JetMod_LCOrigin")
58 jetmodseq.InputType=xAODType.CaloCluster
59 jetmodseq.InputContainer =
"CaloCalTopoClusters"
60 jetmodseq.OutputContainer =
"LCOriginTopoClusters"
65 CompFactory.CaloClusterConstituentsOrigin(
"ClusterOrigin",InputType=xAODType.CaloCluster)
67 jetmodseq.Modifiers = modlist
70 jetmodalg = CompFactory.JetAlgorithm(
75 inputcfg.addEventAlgo(jetmodalg,sequencename)
79 constitpjgalg = CompFactory.PseudoJetAlgorithm(
81 InputContainer =
"LCOriginTopoClusters",
82 OutputContainer =
"PseudoJetLCTopo",
84 SkipNegativeEnergy=
True)
86 ghostpjgalg = CompFactory.PseudoJetAlgorithm(
88 InputContainer =
"TruthParticles",
89 OutputContainer =
"PseudoJetGhostTruth",
91 SkipNegativeEnergy=
True)
93 pjcs = [constitpjgalg.OutputContainer,ghostpjgalg.OutputContainer]
96 inputcfg.addEventAlgo(constitpjgalg,sequencename)
97 inputcfg.addEventAlgo(ghostpjgalg,sequencename)
109 sequencename =
"JetBuildSeq"
110 buildcfg.addSequence( CompFactory.AthSequencer(sequencename) )
113 buildcfg.merge(inputcfg)
116 mergepjalg = CompFactory.PseudoJetMerger(
117 "pjmergealg_"+buildjetsname,
118 InputPJContainers = pjcs,
119 OutputContainer =
"PseudoJetMerged_"+buildjetsname)
121 buildcfg.addEventAlgo(mergepjalg)
124 jclust = CompFactory.JetClusterer(
"builder")
125 jclust.JetAlgorithm =
"AntiKt"
126 jclust.JetRadius = 1.0
128 jclust.GhostArea = 0.01
129 jclust.InputPseudoJets =
"PseudoJetMerged_"+buildjetsname
130 jclust.JetInputType = 1
135 jclsmoms = CompFactory.JetClusterMomentsTool(
"clsmoms",
136 JetContainer = buildjetsname)
141 jra = CompFactory.JetRecAlg(
144 Modifiers = [jclsmoms],
145 OutputContainer = buildjetsname)
148 buildcfg.addEventAlgo( jra, sequencename )
158 sequencename =
"JetGroomSeq"
159 groomcfg.addSequence( CompFactory.AthSequencer(sequencename) )
162 jtrim = CompFactory.getComp(
"JetGrooming::JetTrimming")(
"trimSmallR2Frac5",RClus=0.2,PtFrac=0.05)
163 jtrim.UngroomedJets = buildjetsname
164 jtrim.ParentPseudoJets =
"PseudoJetMerged_"+buildjetsname
169 jra = CompFactory.JetRecAlg(
173 OutputContainer = groomjetsname)
176 groomcfg.addEventAlgo( jra, sequencename )
186 sequencename =
"JetCopySeq"
187 copycfg.addSequence( CompFactory.AthSequencer(sequencename) )
190 jcopy = CompFactory.JetCopier(
"copier")
191 jcopy.InputJets = buildjetsname
194 jclsmoms = CompFactory.JetClusterMomentsTool(
"clsmoms",
195 JetContainer = copyjetsname)
200 jra = CompFactory.JetRecAlg(
203 Modifiers = [jclsmoms],
204 OutputContainer = copyjetsname)
207 copycfg.addEventAlgo( jra, sequencename )
210 if __name__==
"__main__":
213 buildjetsname =
"MyAntiKt10LCTopoJets"
214 groomjetsname =
"MyAntiKt10LCTopoTrimmedSmallR5Frac20Jets"
215 copyjetsname =
"CopyAntiKt10LCTopoJets"
218 cfg.merge(
JetCopyAlgCfg(flags, buildjetsname, copyjetsname) )
222 outputlist = [
"EventInfo#*"]
223 jetlist = [buildjetsname,groomjetsname,copyjetsname]
224 for jetcoll
in jetlist:
225 if "Copy" in jetcoll:
226 outputlist += [
"xAOD::JetContainer#"+copyjetsname,
227 "xAOD::ShallowAuxContainer#"+copyjetsname+
"Aux.-PseudoJet"]
229 outputlist += [
"xAOD::JetContainer#"+jetcoll,
230 "xAOD::JetAuxContainer#"+jetcoll+
"Aux.-PseudoJet"]
233 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg, outputStreamName
235 from pprint
import pprint
243 cfg.run(maxEvents=10)