ATLAS Offline Software
LUCID_DigitizationConfig.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 from AthenaConfiguration.Enums import ProductionStep
6 from DigitizationConfig.PileUpMergeSvcConfig import PileUpMergeSvcCfg, PileUpXingFolderCfg
7 
8 # The earliest bunch crossing time for which interactions will be sent
9 # to the LUCID Digitization code.
11  return 0
12 
13 
14 # The latest bunch crossing time for which interactions will be sent
15 # to the LUCID Digitization code.
17  return 0
18 
19 
20 
21 def LucidRangeCfg(flags, name="LucidRange" , **kwargs):
22  #this is the time of the xing in ns
23  kwargs.setdefault('FirstXing', LUCID_FirstXing() ) #LUCID is only sensitive to the current bunch crossing.
24  kwargs.setdefault('LastXing', LUCID_LastXing() ) #LUCID is only sensitive to the current bunch crossing.
25  kwargs.setdefault('CacheRefreshFrequency', 1.0 ) #default 0 no dataproxy reset
26  kwargs.setdefault('ItemList', ["LUCID_SimHitCollection#LucidSimHitsVector"] )
27  return PileUpXingFolderCfg(flags, name, **kwargs)
28 
29 
30 
31 def LUCID_PileUpToolCfg(flags, name="LUCID_PileUpTool",**kwargs):
32  acc = ComponentAccumulator()
33 
34  if flags.Digitization.PileUp:
35  intervals = []
36  if flags.Digitization.DoXingByXingPileUp:
37  kwargs.setdefault("FirstXing", LUCID_FirstXing() )
38  kwargs.setdefault("LastXing", LUCID_LastXing() )
39  else:
40  intervals += [acc.popToolsAndMerge(LucidRangeCfg(flags))]
41  kwargs.setdefault("mergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
42  #kwargs.setdefault("OnlyUseContainerName", True) # FIXME in future MR
43  else:
44  kwargs.setdefault("mergeSvc", '')
45  #kwargs.setdefault("OnlyUseContainerName", False) # FIXME in future MR
46 
47  from RngComps.RngCompsConfig import AthRNGSvcCfg
48  kwargs.setdefault("RndmSvc", acc.getPrimaryAndMerge(AthRNGSvcCfg(flags)).name)
49 
50  kwargs.setdefault('pmtSmearing', [0.317, 0.000, 0.292, 0.316, 0.208, 0.178, 0.204, 0.281, 0.233, 0.261, 0.223, 0.250, 0.254, 0.239, 0.202, 0.224, 1, 1, 1, 1,
51  0.268, 0.277, 0.297, 0.310, 0.203, 0.347, 0.269, 0.241, 0.234, 0.234, 0.277, 0.297, 0.225, 0.297, 0.238, 0.000, 1, 1, 1, 1] )
52  kwargs.setdefault('pmtScaling', [1.010, 0.000, 0.991, 0.948, 1.152, 1.221, 1.160, 0.988, 1.092, 1.063, 1.143, 1.091, 1.109, 1.117, 1.185, 1.142, 1, 1, 1, 1,
53  1.023, 1.127, 1.043, 0.986, 1.148, 0.899, 0.898, 1.098, 1.115, 1.109, 1.127, 1.043, 1.085, 1.043, 1.063, 0.000, 1, 1, 1, 1] )
54  kwargs.setdefault('gasScaling', [1.176, 0.000, 1.217, 1.101, 1.143, 1.105, 1.103, 1.144, 1.075, 1.069, 1.100, 1.208, 1.212, 1.125, 1.026, 1.037, 1, 1, 1, 1,
55  1.064, 0.956, 0.975, 0.938, 1.205, 1.095, 1.137, 1.222, 1.262, 1.160, 0.923, 0.969, 1.132, 0.969, 1.174, 0.000, 1, 1, 1, 1] )
56  kwargs.setdefault('npeThreshold', [ 17, 15, 16, 16, 18, 16, 16, 18, 17, 16, 16, 17, 19, 16, 16, 17, 15, 15, 15, 15,
57  17, 16, 16, 17, 17, 15, 16, 16, 17, 16, 15, 17, 17, 15, 16, 15, 15, 15, 15, 15] )
58 
59  acc.setPrivateTools(CompFactory.LUCID_PileUpTool(name,**kwargs))
60  return acc
61 
62 
63 def LUCID_OverlayPileUpToolCfg(flags, name="LUCID_OverlayPileUpTool", **kwargs):
64  """Return ComponentAccumulator with LUCID_PileUpTool for Overlay"""
65  acc = ComponentAccumulator()
66  kwargs.setdefault("mergeSvc", '')
67  #kwargs.setdefault("OnlyUseContainerName", False) #TODO in future MR
68  tool = acc.popToolsAndMerge(LUCID_PileUpToolCfg(flags, name, **kwargs))
69  acc.setPrivateTools(tool)
70  return acc
71 
72 
74  """Return ComponentAccumulator with Output for LUCID. Not standalone."""
75  acc = ComponentAccumulator()
76  if flags.Output.doWriteRDO:
77  ItemList = ["LUCID_DigitContainer#LucidDigitsCnt"]
78  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
79  acc.merge(OutputStreamCfg(flags,"RDO", ItemList))
80  return acc
81 
82 
83 def LUCID_DigitizationBasicCfg(flags, **kwargs):
84  """Return ComponentAccumulator for LUCID digitization"""
85  acc = ComponentAccumulator()
86  if "PileUpTools" not in kwargs:
87  PileUpTools = acc.popToolsAndMerge(LUCID_PileUpToolCfg(flags))
88  kwargs["PileUpTools"] = PileUpTools
89  from DigitizationConfig.PileUpToolsConfig import PileUpToolsCfg
90  acc.merge(PileUpToolsCfg(flags, **kwargs))
91  return acc
92 
93 
94 def LUCID_OverlayDigitizationBasicCfg(flags, **kwargs):
95  """Return ComponentAccumulator with LUCID_DigiTop."""
96  acc = ComponentAccumulator()
97  if flags.Common.ProductionStep != ProductionStep.FastChain:
98  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
99  acc.merge(SGInputLoaderCfg(flags,Load={('LUCID_SimHitCollection','LucidSimHitsVector')} ) )
100  if "DigitizationTool" not in kwargs:
101  kwargs.setdefault("DigitizationTool", acc.popToolsAndMerge(LUCID_OverlayPileUpToolCfg(flags)))
102 
103  if flags.Concurrency.NumThreads > 0:
104  kwargs.setdefault("Cardinality", flags.Concurrency.NumThreads)
105 
106  # Set common overlay extra inputs
107  kwargs.setdefault("ExtraInputs", flags.Overlay.ExtraInputs)
108 
109  acc.addEventAlgo(CompFactory.LUCID_DigiTop("LUCID_DigiTop", **kwargs))
110  return acc
111 
112 
113 def LUCID_DigitizationCfg(flags, **kwargs):
114  """Return ComponentAccumulator for LUCID digitization and Output"""
115  acc = ComponentAccumulator()
116  acc.merge(LUCID_DigitizationBasicCfg(flags, **kwargs))
117  acc.merge(LUCID_DigitizationOutputCfg(flags))
118 
119  return acc
120 
121 
122 def LUCID_DigitizationOverlayCfg(flags, **kwargs):
123  """Return ComponentAccumulator for LUCID digitization and Output"""
124  acc = ComponentAccumulator()
125  acc.merge(LUCID_OverlayDigitizationBasicCfg(flags, **kwargs))
126  acc.merge(LUCID_DigitizationOutputCfg(flags))
127 
128  return acc
LUCID_DigitizationConfig.LUCID_DigitizationCfg
def LUCID_DigitizationCfg(flags, **kwargs)
Definition: LUCID_DigitizationConfig.py:113
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
LUCID_DigitizationConfig.LUCID_DigitizationOutputCfg
def LUCID_DigitizationOutputCfg(flags)
Definition: LUCID_DigitizationConfig.py:73
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
LUCID_DigitizationConfig.LucidRangeCfg
def LucidRangeCfg(flags, name="LucidRange", **kwargs)
Definition: LUCID_DigitizationConfig.py:21
LUCID_DigitizationConfig.LUCID_DigitizationOverlayCfg
def LUCID_DigitizationOverlayCfg(flags, **kwargs)
Definition: LUCID_DigitizationConfig.py:122
python.PileUpToolsConfig.PileUpToolsCfg
def PileUpToolsCfg(flags, **kwargs)
Definition: PileUpToolsConfig.py:14
LUCID_DigitizationConfig.LUCID_DigitizationBasicCfg
def LUCID_DigitizationBasicCfg(flags, **kwargs)
Definition: LUCID_DigitizationConfig.py:83
LUCID_DigitizationConfig.LUCID_LastXing
def LUCID_LastXing()
Definition: LUCID_DigitizationConfig.py:16
LUCID_DigitizationConfig.LUCID_OverlayPileUpToolCfg
def LUCID_OverlayPileUpToolCfg(flags, name="LUCID_OverlayPileUpTool", **kwargs)
Definition: LUCID_DigitizationConfig.py:63
python.PileUpMergeSvcConfig.PileUpXingFolderCfg
def PileUpXingFolderCfg(flags, name="PileUpXingFolder", **kwargs)
Definition: PileUpMergeSvcConfig.py:35
LUCID_DigitizationConfig.LUCID_OverlayDigitizationBasicCfg
def LUCID_OverlayDigitizationBasicCfg(flags, **kwargs)
Definition: LUCID_DigitizationConfig.py:94
LUCID_DigitizationConfig.LUCID_PileUpToolCfg
def LUCID_PileUpToolCfg(flags, name="LUCID_PileUpTool", **kwargs)
Definition: LUCID_DigitizationConfig.py:31
python.PileUpMergeSvcConfig.PileUpMergeSvcCfg
def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs)
Definition: PileUpMergeSvcConfig.py:10
LUCID_DigitizationConfig.LUCID_FirstXing
def LUCID_FirstXing()
Definition: LUCID_DigitizationConfig.py:10
RngCompsConfig.AthRNGSvcCfg
def AthRNGSvcCfg(flags, name="AthRNGSvc")
Definition: RngCompsConfig.py:51