CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DPGAnalysis/Skims/python/runonSMtunnel.py

Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import os,string,sys,commands,time
00003 
00004 # template file to be used
00005 MODFILE="reco_skim_cfg_mod.py"
00006 
00007 # the output file is PREFIX_date.root
00008 PREFIX="SkimSM"
00009 
00010 # it produces a file every NUEVENTS events
00011 NUMEVENTS="-1"
00012 
00013 while True:
00014     DATE=str(int(time.time()))
00015     print "Suffix:"+DATE
00016     FILENAME=PREFIX+"_"+DATE+"_cfg.py"
00017     FILELOG=PREFIX+"_"+DATE+".log"
00018     COMMAND="sed 's/SUFFIX/"+DATE+"/;s/NUMEVENTS/"+NUMEVENTS+"/' "+MODFILE+" > "+FILENAME
00019     os.system(COMMAND)
00020     print "Created: "+FILENAME+" . Running cmsRun now and logging in "+FILELOG
00021     os.system("cmsRun "+FILENAME+" 2>&1 | tee "+FILELOG+" | grep  --line-buffered -e \"Begin processing\" -e \"BeamSplash\"")