6 lastrunFile =
"lastrun{}".
format(det)
10 conn = psycopg2.connect(
"dbname=nova_prod host=ifdbrep.fnal.gov user=nova_reader port=5436")
11 except Exception
as e:
12 print(
"I am unable to connect to the database")
17 conn = psycopg2.connect(
"dbname=nova_prod host=ifdbrep.fnal.gov user=nova_reader port=5434")
19 print(
"I am unable to connect to the database")
26 firstrun = int(f.readline()) 29 exceptionsFile = "exceptions"+det+
".txt" 30 f =
open(exceptionsFile,
'r') 33 exceptionRuns.append(
int(line))
37 SQL =
"select run,tstart,tstop from {}.runs where partition=1 and run>{} and nsubruns>4 and tstart < 'yesterday' order by run asc".
format(det,firstrun)
39 SQL =
"select run,tstart,tstop from {}.runs where run>{} and nsubruns>1 and tstart < 'yesterday' order by run asc".
format(det,firstrun)
52 for irow
in range(0,nrows,step):
54 rowList = rows[irow:irow+step]
58 firstRun = rowList[0][0]
59 lastRun = rowList[nrun-1][0]
61 cmd =
"getBadChannels -pdh releases{}.txt {}".
format(det,det)
64 if row[0]
in exceptionRuns:
65 errorMsg =
"Run {} found in the exceptions file. Skipping.".
format(row[0])
70 cmd +=
" {}".
format(row[0])
72 errorMsg =
"No stop time found for {} run {}. Stopping now.".
format(det,row[0])
77 result = os.system(cmd)
84 f =
open(lastrunFile,
'w')
std::string format(const int32_t &value, const int &ndigits=8)
procfile open("FD_BRL_v0.txt")