ATLAS Offline Software
testSCTEncodeNewConf.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 SCTRawContByteStreamToolCfg(flags, name="SCTRawContByteStreamToolCustom", **kwargs) :
10  acc = ComponentAccumulator()
11  acc.setPrivateTools( CompFactory.SCTRawContByteStreamTool(name=name,**kwargs))
12  return acc
13 
14 def SCTRawContByteStreamToolProviderToolCfg(flags, name="SCTRawContByteStreamToolProviderTool", **kwargs) :
15  acc = ComponentAccumulator()
16  if "RawContByteStreamTool" not in kwargs :
17  kwargs.setdefault("RawContByteStreamTool", acc.popToolsAndMerge(SCTRawContByteStreamToolCfg(flags)))
18  acc.addPublicTool( CompFactory.SCTRawContByteStreamToolProviderTool(name=name,**kwargs))
19  return acc
20 
21 
22 if __name__ == "__main__":
23  from AthenaConfiguration.AllConfigFlags import initConfigFlags
24  flags = initConfigFlags()
25  flags.Input.isMC = True
26  flags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/TriggerTest/valid1.110401.PowhegPythia_P2012_ttbar_nonallhad.recon.RDO.e3099_s2578_r7572_tid07644622_00/RDO.07644622._000001.pool.root.1"]
27  flags.IOVDb.GlobalTag = "OFLCOND-RUN12-SDR-31"
28  flags.Detector.GeometrySCT = True
29  flags.lock()
30 
31  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
32  acc = MainServicesCfg(flags)
33 
34  # For POOL file reading
35  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
36  acc.merge(PoolReadCfg(flags))
37 
38  # For ByteStream file writing
39  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamWriteCfg
40  writingAcc = ByteStreamWriteCfg(flags, [ "SCT_RDO_Container#SCT_RDOs" ] )
41  writingAcc.getService("ByteStreamEventStorageOutputSvc").StreamType = "EventStorage"
42  writingAcc.getService("ByteStreamEventStorageOutputSvc").StreamName = "StreamBSFileOutput"
43  acc.merge(writingAcc)
44 
45  if flags.GeoModel.Run is not LHCPeriod.Run4:
47 
48  # For SCT geometry and cabling
49  from SCT_GeoModel.SCT_GeoModelConfig import SCT_ReadoutGeometryCfg
50  acc.merge(SCT_ReadoutGeometryCfg(flags))
51  from SCT_Cabling.SCT_CablingConfig import SCT_CablingToolCfg
52  acc.popToolsAndMerge(SCT_CablingToolCfg(flags))
53 
54  # For EventInfo necessary for ByteStream file writing
55  from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
56  acc.merge(EventInfoCnvAlgCfg(flags,
57  inputKey="McEventInfo",
58  outputKey="EventInfo"))
59 
60  acc.run(maxEvents=10)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.testSCTEncodeNewConf.SCTRawContByteStreamToolCfg
def SCTRawContByteStreamToolCfg(flags, name="SCTRawContByteStreamToolCustom", **kwargs)
Definition: testSCTEncodeNewConf.py:9
python.testSCTEncodeNewConf.SCTRawContByteStreamToolProviderToolCfg
def SCTRawContByteStreamToolProviderToolCfg(flags, name="SCTRawContByteStreamToolProviderTool", **kwargs)
Definition: testSCTEncodeNewConf.py:14
python.ByteStreamConfig.ByteStreamWriteCfg
def ByteStreamWriteCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:100
SCT_GeoModelConfig.SCT_ReadoutGeometryCfg
def SCT_ReadoutGeometryCfg(flags)
Definition: SCT_GeoModelConfig.py:50
python.SCT_CablingConfig.SCT_CablingToolCfg
def SCT_CablingToolCfg(flags, name="SCT_CablingTool")
Definition: SCT_CablingConfig.py:35
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:312
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