6if __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>} {--runnb=run} {--config=XXX} {--stream=YYY} {--noPost} {--postFreq=ZZ}")
14 print(
" default input: /detwork/dqm/GlobalMonitoring_test_data/data25_13p6TeV.00502618.express_express.merge.RAW._lb0982._SFO-ALL._0001.1")
15 print(
" default runnb: 502618")
16 print(
" default XXX: LArMon")
17 print(
" default YYY: ''")
18 print(
" --noPost is switching off postProcessing")
19 print(
" default ZZ: 10")
24 INPUT =
'/detwork/dqm/GlobalMonitoring_test_data/data25_13p6TeV.00502618.express_express.merge.RAW._lb0982._SFO-ALL._0001.1'
32 for ii
in range(1,len(sys.argv)):
33 print(ii,
" ",sys.argv[ii])
35 opts,args=getopt.getopt(sys.argv[1:],
"t:",[
"config=",
"stream=",
"postFreq=",
"noPost"])
36 except getopt.GetoptError
as e:
37 print(
"Failed to interpret arguments")
43 if o==
"--config": CONFIG=a
44 if o==
"--stream": STREAM=a
45 if o==
"--input": INPUT=a
46 if o==
"--noPost": DOPOSTPROC=
False
47 if o==
"--postFreq": POSTFREQ=int(a)
54 if 'CONFIG' not in dir():
58 if "STREAM" not in dir():
61 from AthenaConfiguration.Enums
import Format
67 partition = os.environ.get(
"TDAQ_PARTITION")
69 from ispy
import IPCPartition, ISObject
75 if partition
is not None:
76 p = IPCPartition(partition)
78 print(
"Partition:",p.name(),
"is not valid")
82 if partition ==
"ATLAS":
84 y = ISObject(p,
'RunParams.SOR_RunParams',
'RunParams')
86 print(
"Could not find Run Parameters in IS - Set default beam type to 'cosmics'")
91 beamtype = y.beam_type
92 beamenergy = y.beam_energy
93 runnumber = y.run_number
94 project = y.T0_project_tag
95 print(
"RUN CONFIGURATION: beam type %i, beam energy %i, run number %i, project tag %s"%(beamtype,beamenergy,runnumber,project))
97 if project[7:10]==
"cos":
100 beamType=
'collisions'
104 beamType=
'collisions'
108 x = ISObject(p,
'LArParams.LAr.RunLogger.GlobalParams',
'GlobalParamsInfo')
110 print(
"Couldn not find IS Parameters - Set default flag")
119 print(
"Couldn not find IS Parameters - Set default flag")
127 FirstSample = x.firstSample
128 NSamples = x.nbOfSamples
129 print(
"RUN CONFIGURATION: format %i,run type %i"%(RunType,LArFormat))
141 beamType=
'collisions'
144 print(
"RUN CONFIGURATION: ReadDigits =", ReadDigits)
147 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
148 flags = initConfigFlags()
149 from AthenaMonitoring.DQConfigFlags
import allSteeringFlagsOff
150 allSteeringFlagsOff(flags)
153 from AthenaConfiguration.Enums
import BeamType
154 if beamType==
'collisions':
155 flags.Beam.Type=BeamType.Collisions
156 elif beamType==
'cosmics':
157 flags.Beam.Type=BeamType.Cosmics
159 print(
'Setting default collisions beam type')
160 flags.Beam.Type=BeamType.Collisions
161 flags.Beam.BunchSpacing=25
162 print(
"RUN CONFIGURATION: Beamtype =",flags.Beam.Type)
164 flags.Common.isOnline=
True
165 flags.Input.Format=Format.BS
166 flags.Input.isMC=
False
168 flags.IOVDb.DatabaseInstance=
"CONDBR2"
169 flags.IOVDb.GlobalTag=
"CONDBR2-ES1PA-2016-03"
171 flags.GeoModel.Layout=
"alas"
172 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
173 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN2
176 flags.Calo.TopoCluster.doTopoClusterLocalCalib=
False
178 flags.Exec.MaxEvents=-1
180 from AthenaConfiguration.AutoConfigOnlineRecoFlags
import setDefaultOnlineRecoFlags
181 setDefaultOnlineRecoFlags(flags)
183 from AthenaConfiguration.DetectorConfigFlags
import setupDetectorFlags
184 setupDetectorFlags(flags, [
'LAr'], toggle_geometry=
True)
186 flags.Trigger.doID=
False
187 flags.Trigger.doMuon=
False
188 flags.Trigger.L1.doMuon=
False
189 flags.Trigger.L1.doTopo=
False
190 flags.Trigger.triggerConfig=
'COOL'
192 flags.DQ.doMonitoring=
True
193 flags.DQ.disableAtlasReadyFilter=
True
194 flags.DQ.enableLumiAccess=
False
195 flags.DQ.useTrigger=
True
199 flags.LAr.doAlign=
False
200 flags.LAr.doHVCorr=
False
202 flags.Calo.TopoCluster.doTopoClusterLocalCalib=
False
204 flags.Input.Files=[INPUT]
205 flags.Input.RunNumbers = [runnumber]
212 from LArMonitoring.LArMonConfigFlags
import createLArMonConfigFlags
213 return createLArMonConfigFlags()
215 flags.addFlagsCategory(
"LArMon", __monflags)
217 if 'CaloMon' in CONFIG:
218 flags.DQ.enableLumiAccess=
True
222 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
223 acc = MainServicesCfg(flags)
225 from TileByteStream.TileByteStreamConfig
import TileRawDataReadingCfg
226 acc.merge( TileRawDataReadingCfg(flags) )
231 if CONFIG!=
"LArDTMon":
232 from LArMonitoring.RecoPT_NewConfig
import LArMonitoringConfig
233 acc.merge(LArMonitoringConfig(flags,CONFIG,STREAM))
235 from LArMonitoring.RecoPT_Phase1NewConfig
import LArDTMonitoringConfig
236 acc.merge(LArDTMonitoringConfig(flags,STREAM))
241 from DataQualityUtils.DQPostProcessingAlg
import DQPostProcessingAlg
242 ppa = DQPostProcessingAlg(
"DQPostProcessingAlg")
243 ppa.ExtraInputs = {(
'xAOD::EventInfo' ,
'StoreGateSvc+EventInfo' )}
244 ppa.Interval = POSTFREQ
245 if flags.Common.isOnline:
246 ppa.FileKey = ((flags.DQ.FileKey +
'/')
if not flags.DQ.FileKey.endswith(
'/')
247 else flags.DQ.FileKey)
249 acc.addEventAlgo(ppa, sequenceName=
'AthEndSeq')
void print(char *figname, TCanvas *c1)