8 from tools
import getMaxRunNo_mc, getBelleUrl_mc, readConfigFile_mc, countEventsInUrl, addLine
14 if len(sys.argv) == 1:
15 sys.exit(
'Need one argument: path of config file with job parameters !')
18 thresholdEventsNo, expNoList, eventTypeList, dataTypeList, belleLevelList =\
22 if not os.path.exists(
'tables'):
27 tableName =
'tables/lookUpTable_mc_' + \
28 str(int(thresholdEventsNo / 1000)) +
'k.txt'
29 f = open(tableName,
'w')
33 for expNo
in expNoList:
35 absMaxRunNo = getMaxRunNo_mc(expNo)
36 if absMaxRunNo
is None:
37 sys.exit(
'ExpNo ' + str(expNo) +
' not found. Does it exist ?')
40 print(
'For expNo ' + str(expNo) +
' max runNo is ' + str(absMaxRunNo))
42 if expNo
in range(7, 28):
44 elif expNo
in range(31, 66):
47 for eventType
in eventTypeList:
48 for dataType
in dataTypeList:
49 for belleLevel
in belleLevelList:
52 while minRunNo < absMaxRunNo:
54 maxRunNo = minRunNo + 1
58 for add
in range(1, 1000):
60 maxRunNo = minRunNo + add
62 thisUrl = getBelleUrl_mc(expNo, minRunNo, maxRunNo,
64 belleLevel, streamNo_dummy)
67 print(
'Checking up url: ' + thisUrl)
69 thisUrlCount = countEventsInUrl(thisUrl)
71 print(
'Count is up to: ' + str(thisUrlCount))
73 if maxRunNo > absMaxRunNo
or thisUrlCount > thresholdEventsNo:
76 addLine(f, [expNo, eventType,
81 if debug
and debugCounter > 2:
85 minRunNo = maxRunNo + 1