File indexing completed on 2023-03-17 10:53:43
0001
0002 from __future__ import print_function
0003 import os,string,sys,time
0004
0005
0006 MODFILE="reco_skim_cfg_mod.py"
0007
0008
0009 PREFIX="SkimSM"
0010
0011
0012 NUMEVENTS="-1"
0013
0014
0015
0016 if len(sys.argv)!=2 :
0017 print("Usage = runonSM.py <type>")
0018 print("where type is either \"tunnel\" or \"revproxy\" or \"playback\" ")
0019 sys.exit(1)
0020
0021 TYPE=sys.argv[1]
0022
0023 if TYPE=="tunnel" :
0024 SOURCE="cms.string('http://localhost:22100/urn:xdaq-application:lid=30')"
0025 SELECTHLT= "cms.untracked.string('hltOutputDQM')"
0026 elif TYPE=="revproxy":
0027 SOURCE="cms.string('http://cmsdaq0.cern.ch/event-server/urn:xdaq-application:lid=30')"
0028 SELECTHLT= "cms.untracked.string('hltOutputDQM')"
0029 elif TYPE=="playback":
0030 SOURCE="cms.string('http://localhost:50082/urn:xdaq-application:lid=29')"
0031 SELECTHLT= "cms.untracked.string('hltOutputDQM')"
0032 else:
0033 print("wrong type value.")
0034 sys.exit(1)
0035
0036 while True:
0037 DATE=str(int(time.time()))
0038 print("Suffix:"+DATE)
0039 FILENAME=PREFIX+"_"+DATE+"_cfg.py"
0040 FILELOG=PREFIX+"_"+DATE+".log"
0041
0042 modfile=open(MODFILE,"r")
0043 text=modfile.read()
0044 modfile.close()
0045 text=text.replace("SUFFIX",DATE)
0046 text=text.replace("SOURCE",SOURCE)
0047 text=text.replace("NUMEVENTS",NUMEVENTS)
0048 text=text.replace("SELECTHLT",SELECTHLT)
0049 newfile=open(FILENAME,"w")
0050 newfile.write(text)
0051 newfile.close()
0052
0053 print("Created: "+FILENAME+" . Running cmsRun now and logging in "+FILELOG)
0054 os.system("cmsRun "+FILENAME+" 2>&1 | tee "+FILELOG+" | grep --line-buffered -e \"Begin processing\" -e \"BeamSplash\" -e \"PhysDecl\"")