Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Sherwood
athena
Commits
64e1c3f3
Commit
64e1c3f3
authored
7 years ago
by
Peter Onyisi
Browse files
Options
Downloads
Patches
Plain Diff
Update Z lumi postprocessing: proper livetime, apply autocomputed GRL
Former-commit-id: 7992b910e9e8d43ae2c601ca202c43ab92d41a8a
parent
10eeaa84
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
DataQuality/DataQualityUtils/python/doZLumi.py
+65
-1
65 additions, 1 deletion
DataQuality/DataQualityUtils/python/doZLumi.py
with
65 additions
and
1 deletion
DataQuality/DataQualityUtils/python/doZLumi.py
+
65
−
1
View file @
64e1c3f3
...
...
@@ -28,6 +28,63 @@ def copyPlot(infname, outfname):
d
.
WriteTObject
(
obj
)
fin
.
Close
();
fout
.
Close
()
def
makeGRL
(
run
,
defect
,
fname
):
from
ROOT
import
Root
,
TString
import
DQUtils
,
DQDefects
import
os
tgrl
=
Root
.
TGoodRunsList
(
defect
)
tag
=
'
HEAD
'
runs
=
[
run
]
print
'
Query run information...
'
,
from
DQUtils.db
import
fetch_iovs
dbinstance
=
'
CONDBR2
'
eor
=
fetch_iovs
(
'
EOR
'
,
(
min
(
runs
)
<<
32
)
|
1
,
(
max
(
runs
)
<<
32
)
|
0xFFFFFFFF
,
with_channel
=
False
,
what
=
[],
database
=
'
COOLONL_TDAQ/%s
'
%
dbinstance
)
eor
=
eor
.
trim_iovs
eor
=
DQUtils
.
IOVSet
(
iov
for
iov
in
eor
if
iov
.
since
.
run
in
runs
)
print
'
done
'
print
'
Query defects...
'
,
ddb
=
DQDefects
.
DefectsDB
(
'
COOLOFL_GLOBAL/%s
'
%
dbinstance
,
tag
=
tag
)
ignores
=
set
([
_
for
_
in
ddb
.
defect_names
if
'
UNCHECKED
'
in
_
])
try
:
defectiovs
=
ddb
.
retrieve
(
since
=
min
(
runs
)
<<
32
|
1
,
until
=
max
(
runs
)
<<
32
|
0xffffffff
,
channels
=
[
defect
],
evaluate_full
=
False
,
ignore
=
ignores
)
except
Exception
,
e
:
print
e
raise
print
'
Doing exclusions...
'
,
okiovs
=
eor
.
logical_and
(
eor
,
defectiovs
.
logical_not
())
print
'
done
'
dibr
=
okiovs
.
by_run
print
'
Generating GRL...
'
,
for
run
,
iovs
in
dibr
.
items
():
if
run
not
in
runs
:
continue
tgr
=
Root
.
TGoodRun
(
run
)
for
iov
in
iovs
:
#print iov.since.run, iov.since.lumi, iov.until.run, iov.until.lumi
tgr
.
push_back
(
Root
.
TLumiBlockRange
(
iov
.
since
.
lumi
,
iov
.
until
.
lumi
-
1
))
tgrl
[
run
]
=
tgr
tgrl
.
AddMetaData
(
TString
(
'
Query
'
),
TString
(
'
dummy
'
))
tgrl
.
AddMetaData
(
TString
(
'
ARQEquivalentQuery
'
),
TString
(
'
dummy
'
))
tgrl
.
SetVersion
(
TString
(
'
2.1
'
))
tgrl
.
AddMetaData
(
TString
(
'
RunList
'
),
TString
(
'
,
'
.
join
(
map
(
str
,
tgrl
.
GetRunlist
()))))
tgrl
.
Summary
()
tgrlw
=
Root
.
TGoodRunsListWriter
(
tgrl
,
TString
(
''
))
rv
=
tgrlw
.
GetXMLString
()
if
not
rv
:
print
'
Looks like we have an empty string
'
return
""
print
'
done
'
with
open
(
fname
,
'
w
'
)
as
outf
:
outf
.
write
(
rv
.
Data
()[:])
def
go
(
fname
):
import
subprocess
,
os
,
shutil
...
...
@@ -38,7 +95,14 @@ def go(fname):
if
'
DISPLAY
'
in
os
.
environ
:
del
os
.
environ
[
'
DISPLAY
'
]
runno
=
getRun
(
fname
)
print
'
Seen run
'
,
runno
subprocess
.
call
([
'
dqt_zlumi_compute_lumi.py
'
,
fname
,
'
--out
'
,
'
zlumiraw.root
'
,
'
--plotdir
'
,
''
])
grlcmd
=
[]
if
runno
>=
325000
:
makeGRL
(
runno
,
'
PHYS_StandardGRL_All_Good
'
,
'
grl.xml
'
)
grlcmd
=
[
'
--grl
'
,
'
grl.xml
'
]
else
:
print
'
Run number
'
,
runno
,
'
not 2017 data
'
subprocess
.
call
([
'
dqt_zlumi_compute_lumi.py
'
,
fname
,
'
--out
'
,
'
zlumiraw.root
'
,
'
--dblivetime
'
,
'
--plotdir
'
,
''
]
+
grlcmd
)
subprocess
.
call
([
'
dqt_zlumi_alleff_HIST.py
'
,
fname
,
'
--out
'
,
'
zlumieff.root
'
])
subprocess
.
call
([
'
dqt_zlumi_combine_lumi.py
'
,
'
zlumiraw.root
'
,
'
zlumieff.root
'
,
'
zlumi.root
'
])
subprocess
.
call
([
'
dqt_zlumi_display_z_rate.py
'
,
'
zlumi.root
'
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment