17def readConfigFile_mc():
19 config = configparser.ConfigParser()
20 config.read(sys.argv[1])
22 thresholdEventsNo = int(config[
'Config'][
'thresholdEventsNo'])
23 expNoList = list(map(int, config[
'Config'][
'expNo'].split(
',')))
24 eventTypeList = list(map(str, config[
'Config'][
'eventType'].split(
',')))
25 dataTypeList = list(map(str, config[
'Config'][
'dataType'].split(
',')))
26 belleLevelList = list(map(str, config[
'Config'][
'belleLevel'].split(
',')))
28 return thresholdEventsNo, expNoList, eventTypeList, dataTypeList, belleLevelList
31def readConfigFile_data():
33 config = configparser.ConfigParser()
34 config.read(sys.argv[1])
36 runsPerJob = int(config[
'Config'][
'runsPerJob'])
37 expNoList = list(map(int, config[
'Config'][
'expNo'].split(
',')))
38 skimTypeList = list(map(str, config[
'Config'][
'skimType'].split(
',')))
39 dataTypeList = list(map(str, config[
'Config'][
'dataType'].split(
',')))
40 belleLevelList = list(map(str, config[
'Config'][
'belleLevel'].split(
',')))
42 return runsPerJob, expNoList, skimTypeList, dataTypeList, belleLevelList
45def countEventsInUrl(link):
46 aFile = urllib.request.urlopen(link)
48 fileStr = str(aFile.read(),
'utf-8')
50 nEventsStr = fileStr.split(
"Total events: ")[1].split()[0]
52 nEvents = int(re.search(
r'\d+', nEventsStr).group())
56def getBelleUrl_mc(expNo, startRun, endRun, eventType, dataType, belleLevel, streamNo):
57 header =
'http://bweb3/montecarlo.php?'
60 '&rs=' + str(startRun) +\
61 '&re=' + str(endRun) +\
64 '&bl=' + belleLevel +\
65 '&st=' + str(streamNo)
68def getBelleUrl_data(expNo, startRun, endRun, skimType, dataType, belleLevel):
70 header =
'http://bweb3/mdst.php?'
73 '&rs=' + str(startRun) +\
74 '&re=' + str(endRun) +\
80def addLine(tableFile, aList):
83 writeStr += str(el) +
'\t'
85 tableFile.write(writeStr)
86 print(
'Added line to table: ' + writeStr)
89def getMaxRunNo_mc(expNo):
119 return int(maxRunNoDict.get(expNo))
122def getMaxRunNo_data(expNo):
158 return int(maxRunNoDict.get(expNo))