ATLAS Offline Software
InDetAlignAlgsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
6 def CreateITkMisalignAlgCfg(flags, name="CreateITkMisalignAlg", **kwargs):
7 
8  result = ComponentAccumulator()
9 
10  if flags.Detector.EnableITkPixel:
11  from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
12  result.merge(ITkPixelReadoutGeometryCfg(flags))
13  kwargs.setdefault("PixelDetEleCollKey","ITkPixelDetectorElementCollection")
14  else:
15  kwargs.setdefault("PixelDetEleCollKey","")
16 
17  if flags.Detector.EnableITkStrip:
18  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
19  result.merge(ITkStripReadoutGeometryCfg(flags))
20  kwargs.setdefault("SCTDetEleCollKey","ITkStripDetectorElementCollection")
21  else:
22  kwargs.setdefault("SCTDetEleCollKey","")
23 
24  from InDetAlignGenTools.InDetAlignGenToolsConfig import ITkAlignDBTool
25  dbTool = result.popToolsAndMerge(ITkAlignDBTool(flags))
26 
27  kwargs.setdefault("IDAlignDBTool",dbTool)
28  kwargs.setdefault("TRTDetEleCollKey","")
29 
30  histoSvc = CompFactory.THistSvc(Output = ["IDENTIFIERTREE DATAFILE='ITkIdentifierTree.root' TYPE='ROOT' OPT='RECREATE'"])
31  result.addService( histoSvc )
32  ntupSvc = CompFactory.NTupleSvc(Output = ["CREATEMISALIGN DATAFILE='CreateMisalignmentITk.root' TYP='ROOT' OPT='NEW'"])
33  result.addService( ntupSvc )
34  result.setAppProperty("HistogramPersistency","ROOT")
35 
36  result.addEventAlgo(CompFactory.InDetAlignment.CreateMisalignAlg(name,**kwargs))
37  return result
38 
39 def CreateInDetMisalignAlgCfg(flags, name="CreateInDetMisalignAlg",setAlignmentFolderName="/Indet/Align", **kwargs):
40  result = ComponentAccumulator()
41 
42  if flags.Detector.EnablePixel:
43  from PixelGeoModel.PixelGeoModelConfig import PixelReadoutGeometryCfg
44  result.merge(PixelReadoutGeometryCfg(flags))
45  else:
46  kwargs.setdefault("PixelDetEleCollKey","")
47 
48  if flags.Detector.EnableSCT:
49  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
50  result.merge(SCT_ReadoutGeometryCfg(flags))
51  else:
52  kwargs.setdefault("SCTDetEleCollKey","")
53 
54  if flags.Detector.EnableTRT:
55  from TRT_GeoModel.TRT_GeoModelConfig import TRT_ReadoutGeometryCfg
56  result.merge(TRT_ReadoutGeometryCfg(flags))
57  else:
58  kwargs.setdefault("TRTDetEleCollKey","")
59 
60  from InDetAlignGenTools.InDetAlignGenToolsConfig import InDetAlignDBTool
61  dbTool = result.popToolsAndMerge(InDetAlignDBTool(flags,setAlignmentFolderName=setAlignmentFolderName))
62 
63  histoSvc = CompFactory.THistSvc(Output = ["IDENTIFIERTREE DATAFILE='InDetIdentifierTree.root' TYPE='ROOT' OPT='RECREATE'"])
64  result.addService( histoSvc )
65  ntupSvc = CompFactory.NTupleSvc(Output = ["CREATEMISALIGN DATAFILE='CreateMisalignmentInDet.root' TYP='ROOT' OPT='NEW'"])
66  result.addService( ntupSvc )
67  result.setAppProperty("HistogramPersistency","ROOT")
68 
69  kwargs.setdefault("IDAlignDBTool",dbTool)
70  result.addEventAlgo(CompFactory.InDetAlignment.CreateMisalignAlg(name,**kwargs))
71  return result
InDetAlignDBTool
Definition: InDetAlignDBTool.h:54
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
TRT_GeoModelConfig.TRT_ReadoutGeometryCfg
def TRT_ReadoutGeometryCfg(flags)
Definition: TRT_GeoModelConfig.py:59
InDetAlignAlgsConfig.CreateITkMisalignAlgCfg
def CreateITkMisalignAlgCfg(flags, name="CreateITkMisalignAlg", **kwargs)
Definition: InDetAlignAlgsConfig.py:6
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:39
ITkPixelGeoModelConfig.ITkPixelReadoutGeometryCfg
def ITkPixelReadoutGeometryCfg(flags)
Definition: ITkPixelGeoModelConfig.py:39
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:51
PixelGeoModelConfig.PixelReadoutGeometryCfg
def PixelReadoutGeometryCfg(flags)
Definition: PixelGeoModelConfig.py:52
InDetAlignGenToolsConfig.ITkAlignDBTool
def ITkAlignDBTool(flags, name="ITkAlignDBTool", **kwargs)
Definition: InDetAlignGenToolsConfig.py:6
InDetAlignAlgsConfig.CreateInDetMisalignAlgCfg
def CreateInDetMisalignAlgCfg(flags, name="CreateInDetMisalignAlg", setAlignmentFolderName="/Indet/Align", **kwargs)
Definition: InDetAlignAlgsConfig.py:39