ATLAS Offline Software
Loading...
Searching...
No Matches
EventDisplaysOnlineConfig Namespace Reference

Functions

 EventDisplaysOnlineCfg (flags, **kwargs)

Variables

 flags = initConfigFlags()
 HorizontalMuonsMode
 MakeVP1File
 CosmicMode
 HIMode
 HIPMode
 BeamSplashMode
 OfflineTest
 cfg = EventDisplaysOnlineCfg(flags)
 sc = cfg.run()

Function Documentation

◆ EventDisplaysOnlineCfg()

EventDisplaysOnlineConfig.EventDisplaysOnlineCfg ( flags,
** kwargs )

Definition at line 4 of file EventDisplaysOnlineConfig.py.

4def EventDisplaysOnlineCfg(flags, **kwargs):
5 from EventDisplaysOnline.EventDisplaysOnlineHelpers import GetBFields, WaitForPartition, GetUniqueJobID, GetRunNumber, Ready4Physics
6
7 from AthenaCommon.Logging import logging
8 mlog = logging.getLogger( 'EventDisplaysOnlineCfg' )
9
10 if not flags.OnlineEventDisplays.OfflineTest:
11 from AthenaConfiguration.AutoConfigOnlineRecoFlags import autoConfigOnlineRecoFlags
12 autoConfigOnlineRecoFlags(flags, flags.OnlineEventDisplays.PartitionName)
13 flags.OnlineEventDisplays.Ready4PhysicsAtStart=Ready4Physics()
14
15 # An explicit list for nominal data taking to exclude some high rate streams
16 # Empty list to read all
17 flags.OnlineEventDisplays.TriggerStreams = ['MinBias','express','ZeroBias','CosmicCalo','IDCosmic','CosmicMuons','Background','Standby','L1Calo','Main']
18 if flags.OnlineEventDisplays.BeamSplashMode:
19 flags.OnlineEventDisplays.TriggerStreams = ['MinBias'] #if trigger fails it will go to debug_HltError
20
21 # If testing at p1, create dir /tmp/your_user_name and write out to /tmp/your_user_name to see output
22 flags.OnlineEventDisplays.OutputDirectory = "/atlas/EventDisplayEvents/"
23
24 if flags.OnlineEventDisplays.OfflineTest:
25 flags.OnlineEventDisplays.OutputDirectory = "."
26
27
38 flags.OnlineEventDisplays.PartitionName='ATLAS' # 'ATLAS', 'GMTestPartition' or 'GMTestPartitionT9'
39
40 flags.OnlineEventDisplays.MaxEvents=50
41 flags.OnlineEventDisplays.ProjectTag='data25_13p6TeV'
42 flags.OnlineEventDisplays.PublicStreams=['Main']
43 if flags.OnlineEventDisplays.HIMode:
44 flags.OnlineEventDisplays.MaxEvents=200
45 flags.OnlineEventDisplays.ProjectTag='data25_hi'
46 flags.OnlineEventDisplays.PublicStreams=['HardProbes']
47 if flags.OnlineEventDisplays.HIPMode:
48 flags.OnlineEventDisplays.MaxEvents=200
49 flags.OnlineEventDisplays.ProjectTag='data25_hip'
50 flags.OnlineEventDisplays.PublicStreams=['Main']
51 if flags.OnlineEventDisplays.CosmicMode:
52 flags.OnlineEventDisplays.MaxEvents=200
53 flags.OnlineEventDisplays.ProjectTag='data25_cos'
54 flags.OnlineEventDisplays.PublicStreams=['']
55 if flags.OnlineEventDisplays.BeamSplashMode:
56 flags.OnlineEventDisplays.MaxEvents=-1 # keep all the events
57 flags.OnlineEventDisplays.ProjectTag='data25_comm'
58 flags.OnlineEventDisplays.PublicStreams=['']
59
60 # Pause this thread until the partition is up
61 if not flags.OnlineEventDisplays.OfflineTest:
62 WaitForPartition(flags.OnlineEventDisplays.PartitionName)
63
64 if not flags.OnlineEventDisplays.OfflineTest:
65 import os
66 IPC_timeout = int(os.environ['TDAQ_IPC_TIMEOUT'])
67 print(" IPC_timeout Envrionment Variable = %d" %IPC_timeout)
68
69 # Conditions tag
70 if flags.OnlineEventDisplays.OfflineTest:
71 flags.IOVDb.GlobalTag = 'CONDBR2-BLKPA-2025-02'
72 else:
73 flags.IOVDb.GlobalTag = 'CONDBR2-HLTP-2025-01' # Online conditions tag
74
75 # Geometry tag
76 flags.GeoModel.AtlasVersion = 'ATLAS-R3S-2021-03-02-00'
77
78 flags.Trigger.triggerConfig='DB'
79
80 jobId = GetUniqueJobID()
81
82 # Test wth a small amount of events and write out to e.g. a tmp dir
83 if flags.OnlineEventDisplays.PartitionName != 'ATLAS' or flags.OnlineEventDisplays.OfflineTest:
84 flags.Exec.MaxEvents = 5
85 flags.Output.ESDFileName = flags.OnlineEventDisplays.OutputDirectory + "ESD-%s-%s.pool.root" % (jobId[3], jobId[4])
86 else:
87 flags.Exec.MaxEvents = 20000 # hack until we find a way to fix the memory fragmentation ATEAM-896, this resets the memory after 20k events
88 flags.Output.ESDFileName = "ESD-%s-%s.pool.root" % (jobId[3], jobId[4])
89
90 if flags.OnlineEventDisplays.MakeVP1File:
91 flags.Output.doWriteESD = True
92 else:
93 flags.Output.doWriteESD = False
94
95 flags.Output.doJiveXML = False # We call the AlgoJive later on
96
97 if flags.OnlineEventDisplays.OfflineTest:
98 flags.Input.Files = ['/eos/home-m/myexley/sharedWithATLASauthors/data25_13p6TeV.00499912.physics_Main.daq.RAW._lb0600._SFO-11._0001.data']
99 else:
100 flags.Input.Files = [] # Files are read from the ATLAS (or GM test) partition
101
102 flags.Reco.EnableTrigger = False # TODO test True
103 flags.Detector.GeometryForward = False
104 flags.Detector.EnableFwdRegion = False
105 flags.Reco.EnableZDC = False
106 flags.LAr.doHVCorr = False # ATLASRECTS-6823
107 flags.DQ.doMonitoring = False
108 flags.DQ.doPostProcessing = False
109 flags.Concurrency.NumThreads = 1
110
111 if flags.OnlineEventDisplays.MakeVP1File:
112 flags.Concurrency.NumThreads = 0 # We cannot run multithread if we want one ESD file per event named with the event number etc. changing the name of the output ESD file when multithreading is not so simple...
113 if flags.OnlineEventDisplays.HIMode or flags.OnlineEventDisplays.HIPMode:
114 mlog.warning("You have said you want to create a vp1 file 'flags.OnlineEventDisplays.MakeVP1File=True' but you have also said you want to run reconstruction in an heavy ion mode, this will not work as heavy ion mode needs to run in multithreading mode, and in this mode we cannot write out one ESD file (i.e. vp1 file) per event.")
115
116 if flags.OnlineEventDisplays.HIMode:
117 from AthenaConfiguration.Enums import HIMode
118 flags.Reco.HIMode = HIMode.HI
119 flags.Concurrency.NumThreads = 1
120 flags.OnlineEventDisplays.MakeVP1File = False
121 flags.Beam.BunchSpacing = 50
122
123 if flags.OnlineEventDisplays.HIPMode:
124 from AthenaConfiguration.Enums import HIMode
125 flags.Reco.HIMode = HIMode.HIP
126 flags.Concurrency.NumThreads = 1
127 flags.OnlineEventDisplays.MakeVP1File = False
128
129 if flags.OnlineEventDisplays.BeamSplashMode:
130 flags.Reco.EnableJet=False
131 flags.Reco.EnableMet=False
132 flags.Reco.EnableTau=False
133 flags.Reco.EnablePFlow=False
134 flags.Reco.EnableBTagging=False
135 flags.Reco.EnableEgamma=False
136 flags.Reco.EnableCombinedMuon=False
137
138 from AthenaCommon.Constants import INFO
139 flags.Exec.OutputLevel = INFO
140
141 flags.Common.isOnline = not flags.OnlineEventDisplays.OfflineTest
142
143 if flags.OnlineEventDisplays.PartitionName == 'ATLAS' and not flags.OnlineEventDisplays.OfflineTest:
144 # For beam plashes when LAr running in a different samples mode, the current run number to LAr config is needed
145 run_number = GetRunNumber(flags.OnlineEventDisplays.PartitionName)
146 flags.Input.OverrideRunNumber = True
147 flags.Input.RunNumbers = [run_number]
148
149 # Get the B field
150 (solenoidOn,toroidOn)=GetBFields()
151 flags.BField.solenoidOn = solenoidOn
152 flags.BField.barrelToroidOn = toroidOn
153 flags.BField.endcapToroidOn = toroidOn
154
155 # GM test partition needs to be given the below info
156 if (flags.OnlineEventDisplays.PartitionName == 'GMTestPartition' or flags.OnlineEventDisplays.PartitionName == 'GMTestPartitionT9'):
157 flags.Input.RunNumbers = [482485] # keep this number the same as (or close to) the run number of the file you are testing on
158 flags.Input.LumiBlockNumbers = [111]
159
160 from AthenaConfiguration.Enums import BeamType
161 if not flags.OnlineEventDisplays.OfflineTest:
162 if flags.OnlineEventDisplays.CosmicMode:
163 flags.Beam.Type = BeamType.Cosmics
164 else:
165 flags.Beam.Type = BeamType.Collisions
166 flags.lock()
167 flags.dump()
168
170 from RecJobTransforms.RecoSteering import RecoSteering
171 cfg = RecoSteering(flags)
172
173 from IOVDbSvc.IOVDbSvcConfig import addOverride
174 if not flags.OnlineEventDisplays.OfflineTest:
175 cfg.merge(addOverride(flags, "/TRT/Onl/Calib/PID_NN", "TRTCalibPID_NN_v2", db=""))
176
177 # Get the input files from the partition
178 if not flags.OnlineEventDisplays.OfflineTest:
179 from EventDisplaysOnline.ByteStreamConfig import ByteStreamCfg
180 cfg.merge(ByteStreamCfg(flags, **kwargs))
181
182 from EventDisplaysOnline.OnlineEventDisplaysSvcConfig import OnlineEventDisplaysSvcCfg
183 cfg.merge(OnlineEventDisplaysSvcCfg(flags, **kwargs))
184
185 from JiveXML.OnlineStreamToFileConfig import OnlineStreamToFileCfg
186 streamToFileTool = cfg.popToolsAndMerge(OnlineStreamToFileCfg(flags, **kwargs))
187
188 streamToServerTool = None
189 if not flags.OnlineEventDisplays.OfflineTest:
190 from JiveXML.OnlineStreamToServerConfig import OnlineStreamToServerCfg
191 streamToServerTool = cfg.popToolsAndMerge(OnlineStreamToServerCfg(flags, **kwargs))
192
193 from JiveXML.JiveXMLConfig import AlgoJiveXMLCfg
194 cfg.merge(AlgoJiveXMLCfg(flags,
195 StreamToFileTool = streamToFileTool,
196 StreamToServerTool = streamToServerTool,
197 OnlineMode = not flags.OnlineEventDisplays.OfflineTest))
198
199 if flags.OnlineEventDisplays.HIMode:
200 from EventDisplaysOnline.ContainerKeysCfg import getHIContainterKeys
201 getHIContainterKeys(cfg)
202
203 if flags.OnlineEventDisplays.HIPMode:
204 from EventDisplaysOnline.ContainerKeysCfg import getHIPContainterKeys
205 getHIPContainterKeys(cfg)
206
207 if flags.OnlineEventDisplays.MakeVP1File:
208 # This gets the ESD output file which is renamed and moved to the desired output stream
209 # in the VP1 Event Prod alg, this creates one ESD file per event
210 from AthenaServices.OutputStreamSequencerSvcConfig import OutputStreamSequencerSvcCfg
211 cfg.merge(OutputStreamSequencerSvcCfg(flags,incidentName="EndEvent"))
212 from OutputStreamAthenaPool.OutputStreamConfig import outputStreamName
213 streamESD = cfg.getEventAlgo(outputStreamName("ESD"))
214 streamESD.OutputFile=flags.Output.ESDFileName
215
216 from VP1AlgsEventProd.VP1AlgsEventProdConfig import VP1AlgsEventProdCfg
217 cfg.merge(VP1AlgsEventProdCfg(flags, streamESD, **kwargs))
218
219 # switch of the NSW segment making as it takes too much CPU in beamsplashes
220 if flags.OnlineEventDisplays.BeamSplashMode:
221 cfg.getEventAlgo("MuonSegmentMaker").doStgcSegments=False
222 cfg.getEventAlgo("MuonSegmentMaker").doMMSegments=False
223 cfg.getEventAlgo("MuonSegmentMaker_NCB").doStgcSegments=False
224 cfg.getEventAlgo("MuonSegmentMaker_NCB").doMMSegments=False
225 cfg.dropEventAlgo("QuadNSW_MuonSegmentCnvAlg")
226
227 if flags.OnlineEventDisplays.HorizontalMuonsMode:
228 from MuonConfig.MuonReconstructionConfig import MuonNCBTrackCfg
229 cfg.merge(MuonNCBTrackCfg(flags))
230
231 cfg.getService("PoolSvc").WriteCatalog = "xmlcatalog_file:PoolFileCatalog_%s_%s.xml" % (jobId[3], jobId[4])
232
233
237 cfg.getService("PoolSvc").ReadCatalog += ["xmlcatalog_file:/det/dqm/GlobalMonitoring/PoolFileCatalog_M7/PoolFileCatalog.xml"]
238
239 # Dump the pickle file
240 with open("OnlineEventDisplays.pkl", "wb") as f:
241 cfg.store(f)
242
243 return cfg
244
void print(char *figname, TCanvas *c1)

Variable Documentation

◆ BeamSplashMode

EventDisplaysOnlineConfig.BeamSplashMode

Definition at line 254 of file EventDisplaysOnlineConfig.py.

◆ cfg

EventDisplaysOnlineConfig.cfg = EventDisplaysOnlineCfg(flags)

Definition at line 257 of file EventDisplaysOnlineConfig.py.

◆ CosmicMode

EventDisplaysOnlineConfig.CosmicMode

Definition at line 251 of file EventDisplaysOnlineConfig.py.

◆ flags

EventDisplaysOnlineConfig.flags = initConfigFlags()

Definition at line 247 of file EventDisplaysOnlineConfig.py.

◆ HIMode

EventDisplaysOnlineConfig.HIMode

Definition at line 252 of file EventDisplaysOnlineConfig.py.

◆ HIPMode

EventDisplaysOnlineConfig.HIPMode

Definition at line 253 of file EventDisplaysOnlineConfig.py.

◆ HorizontalMuonsMode

EventDisplaysOnlineConfig.HorizontalMuonsMode

Definition at line 249 of file EventDisplaysOnlineConfig.py.

◆ MakeVP1File

EventDisplaysOnlineConfig.MakeVP1File

Definition at line 250 of file EventDisplaysOnlineConfig.py.

◆ OfflineTest

EventDisplaysOnlineConfig.OfflineTest

Definition at line 255 of file EventDisplaysOnlineConfig.py.

◆ sc

EventDisplaysOnlineConfig.sc = cfg.run()

Definition at line 259 of file EventDisplaysOnlineConfig.py.