6 if __name__==
'__main__':
9 if len(sys.argv)>1
and (sys.argv[1]==
"-h" or sys.argv[1]==
"--help"):
12 print(
"StateLessPT_NewConfig.py {--config XXX} {--stream YYY}")
13 print(
" default XXX: LArMon")
14 print(
" default YYY: ''")
24 for ii
in range(1,len(sys.argv)):
25 print(ii,
" ",sys.argv[ii])
27 opts,args=getopt.getopt(sys.argv[1:],
"t:",[
"config=",
"stream="])
28 except getopt.GetoptError
as e:
29 print(
"Failed to interpret arguments")
36 print(
"Got option --config: ",a)
38 if o==
"--stream": STREAM=a
40 from AthenaConfiguration.Enums
import Format
46 partition = os.environ.get(
"TDAQ_PARTITION")
48 from ispy
import IPCPartition, ISObject
53 p = IPCPartition(partition)
55 print(
"Partition:",p.name(),
"is not valid")
59 from AthenaConfiguration.Enums
import BeamType
60 if partition ==
"ATLAS":
62 y = ISObject(p,
'RunParams.SOR_RunParams',
'RunParams')
64 print(
"Could not find Run Parameters in IS - Set default beam type to 'cosmics'")
65 beamType=BeamType.Cosmics
68 beamtype = y.beam_type
69 beamenergy = y.beam_energy
70 runnumber = y.run_number
71 project = y.T0_project_tag
72 print(
"RUN CONFIGURATION: beam type %i, beam energy %i, run number %i, project tag %s"%(beamtype,beamenergy,runnumber,project))
74 if project[7:10]==
"cos":
75 beamType=BeamType.Cosmics
77 beamType=BeamType.Collisions
81 beamType=BeamType.Collisions
85 x = ISObject(p,
'LArParams.LAr.RunLogger.GlobalParams',
'GlobalParamsInfo')
87 print(
"Couldn not find IS Parameters - Set default flag")
105 print(
"Couldn not find IS Parameters - Set default flag")
122 FirstSample = x.firstSample
123 NSamples = x.nbOfSamples
125 print(
"RUN CONFIGURATION: format %i,run type %i"%(RunType,LArFormat))
132 print(
"RUN CONFIGURATION: ReadDigits =", ReadDigits)
135 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
137 from AthenaMonitoring.DQConfigFlags
import allSteeringFlagsOff
141 flags.Beam.Type=beamType
142 flags.Beam.BunchSpacing=25
143 print(
"RUN CONFIGURATION: Beamtype =",flags.Beam.Type)
145 flags.Common.isOnline=
True
146 flags.Input.Format=Format.BS
147 flags.Input.isMC=
False
149 flags.IOVDb.DatabaseInstance=
"CONDBR2"
150 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2016-03"
152 flags.GeoModel.Layout=
"atlas"
153 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
154 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
156 flags.Exec.MaxEvents=-1
158 from AthenaConfiguration.AutoConfigOnlineRecoFlags
import autoConfigOnlineRecoFlags
161 flags.Input.RunNumbers=[runnumber]
163 flags.Input.LumiBlockNumbers=[0]
165 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
168 flags.Trigger.doID=
False
169 flags.Trigger.doMuon=
False
170 flags.Trigger.L1.doMuon=
False
171 flags.Trigger.L1.doTopo=
False
172 flags.Trigger.doHLT=
False
173 flags.Trigger.doLVL1=
False
174 flags.Trigger.Online.isPartition=
True
175 flags.Trigger.triggerConfig=
'DB'
177 flags.DQ.doMonitoring=
True
178 flags.DQ.disableAtlasReadyFilter=
True
179 flags.DQ.useTrigger=
True
181 flags.DQ.Environment=
'online'
183 flags.LAr.doAlign=
True
184 flags.LAr.doHVCorr=
False
186 flags.Calo.TopoCluster.doTopoClusterLocalCalib=
False
193 from LArMonitoring.LArMonConfigFlags
import createLArMonConfigFlags
196 flags.addFlagsCategory(
"LArMon", __monflags)
198 if STREAM==
"CosmicCalo" or STREAM==
"LArCellsEmpty":
199 flags.LArMon.doLArRawMonitorSignal=
True
201 if 'CaloMon' in CONFIG:
202 flags.DQ.enableLumiAccess=
False
204 flags.DQ.enableLumiAccess=
False
211 from AthenaConfiguration.ComponentFactory
import CompFactory
213 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
216 bytestream_conversion = CompFactory.ByteStreamCnvSvc()
217 acc.addService(bytestream_conversion, primary=
True)
219 from ByteStreamEmonSvc.EmonByteStreamConfig
import EmonByteStreamCfg
222 bytestream_input = acc.getService(
"ByteStreamInputSvc")
229 bytestream_input.Partition = partition
235 if partition ==
"ATLAS" or partition[:3] ==
"LAr":
236 bytestream_input.Key =
"dcm"
238 bytestream_input.Key =
"CompleteEvent"
240 bytestream_input.KeyCount = 15
241 bytestream_input.KeyCount = 150
242 bytestream_input.UpdatePeriod = 60
250 bytestream_input.ISServer =
'LArHistogramming'
258 bytestream_input.PublishName =
'%s-Test-%s'%(CONFIG,STREAM)
260 bytestream_input.PublishName =
'%s-Test-%s'%(CONFIG,
"NoTrigSel")
267 bytestream_input.ClearHistograms =
True
286 bytestream_input.Timeout = 3600000
294 if bytestream_input.Partition[:3] ==
"LAr":
295 bytestream_input.StreamType =
""
297 bytestream_input.LVL1Logic =
"Or"
298 bytestream_input.LVL1Origin =
"TAV"
299 bytestream_input.StreamType =
"physics"
300 bytestream_input.StreamLogic =
"And"
302 if STREAM==
"LArCellsEmpty":
303 bytestream_input.StreamType =
"calibration"
304 bytestream_input.StreamNames = [
'LArCellsEmpty']
306 bytestream_input.StreamNames = [
'Main']
307 if STREAM==
"CosmicCalo":
308 bytestream_input.StreamNames = [
'CosmicCalo']
310 bytestream_input.StreamNames = [
'L1Topo']
312 bytestream_input.StreamNames = [
'L1Calo']
313 if STREAM==
"express":
314 bytestream_input.StreamNames = [
'express']
315 bytestream_input.StreamType =
"express"
316 if STREAM==
"LArNoiseBurst":
317 bytestream_input.StreamType =
"calibration"
318 bytestream_input.StreamNames = [
'LArNoiseBurst']
319 if STREAM==
"Standby":
320 bytestream_input.StreamNames = [
'Standby']
321 if STREAM==
"ZeroBias":
322 bytestream_input.StreamNames = [
'ZeroBias']
323 if STREAM==
"MinBias":
324 bytestream_input.StreamNames = [
'MinBias']
325 if STREAM==
"Background":
326 bytestream_input.StreamNames = [
'Background']
327 if STREAM==
"05_Jets":
328 bytestream_input.StreamType =
"calibration"
329 bytestream_input.StreamNames = [
'DataScouting_05_Jets']
331 bytestream_input.StreamNames = [
'monitoring_random']
332 bytestream_input.StreamType =
"monitoring"
333 if STREAM==
"calibration":
334 bytestream_input.StreamType =
"calibration"
337 print(
"DEBUG: bytestream_input.StreamNames:",bytestream_input.StreamNames)
340 bytestream_input.StreamType =
"physics"
341 bytestream_input.StreamLogic =
"Or"
343 bytestream_input.StreamNames = [
"Main",
"CosmicCalo",
"L1Topo",
"L1Calo",
"Standby",
"ZeroBias",
"Background",
"EnhancedBias",
"MinBias",
"LArCells",
"LArCellsEmpty",
"LArNoiseBurst",
"BphysDelayed",
"Late"]
351 bytestream_input.ExitOnPartitionShutdown =
False
359 bytestream_input.BufferSize = 10
368 event_selector = CompFactory.EventSelectorByteStream(
369 name=
'EventSelector',
370 ByteStreamInputSvc=bytestream_input.name,
372 acc.addService(event_selector)
373 acc.setAppProperty(
"EvtSel", event_selector.name)
375 event_persistency = CompFactory.EvtPersistencySvc(
376 name=
"EventPersistencySvc",
377 CnvServices=[bytestream_conversion.name])
378 acc.addService(event_persistency)
380 address_provider = CompFactory.ByteStreamAddressProviderSvc()
381 acc.addService(address_provider)
383 proxy = CompFactory.ProxyProviderSvc()
384 proxy.ProviderNames += [address_provider.name]
385 acc.addService(proxy)
387 from TriggerJobOpts.TriggerRecoConfig
import TriggerRecoCfg
391 l1bsdec = acc.getEventAlgo(
"L1TriggerByteStreamDecoder")
392 l1bsdec.ByteStreamMetadataRHKey=
""
393 print(
"MaybeMissingROBs: ",l1bsdec.MaybeMissingROBs)
394 l1bsdec.MaybeMissingROBs += [0x770001, 0x7500ac, 0x7500ad, 0x7300a8, 0x7300a9, 0x7300aa, 0x7300ab]
396 from LArMonitoring.RecoPT_NewConfig
import LArMonitoringConfig
397 print(
'CONFIG ',CONFIG)
398 print(
'STREAM ',STREAM)
401 from LArMonitoring.LArSuperCellMonAlg
import LArSuperCellMonConfig
406 acc.getEventAlgo(
"LArRawDataReadingAlg").LArRawChannelKey=
""
423 from DataQualityUtils.DQPostProcessingAlg
import DQPostProcessingAlg
424 ppa = DQPostProcessingAlg(
"DQPostProcessingAlg")
425 ppa.ExtraInputs = {(
'xAOD::EventInfo' ,
'StoreGateSvc+EventInfo' )}
427 ppa.OutputLevel = WARNING
428 if flags.Common.isOnline:
429 ppa.FileKey = ((flags.DQ.FileKey +
'/')
if not flags.DQ.FileKey.endswith(
'/')
430 else flags.DQ.FileKey)
432 acc.addEventAlgo(ppa, sequenceName=
'AthEndSeq')