ATLAS Offline Software
VertexFindingFlags.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 import AthenaCommon.SystemOfUnits as Units
4 from AthenaConfiguration.Enums import FlagEnum
5 from TrkConfig.TrkConfigFlags import PrimaryPassConfig
6 
7 
8 class VertexSortingSetup(FlagEnum):
9  SumPt2Sorting = 'SumPt2Sorting'
10  SumPtSorting = 'SumPtSorting'
11  JetWeightedSorting = 'JetWeightedSorting'
12 
13 
14 class VertexSetup(FlagEnum):
15  IVF = 'IterativeFinding'
16  FastIVF = 'FastIterativeFinding'
17  ActsGaussAMVF = 'ActsGaussAdaptiveMultiFinding'
18  # Experimental setups, not to be used in production
19  ExperimentalActsIVF = 'ExperimentalActsIterativeFinding'
20 
21 
23  from AthenaConfiguration.AthConfigFlags import AthConfigFlags
24  flags = AthConfigFlags()
25 
26  flags.addFlag("maxAbsEta", 9999.0)
27  flags.addFlag("minNTrtHits", 0)
28  flags.addFlag("maxNPixelHoles", 1)
29  flags.addFlag("maxZ0", 1000.0 * Units.mm)
30  flags.addFlag("maxZ0SinTheta", 1000.0 * Units.mm)
31  flags.addFlag("minNInnermostLayerHits", 0)
32  # MaxTracks cuts are specific to the IterativeFinding config
33  flags.addFlag("doMaxTracksCut", lambda pcf:
34  not(pcf.Tracking.PriVertex.useBeamConstraint or
35  pcf.Tracking.PrimaryPassConfig is (
36  PrimaryPassConfig.HeavyIon)))
37  flags.addFlag("maxTracks", 3000)
38  flags.addFlag("maxVertices", lambda pcf:
39  1 if pcf.Tracking.PrimaryPassConfig is (
40  PrimaryPassConfig.HeavyIon)
41  else 200)
42 
43  # string to store the setup for primary vertexing.
44 
45  def vertexSetup(pcf):
46  if pcf.Reco.EnableHI:
47  return VertexSetup.FastIVF
48  elif (pcf.Tracking.doMinBias or
49  pcf.Tracking.doLowMu or
50  pcf.Tracking.PrimaryPassConfig in [
51  PrimaryPassConfig.VtxLumi,
52  PrimaryPassConfig.VtxBeamSpot,
53  PrimaryPassConfig.HighPileup]):
54  return VertexSetup.IVF
55  else: # Default
56  return VertexSetup.ActsGaussAMVF
57 
58  flags.addFlag("setup", vertexSetup, type=VertexSetup)
59 
60  # string to store the type of sorting algorithm to separate signal and pile-up vertices.
61  flags.addFlag("sortingSetup", VertexSortingSetup.SumPt2Sorting, type=VertexSortingSetup)
62  flags.addFlag("useBeamConstraint", lambda pcf:
63  not(pcf.Tracking.PrimaryPassConfig in [
64  PrimaryPassConfig.VtxLumi,
65  PrimaryPassConfig.VtxBeamSpot]))
66 
67  def maxD0(pcf):
68  if pcf.Detector.GeometryITk:
69  return 1.0 * Units.mm
70  else:
71  if not pcf.Tracking.PriVertex.useBeamConstraint:
72  return 10.0 * Units.mm
73  else: # Default ID
74  return 4.0 * Units.mm
75 
76  flags.addFlag("maxD0", maxD0)
77 
78  def minPt(pcf):
79  if pcf.Detector.GeometryITk:
80  return 900.0 * Units.MeV
81  else:
82  if pcf.Tracking.doMinBias or pcf.Tracking.doLowPt:
83  return 100.0 * Units.MeV
84  elif pcf.Reco.EnableHI or pcf.Tracking.doLowMu:
85  return 400.0 * Units.MeV
86  else: # Default ID
87  return 500.0 * Units.MeV
88 
89  flags.addFlag("minPt", minPt)
90 
91  def maxSigmaD0(pcf):
92  if pcf.Detector.GeometryITk:
93  return 0.35 * Units.mm
94  else:
95  if pcf.Tracking.doLowPt:
96  return 0.9 * Units.mm
97  else: # Default ID
98  return 5.0 * Units.mm
99 
100  flags.addFlag("maxSigmaD0", maxSigmaD0)
101 
102  idflags = { "maxSigmaZ0SinTheta" : 10.0 * Units.mm,
103  "minNPixelHits" : 1,
104  "minNSctHits" : 4,
105  "minNSiHits" : 6,
106  "maxZinterval" : 3}
107 
108  itkflags = {"maxSigmaZ0SinTheta" : 2.5 * Units.mm,
109  "minNPixelHits" : 3,
110  "minNSctHits" : 0,
111  "minNSiHits" : 7,
112  "maxZinterval" : 0.5}
113 
114  for k in idflags:
115  # Need to use default arguments in lambda function to keep them set
116  # despite the loop
117  flags.addFlag(k, lambda pcf, a=idflags[k], b=itkflags[k]:
118  a if pcf.Detector.GeometryID else b)
119 
120  return flags
SystemOfUnits
python.VertexFindingFlags.VertexSortingSetup
Definition: VertexFindingFlags.py:8
python.VertexFindingFlags.createPriVertexingFlags
def createPriVertexingFlags()
Definition: VertexFindingFlags.py:22
python.VertexFindingFlags.VertexSetup
Definition: VertexFindingFlags.py:14