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 <[email protected]>
* Improvements to the rivet coverage for e+e- experiments
2020-02-01 Jon Butterworth <[email protected]>
* Error trapping in rivet-findid for rare cases
when two bibtex entries are found (e.g. rivet-findid 1487288)
2020-01-15 Jon Butterworth <[email protected]>
* 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
NAUTH=100
for SMALLEXPT in ${SMALL[@]}; do
if [[ "$SMALLEXPT" == "$EXPT" ]]; then
NAUTH=15
break
fi
done
# change start year for older experiments
STARTYEAR=1980
ENDYEAR=$(date +"%Y")
for OLDEXPT in ${PRE_2000[@]}; do
if [[ "$OLDEXPT" == "$EXPT" ]]; then
ENDYEAR=2000
break
fi
done
for OLDEXPT in ${OLD[@]}; do
if [[ "$OLDEXPT" == "$EXPT" ]]; then
STARTYEAR=1970
ENDYEAR=1990
break
fi
done
for YEAR in $(seq $STARTYEAR $ENDYEAR); do
OUT=inspire-$EXPT-$YEAR.marc.xml
if [[ -e $OUT ]]; then
echo "$OUT exists: skipping $EXPT $YEAR download"
else
echo "Downloading $EXPT $YEAR Inspire record to $OUT"
#URL="https://cds.cern.ch/search?ln=en&cc=${COLL}&op1=a&m1=a&p1=${YEAR}&f1=year&rg=200&jrec=1&of=xm"
URL="https://inspirehep.net/search?ln=en&ln=en&p=find+cn+${EXPT}+and+ac+100%2B+and+de+${YEAR}&of=xm&action_search=Search&sf=earliestdate&so=d&rm=&rg=250&sc=0&ot=001,024,035,037,710,245"
#URL="https://inspirehep.net/search?ln=en&ln=en&p=find+cn+${EXPT}+and+ac+100%2B+and+de+${YEAR}&of=xm&action_search=Search&sf=earliestdate&so=d&rm=&rg=250&sc=0&ot=001,024,035,037,710,245"
URL="https://inspirehep.net/search?ln=en&ln=en&p=find+cn+${EXPT}+and+ac+${NAUTH}%2B+and+de+${YEAR}&of=xm&action_search=Search&sf=earliestdate&so=d&rm=&rg=250&sc=0&ot=001,024,035,037,710,245"
echo "$URL"
wget "$URL" -O $OUT
fi
......
......@@ -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))
continue
......
......@@ -42,8 +42,8 @@ now = datetime.datetime.now()
## Experiment (grouping) names and regex patterns
import re
EXPTS = ["ALICE", "ATLAS", "CMS", "LHCb", "B-factories", "HERA", "LEP", "Other"]
EXPT_PATTS = ["ALICE", "ATLAS", "CMS", "LHCb", "BABAR|BELLE", "H1|ZEUS", "ALEPH|DELPHI|L3|OPAL|SLD"]
EXPTS = ["ALICE", "ATLAS", "CMS", "LHCb", "Forward", "HERA", "EE-HIGH", "EE-LOW", "Tevatron", "RHIC", "SPS", "Other"]
EXPT_PATTS = ["ALICE", "ATLAS", "CMS", "LHCb", "LHCF|TOTEM", "H1|ZEUS|HERMES", "ALEPH|DELPHI|L3|OPAL|SLD|LEP|TASSO|JADE|AMY|TOPAZ|MAC|VENUS|CELLO|TPC|HRS|PLUTO|MARK-J|MARK-II", "BABAR|BELLE|CLEO|CUSB|ARGUS|SND|CMD|DM1|DM2|KLOE|BES|OLYA|FENICE|LENA|DASP|MARK-I|MUPI|NMD|DESY147|MD1|CRYSTAL|ND|GAMMAGAMMA|BBAR|AACHEN-DESY-ANNECY(LAPP)-MIT-NIKHEF-BEIJING", "CDF|D0|E735", "STAR|PHENIX", "COMPASS|NA48|NA49|EHS/NA22|NA22"]
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):
#print(d)
rivet.addAnalysisDataPath(os.path.abspath(d))
......@@ -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")
try:
import html
OUT = html.HTML("html")
except :
import imp
html = imp.load_source('html', '/usr/local/lib/python2.7/dist-packages/html.py')
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 = th.tr(klass="thead")
r.td().b("Key")
for ex in EXPTS:
r.td().b(ex)
if(ex=="EE-HIGH") :
r.td().b("$e^+e^-(\geq12$ GeV)")
elif(ex=="EE-LOW") :
r.td().b("$e^+e^-(\leq12$ GeV)")
else :
r.td().b(ex)
#
tb = t.tbody(newlines=True)
r = tb.tr(klass="default")
......@@ -324,7 +340,13 @@ body.button("Show blacklist", id="blacktoggle")
tabs = body.div(id="tabs")
u = tabs.ul()
for ex in EXPTS:
u.li().a(ex, href="#{}expt".format(ex.lower()))
if(ex=="EE-HIGH") :
u.li().a("$e^+e^-(\geq12$ GeV)", href="#{}expt".format(ex.lower()))
elif(ex=="EE-LOW") :
u.li().a("$e^+e^-(\leq12$ GeV)", href="#{}expt".format(ex.lower()))
else :
u.li().a(ex, 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 :
cell.p().span().b(comment[ins])
## 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