CMS 3D CMS Logo

runonSMtunnel.py
Go to the documentation of this file.
1 #!/usr/bin/env python3
2 from __future__ import print_function
3 import os,string,sys,time
4 
5 # template file to be used
6 MODFILE="reco_skim_cfg_mod.py"
7 
8 # the output file is PREFIX_date.root
9 PREFIX="SkimSM"
10 
11 # it produces a file every NUEVENTS events
12 NUMEVENTS="-1"
13 
14 while True:
15  DATE=str(int(time.time()))
16  print("Suffix:"+DATE)
17  FILENAME=PREFIX+"_"+DATE+"_cfg.py"
18  FILELOG=PREFIX+"_"+DATE+".log"
19  COMMAND="sed 's/SUFFIX/"+DATE+"/;s/NUMEVENTS/"+NUMEVENTS+"/' "+MODFILE+" > "+FILENAME
20  os.system(COMMAND)
21  print("Created: "+FILENAME+" . Running cmsRun now and logging in "+FILELOG)
22  os.system("cmsRun "+FILENAME+" 2>&1 | tee "+FILELOG+" | grep --line-buffered -e \"Begin processing\" -e \"BeamSplash\"")
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)