ATLAS Offline Software
TileGeoG4SDToolConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2022 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 BeamType
6 from ISF_Algorithms.CollectionMergerConfig import CollectionMergerCfg
7 
8 
9 def TileGeoG4SDCfg(flags, name="TileGeoG4SD", **kwargs):
10  bare_collection_name = "TileHitVec"
11  mergeable_collection_suffix = "_G4"
12  merger_input_property = "TileHits"
13  region = "CALO"
14 
15  result, hits_collection_name = CollectionMergerCfg(flags, bare_collection_name, mergeable_collection_suffix, merger_input_property, region)
16  kwargs.setdefault("LogicalVolumeNames", ["Tile::Scintillator"])
17  kwargs.setdefault("OutputCollectionNames", [hits_collection_name])
18 
19  kwargs.setdefault("TileCalculator", result.getPrimaryAndMerge(TileGeoG4SDCalcCfg(flags)).name )
20 
21  result.setPrivateTools(CompFactory.TileGeoG4SDTool(name, **kwargs))
22  return result
23 
24 
25 def TileCTBGeoG4SDCfg(flags, name="TileCTBGeoG4SD", **kwargs):
26  kwargs.setdefault("LogicalVolumeNames", ["Tile::Scintillator"])
27  kwargs.setdefault("OutputCollectionNames", ["TileHitVec"])
28 
29  result = ComponentAccumulator()
30  kwargs.setdefault("TileCalculator", result.getPrimaryAndMerge(TileCTBGeoG4SDCalcCfg(flags)).name )
31 
32  result.setPrivateTools(CompFactory.TileGeoG4SDTool(name, **kwargs))
33  return result
34 
35 
36 def TileGeoG4SDCalcCfg(flags, name="TileGeoG4SDCalc", **kwargs):
37  result = ComponentAccumulator()
38 
39  if flags.Beam.Type is BeamType.Cosmics or flags.Sim.ReadTR:
40  kwargs.setdefault("DeltaTHit", [1])
41  kwargs.setdefault("DoTOFCorrection", False)
42  kwargs.setdefault("DoCalibHitParticleID", flags.Sim.ParticleID )
43 
44  result.addService(CompFactory.TileGeoG4SDCalc(name, **kwargs), primary=True)
45  return result
46 
47 
48 def TileCTBGeoG4SDCalcCfg(flags, name="TileCTBGeoG4SDCalc", **kwargs):
49  result = ComponentAccumulator()
50 
51  kwargs.setdefault("TileTB", True)
52  kwargs.setdefault("DoCalibHitParticleID", flags.Sim.ParticleID )
53 
54  result.addService(CompFactory.TileGeoG4SDCalc(name, **kwargs), primary=True)
55  return result
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TileGeoG4SDToolConfig.TileCTBGeoG4SDCfg
def TileCTBGeoG4SDCfg(flags, name="TileCTBGeoG4SD", **kwargs)
Definition: TileGeoG4SDToolConfig.py:25
TileGeoG4SDToolConfig.TileCTBGeoG4SDCalcCfg
def TileCTBGeoG4SDCalcCfg(flags, name="TileCTBGeoG4SDCalc", **kwargs)
Definition: TileGeoG4SDToolConfig.py:48
TileGeoG4SDToolConfig.TileGeoG4SDCfg
def TileGeoG4SDCfg(flags, name="TileGeoG4SD", **kwargs)
Definition: TileGeoG4SDToolConfig.py:9
TileGeoG4SDToolConfig.TileGeoG4SDCalcCfg
def TileGeoG4SDCalcCfg(flags, name="TileGeoG4SDCalc", **kwargs)
Definition: TileGeoG4SDToolConfig.py:36
CollectionMergerConfig.CollectionMergerCfg
def CollectionMergerCfg(flags, bare_collection_name, mergeable_collection_suffix, merger_input_property, region)
Definition: CollectionMergerConfig.py:66