Commit 64401141 authored by Peter Richardson's avatar Peter Richardson Committed by Andy Buckley

improvements to the coverage

parent 9de322e0
2020-02-04 Peter Richardson <>
* Improvements to the rivet coverage for e+e- experiments
2020-02-01 Jon Butterworth <>
* Error trapping in rivet-findid for rare cases
when two bibtex entries are found (e.g. rivet-findid 1487288)
2020-01-15 Jon Butterworth <>
* Add a warning to CMS WZ analysis CMS_2016_I1487288 because
#! /usr/bin/env bash
RUNNING=(alice atlas cms lhcb totem lhcf star phenix cleo h1 zeus hermes babar belle opal delphi aleph l3 sld compass snd cmd bes besiii cdf d0 kloe)
PRE_2000=(amy jade argus tasso venus topaz pluto hrs mac marki markii markj tpc dm1 dm2 cello fenice lena mupi cusb dasp desy147 e735 olya)
SMALL=(amy jade argus snd cmd topaz pluto tasso dm1 dm2 lhcf cello mupi lena kloe fenice bbar brahms kloe cusb dasp desy147 e735 ehs two_gamma hrs mac marki markii markj md1 nd nmd olya sfm totem tpc venus fenice)
OLD=(dasp desy147 dm1 two_gamma jade marki markii markj mupi nmd pluto tasso)
EXPTS=("${RUNNING[@]}" "${PRE_2000[@]}")
for EXPT in alice atlas cms lhcb star phenix cleo h1 zeus hermes babar belle opal delphi aleph l3 jade sld argus compass; do
for YEAR in $(seq 1980 $(date +"%Y")); do
for EXPT in ${EXPTS[@]}; do
# set the number of authors (needs to be lower for small experiments
for SMALLEXPT in ${SMALL[@]}; do
if [[ "$SMALLEXPT" == "$EXPT" ]]; then
# change start year for older experiments
ENDYEAR=$(date +"%Y")
for OLDEXPT in ${PRE_2000[@]}; do
if [[ "$OLDEXPT" == "$EXPT" ]]; then
for OLDEXPT in ${OLD[@]}; do
if [[ "$OLDEXPT" == "$EXPT" ]]; then
for YEAR in $(seq $STARTYEAR $ENDYEAR); do
if [[ -e $OUT ]]; then
echo "$OUT exists: skipping $EXPT $YEAR download"
echo "Downloading $EXPT $YEAR Inspire record to $OUT"
echo "$URL"
wget "$URL" -O $OUT
......@@ -33,6 +33,7 @@ for ifile, xmlfile in enumerate(args.XMLFILES):
if ifile > 0: print()
print("Processing {}...".format(xmlfile))
jsonfile = xmlfile.replace(".marc.xml", ".json")
print (jsonfile)
if os.path.exists(jsonfile):
print("{} exists, skipping {} testing".format(jsonfile, xmlfile))
......@@ -42,8 +42,8 @@ now =
## Experiment (grouping) names and regex patterns
import re
EXPTS = ["ALICE", "ATLAS", "CMS", "LHCb", "B-factories", "HERA", "LEP", "Other"]
EXPTS = ["ALICE", "ATLAS", "CMS", "LHCb", "Forward", "HERA", "EE-HIGH", "EE-LOW", "Tevatron", "RHIC", "SPS", "Other"]
EXPT_REOBJS = [re.compile(patt, re.I) for patt in EXPT_PATTS]
## Add the rivet Python module build dir(s) to the Python module path, then import
......@@ -56,7 +56,7 @@ import rivet
## Add info file locations
from glob import glob
dirpatt = os.path.join(os.getcwd(), "..", "analyses", "plugin*")
dirpatt = os.path.join(os.getcwd(), "..", "..", "analyses", "plugin*")
for d in glob(dirpatt):
......@@ -90,6 +90,7 @@ if args.VERBOSE:
## Read Inspire IDs from ranking files
blacklist, greylist, hotlist = [], [], []
assigned = {}
comment = {}
for rankfilestr in args.RANKFILES:
for rankfile in rankfilestr.split(" "):
with open(rankfile) as rf:
......@@ -114,6 +115,9 @@ for rankfilestr in args.RANKFILES:
if last.startswith("<") and last.endswith(">"):
last = last[1:-1]
assigned[ins] = last
# Detect an optional comment
if(line.count("#")==2) :
comment[ins] = line.split("#")[1]
## Add rankings/tags to the record
......@@ -190,6 +194,8 @@ for iex, ex in enumerate(EXPTS):
rankcode = rec[-1].split()[0]
# line = u"{} {} {}\n".format(ins.encode("UTF-8"), syms[code], rec[3].encode("UTF-8"))
line = u"{} {} {}".format(ins, syms[rankcode], rec[0])
if ins in comment :
line += " #{}#".format(comment[ins])
# print(assigned.get(ins))
if ins in assigned:
#print(ins, rec[0], assigned[ins])
......@@ -218,8 +224,13 @@ if args.NOHEAVYION:
## Web page rendering
import html
OUT = html.HTML("html")
import html
OUT = html.HTML("html")
except :
import imp
html = imp.load_source('html', '/usr/local/lib/python2.7/dist-packages/')
OUT = html.HTML("html")
title = "Rivet analysis coverage"
exclstr = " ({})".format(", ".join(excls)) if excls else ""
......@@ -290,7 +301,12 @@ th = t.thead(newlines=True)
r ="thead")"Key")
for ex in EXPTS:
if(ex=="EE-HIGH") :"$e^+e^-(\geq12$ GeV)")
elif(ex=="EE-LOW") :"$e^+e^-(\leq12$ GeV)")
else :
tb = t.tbody(newlines=True)
r ="default")
......@@ -324,7 +340,13 @@ body.button("Show blacklist", id="blacktoggle")
tabs = body.div(id="tabs")
u = tabs.ul()
for ex in EXPTS:, href="#{}expt".format(ex.lower()))
if(ex=="EE-HIGH") :"$e^+e^-(\geq12$ GeV)", href="#{}expt".format(ex.lower()))
elif(ex=="EE-LOW") :"$e^+e^-(\leq12$ GeV)", href="#{}expt".format(ex.lower()))
else :, href="#{}expt".format(ex.lower()))
for ex in EXPTS:
d = tabs.div(id="{}expt".format(ex.lower()))
t = d.table(klass="list").tbody(newlines=True)
......@@ -380,6 +402,9 @@ for ex in EXPTS:
if ins in assigned:
p += " "
p.a("IN PROGRESS: assigned to {}".format(assigned[ins]), href="mailto:{}".format(assigned[ins]))
## Comment
if ins in comment :
## Time-created footer
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment