ATLAS Offline Software
testITkEncodeNewConf.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6 from AthenaConfiguration.ComponentFactory import CompFactory
7 from AthenaConfiguration.Enums import LHCPeriod
8 
9 def ITkStripRawContByteStreamToolCfg(flags, name="ITkStripRawContByteStreamToolCustom", **kwargs) :
10  acc = ComponentAccumulator()
11  acc.setPrivateTools( CompFactory.ITkStripsRawContByteStreamTool(name=name,**kwargs))
12  return acc
13 
14 def ITkStripRawContByteStreamToolProviderToolCfg(flags, name="SCTRawContByteStreamToolProviderTool", **kwargs) :
15  acc = ComponentAccumulator()
16  if "RawContByteStreamTool" not in kwargs :
17  kwargs.setdefault("RawContByteStreamTool", acc.popToolsAndMerge(ITkStripRawContByteStreamToolCfg(flags)))
18  acc.addPublicTool( CompFactory.ITkStripRawContByteStreamToolProviderTool(name=name,**kwargs))
19  return acc
20 
21 
22 if __name__ == "__main__":
23  from AthenaConfiguration.AllConfigFlags import initConfigFlags
24  from AthenaConfiguration.TestDefaults import defaultTestFiles
25  flags = initConfigFlags()
26  flags.Input.isMC = True
27  flags.Input.Files = defaultTestFiles.RDO_RUN4
28  flags.Detector.GeometryITkStrip = True
29 
30  flags.ITk.Geometry.AllLocal = False
31 
32  # for debugging
33  from AthenaCommon.Constants import INFO
34  flags.Exec.OutputLevel=INFO
35 
36  flags.lock()
37 
38  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
39  acc = MainServicesCfg(flags)
40 
41  # For POOL file reading
42  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
43  acc.merge(PoolReadCfg(flags))
44 
45  # For ByteStream file writing
46  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamWriteCfg
47  writingAcc = ByteStreamWriteCfg(flags, [ "SCT_RDO_Container#ITkStripRDOs" ] )
48  writingAcc.getService("ByteStreamEventStorageOutputSvc").StreamType = "EventStorage"
49  writingAcc.getService("ByteStreamEventStorageOutputSvc").StreamName = "StreamBSFileOutput"
50  acc.merge(writingAcc)
51 
52  if flags.GeoModel.Run is LHCPeriod.Run4:
54 
55  from StripGeoModelXml.ITkStripGeoModelConfig import ITkStripReadoutGeometryCfg
56  acc.merge(ITkStripReadoutGeometryCfg(flags))
57  from AtlasGeoModel.GeoModelConfig import GeoModelCfg
58  acc.merge(GeoModelCfg(flags))
59 
60  from ITkStripCabling.ITkStripCablingConfig import ITkStripCablingToolCfg
61  acc.popToolsAndMerge(ITkStripCablingToolCfg(flags))
62 
63  # For EventInfo necessary for ByteStream file writing
64  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
65  acc.merge(EventInfoCnvAlgCfg(flags,
66  inputKey="McEventInfo",
67  outputKey="EventInfo"))
68 
69  acc.run(maxEvents=2)
ITkStripCablingConfig.ITkStripCablingToolCfg
def ITkStripCablingToolCfg(flags, name="ITkStripCablingTool")
Definition: ITkStripCablingConfig.py:13
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
ITkStripGeoModelConfig.ITkStripReadoutGeometryCfg
def ITkStripReadoutGeometryCfg(flags)
Definition: ITkStripGeoModelConfig.py:43
testITkEncodeNewConf.ITkStripRawContByteStreamToolCfg
def ITkStripRawContByteStreamToolCfg(flags, name="ITkStripRawContByteStreamToolCustom", **kwargs)
Definition: testITkEncodeNewConf.py:9
testITkEncodeNewConf.ITkStripRawContByteStreamToolProviderToolCfg
def ITkStripRawContByteStreamToolProviderToolCfg(flags, name="SCTRawContByteStreamToolProviderTool", **kwargs)
Definition: testITkEncodeNewConf.py:14
python.ByteStreamConfig.ByteStreamWriteCfg
def ByteStreamWriteCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:100
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:310
Constants
some useful constants -------------------------------------------------—
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.xAODEventInfoCnvConfig.EventInfoCnvAlgCfg
def EventInfoCnvAlgCfg(flags, name="EventInfoCnvAlg", inputKey="McEventInfo", outputKey="EventInfo", disableBeamSpot=False, **kwargs)
Definition: xAODEventInfoCnvConfig.py:11
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:71
python.GeoModelConfig.GeoModelCfg
def GeoModelCfg(flags)
Definition: GeoModelConfig.py:16