ATLAS Offline Software
TrkDetDescrAlgsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 """Define methods to configure TrkDetDescrAlgs"""
4 
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 
9 def ITkMaterialMappingCfg(flags, name="ITkMaterialMapping", **kwargs):
10  """Return configured ComponentAccumulator and tool for MaterialMapping"""
11 
12  result=ComponentAccumulator()
13  LayerMaterialName = 'LayerMaterialITK'
14  LayerMaterialDirectory = '/GLOBAL/TrackingGeo/'
15 
16  # get the correct TrackingGeometry setup
17  from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
18  result.merge( TrackingGeometryCondAlgCfg(flags) )
19  geom_cond_key = 'AtlasTrackingGeometry'
20  kwargs.setdefault("TrackingGeometryReadKey", geom_cond_key)
21 
22  if 'MappingVolumeName' not in kwargs :
23  if flags.Detector.GeometryHGTD:
24  kwargs.setdefault("MappingVolumeName", 'HGTD::Detectors::HGTD')
25  else:
26  kwargs.setdefault("MappingVolumeName", 'InDet::Containers::InnerDetector')
27 
28  if 'ExtrapolationEngine' not in kwargs :
29  from TrkConfig.AtlasExtrapolationEngineConfig import AtlasExtrapolationEngineCfg
30  kwargs.setdefault("ExtrapolationEngine", result.getPrimaryAndMerge(AtlasExtrapolationEngineCfg(flags)))
31 
32  if 'MaterialMapper' not in kwargs :
33  MaterialMapper = CompFactory.Trk.MaterialMapper("MaterialMapper")
34  kwargs.setdefault("MaterialMapper", MaterialMapper)
35 
36  if 'LayerMaterialRecordAnalyser' not in kwargs :
37  LayerMaterialAnalyser = CompFactory.Trk.LayerMaterialAnalyser(name="LayerMaterialRecordAnalyser")
38  kwargs.setdefault("LayerMaterialRecordAnalyser", LayerMaterialAnalyser)
39 
40  if 'LayerMaterialCreators' not in kwargs :
41  BinnedLayerMaterialCreator = CompFactory.Trk.BinnedLayerMaterialCreator(name="BinnedLayerMaterialCreator")
42  BinnedLayerMaterialCreator.LayerMaterialName = LayerMaterialName
43  BinnedLayerMaterialCreator.LayerMaterialDirectory = LayerMaterialDirectory
44  LayerMaterialCreators = [BinnedLayerMaterialCreator]
45  kwargs.setdefault("LayerMaterialCreators", LayerMaterialCreators)
46 
47  if 'LayerMaterialAnalysers' not in kwargs :
48  BinnedLayerMaterialAnalyser = CompFactory.Trk.LayerMaterialAnalyser(name="BinnedLayerMaterialAnalyser")
49  BinnedLayerMaterialAnalyser.LayerMaterialName = LayerMaterialName
50  BinnedLayerMaterialAnalyser.ValidationTreeName = 'BinnedLayerMaterialAnalyser'
51  BinnedLayerMaterialAnalyser.ValidationTreeDescription = 'Output of the BinnedLayerMaterialAnalyser'
52  BinnedLayerMaterialAnalyser.ValidationTreeFolder = '/val/BinnedLayerMaterialAnalyser'
53  LayerMaterialAnalysers = [ BinnedLayerMaterialAnalyser ]
54  kwargs.setdefault("LayerMaterialAnalysers", LayerMaterialAnalysers)
55 
56  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='AtlasGeant4Geometry.root' TYPE='ROOT' OPT='RECREATE'"])
57  result.addService( histSvc )
58 
59  algo = CompFactory.Trk.MaterialMapping(name=name, **kwargs)
60  result.addEventAlgo(algo, primary = True)
61 
62  from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
63  result.merge(OutputConditionsAlgCfg(flags, name = "CondAlg_Material",
64  outputFile="AtlasLayerMaterial.pool.root",
65  ObjectList=['Trk::LayerMaterialMap#'+LayerMaterialDirectory+LayerMaterialName],
66  WriteIOV=True,IOVTagList=[flags.ITk.trackingGeometry.materialTag+str(flags.ITk.trackingGeometry.version)] ))
67 
68  result.addService(CompFactory.IOVRegistrationSvc(RecreateFolders = True))
69 
70  return result
71 
72 
73 def MaterialValidationCfg(flags, name="MaterialValidation", **kwargs):
74  """Return configured ComponentAccumulator and tool for MaterialMapping"""
75  result=ComponentAccumulator()
76 
77  # get the correct TrackingGeometry setup
78  from TrackingGeometryCondAlg.AtlasTrackingGeometryCondAlgConfig import TrackingGeometryCondAlgCfg
79  result.merge( TrackingGeometryCondAlgCfg(flags) )
80  geom_cond_key = 'AtlasTrackingGeometry'
81  kwargs.setdefault("TrackingGeometryReadKey", geom_cond_key)
82 
83  if 'MaterialMapper' not in kwargs :
84  MaterialMapper = CompFactory.Trk.MaterialMapper("MaterialMapper")
85  kwargs.setdefault("MaterialMapper", MaterialMapper)
86 
87  if 'MinEta' not in kwargs :
88  minEta = -6.
89  kwargs.setdefault("MinEta", minEta)
90 
91  if 'MaxEta' not in kwargs :
92  maxEta = 6.
93  kwargs.setdefault("MaxEta", maxEta)
94 
95  histSvc = CompFactory.THistSvc(Output = ["val DATAFILE='AtlasTrackingGeometry.root' TYPE='ROOT' OPT='RECREATE'"])
96  result.addService( histSvc )
97 
98  algo = CompFactory.Trk.MaterialValidation(name=name, **kwargs)
99  result.addEventAlgo(algo, primary = True)
100 
101  return result
python.AtlasExtrapolationEngineConfig.AtlasExtrapolationEngineCfg
def AtlasExtrapolationEngineCfg(flags, name='Extrapolation', nameprefix='Atlas')
Definition: AtlasExtrapolationEngineConfig.py:14
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
OutputConditionsAlgConfig.OutputConditionsAlgCfg
def OutputConditionsAlgCfg(flags, name="OutputConditionsAlg", outputFile='condobjs.root', **kwargs)
Definition: OutputConditionsAlgConfig.py:5
AtlasTrackingGeometryCondAlgConfig.TrackingGeometryCondAlgCfg
def TrackingGeometryCondAlgCfg(flags, name='AtlasTrackingGeometryCondAlg', doMaterialValidation=False, **kwargs)
Definition: AtlasTrackingGeometryCondAlgConfig.py:131
TrkDetDescrAlgsConfig.MaterialValidationCfg
def MaterialValidationCfg(flags, name="MaterialValidation", **kwargs)
Definition: TrkDetDescrAlgsConfig.py:73
TrkDetDescrAlgsConfig.ITkMaterialMappingCfg
def ITkMaterialMappingCfg(flags, name="ITkMaterialMapping", **kwargs)
Definition: TrkDetDescrAlgsConfig.py:9
str
Definition: BTagTrackIpAccessor.cxx:11