1 |
abrinke1 |
1.1 |
#!/usr/bin/env python
|
2 |
|
|
|
3 |
|
|
import sys
|
4 |
|
|
from AndrewWBMParser import AndrewWBMParser
|
5 |
|
|
|
6 |
|
|
WBMPageTemplate = "http://cmswbm/cmsdb/servlet/RunSummary?RUN=%s&DB=cms_omds_lb"
|
7 |
|
|
|
8 |
|
|
def GetRun(RunNum, fileName, Save, StartLS=999999, EndLS=111111):
|
9 |
|
|
print "Getting info for run "+str(RunNum)+" from LS "+str(StartLS)+" to "+str(EndLS)
|
10 |
|
|
print "This can take several minutes ..."
|
11 |
|
|
|
12 |
|
|
RunSumPage = WBMPageTemplate % str(RunNum)
|
13 |
|
|
|
14 |
|
|
Parser = AndrewWBMParser()
|
15 |
|
|
Parser._Parse(RunSumPage)
|
16 |
|
|
[HLTLink,LumiLink,L1Link,PrescaleLink,TriggerLink] = Parser.ParseRunPage()
|
17 |
|
|
|
18 |
|
|
Parser._Parse(LumiLink)
|
19 |
|
|
[LumiInfo,StartLS,EndLS] = Parser.ParseLumiPage(StartLS,EndLS)
|
20 |
|
|
|
21 |
|
|
Parser._Parse(TriggerLink)
|
22 |
|
|
TriggerInfo = Parser.ParseTriggerModePage()
|
23 |
|
|
|
24 |
|
|
HLTLink = HLTLink.replace("HLTSummary?","HLTSummary?fromLS="+str(StartLS)+"&toLS="+str(EndLS)+"&")
|
25 |
|
|
Parser._Parse(HLTLink)
|
26 |
|
|
TriggerRates = Parser.ParseHLTSummaryPage(StartLS,EndLS)
|
27 |
|
|
|
28 |
|
|
Parser._Parse(L1Link)
|
29 |
|
|
L1Rates = Parser.ParseL1Page()
|
30 |
|
|
|
31 |
|
|
PrescaleValues = Parser.AssemblePrescaleValues()
|
32 |
|
|
|
33 |
|
|
TotalPSInfo = Parser.ComputeTotalPrescales(StartLS,EndLS)
|
34 |
|
|
|
35 |
|
|
CorrectedPSInfo = Parser.CorrectForPrescaleChange(StartLS,EndLS)
|
36 |
|
|
|
37 |
|
|
## L1_LS_Link = L1Link.replace("L1Summary?","L1Summary?fromLS="+str(Parser.FirstLS)+"&toLS="+str(EndLS)+"&")
|
38 |
|
|
## Parser._Parse(L1_LS_Link)
|
39 |
|
|
## Parser.Parse_LS_L1Page()
|
40 |
|
|
|
41 |
|
|
if Save:
|
42 |
|
|
Parser.Save(fileName)
|
43 |
|
|
print "Done!"
|
44 |
|
|
|
45 |
|
|
return Parser
|