ATLAS Offline Software
ITkStripConditionsAlgorithmsConfig.py
Go to the documentation of this file.
1 
2 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
6 from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripGeoModelCfg
7 
8 
9 def ITkStripAlignCondAlgCfg(flags, name="ITkStripAlignCondAlg", **kwargs):
10  """Return a configured SCT_AlignCondAlg for ITk"""
11  acc = ITkStripGeoModelCfg(flags)
12  if flags.GeoModel.Align.Dynamic:
13  raise RuntimeError("Dynamic alignment not supported for ITk yet")
14  else:
15  acc.merge(addFoldersSplitOnline(flags, "INDET", "/Indet/Onl/Align", flags.ITk.Geometry.alignmentFolder, className="AlignableTransformContainer"))
16 
17  kwargs.setdefault("DetManagerName", "ITkStrip")
18  kwargs.setdefault("WriteKey", "ITkStripAlignmentStore")
19  kwargs.setdefault("UseDynamicAlignFolders", flags.GeoModel.Align.Dynamic)
20  kwargs.setdefault("ReadKeyStatic",flags.ITk.Geometry.alignmentFolder)
21 
22  sctAlignCondAlg = CompFactory.SCT_AlignCondAlg(name, **kwargs)
23  acc.addCondAlgo(sctAlignCondAlg)
24  return acc
25 
26 
28  return "/ITkStrip/DAQ/Config/" if flags.IOVDb.DatabaseInstance != "COMP200" else "/ITkStrip/DAQ/Configuration/"
29 
30 
31 def ITkStripConfigurationCondAlgCfg(flags, name="ITkStripConfigurationCondAlg", **kwargs):
32  acc = ComponentAccumulator()
33  folder_prefix = getITkStripDAQConfigFolder(flags)
34  channelFolder = folder_prefix + ("Chip" if flags.IOVDb.DatabaseInstance == "COMP200" else "ChipSlim")
35  kwargs.setdefault("ReadKeyChannel", channelFolder)
36  kwargs.setdefault("ReadKeyModule", f"{folder_prefix}Module")
37  kwargs.setdefault("ReadKeyMur", f"{folder_prefix}MUR")
38 
39  acc.merge(addFoldersSplitOnline(flags,
40  detDb="ITkStrip",
41  onlineFolders=channelFolder,
42  offlineFolders=channelFolder,
43  className="CondAttrListVec",
44  splitMC=True))
45  acc.merge(addFoldersSplitOnline(flags,
46  detDb="ITkStrip",
47  onlineFolders=f"{folder_prefix}Module",
48  offlineFolders=f"{folder_prefix}Module",
49  className="CondAttrListVec",
50  splitMC=True))
51  acc.merge(addFoldersSplitOnline(flags,
52  detDb="ITkStrip",
53  onlineFolders=f"{folder_prefix}MUR",
54  offlineFolders=f"{folder_prefix}MUR",
55  className="CondAttrListVec",
56  splitMC=True))
57 
58  from SCT_Cabling.ITkStripCablingConfig import ITkStripCablingToolCfg
59  kwargs.setdefault("SCT_CablingTool", acc.popToolsAndMerge(ITkStripCablingToolCfg(flags)))
60 
61  from SCT_ConditionsTools.ITkStripConditionsToolsConfig import ITkStripReadoutToolCfg
62  kwargs.setdefault("SCT_ReadoutTool", acc.popToolsAndMerge(ITkStripReadoutToolCfg(flags)))
63 
64  acc.addCondAlgo(CompFactory.SCT_ConfigurationCondAlg(name, **kwargs))
65  return acc
66 
67 
68 def ITkStripDetectorElementCondAlgCfg(flags, name="ITkStripDetectorElementCondAlg", **kwargs):
69  kwargs.setdefault("DetManagerName", "ITkStrip")
70  kwargs.setdefault("ReadKey", "ITkStripAlignmentStore")
71  kwargs.setdefault("WriteKey", "ITkStripDetectorElementCollection")
72 
73  acc = ITkStripAlignCondAlgCfg(flags)
74  acc.addCondAlgo(CompFactory.SCT_DetectorElementCondAlg(name, **kwargs))
75  return acc
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ITkStripGeoModelConfig.ITkStripGeoModelCfg
def ITkStripGeoModelCfg(flags)
Definition: ITkStripGeoModelConfig.py:3
python.ITkStripConditionsAlgorithmsConfig.ITkStripDetectorElementCondAlgCfg
def ITkStripDetectorElementCondAlgCfg(flags, name="ITkStripDetectorElementCondAlg", **kwargs)
Definition: ITkStripConditionsAlgorithmsConfig.py:68
python.ITkStripConditionsToolsConfig.ITkStripReadoutToolCfg
def ITkStripReadoutToolCfg(flags, name="ITkStripReadoutTool", **kwargs)
Definition: ITkStripConditionsToolsConfig.py:178
python.ITkStripCablingConfig.ITkStripCablingToolCfg
def ITkStripCablingToolCfg(flags, name="ITkStripCablingTool")
Definition: ITkStripCablingConfig.py:33
python.IOVDbSvcConfig.addFoldersSplitOnline
def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='')
Definition: IOVDbSvcConfig.py:153
python.ITkStripConditionsAlgorithmsConfig.getITkStripDAQConfigFolder
def getITkStripDAQConfigFolder(flags)
Definition: ITkStripConditionsAlgorithmsConfig.py:27
python.ITkStripConditionsAlgorithmsConfig.ITkStripConfigurationCondAlgCfg
def ITkStripConfigurationCondAlgCfg(flags, name="ITkStripConfigurationCondAlg", **kwargs)
Definition: ITkStripConditionsAlgorithmsConfig.py:31
python.ITkStripConditionsAlgorithmsConfig.ITkStripAlignCondAlgCfg
def ITkStripAlignCondAlgCfg(flags, name="ITkStripAlignCondAlg", **kwargs)
Definition: ITkStripConditionsAlgorithmsConfig.py:9