ATLAS Offline Software
CSC_DigitizationConfig.py
Go to the documentation of this file.
1 """Define methods to construct configured CSC Digitization tools and algorithms
2 
3 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaConfiguration.Enums import ProductionStep
8 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
9 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
10 from MuonConfig.MuonCondAlgConfig import CscCondDbAlgCfg
11 from MuonConfig.MuonByteStreamCnvTestConfig import CscDigitToCscRDOCfg
12 from MuonConfig.MuonCablingConfig import CSCCablingConfigCfg
13 from DigitizationConfig.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
14 from DigitizationConfig.PileUpToolsConfig import PileUpToolsCfg
15 from DigitizationConfig.PileUpMergeSvcConfig import PileUpMergeSvcCfg, PileUpXingFolderCfg
16 
17 
18 # The earliest and last bunch crossing times for which interactions will be sent
19 # to the CscDigitizationTool.
21  return -375
22 
23 
25  return 175
26 
27 
28 def CSC_RangeCfg(flags, name="CSC_Range", **kwargs):
29  """Return a PileUpXingFolder tool configured for CSC"""
30  kwargs.setdefault("FirstXing", CSC_FirstXing())
31  kwargs.setdefault("LastXing", CSC_LastXing())
32  kwargs.setdefault("CacheRefreshFrequency", 1.0)
33  kwargs.setdefault("ItemList", ["CSCSimHitCollection#CSC_Hits"])
34  return PileUpXingFolderCfg(flags, name, **kwargs)
35 
36 
37 def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs):
38  """Return a ComponentAccumulator with configured CscDigitizationTool"""
39  acc = ComponentAccumulator()
40  if flags.Digitization.PileUp and not flags.Common.isOverlay:
41  intervals = []
42  if not flags.Digitization.DoXingByXingPileUp:
43  intervals += [acc.popToolsAndMerge(CSC_RangeCfg(flags))]
44  kwargs.setdefault("OnlyUseContainerName", True)
45  kwargs.setdefault("PileUpMergeSvc", acc.getPrimaryAndMerge(PileUpMergeSvcCfg(flags, Intervals=intervals)).name)
46  else:
47  kwargs.setdefault("OnlyUseContainerName", False)
48  kwargs.setdefault("PileUpMergeSvc", '')
49  if flags.Digitization.DoXingByXingPileUp:
50  kwargs.setdefault("FirstXing", CSC_FirstXing())
51  kwargs.setdefault("LastXing", CSC_LastXing())
52  kwargs.setdefault("pedestal", 0.0)
53  kwargs.setdefault("WindowLowerOffset", -25.0)
54  kwargs.setdefault("WindowUpperOffset", 25.0)
55  kwargs.setdefault("isPileUp", False)
56  kwargs.setdefault("amplification", 0.43e5)
57  kwargs.setdefault("NewDigitEDM", True)
58  kwargs.setdefault("DriftVelocity", 39)
59  kwargs.setdefault("ElectronEnergy", 66) # eV
60 
61  from MuonConfig.MuonCalibrationConfig import CscCalibToolCfg
62  kwargs.setdefault("cscCalibTool", acc.popToolsAndMerge(CscCalibToolCfg(flags)))
63 
64  CscDigitizationTool = CompFactory.CscDigitizationTool
65  acc.setPrivateTools(CscDigitizationTool(name, **kwargs))
66  return acc
67 
68 
69 def CSC_DigitizationToolCfg(flags, name="CscDigitizationTool", **kwargs):
70  """Return a ComponentAccumulator with configured CscDigitizationTool"""
71  acc = ComponentAccumulator()
72  kwargs.setdefault("InputObjectName", "CSC_Hits")
73  kwargs.setdefault("OutputObjectName", "CSC_DIGITS")
74  if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
75  kwargs.setdefault("CSCSimDataCollectionOutputName", flags.Overlay.BkgPrefix + "CSC_SDO")
76  else:
77  kwargs.setdefault("CSCSimDataCollectionOutputName", "CSC_SDO")
78  tool = acc.popToolsAndMerge(CSC_DigitizationToolCommonCfg(flags, name, **kwargs))
79  acc.setPrivateTools(tool)
80  return acc
81 
82 
83 def CSC_OverlayDigitizationToolCfg(flags, name="CscOverlayDigitizationTool", **kwargs):
84  """Return a ComponentAccumulator with CscDigitizationTool configured for Overlay"""
85  kwargs.setdefault("OnlyUseContainerName", False)
86  kwargs.setdefault("OutputObjectName", flags.Overlay.SigPrefix + "CSC_DIGITS")
87  kwargs.setdefault("CSCSimDataCollectionOutputName", flags.Overlay.SigPrefix + "CSC_SDO")
88  kwargs.setdefault("PileUpMergeSvc", '')
89  return CSC_DigitizationToolCommonCfg(flags, name, **kwargs)
90 
91 
92 def CSC_OutputCfg(flags):
93  """Return ComponentAccumulator with Output for CSC. Not standalone."""
94  acc = ComponentAccumulator()
95  if flags.Output.doWriteRDO:
96  ItemList = ["CscRawDataContainer#*"]
97  if flags.Digitization.EnableTruth:
98  ItemList += ["CscSimDataCollection#*CSC_SDO"]
99  acc.merge(TruthDigitizationOutputCfg(flags))
100  acc.merge(OutputStreamCfg(flags, "RDO", ItemList))
101  return acc
102 
103 
104 def CSC_DigitizationBasicCfg(flags, **kwargs):
105  """Return ComponentAccumulator for CSC digitization"""
106  acc = MuonGeoModelCfg(flags)
107  acc.merge(CscCondDbAlgCfg(flags))
108  if "PileUpTools" not in kwargs:
109  PileUpTools = acc.popToolsAndMerge(CSC_DigitizationToolCfg(flags))
110  kwargs["PileUpTools"] = PileUpTools
111  acc.merge(PileUpToolsCfg(flags, **kwargs))
112  return acc
113 
114 
115 def CSC_OverlayDigitizationBasicCfg(flags, **kwargs):
116  """Return ComponentAccumulator with CSC Overlay digitization"""
117  acc = MuonGeoModelCfg(flags)
118  acc.merge(CscCondDbAlgCfg(flags))
119 
120  if flags.Common.ProductionStep != ProductionStep.FastChain:
121  from SGComps.SGInputLoaderConfig import SGInputLoaderCfg
122  acc.merge(SGInputLoaderCfg(flags, ["CSCSimHitCollection#CSC_Hits"]))
123 
124  if "DigitizationTool" not in kwargs:
125  tool = acc.popToolsAndMerge(CSC_OverlayDigitizationToolCfg(flags))
126  kwargs["DigitizationTool"] = tool
127 
128  if flags.Concurrency.NumThreads > 0:
129  kwargs.setdefault("Cardinality", flags.Concurrency.NumThreads)
130 
131  # Set common overlay extra inputs
132  kwargs.setdefault("ExtraInputs", flags.Overlay.ExtraInputs)
133 
134  CscDigitBuilder = CompFactory.CscDigitBuilder
135  acc.addEventAlgo(CscDigitBuilder(name="CscOverlayDigitBuilder", **kwargs))
136  return acc
137 
138 
139 # with output defaults
140 def CSC_DigitizationCfg(flags, **kwargs):
141  """Return ComponentAccumulator for CSC digitization and Output"""
142  acc = CSC_DigitizationBasicCfg(flags, **kwargs)
143  acc.merge(CSC_OutputCfg(flags))
144  return acc
145 
146 
148  """Return ComponentAccumulator with CSC Digitization and Digit to CSCRDO"""
149  acc = CSC_DigitizationCfg(flags)
150  acc.merge(CSCCablingConfigCfg(flags))
151  acc.merge(CscDigitToCscRDOCfg(flags))
152  return acc
python.CSC_DigitizationConfig.CSC_RangeCfg
def CSC_RangeCfg(flags, name="CSC_Range", **kwargs)
Definition: CSC_DigitizationConfig.py:28
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
python.TruthDigitizationOutputConfig.TruthDigitizationOutputCfg
def TruthDigitizationOutputCfg(flags)
Definition: TruthDigitizationOutputConfig.py:9
python.MuonCalibrationConfig.CscCalibToolCfg
def CscCalibToolCfg(flags, name="CscCalibTool", **kwargs)
CSC calibration.
Definition: MuonCalibrationConfig.py:21
python.CSC_DigitizationConfig.CSC_DigitizationDigitToRDOCfg
def CSC_DigitizationDigitToRDOCfg(flags)
Definition: CSC_DigitizationConfig.py:147
python.MuonCondAlgConfig.CscCondDbAlgCfg
def CscCondDbAlgCfg(flags, **kwargs)
Definition: MuonCondAlgConfig.py:90
CscDigitizationTool
Definition: CscDigitizationTool.h:39
python.CSC_DigitizationConfig.CSC_DigitizationToolCommonCfg
def CSC_DigitizationToolCommonCfg(flags, name="CscDigitizationTool", **kwargs)
Definition: CSC_DigitizationConfig.py:37
python.CSC_DigitizationConfig.CSC_OverlayDigitizationToolCfg
def CSC_OverlayDigitizationToolCfg(flags, name="CscOverlayDigitizationTool", **kwargs)
Definition: CSC_DigitizationConfig.py:83
python.CSC_DigitizationConfig.CSC_DigitizationToolCfg
def CSC_DigitizationToolCfg(flags, name="CscDigitizationTool", **kwargs)
Definition: CSC_DigitizationConfig.py:69
SGInputLoaderConfig.SGInputLoaderCfg
def SGInputLoaderCfg(flags, Load=None, **kwargs)
Definition: SGInputLoaderConfig.py:7
python.CSC_DigitizationConfig.CSC_LastXing
def CSC_LastXing()
Definition: CSC_DigitizationConfig.py:24
python.CSC_DigitizationConfig.CSC_OutputCfg
def CSC_OutputCfg(flags)
Definition: CSC_DigitizationConfig.py:92
python.PileUpToolsConfig.PileUpToolsCfg
def PileUpToolsCfg(flags, **kwargs)
Definition: PileUpToolsConfig.py:14
CscDigitBuilder
Definition: CscDigitBuilder.h:22
python.MuonCablingConfig.CSCCablingConfigCfg
def CSCCablingConfigCfg(flags)
Definition: MuonCablingConfig.py:166
python.CSC_DigitizationConfig.CSC_DigitizationCfg
def CSC_DigitizationCfg(flags, **kwargs)
Definition: CSC_DigitizationConfig.py:140
python.CSC_DigitizationConfig.CSC_OverlayDigitizationBasicCfg
def CSC_OverlayDigitizationBasicCfg(flags, **kwargs)
Definition: CSC_DigitizationConfig.py:115
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.CSC_DigitizationConfig.CSC_DigitizationBasicCfg
def CSC_DigitizationBasicCfg(flags, **kwargs)
Definition: CSC_DigitizationConfig.py:104
python.PileUpMergeSvcConfig.PileUpXingFolderCfg
def PileUpXingFolderCfg(flags, name="PileUpXingFolder", **kwargs)
Definition: PileUpMergeSvcConfig.py:35
python.MuonByteStreamCnvTestConfig.CscDigitToCscRDOCfg
def CscDigitToCscRDOCfg(flags, name="CscDigitToCscRDO", **kwargs)
Definition: MuonByteStreamCnvTestConfig.py:257
python.CSC_DigitizationConfig.CSC_FirstXing
def CSC_FirstXing()
Definition: CSC_DigitizationConfig.py:20
python.PileUpMergeSvcConfig.PileUpMergeSvcCfg
def PileUpMergeSvcCfg(flags, name="PileUpMergeSvc", Intervals=[], **kwargs)
Definition: PileUpMergeSvcConfig.py:10