10 from egammaD3PDMaker.defineBlockAndAlg
import defineBlockAndAlg
11 from EventCommonD3PDMaker.DRAssociation
import DRAssociation
12 from D3PDMakerCoreComps.D3PDObject
import make_SGDataVector_D3PDObject
13 from D3PDMakerCoreComps.D3PDObject
import DeferArg
14 from D3PDMakerCoreComps.SimpleAssociation
import SimpleAssociation
15 from D3PDMakerConfig.D3PDMakerFlags
import D3PDMakerFlags
16 from D3PDMakerConfig.D3PDMakerFlags
import configFlags
17 from D3PDMakerCoreComps.resolveSGKey
import testSGKey
18 from D3PDMakerCoreComps.resolveSGKey
import resolveSGKey
19 from TrackD3PDMaker.xAODTrackSummaryFiller
import xAODTrackSummaryFiller
20 from D3PDMakerCoreComps.ContainedVectorMultiAssociation
import ContainedVectorMultiAssociation
21 from AthenaConfiguration.ComponentFactory
import CompFactory
23 D3PD = CompFactory.D3PD
28 make_SGDataVector_D3PDObject (
'xAOD::PhotonContainer',
29 D3PDMakerFlags.PhotonSGKey,
30 'ph_',
'PhotonD3PDObject')
33 auxprefix = DeferArg (
'D3PDMakerFlags.EgammaUserDataPrefix + "_" +'
34 'resolveSGKey (configFlags, sgkey) + "_"',
38 PhotonD3PDObject.defineBlock (0,
'Kinematics',
43 PhotonD3PDObject.defineBlock (
47 PhotonD3PDObject.defineBlock (
50 Vars = [
'loose = Loose',
53 PhotonD3PDObject.defineBlock (
58 PhotonD3PDObject.defineBlock (0,
'Conversion0',
67 AuxPrefix = auxprefix,
68 Vars = [
'maxEcell_time',
80 'egammaSumCellsGainAlg',
81 AuxPrefix = auxprefix,
100 'egammaNbCellsGainAlg',
101 AuxPrefix = auxprefix,
105 'nbCells_s0HighGain',
108 'nbCells_s1HighGain',
111 'nbCells_s2HighGain',
114 'nbCells_s3HighGain',
118 if D3PDMakerFlags.DoTruth:
119 truthClassification = \
120 PhotonD3PDObject.defineBlock (1,
'TruthClassification',
124 from TruthD3PDMaker.MCTruthClassifierConfig \
125 import D3PDMCTruthClassifierCfg
126 acc.merge (D3PDMCTruthClassifierCfg (flags))
127 c.Classifier = acc.getPublicTool (
'D3PDMCTruthClassifier')
129 truthClassification.defineHook (_truthClassificationHook)
130 PhotonTruthPartAssoc = SimpleAssociation \
135 blockname =
'TruthAssoc',
136 DRVar =
'deltaRRecPhoton')
138 from TruthD3PDMaker.MCTruthClassifierConfig \
139 import D3PDMCTruthClassifierCfg
140 acc.merge (D3PDMCTruthClassifierCfg (flags))
141 c.Associator.Classifier = acc.getPublicTool (
'D3PDMCTruthClassifier')
143 PhotonTruthPartAssoc.defineHook (_truthClassificationAssocHook)
144 PhotonTruthPartAssoc.defineBlock (0,
'TruthKin',
148 PhotonTruthPartAssoc.defineBlock (0,
'Truth',
151 PDGIDVariable =
'type')
152 PhotonTruthPartMotherAssoc = SimpleAssociation \
153 (PhotonTruthPartAssoc,
157 (
'PhotonTruthPartMotherAssoc2'),
158 blockname =
'PhotonTruthPartMotherAssoc',
160 PhotonTruthPartMotherAssoc.defineBlock (0,
'MotherTruth',
163 PDGIDVariable =
'type')
164 PhotonTruthPartAssoc.defineBlock (0,
'TruthAssocIndex',
170 PhotonD3PDObject.defineBlock (
173 Vars = [
'Ethad = ethad',
175 PhotonD3PDObject.defineBlock (
178 Vars = [
'E033 = e033 < float : 0'])
179 PhotonD3PDObject.defineBlock (
189 'E132 = e132 < float : 0',
190 'E1152 = e1152 < float : 0',
192 PhotonD3PDObject.defineBlock (1,
'Layer1ShapeExtra',
194 PhotonD3PDObject.defineBlock (
197 Vars = [
'E233 = e233',
201 PhotonD3PDObject.defineBlock (
204 Vars = [
'f3',
'f3core'])
205 PhotonD3PDObject.defineBlock (
208 Vars = [
'rphiallcalo = r33over37allcalo',
209 'Etcone20 = etcone20 < float: 0',
210 'Etcone30 = etcone30 < float: 0',
211 'Etcone40 = etcone40 < float: 0',
212 'ptcone20 < float: 0',
213 'ptcone30 < float: 0',
214 'ptcone40 < float: 0',
216 PhotonD3PDObject.defineBlock (
219 Vars = [
'Etcone20_pt_corrected = etcone20_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.20 cone',
220 'Etcone30_pt_corrected = etcone30_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.30 cone',
221 'Etcone40_pt_corrected = etcone40_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.40 cone',
223 PhotonD3PDObject.defineBlock (1,
'Conversion',
225 PhotonD3PDObject.defineBlock (1,
'Retaphi',
230 PhotonD3PDObject.defineBlock (
231 1,
'TopoClusterIsolationCones',
233 Vars = [
'topoEtcone20 = topoetcone20_core57cells,topoetcone20',
234 'topoEtcone30 = topoetcone30_core57cells,topoetcone30',
235 'topoEtcone40 = topoetcone40_core57cells,topoetcone40',
238 traversedMaterial = \
239 PhotonD3PDObject.defineBlock (2,
'TraversedMaterial',
242 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg
243 c.Extrapolator = acc.popToolsAndMerge (AtlasExtrapolatorCfg (flags))
245 traversedMaterial.defineHook (_traversedMaterialExtrapolatorHook)
248 PhotonD3PDObject.defineBlock (
251 Vars = [
'zvertex < float:0 ',
256 from egammaD3PDMaker.egammaCluster
import egammaCluster
257 PhotonClusterAssoc = egammaCluster (PhotonD3PDObject)
260 PhotonD3PDObject.defineBlock (
261 1,
'ConvDeltaEtaPhi',
263 Vars = [
'convMatchDeltaEta1',
264 'convMatchDeltaEta2',
265 'convMatchDeltaPhi1',
266 'convMatchDeltaPhi2',
277 ConversionVertexAssociation = ContainedVectorMultiAssociation (
281 ConversionVertexAssociation.defineBlock (
282 10,
'ConversionVertexPosition',
284 Vars = [
'x < float:0 ',
'y < float:0',
'z < float:0'])
285 ConversionVertexAssociation.defineBlock (
286 10,
'ConversionVertexKinematics',
291 ConversionVertexTrackParticleAssociation = \
292 ContainedVectorMultiAssociation (ConversionVertexAssociation,
301 if reqlev < 10:
return False
302 if 'target' not in args:
return False
303 args[
'Target'] = args[
'target']
306 ConversionVertexTrackParticleAssociation.defineBlock (
307 _cvAssocLevel,
"ConversionVertexTrackIndex",
312 ConversionVertexTrackParticleAssociation.defineBlock (
313 10,
'ConversionVertexTrackInfo',
315 Vars = [
'fitter = trackFitter < unsigned char: 0',
316 'patternReco = patternRecoInfo < unsigned long: 0',
317 'trackProperties < unsigned char: 0',
318 'particleHypothesis < unsigned char: 0',
321 xAODTrackSummaryFiller (ConversionVertexTrackParticleAssociation,
322 10,
'CoversionTrackSummary',
327 PixelInfoPlus =
True,
337 ConversionVertexTrackParticleAssociation.defineBlock (
338 10,
'ConversionTrackSummaryPID',
340 Vars = [
'eProbabilityComb',
342 'eProbabilityToT < float:0',
343 'eProbabilityBrem < float:0'])
344 ConversionVertexTrackParticleAssociation.defineBlock (
345 10,
'ConversionTrackFitQuality',
347 Vars = [
'chi2 = chiSquared',
356 if D3PDMakerFlags.HaveEgammaUserData
or D3PDMakerFlags.MakeEgammaUserData:
357 if D3PDMakerFlags.DoTruth:
363 AuxPrefix = auxprefix,
364 Vars = [
'truth_isConv',
366 'truth_isFromHardProc',
367 'truth_isPhotonFromHardProc',
375 AuxPrefix = auxprefix,
376 Vars = [
'truth_Rconv',
380 defineBlockAndAlg (PhotonD3PDObject,
384 AuxPrefix = auxprefix,
385 Vars = [
'deltaEmax2',
394 PhotonJetD3PDAssoc = DRAssociation (PhotonD3PDObject,
395 'DataVector<xAOD::Jet_v1>',
396 D3PDMakerFlags.JetSGKey,
400 blockname =
'JetMatch')
401 PhotonJetD3PDAssoc.defineBlock (2,
'JetKinematics',
406 if D3PDMakerFlags.DoTruth
and testSGKey (configFlags, D3PDMakerFlags.TruthJetSGKey):
407 JetTruthJetD3PDAssoc = DRAssociation (PhotonJetD3PDAssoc,
408 'DataVector<xAOD::Jet_v1>',
409 D3PDMakerFlags.TruthJetSGKey,
413 blockname =
'TrueJetMatch')
414 JetTruthJetD3PDAssoc.defineBlock (2,
'TrueJetKinematics',
426 PhotonTopoD3PDAssoc = DRAssociation (PhotonD3PDObject,
427 'DataVector<xAOD::CaloCluster_v1>',
428 D3PDMakerFlags.ClusterSGKey,
432 blockname =
'TopoMatch')
433 PhotonTopoD3PDAssoc.defineBlock (2,
'TopoKinematics',