ATLAS Offline Software
Loading...
Searching...
No Matches
EventInfoWrite.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
4from AthenaConfiguration.AllConfigFlags import initConfigFlags
5from AthenaConfiguration.ComponentFactory import CompFactory
6from AthenaConfiguration.TestDefaults import defaultGeometryTags
7from AthenaConfiguration.Utils import setupLoggingLevels
8from Campaigns.Utils import Campaign
9import sys
10
11#Set a number of flags to avoid input-file peeking
12flags=initConfigFlags()
13flags.Input.isMC=True
14flags.Input.RunNumbers=[1]
15flags.Input.TimeStamps=[0]
16flags.IOVDb.GlobalTag = 'OFLCOND-SDR-BS14T-IBL-06'
17flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
18flags.LAr.doAlign=False
19flags.Input.MCCampaign=Campaign.Unknown
20flags.Input.Files=[]
21flags.Input.TypedCollections=[]
22
23flags.Exec.DebugMessageComponents=["TagInfoMgr",
24 "EventSelector",
25 "EventInfoWriter",
26 "IOVDbMetaDataTool"]
27
28flags.lock()
29StreamName="EventInfoPoolFile1"
30
31from AthenaConfiguration.MainServicesConfig import MainEvgenServicesCfg
32acc=MainEvgenServicesCfg(flags)
33
34from xAODEventInfoCnv.xAODEventInfoCnvConfig import EventInfoCnvAlgCfg
35acc.merge(EventInfoCnvAlgCfg(flags, disableBeamSpot=True), sequenceName="AthAlgSeq")
36
37#Add some LAr and Tile conditions, this is the payload obj for this test
38from LArGeoAlgsNV.LArGMConfig import LArGMCfg
39acc.merge(LArGMCfg(flags))
40
41
42from LArCabling.LArCablingConfig import LArOnOffIdMappingCfg, LArCalibIdMappingCfg,LArFebRodMappingCfg
43acc.merge(LArOnOffIdMappingCfg(flags))
44acc.merge(LArCalibIdMappingCfg(flags))
45acc.merge(LArFebRodMappingCfg(flags))
46
47from TileConditions.TileEMScaleConfig import TileEMScaleCondAlgCfg
48acc.merge(TileEMScaleCondAlgCfg(flags))
49
50EventSelector=acc.getService("EventSelector")
51EventSelector.RunNumber = 1
52EventSelector.EventsPerRun = 0x100000010
53EventSelector.FirstEvent = 0x100000000
54EventSelector.EventsPerLB = 1
55EventSelector.FirstLB = 1
56EventSelector.InitialTimeStamp = 0
57EventSelector.TimeStampInterval = 5
58
59
60from EventInfoMgt.TagInfoMgrConfig import TagInfoMgrCfg
61acc.merge(TagInfoMgrCfg(flags))
62
63acc.addEventAlgo(CompFactory.EventInfoWriter(),sequenceName = 'AthAlgSeq')
64
65from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
66acc.merge(
67 OutputStreamCfg(
68 flags,
69 StreamName,
70 ItemList=[],
71 MetadataItemList=["IOVMetaDataContainer#*"],
72 )
73)
74
75# Change output file catalog to avoid races.
76acc.getService("PoolSvc").WriteCatalog = 'file:EventInfoTests_catalog.xml'
77
78setupLoggingLevels(flags,acc)
79
80sys.exit(acc.run(25).isFailure())