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 
14 def PhotonVertexSelectionToolCfg(flags, name="PhotonVertexSelectionTool", **kwargs):
15  acc = ComponentAccumulator()
16  acc.setPrivateTools(CompFactory.CP.PhotonVertexSelectionTool(**kwargs))
17  return acc
18 
19 
20 def DecoratePhotonPointingAlgCfg(flags, name="DecoratePhotonPointingAlg", **kwargs):
21  acc = ComponentAccumulator()
22 
23  kwargs.setdefault("PhotonContainerKey", "Photons")
24 
25  if not kwargs.get("PhotonPointingTool", None):
26  toolAcc = PhotonPointingToolCfg(flags, ContainerName=kwargs['PhotonContainerKey'])
27  tool = toolAcc.popPrivateTools()
28  acc.merge(toolAcc)
29  kwargs["PhotonPointingTool"] = tool
30 
31  alg = CompFactory.DecoratePhotonPointingAlg("DecoratePhotonPointingAlg", **kwargs)
32  acc.addEventAlgo(alg)
33  return acc
34 
35 
36 def BuildVertexPointingAlgCfg(flags, name="BuildVertexPointingAlg", **kwargs):
37  from AthenaCommon.SystemOfUnits import GeV
38 
39  acc = ComponentAccumulator()
40  kwargs.setdefault(
41  "selectionTool",
42  CompFactory.CP.AsgPtEtaSelectionTool(
43  "CutPhotonPtEta",
44  minPt=20 * GeV,
45  maxEta=2.37,
46  etaGapLow=1.37,
47  etaGapHigh=1.52,
48  useClusterEta=True,
49  ),
50  )
51  kwargs.setdefault(
52  "goodPhotonSelectionTool",
53  CompFactory.CP.AsgFlagSelectionTool(
54  "GoodPhotonSelectionTool",
55  selectionFlags=[
56  "Tight"
57  ], # TODO: why not DFCommonPhotonsIsEMTight (not working)?
58  ),
59  )
60  kwargs.setdefault("nphotonsToUse", 2)
61  kwargs.setdefault("PhotonContainerKey", "Photons")
62  alg = CompFactory.BuildVertexPointingAlg("BuildVertexPointingAlg", **kwargs)
63  acc.addEventAlgo(alg)
64  return acc
65 
SystemOfUnits
PhotonVertexSelectionConfig.BuildVertexPointingAlgCfg
def BuildVertexPointingAlgCfg(flags, name="BuildVertexPointingAlg", **kwargs)
Definition: PhotonVertexSelectionConfig.py:36
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:20
PhotonVertexSelectionConfig.PhotonVertexSelectionToolCfg
def PhotonVertexSelectionToolCfg(flags, name="PhotonVertexSelectionTool", **kwargs)
Definition: PhotonVertexSelectionConfig.py:14