ATLAS Offline Software
TRT_G4_SDToolConfig.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 LHCPeriod
6 from ISF_Algorithms.CollectionMergerConfig import CollectionMergerCfg
7 
8 
9 def TRTSensitiveDetectorCfg(flags, name="TRTSensitiveDetector", **kwargs):
10  bare_collection_name = "TRTUncompressedHits"
11  mergeable_collection_suffix = "_G4"
12  merger_input_property = "TRTUncompressedHits"
13  region = "ID"
14 
15  acc, hits_collection_name = CollectionMergerCfg(flags,
16  bare_collection_name,
17  mergeable_collection_suffix,
18  merger_input_property,
19  region)
20 
21  logicalVolumeNames = ["TRT::Gas"]
22  if flags.GeoModel.Run in [LHCPeriod.Run2]:
23  logicalVolumeNames += ["TRT::GasMA"]
24  if flags.GeoModel.Run in [LHCPeriod.Run2, LHCPeriod.Run3]:
25  logicalVolumeNames += ["TRT::Gas_Ar", "TRT::GasMA_Ar"]
26  # In the case that Krypton is used to fill some volumes then
27  # logicalVolumeNames += ["TRT::Gas_Kr", TRT::GasMA_Kr"]
28  kwargs.setdefault("LogicalVolumeNames", logicalVolumeNames)
29  kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
30 
31  result = ComponentAccumulator()
32  result.merge(acc)
33  result.setPrivateTools(CompFactory.TRTSensitiveDetectorTool(name, **kwargs))
34  return result
35 
36 
37 def TRTSensitiveDetector_CTBCfg(flags, name="TRTSensitiveDetector_CTB", **kwargs):
38  kwargs.setdefault("LogicalVolumeNames", ["TRT::GasMA"])
39  kwargs.setdefault("OutputCollectionNames", ["TRTUncompressedHits"])
40  result = ComponentAccumulator()
41  result.setPrivateTools(CompFactory.TRTSensitiveDetectorTool(name, **kwargs))
42  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TRT_G4_SDToolConfig.TRTSensitiveDetectorCfg
def TRTSensitiveDetectorCfg(flags, name="TRTSensitiveDetector", **kwargs)
Definition: TRT_G4_SDToolConfig.py:9
TRT_G4_SDToolConfig.TRTSensitiveDetector_CTBCfg
def TRTSensitiveDetector_CTBCfg(flags, name="TRTSensitiveDetector_CTB", **kwargs)
Definition: TRT_G4_SDToolConfig.py:37
CollectionMergerConfig.CollectionMergerCfg
def CollectionMergerCfg(flags, bare_collection_name, mergeable_collection_suffix, merger_input_property, region)
Definition: CollectionMergerConfig.py:66