ATLAS Offline Software
SCT_ReadoutTestAlgConfig.py
Go to the documentation of this file.
1 """Define method to configure and test SCT_ReadoutTestAlg
2 
3 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4 """
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 
8 def SCT_ReadoutTestAlgCfg(flags, name="SCT_ReadoutTestAlg", **kwargs):
9  """Return a configured SCT_ReadoutTestAlg"""
10  acc = ComponentAccumulator()
11  from SCT_ConditionsTools.SCT_ConditionsToolsConfig import SCT_ReadoutToolCfg
12  kwargs.setdefault("SCT_ReadoutTool", acc.popToolsAndMerge(SCT_ReadoutToolCfg(flags)))
13 
14  # Module type and link status
15  # kwargs.setdefault("ModuleId", 143704064) # Endcap (default is barrel)
16  # kwargs.setdefault("LinkOStatus", False) # Link 0 disabled (default is 'good')
17  # kwargs.setdefault("Link1Status", False) # Link 1 disabled (default is 'good')
18 
19  # Some possible chip configs strings
20  masterChip = "10110000000001"
21  slaveChip = "10110000000101"
22  # slaveChipIn1 = "10110000010101"
23  # slaveChipOut1 = "10110000001101"
24  endChip = "10110000000111"
25  # masterAndEndChip = "10110000000011"
26 
27  # Some test module configs
28  defaultLink = [masterChip] + [slaveChip]*4 + [endChip]
29  # noEndLink = [masterChip] + [slaveChip]*5
30  # endAt2Link = [masterChip] + [slaveChip] + [endChip] + [slaveChip]*3
31  # bypass2Link = [masterChip] + [slaveChipIn1] + [slaveChip] + [slaveChipOut1] + [slaveChip] + [endChip]
32  # master3Link = [slaveChip]*3 + [masterChip] + [slaveChip] + [endChip]
33  # noMapped4Link = [masterChip] + [slaveChip]*3 + [slaveChipIn1] + [endChip]
34  # nothingTalkingTo2Link = [masterChip] + [slaveChip] + [slaveChipIn1] + [slaveChip]*2 + [endChip]
35  # allExcept1Link0Mod = [masterChip] + [slaveChip]*4 + [slaveChipIn1] + [slaveChipOut1] + [masterAndEndChip] + [slaveChip]*3 + [endChip]
36  # allLink0EndcapMod = [masterChip] + [slaveChip]*10 + [endChip]
37  # allLink1EndcapMod = [slaveChip]*5 + [endChip] + [masterChip] + [slaveChip]*5
38  # infiniteEndcapMod = [masterChip] + [slaveChip]*11
39 
40  kwargs.setdefault("ChipConfigurationList", defaultLink*2)
41  # kwargs.setdefault("ChipConfigurationList", defaultLink + endAt2Link)
42  # kwargs.setdefault("ChipConfigurationList", bypass2Link + defaultLink)
43  # kwargs.setdefault("ChipConfigurationList", master3Link + defaultLink)
44  # kwargs.setdefault("ChipConfigurationList", defaultLink + noMapped4Link)
45  # kwargs.setdefault("ChipConfigurationList", defaultLink + nothingTalkingTo2Link)
46  # kwargs.setdefault("ChipConfigurationList", noEndLink + defaultLink)
47  # kwargs.setdefault("ChipConfigurationList", allExcept1Link1Mod)
48  # kwargs.setdefault("ChipConfigurationList", allLink0EndcapMod)
49  # kwargs.setdefault("ChipConfigurationList", allLink1EndcapMod)
50  # kwargs.setdefault("ChipConfigurationList", infiniteEndcapMod)
51 
52  acc.addEventAlgo(CompFactory.SCT_ReadoutTestAlg(name, **kwargs))
53  return acc
54 
55 if __name__=="__main__":
56  from AthenaCommon.Logging import log
57  from AthenaCommon.Constants import INFO
58  log.setLevel(INFO)
59 
60  from AthenaConfiguration.AllConfigFlags import initConfigFlags
61  flags = initConfigFlags()
62  flags.Input.Files = []
63  flags.Input.isMC = True
64  flags.Input.ProjectName = "mc16_13TeV"
65  flags.Input.RunNumbers = [300000] # MC16c 2017 run number
66  flags.Input.TimeStamps = [1500000000]
67  flags.IOVDb.GlobalTag = "OFLCOND-MC16-SDR-18"
68  from AthenaConfiguration.TestDefaults import defaultGeometryTags
69  flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
70  flags.Detector.GeometrySCT = True
71  flags.lock()
72 
73  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
74  cfg = MainServicesCfg(flags)
75 
76  from McEventSelector.McEventSelectorConfig import McEventSelectorCfg
77  cfg.merge(McEventSelectorCfg(flags))
78 
79  cfg.merge(SCT_ReadoutTestAlgCfg(flags))
80 
81  cfg.run(maxEvents=20)
python.SCT_ReadoutTestAlgConfig.SCT_ReadoutTestAlgCfg
def SCT_ReadoutTestAlgCfg(flags, name="SCT_ReadoutTestAlg", **kwargs)
Definition: SCT_ReadoutTestAlgConfig.py:8
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.McEventSelectorConfig.McEventSelectorCfg
def McEventSelectorCfg(flags, **kwargs)
Definition: McEventSelectorConfig.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.SCT_ConditionsToolsConfig.SCT_ReadoutToolCfg
def SCT_ReadoutToolCfg(flags, name="SCT_ReadoutTool", **kwargs)
Definition: SCT_ConditionsToolsConfig.py:399