ATLAS Offline Software
PhotonVertexSelectionConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 
7 def PhotonPointingToolCfg(flags, name="PhotonPointingTool", **kwargs):
9  kwargs.setdefault("isSimulation", flags.Input.isMC)
10  acc.setPrivateTools(CompFactory.CP.PhotonPointingTool(name, **kwargs))
11  return acc
12 
13 
15  flags, name="PhotonVertexSelectionTool", **kwargs):
16  acc = ComponentAccumulator()
17  acc.setPrivateTools(CompFactory.CP.PhotonVertexSelectionTool(**kwargs))
18  return acc
19 
20 
21 def DecoratePhotonPointingAlgCfg(flags, name="DecoratePhotonPointingAlg", **kwargs):
22  acc = ComponentAccumulator()
23 
24  kwargs.setdefault("PhotonContainerKey", "Photons")
25 
26  if not kwargs.get("PhotonPointingTool", None):
27  toolAcc = PhotonPointingToolCfg(flags, ContainerName=kwargs['PhotonContainerKey'])
28  tool = toolAcc.popPrivateTools()
29  acc.merge(toolAcc)
30  kwargs["PhotonPointingTool"] = tool
31 
32  alg = CompFactory.DecoratePhotonPointingAlg("DecoratePhotonPointingAlg", **kwargs)
33  acc.addEventAlgo(alg)
34  return acc
35 
36 
37 def BuildVertexPointingAlgCfg(flags, name="BuildVertexPointingAlg", **kwargs):
38  from AthenaCommon.SystemOfUnits import GeV
39 
40  acc = ComponentAccumulator()
41  kwargs.setdefault(
42  "selectionTool",
43  CompFactory.CP.AsgPtEtaSelectionTool(
44  "CutPhotonPtEta",
45  minPt=20 * GeV,
46  maxEta=2.37,
47  etaGapLow=1.37,
48  etaGapHigh=1.52,
49  useClusterEta=True,
50  ),
51  )
52  kwargs.setdefault(
53  "goodPhotonSelectionTool",
54  CompFactory.CP.AsgFlagSelectionTool(
55  "GoodPhotonSelectionTool",
56  selectionFlags=[
57  "Tight"
58  ], # TODO: why not DFCommonPhotonsIsEMTight (not working)?
59  ),
60  )
61  kwargs.setdefault("nphotonsToUse", 2)
62  kwargs.setdefault("PhotonContainerKey", "Photons")
63  alg = CompFactory.BuildVertexPointingAlg("BuildVertexPointingAlg", **kwargs)
64  acc.addEventAlgo(alg)
65  return acc
66 
SystemOfUnits
PhotonVertexSelectionConfig.BuildVertexPointingAlgCfg
def BuildVertexPointingAlgCfg(flags, name="BuildVertexPointingAlg", **kwargs)
Definition: PhotonVertexSelectionConfig.py:37
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
PhotonVertexSelectionConfig.PhotonPointingToolCfg
def PhotonPointingToolCfg(flags, name="PhotonPointingTool", **kwargs)
Definition: PhotonVertexSelectionConfig.py:7
PhotonVertexSelectionConfig.DecoratePhotonPointingAlgCfg
def DecoratePhotonPointingAlgCfg(flags, name="DecoratePhotonPointingAlg", **kwargs)
Definition: PhotonVertexSelectionConfig.py:21
PhotonVertexSelectionConfig.PhotonVertexSelectionToolCfg
def PhotonVertexSelectionToolCfg(flags, name="PhotonVertexSelectionTool", **kwargs)
Definition: PhotonVertexSelectionConfig.py:14