ATLAS Offline Software
Loading...
Searching...
No Matches
HIGG1D1CustomVertexConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4from AthenaConfiguration.ComponentFactory import CompFactory
5
6
7def PrimaryVertexRefittingToolCfg(flags, **kwargs):
8 """ PV refitting tool """
9 acc = ComponentAccumulator()
10
11 if "TrackToVertexIPEstimator" not in kwargs:
12 from TrkConfig.TrkVertexFitterUtilsConfig import (
13 TrackToVertexIPEstimatorCfg)
14 kwargs.setdefault("TrackToVertexIPEstimator", acc.popToolsAndMerge(
15 TrackToVertexIPEstimatorCfg(flags)))
16
17 acc.setPrivateTools(CompFactory.Analysis.PrimaryVertexRefitter(**kwargs))
18 return acc
19
21 flags, name="HIGG1D1_ZeeVertexRefitterTool", **kwargs):
22 """ PV refitting after removing Z->ee tracks, for vertex studies """
23 acc = ComponentAccumulator()
24
25 import AthenaCommon.SystemOfUnits as Units
26
27 if "PrimaryVertexRefitterTool" not in kwargs:
28 kwargs.setdefault("PrimaryVertexRefitterTool", acc.popToolsAndMerge(
30
31 kwargs.setdefault("ObjectRequirements", (
32 "(Electrons.DFCommonElectronsLHMedium) && (Electrons.pt > 19.*GeV)"))
33 kwargs.setdefault("LowMassCut", 50*Units.GeV)
34 kwargs.setdefault("RefittedPVContainerName", "ZeeRefittedPrimaryVertices")
35 kwargs.setdefault("MCSamples", [361106, 601189])
36
37 acc.setPrivateTools(
38 CompFactory.DerivationFramework.ZeeVertexRefittingTool(name, **kwargs))
39 return acc
40
41def ZeeVertexRefitterCfg(flags, name="ZeeVertexRefitKernel"):
42 """ PV refitting after removing Z->ee tracks, for vertex studies """
43
44 # Creates a vertex container (ZeeRefittedPrimaryVertices) where the type=1 vertex is refitted
45 # after removing tracks that are associated with Z->ee decay candidates
46 # Tool runs only for data and Zee MC samples (must be defined in the MCSamples list)
47
48 acc = ComponentAccumulator()
49 ZeeVertexRefittingTool = acc.popToolsAndMerge(
51 acc.addPublicTool(ZeeVertexRefittingTool)
52 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
53 name, AugmentationTools=[ZeeVertexRefittingTool]))
54 return acc
55
56def DiphotonVertexDecoratorCfg(flags, **kwargs):
57 acc = ComponentAccumulator()
58 if "PhotonVertexSelectionTool" not in kwargs:
59 from PhotonVertexSelection.PhotonVertexSelectionConfig import (
60 PhotonVertexSelectionToolCfg)
61 kwargs.setdefault("PhotonVertexSelectionTool", acc.popToolsAndMerge(
62 PhotonVertexSelectionToolCfg(flags)))
63 acc.setPrivateTools(
64 CompFactory.DerivationFramework.DiphotonVertexDecorator(**kwargs))
65 return acc
66
67def DiPhotonVertexDecoratorKernelCfg(flags, name="DiphotonVertexKernel"):
68 """ Diphoton vertex decoration tool """
69
70 # Decorator creates a shallow copy of PrimaryVertices (HggPrimaryVertices) for diphoton events
71 # Must be created before the jetalg in the sequence as it is input to the modified PFlow jets
72
73 acc = ComponentAccumulator()
74 DiphotonVertexDecorator = acc.popToolsAndMerge(
76 acc.addPublicTool(DiphotonVertexDecorator)
77 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation(
78 name,AugmentationTools=[DiphotonVertexDecorator]))
79 return acc
80
82 from DerivationFrameworkEGamma.EGammaToolsConfig import (
83 PhotonVertexSelectionWrapperKernelCfg)
84 acc = PhotonVertexSelectionWrapperKernelCfg(flags)
85 acc.merge(DiPhotonVertexDecoratorKernelCfg(flags))
86 return acc
DiPhotonVertexDecoratorKernelCfg(flags, name="DiphotonVertexKernel")
ZeeVertexRefitterCfg(flags, name="ZeeVertexRefitKernel")
ZeeVertexRefittingToolCfg(flags, name="HIGG1D1_ZeeVertexRefitterTool", **kwargs)