ATLAS Offline Software
Loading...
Searching...
No Matches
JetRecAlgTestCfg Namespace Reference

Functions

 JetInputCfg (flags)
 JetBuildAlgCfg (flags, buildjetsname)
 JetGroomAlgCfg (flags, buildjetsname, groomjetsname)
 JetCopyAlgCfg (flags, buildjetsname, copyjetsname)

Variables

 flags = initConfigFlags()
 isMC
 Files
 NumThreads
 ShowDataDeps
 ShowDataFlow
 ShowControlFlow
 NumConcurrentEvents
 cfg = MainServicesCfg(flags)
str buildjetsname = "MyAntiKt10LCTopoJets"
str groomjetsname = "MyAntiKt10LCTopoTrimmedSmallR5Frac20Jets"
str copyjetsname = "CopyAntiKt10LCTopoJets"
list outputlist = ["EventInfo#*"]
list jetlist = [buildjetsname,groomjetsname,copyjetsname]
 maxEvents

Function Documentation

◆ JetBuildAlgCfg()

JetRecAlgTestCfg.JetBuildAlgCfg ( flags,
buildjetsname )

Definition at line 102 of file JetRecAlgTestCfg.py.

102def JetBuildAlgCfg(flags,buildjetsname):
103 buildcfg = ComponentAccumulator()
104
105 # Create a sequence that holds a set of algorithms
106 # -- mainly for understanding how chunks of the job
107 # relate to each other
108
109 sequencename = "JetBuildSeq"
110 buildcfg.addSequence( CompFactory.AthSequencer(sequencename) )
111 # Merge in config to get jet inputs
112 inputcfg, pjcs = JetInputCfg(flags)
113 buildcfg.merge(inputcfg)
114
115 # Create a merger to build the PseudoJetContainer for this specific jet collection
116 mergepjalg = CompFactory.PseudoJetMerger(
117 "pjmergealg_"+buildjetsname,
118 InputPJContainers = pjcs,
119 OutputContainer = "PseudoJetMerged_"+buildjetsname)
120
121 buildcfg.addEventAlgo(mergepjalg)
122
123 # Create the JetClusterer, set some standard options
124 jclust = CompFactory.JetClusterer("builder")
125 jclust.JetAlgorithm = "AntiKt"
126 jclust.JetRadius = 1.0
127 jclust.PtMin = 10e3 # MeV
128 jclust.GhostArea = 0.01
129 jclust.InputPseudoJets = "PseudoJetMerged_"+buildjetsname
130 jclust.JetInputType = 1 # Hardcoded "magic number" for now
131 # See https://gitlab.cern.ch/atlas/athena/blob/master/Event/xAOD/xAODJet/xAODJet/JetContainerInfo.h
132 # This should get its own dictionary.
133
134 # Add a simple jet modifier to the JetRecAlg
135 jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms",
136 JetContainer = buildjetsname)
137
138 # Create the JetRecAlg, configure it to use the builder
139 # using constructor syntax instead
140 # (equivalent to setting properties with "=")
141 jra = CompFactory.JetRecAlg(
142 "JRA_build",
143 Provider = jclust, # Single ToolHandle
144 Modifiers = [jclsmoms], # ToolHandleArray
145 OutputContainer = buildjetsname)
146
147 # Add the alg to the ComponentAccumulator in the named sequence
148 buildcfg.addEventAlgo( jra, sequencename )
149 return buildcfg
150
151# Return a ComponentAccumulator holding the jet groom sequence

◆ JetCopyAlgCfg()

JetRecAlgTestCfg.JetCopyAlgCfg ( flags,
buildjetsname,
copyjetsname )

Definition at line 180 of file JetRecAlgTestCfg.py.

180def JetCopyAlgCfg(flags,buildjetsname,copyjetsname):
181 copycfg = ComponentAccumulator()
182
183 # Create a sequence that holds a set of algorithms
184 # -- mainly for understanding how chunks of the job
185 # relate to each other
186 sequencename = "JetCopySeq"
187 copycfg.addSequence( CompFactory.AthSequencer(sequencename) )
188
189 # Create the JetCopier, set some standard options
190 jcopy = CompFactory.JetCopier("copier")
191 jcopy.InputJets = buildjetsname
192
193 # Add a simple jet modifier to the JetRecAlg
194 jclsmoms = CompFactory.JetClusterMomentsTool("clsmoms",
195 JetContainer = copyjetsname)
196
197 # Create the JetRecAlg, configure it to use the copier
198 # using constructor syntax instead
199 # (equivalent to setting properties with "=")
200 jra = CompFactory.JetRecAlg(
201 "JRA_copy",
202 Provider = jcopy, # Single ToolHandle
203 Modifiers = [jclsmoms], # ToolHandleArray
204 OutputContainer = copyjetsname)
205
206 # Add the alg to the ComponentAccumulator in the named sequence
207 copycfg.addEventAlgo( jra, sequencename )
208 return copycfg
209

◆ JetGroomAlgCfg()

JetRecAlgTestCfg.JetGroomAlgCfg ( flags,
buildjetsname,
groomjetsname )

Definition at line 152 of file JetRecAlgTestCfg.py.

152def JetGroomAlgCfg(flags,buildjetsname,groomjetsname):
153 groomcfg = ComponentAccumulator()
154
155 # Create a sequence that holds a set of algorithms
156 # -- mainly for understanding how chunks of the job
157 # relate to each other
158 sequencename = "JetGroomSeq"
159 groomcfg.addSequence( CompFactory.AthSequencer(sequencename) )
160
161 # Create the JetGroomer, provide it with a JetTrimmer
162 jtrim = CompFactory.getComp("JetGrooming::JetTrimming")("trimSmallR2Frac5",RClus=0.2,PtFrac=0.05)
163 jtrim.UngroomedJets = buildjetsname
164 jtrim.ParentPseudoJets = "PseudoJetMerged_"+buildjetsname
165
166 # Create the JetRecAlg, configure it to use the builder
167 # using constructor syntax instead
168 # (equivalent to setting properties with "=")
169 jra = CompFactory.JetRecAlg(
170 "JRA_trim",
171 Provider = jtrim, # Single ToolHandle
172 Modifiers = [], # ToolHandleArray
173 OutputContainer = groomjetsname)
174
175 # Add the alg to the ComponentAccumulator in the named sequence
176 groomcfg.addEventAlgo( jra, sequencename )
177 return groomcfg
178
179# Return a ComponentAccumulator holding the jet copy sequence

◆ JetInputCfg()

JetRecAlgTestCfg.JetInputCfg ( flags)

Definition at line 44 of file JetRecAlgTestCfg.py.

44def JetInputCfg(flags):
45 # Create a sequence that holds a set of algorithms
46 # -- mainly for understanding how chunks of the job
47 # relate to each other
48 sequencename = "JetInputSeq"
49 inputcfg = ComponentAccumulator()
50 inputcfg.addSequence( CompFactory.AthSequencer(sequencename, ModeOR=True) )
51
52
53 from xAODBase.xAODType import xAODType
54
55 # Apply some corrections to the topoclusters
56 # Example with property assignments
57 jetmodseq = CompFactory.JetConstituentModSequence("JetMod_LCOrigin")
58 jetmodseq.InputType=xAODType.CaloCluster
59 jetmodseq.InputContainer = "CaloCalTopoClusters"
60 jetmodseq.OutputContainer = "LCOriginTopoClusters"
61
62 # Build the list of modifiers to run
63 # Configuration with constructor keywords
64 modlist = [
65 CompFactory.CaloClusterConstituentsOrigin("ClusterOrigin",InputType=xAODType.CaloCluster)
66 ]
67 jetmodseq.Modifiers = modlist
68
69 # We need a JetAlgorithm to run the modseq, which is a tool
70 jetmodalg = CompFactory.JetAlgorithm(
71 "JetModAlg_LCOrigin",
72 Tools = [jetmodseq])
73
74 # Add the alg to the sequence in the ComponentAccumulator
75 inputcfg.addEventAlgo(jetmodalg,sequencename)
76
77 # Create a PseudoJetAlgorithm
78
79 constitpjgalg = CompFactory.PseudoJetAlgorithm(
80 "pjgalg_LCTopo",
81 InputContainer = "LCOriginTopoClusters",
82 OutputContainer = "PseudoJetLCTopo",
83 Label = "LCTopo",
84 SkipNegativeEnergy=True)
85
86 ghostpjgalg = CompFactory.PseudoJetAlgorithm(
87 "pjgalg_GhostTruth",
88 InputContainer = "TruthParticles",
89 OutputContainer = "PseudoJetGhostTruth",
90 Label = "GhostTruth",
91 SkipNegativeEnergy=True)
92
93 pjcs = [constitpjgalg.OutputContainer,ghostpjgalg.OutputContainer]
94
95 # Add the algs to the sequence in the ComponentAccumulator
96 inputcfg.addEventAlgo(constitpjgalg,sequencename)
97 inputcfg.addEventAlgo(ghostpjgalg,sequencename)
98
99 return inputcfg, pjcs
100
101# Return a ComponentAccumulator holding the jet building sequence

Variable Documentation

◆ buildjetsname

str JetRecAlgTestCfg.buildjetsname = "MyAntiKt10LCTopoJets"

Definition at line 213 of file JetRecAlgTestCfg.py.

◆ cfg

JetRecAlgTestCfg.cfg = MainServicesCfg(flags)

Definition at line 33 of file JetRecAlgTestCfg.py.

◆ copyjetsname

str JetRecAlgTestCfg.copyjetsname = "CopyAntiKt10LCTopoJets"

Definition at line 215 of file JetRecAlgTestCfg.py.

◆ Files

JetRecAlgTestCfg.Files

Definition at line 13 of file JetRecAlgTestCfg.py.

◆ flags

JetRecAlgTestCfg.flags = initConfigFlags()

Definition at line 10 of file JetRecAlgTestCfg.py.

◆ groomjetsname

str JetRecAlgTestCfg.groomjetsname = "MyAntiKt10LCTopoTrimmedSmallR5Frac20Jets"

Definition at line 214 of file JetRecAlgTestCfg.py.

◆ isMC

JetRecAlgTestCfg.isMC

Definition at line 11 of file JetRecAlgTestCfg.py.

◆ jetlist

list JetRecAlgTestCfg.jetlist = [buildjetsname,groomjetsname,copyjetsname]

Definition at line 223 of file JetRecAlgTestCfg.py.

◆ maxEvents

JetRecAlgTestCfg.maxEvents

Definition at line 243 of file JetRecAlgTestCfg.py.

◆ NumConcurrentEvents

JetRecAlgTestCfg.NumConcurrentEvents

Definition at line 21 of file JetRecAlgTestCfg.py.

◆ NumThreads

JetRecAlgTestCfg.NumThreads

Definition at line 16 of file JetRecAlgTestCfg.py.

◆ outputlist

list JetRecAlgTestCfg.outputlist = ["EventInfo#*"]

Definition at line 222 of file JetRecAlgTestCfg.py.

◆ ShowControlFlow

JetRecAlgTestCfg.ShowControlFlow

Definition at line 20 of file JetRecAlgTestCfg.py.

◆ ShowDataDeps

JetRecAlgTestCfg.ShowDataDeps

Definition at line 18 of file JetRecAlgTestCfg.py.

◆ ShowDataFlow

JetRecAlgTestCfg.ShowDataFlow

Definition at line 19 of file JetRecAlgTestCfg.py.