6 if __name__==
'__main__':
10 if len(sys.argv)>1
and (sys.argv[1]==
"-h" or sys.argv[1]==
"--help"):
13 print(
"StateLessPT_TestFile_NewConfig.py {--input=<infile>} {--config=XXX} {--stream=YYY} {--noPost} {--postFreq=ZZ}")
14 print(
" default input: /det/dqm/GlobalMonitoring/SMW_test/testpart_sample/data21_900GeV.00405543.physics_MinBias.daq.RAW._lb1977._SFO-6._0001.data")
15 print(
" default XXX: LArMon")
16 print(
" default YYY: ''")
17 print(
" --noPost is switching off postProcessing")
18 print(
" default ZZ: 10")
24 INPUT =
'/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/data18_13TeV/data18_13TeV.00357750.physics_Main.daq.RAW/data18_13TeV.00357750.physics_Main.daq.RAW._lb0083._SFO-1._0001.data'
30 for ii
in range(1,len(sys.argv)):
31 print(ii,
" ",sys.argv[ii])
33 opts,args=getopt.getopt(sys.argv[1:],
"t:",[
"config=",
"stream=",
"postFreq=",
"noPost"])
34 except getopt.GetoptError
as e:
35 print(
"Failed to interpret arguments")
41 if o==
"--config": CONFIG=a
42 if o==
"--stream": STREAM=a
43 if o==
"--input": INPUT=a
44 if o==
"--noPost": DOPOSTPROC=
False
45 if o==
"--postFreq": POSTFREQ=
int(a)
52 if 'CONFIG' not in dir():
56 if "STREAM" not in dir():
59 from AthenaConfiguration.Enums
import Format
65 partition = os.environ.get(
"TDAQ_PARTITION")
67 from ispy
import IPCPartition, ISObject
73 if partition
is not None:
74 p = IPCPartition(partition)
76 print(
"Partition:",p.name(),
"is not valid")
80 if partition ==
"ATLAS":
82 y = ISObject(p,
'RunParams.SOR_RunParams',
'RunParams')
84 print(
"Could not find Run Parameters in IS - Set default beam type to 'cosmics'")
88 beamtype = y.beam_type
89 beamenergy = y.beam_energy
90 runnumber = y.run_number
91 project = y.T0_project_tag
92 print(
"RUN CONFIGURATION: beam type %i, beam energy %i, run number %i, project tag %s"%(beamtype,beamenergy,runnumber,project))
94 if project[7:10]==
"cos":
101 beamType=
'collisions'
105 x = ISObject(p,
'LArParams.LAr.RunLogger.GlobalParams',
'GlobalParamsInfo')
107 print(
"Couldn not find IS Parameters - Set default flag")
116 print(
"Couldn not find IS Parameters - Set default flag")
124 FirstSample = x.firstSample
125 NSamples = x.nbOfSamples
126 print(
"RUN CONFIGURATION: format %i,run type %i"%(RunType,LArFormat))
138 beamType=
'collisions'
140 print(
"RUN CONFIGURATION: ReadDigits =", ReadDigits)
143 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
145 from AthenaMonitoring.DQConfigFlags
import allSteeringFlagsOff
149 from AthenaConfiguration.Enums
import BeamType
150 if beamType==
'collisions':
151 flags.Beam.Type=BeamType.Collisions
152 elif beamType==
'cosmics':
153 flags.Beam.Type=BeamType.Cosmics
155 print(
'Setting default collisions beam type')
156 flags.Beam.Type=BeamType.Collisions
157 flags.Beam.BunchSpacing=25
158 print(
"RUN CONFIGURATION: Beamtype =",flags.Beam.Type)
160 flags.Common.isOnline=
True
161 flags.Input.Format=Format.BS
162 flags.Input.isMC=
False
164 flags.IOVDb.DatabaseInstance=
"CONDBR2"
165 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2016-03"
167 flags.GeoModel.Layout=
"alas"
168 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
169 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
172 flags.Calo.TopoCluster.doTopoClusterLocalCalib=
False
174 flags.Exec.MaxEvents=-1
176 from AthenaConfiguration.AutoConfigOnlineRecoFlags
import setDefaultOnlineRecoFlags
179 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
182 flags.Trigger.doID=
False
183 flags.Trigger.doMuon=
False
184 flags.Trigger.L1.doMuon=
False
185 flags.Trigger.L1.doTopo=
False
186 flags.Trigger.triggerConfig=
'COOL'
188 flags.DQ.doMonitoring=
True
189 flags.DQ.disableAtlasReadyFilter=
True
190 flags.DQ.enableLumiAccess=
False
191 flags.DQ.useTrigger=
True
195 flags.LAr.doAlign=
False
196 flags.LAr.doHVCorr=
False
198 flags.Calo.TopoCluster.doTopoClusterLocalCalib=
False
200 flags.Input.Files=[INPUT]
203 flags.Concurrency.NumThreads=4
204 flags.Concurrency.NumConcurrentEvents=4
207 from LArMonitoring.LArMonConfigFlags
import createLArMonConfigFlags
210 flags.addFlagsCategory(
"LArMon", __monflags)
212 if 'CaloMon' in CONFIG:
213 flags.DQ.enableLumiAccess=
True
217 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
220 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
226 from LArMonitoring.RecoPT_NewConfig
import LArMonitoringConfig
231 from DataQualityUtils.DQPostProcessingAlg
import DQPostProcessingAlg
232 ppa = DQPostProcessingAlg(
"DQPostProcessingAlg")
233 ppa.ExtraInputs = {(
'xAOD::EventInfo' ,
'StoreGateSvc+EventInfo' )}
234 ppa.Interval = POSTFREQ
235 if flags.Common.isOnline:
236 ppa.FileKey = ((flags.DQ.FileKey +
'/')
if not flags.DQ.FileKey.endswith(
'/')
237 else flags.DQ.FileKey)
239 acc.addEventAlgo(ppa, sequenceName=
'AthEndSeq')