ATLAS Offline Software
Loading...
Searching...
No Matches
testSCTEncodeNewConf.py
Go to the documentation of this file.
2# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3#
4
5from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
6from AthenaConfiguration.ComponentFactory import CompFactory
7from AthenaConfiguration.Enums import LHCPeriod
8
9def SCTRawContByteStreamToolCfg(flags, name="SCTRawContByteStreamToolCustom", **kwargs) :
10 acc = ComponentAccumulator()
11 acc.setPrivateTools( CompFactory.SCTRawContByteStreamTool(name=name,**kwargs))
12 return acc
13
14def 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
22if __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)
SCTRawContByteStreamToolCfg(flags, name="SCTRawContByteStreamToolCustom", **kwargs)
SCTRawContByteStreamToolProviderToolCfg(flags, name="SCTRawContByteStreamToolProviderTool", **kwargs)