14 from tools
import getMaxRunNo_mc, getBelleUrl_mc, readConfigFile_mc, countEventsInUrl, addLine
20 if len(sys.argv) == 1:
21 sys.exit(
'Need one argument: path of config file with job parameters !')
24 thresholdEventsNo, expNoList, eventTypeList, dataTypeList, belleLevelList =\
28 if not os.path.exists(
'tables'):
33 tableName =
'tables/lookUpTable_mc_' + \
34 str(int(thresholdEventsNo / 1000)) +
'k.txt'
35 f = open(tableName,
'w')
39 for expNo
in expNoList:
41 absMaxRunNo = getMaxRunNo_mc(expNo)
42 if absMaxRunNo
is None:
43 sys.exit(
'ExpNo ' + str(expNo) +
' not found. Does it exist ?')
46 print(
'For expNo ' + str(expNo) +
' max runNo is ' + str(absMaxRunNo))
48 if expNo
in range(7, 28):
50 elif expNo
in range(31, 66):
53 for eventType
in eventTypeList:
54 for dataType
in dataTypeList:
55 for belleLevel
in belleLevelList:
58 while minRunNo < absMaxRunNo:
60 maxRunNo = minRunNo + 1
64 for add
in range(1, 1000):
66 maxRunNo = minRunNo + add
68 thisUrl = getBelleUrl_mc(expNo, minRunNo, maxRunNo,
70 belleLevel, streamNo_dummy)
73 print(
'Checking up url: ' + thisUrl)
75 thisUrlCount = countEventsInUrl(thisUrl)
77 print(
'Count is up to: ' + str(thisUrlCount))
79 if maxRunNo > absMaxRunNo
or thisUrlCount > thresholdEventsNo:
82 addLine(f, [expNo, eventType,
87 if debug
and debugCounter > 2:
91 minRunNo = maxRunNo + 1