10 from egammaD3PDMaker.defineBlockAndAlg
import defineBlockAndAlg
11 from EventCommonD3PDMaker.DRAssociation
import DRAssociation
12 from TrackD3PDMaker.xAODTrackSummaryFiller
import xAODTrackSummaryFiller
13 from D3PDMakerCoreComps.D3PDObject
import make_SGDataVector_D3PDObject
14 from D3PDMakerCoreComps.D3PDObject
import DeferArg
15 from D3PDMakerCoreComps.SimpleAssociation
import SimpleAssociation
16 from D3PDMakerCoreComps.IndexMultiAssociation
import IndexMultiAssociation
17 from D3PDMakerCoreComps.resolveSGKey
import testSGKey
18 from D3PDMakerCoreComps.resolveSGKey
import resolveSGKey
19 from D3PDMakerConfig.D3PDMakerFlags
import D3PDMakerFlags, configFlags
20 from AthenaConfiguration.ComponentFactory
import CompFactory
22 D3PD = CompFactory.D3PD
25 ElectronD3PDObject = \
26 make_SGDataVector_D3PDObject (
'xAOD::ElectronContainer',
27 D3PDMakerFlags.ElectronSGKey,
28 'el_',
'ElectronD3PDObject')
31 auxprefix = DeferArg (
'D3PDMakerFlags.EgammaUserDataPrefix + "_" +'
32 'resolveSGKey (configFlags, sgkey) + "_"',
36 ElectronD3PDObject.defineBlock (0,
'Kinematics',
41 ElectronD3PDObject.defineBlock (
45 ElectronD3PDObject.defineBlock (
49 ElectronD3PDObject.defineBlock (
53 Vars = [
'loose = Loose < int8_t: 0',
54 'medium = Medium < int8_t: 0',
55 'tight = Tight < int8_t : 0'
57 ElectronD3PDObject.defineBlock (
67 AuxPrefix = auxprefix,
68 Vars = [
'maxEcell_time',
81 'egammaSumCellsGainAlg',
82 AuxPrefix = auxprefix,
103 'egammaNbCellsGainAlg',
104 AuxPrefix = auxprefix,
108 'nbCells_s0HighGain',
111 'nbCells_s1HighGain',
114 'nbCells_s2HighGain',
117 'nbCells_s3HighGain',
121 if D3PDMakerFlags.DoTruth:
122 truthClassification = \
123 ElectronD3PDObject.defineBlock (1,
'TruthClassification',
125 DoBkgElecOrigin =
True,
128 from TruthD3PDMaker.MCTruthClassifierConfig \
129 import D3PDMCTruthClassifierCfg
130 acc.merge (D3PDMCTruthClassifierCfg (flags))
131 c.Classifier = acc.getPublicTool (
'D3PDMCTruthClassifier')
133 truthClassification.defineHook (_truthClassificationHook)
134 ElectronTruthPartAssoc = SimpleAssociation \
139 blockname =
'TruthAssoc')
141 from TruthD3PDMaker.MCTruthClassifierConfig \
142 import D3PDMCTruthClassifierCfg
143 acc.merge (D3PDMCTruthClassifierCfg (flags))
144 c.Associator.Classifier = acc.getPublicTool (
'D3PDMCTruthClassifier')
146 ElectronTruthPartAssoc.defineHook (_truthClassificationAssocHook)
147 ElectronTruthPartAssoc.defineBlock (0,
'TruthKin',
151 ElectronTruthPartAssoc.defineBlock (0,
'Truth',
154 PDGIDVariable =
'type')
155 ElectronTruthPartMotherAssoc = SimpleAssociation \
156 (ElectronTruthPartAssoc,
160 (
'ElectronTruthPartMotherAssoc2'),
161 blockname =
'ElectronTruthPartMotherAssoc',
163 ElectronTruthPartMotherAssoc.defineBlock (0,
'MotherTruth',
166 PDGIDVariable =
'type')
167 ElectronTruthPartAssoc.defineBlock (0,
'TruthBrem',
170 ElectronTruthPartAssoc.defineBlock (0,
'TruthAssocIndex',
175 ElectronD3PDObject.defineBlock (
178 Vars = [
'Ethad = ethad < float: 0',
179 'Ethad1 = ethad1 < float: 0'])
180 ElectronD3PDObject.defineBlock (
185 'Emins1 = emins1 < float: 0',
187 'Emax2 = e2tsts1 < float: 0',
190 'emaxs1 < float: 0'])
191 ElectronD3PDObject.defineBlock (1,
'Layer1ShapeExtra',
193 ElectronD3PDObject.defineBlock (
196 Vars = [
'E233 = e233 < float: 0',
197 'E237 = e237 < float: 0',
198 'E277 = e277 < float: 0',
200 ElectronD3PDObject.defineBlock (
203 Vars = [
'f3',
'f3core'])
204 ElectronD3PDObject.defineBlock (
207 Vars = [
'rphiallcalo = r33over37allcalo < float: 0',
208 'Etcone20 = etcone20 < float: 0',
209 'Etcone30 = etcone30 < float: 0',
210 'Etcone40 = etcone40 < float: 0',
211 'ptcone20 < float: 0',
212 'ptcone30 < float: 0',
213 'ptcone40 < float: 0',
215 ElectronD3PDObject.defineBlock (
218 Vars = [
'Etcone20_pt_corrected = etcone20_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.20 cone',
219 'Etcone30_pt_corrected = etcone30_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.30 cone',
220 'Etcone40_pt_corrected = etcone40_ptcorrected < float: 0 #pt-corrected isolation energy within DR=0.40 cone',
222 ElectronD3PDObject.defineBlock (
225 Vars = [
'pos7 < float: 0',
226 'deltaeta1 = deltaEta1',
227 'deltaeta2 = deltaEta2',
228 'deltaphi2 = deltaPhi2',
229 'deltaphiRescaled = deltaPhiRescaled2',
233 ElectronD3PDObject.defineBlock (
234 1,
'TopoClusterIsolationCones',
236 Vars = [
'topoEtcone20 = topoetcone20 < float: 0',
237 'topoEtcone30 = topoetcone30 < float: 0',
238 'topoEtcone40 = topoetcone40 < float: 0',
241 traversedMaterial = \
242 ElectronD3PDObject.defineBlock (2,
'TraversedMaterial',
245 from TrkConfig.AtlasExtrapolatorConfig
import AtlasExtrapolatorCfg
246 c.Extrapolator = acc.popToolsAndMerge (AtlasExtrapolatorCfg (flags))
248 traversedMaterial.defineHook (_traversedMaterialExtrapolatorHook)
250 ElectronD3PDObject.defineBlock (
253 Vars = [
'zvertex < float: 0',
259 from egammaD3PDMaker.egammaCluster
import egammaCluster
260 ElectronClusterAssoc = egammaCluster (ElectronD3PDObject,
270 ElectronTPAssoc = SimpleAssociation \
273 matched =
'hastrack',
274 blockname =
'TrkInfo')
276 TrackParticlePerigeeAssoc = SimpleAssociation \
281 TrackParticlePerigeeAssoc.defineBlock (1,
'Trk',
284 TrackParticleCovarAssoc = SimpleAssociation (TrackParticlePerigeeAssoc,
287 TrackParticleCovarAssoc.defineBlock (3,
'TrkCovDiag',
290 IsTrackPerigee =
True,
292 DiagCovariance =
True)
293 TrackParticleCovarAssoc.defineBlock (3,
'TrkCovOffDiag',
296 IsTrackPerigee =
True,
298 OffDiagCovariance =
True)
301 ElectronTPAssoc.defineBlock (
304 Vars = [
'chi2 = chiSquared < float:0',
305 'ndof = numberDoF < float:0'],
308 xAODTrackSummaryFiller (ElectronTPAssoc, 1,
'IDHits',
316 PixelInfoPlus =
True)
318 ElectronTPAssoc.defineBlock (
319 1,
'TrackSummaryPID',
321 Vars = [
'eProbabilityComb < float:0',
322 'eProbabilityHT < float:0',
323 'eProbabilityToT < float:0',
324 'eProbabilityBrem < float:0'])
327 ElectronVertAssoc = SimpleAssociation \
332 ElectronVertAssoc.defineBlock (
335 Vars = [
'x < float:0 ',
'y < float:0',
'z < float:0'])
338 from TrackD3PDMaker.TrackParticleImpactParameters \
339 import TrackParticleImpactParameters
340 TrackParticleImpactParameters (ElectronTPAssoc)
345 TPPerigeePairAssoc = SimpleAssociation \
351 SGKey = D3PDMakerFlags.GSFTrackAssocSGKey,
352 TypeName =
'TrackParticleAssocs'),
353 blockname =
'TPPerigeePairAssoc')
355 UnRefittedTrackParticlePerigeeAssoc = SimpleAssociation \
359 blockname =
'UnrefittedTrackPerigeeAssoc',
360 prefix =
'Unrefittedtrack_')
362 UnRefittedTrackParticlePerigeeAssoc.defineBlock (1,
'UnrefitTrk',
372 if D3PDMakerFlags.HaveEgammaUserData
or D3PDMakerFlags.MakeEgammaUserData:
376 if reqlev < 2:
return False
377 if 'target' not in args:
return False
378 args[
'Target'] = args[
'target']
381 EgammaJetDRAssoc = IndexMultiAssociation\
385 blockname=
'EgammaJetSignedIPAndPTRel',
387 level = _jetAssocLevel,
389 VertexContainerName = D3PDMakerFlags.VertexSGKey)
391 from TrkConfig.TrkVertexFitterUtilsConfig
import TrackToVertexIPEstimatorCfg
392 c.Associator.TrackToVertexIPEstimator = acc.popToolsAndMerge (TrackToVertexIPEstimatorCfg (flags))
394 EgammaJetDRAssoc.defineHook (_trackToVertexHook)
395 EgammaJetDRAssoc.defineBlock \
397 'EgammaJetSignedIPAndPTRelKin',
402 EgammaTrackJetDRAssoc = IndexMultiAssociation\
406 blockname=
'EgammaTrackJetSignedIPAndPTRel',
407 prefix =
'jettrack_',
408 level = _jetAssocLevel,
410 VertexContainerName = D3PDMakerFlags.VertexSGKey)
411 EgammaTrackJetDRAssoc.defineHook (_trackToVertexHook)
412 EgammaTrackJetDRAssoc.defineBlock \
414 'EgammaTrackJetSignedIPAndPTRelKin',
425 EleJetD3PDAssoc = DRAssociation (ElectronD3PDObject,
426 'DataVector<xAOD::Jet_v1>',
427 D3PDMakerFlags.JetSGKey,
431 blockname =
'JetMatch')
432 EleJetD3PDAssoc.defineBlock (2,
'JetKinematics',
437 if D3PDMakerFlags.DoTruth
and testSGKey (configFlags, D3PDMakerFlags.TruthJetSGKey):
438 JetTruthJetD3PDAssoc = DRAssociation (EleJetD3PDAssoc,
439 'DataVector<xAOD::Jet_v1>',
440 D3PDMakerFlags.TruthJetSGKey,
444 blockname =
'TrueJetMatch')
445 JetTruthJetD3PDAssoc.defineBlock (2,
'TrueJetKinematics',