How To: Load the database, selecting only a few results.

In [1]:
#Set up the path to SModelS installation folder if running on a different folder
import sys,os
sys.path.append(os.path.join(os.getenv("HOME"),"smodels/"))
In [2]:
from smodels.experiment.databaseObj import Database
from smodels.tools.physicsUnits import GeV
In [3]:
## Load the database:
dbPath = os.path.join(os.getenv("HOME"),"smodels-database/")
database = Database(dbPath)

How to select results from one publication (or conference note)

In [6]:
#Select only the CMS SUS-12-028 conference note
expID=["CMS-SUS-12-028"]
In [7]:
#Loads the selected analyses
#(The INFO tells you that superseded analyses are not loaded, see below)
results = database.getExpResults(analysisIDs=expID)
In [9]:
#Print all the results selected:
for exp in results:
    print exp
#Print the txnames constrained by the result in bracket notation:
exp = results[0]
for tx in exp.getTxNames():
    print tx,'=',tx.constraint
CMS-SUS-12-028::T1,T1bbbb,T1tttt,T2,T2bb
T1 = [[[jet,jet]],[[jet,jet]]]
T1bbbb = [[[b,b]],[[b,b]]]
T1tttt = [[[t,t]],[[t,t]]]
T2 = [[[jet]],[[jet]]]
T2bb = [[[b]],[[b]]]
In [10]:
#Print ALL info fields available:
exp = results[0]
print exp.getAttributes()
['comment', 'sqrts', 'private', 'txnameDataExp', 'validated', 'id', 'implementedBy', 'publication', 'axes', 'supersedes', 'lastUpdate', 'figureUrl', 'publishedData', 'dataUrl', 'conditionDescription', 'dataType', 'txName', 'txnameData', 'lumi', 'path', 'condition', 'dataId', 'constraint', 'url', 'arxiv', 'contact', 'prettyName']
In [11]:
#Print values for some of the info fields (always returned as a list):
print 'sqrts=',exp.getValuesFor('sqrts')
print 'lumi=',exp.getValuesFor('lumi')
print 'dataType=',exp.getValuesFor('dataType')
print 'txnames=',exp.getValuesFor('txName')
sqrts= [8.00E+00 [TeV]]
lumi= [1.17E+01 [1/fb]]
dataType= ['upperLimit']
txnames= ['T1bbbb', 'T2', 'T2bb', 'T1tttt', 'T1']
In [12]:
#To obtain the upper limit for a given mass vector and a given simplified model (txname)
#Note that the number of masses in the mass vector must be consitent with the txname.
#For the T1 txname, for instance:
massesT1 = [[300*GeV,100*GeV],[300*GeV,100*GeV]]
print 'xsection upper limit = ',exp.getUpperLimitFor(mass=massesT1,txname='T1')
xsection upper limit =  2.11E+00 [pb]
In [13]:
#For the T2 analysis:
massesT2 = [[300*GeV,50*GeV],[300*GeV,50*GeV]]
print 'xsection upper limit = ',exp.getUpperLimitFor(mass=massesT2,txname='T2')
xsection upper limit =  1.07E+00 [pb]
In [14]:
#If you try with the wrong mass format, an error will be printed:
masses = [[300*GeV],[300*GeV,50*GeV]]
print 'xsection upper limit = ',exp.getUpperLimitFor(mass=masses,txname='T2')
ERROR in txnameObj.getValueFor() in 292: dimensional error. I have been asked to compare a 3-dimensional mass vector with 4-dimensional _data!
xsection upper limit =  None

How to load results for one simplified model (txname)

In [15]:
#It is also possible to load all the results for a single simplified (using the Txname convention)
Txnames = ["T1"]
T1results = database.getExpResults(txnames=Txnames)
In [16]:
#Print all the results constraining the required Txname:
for exp in T1results:
    print exp.globalInfo.id #(or print exp.getValuesFor('id'))
CMS-SUS-PAS-15-002
ATLAS-CONF-2013-024
ATLAS-CONF-2013-035
ATLAS-CONF-2013-037
ATLAS-CONF-2013-047
ATLAS-CONF-2013-048
ATLAS-CONF-2013-049
ATLAS-CONF-2013-053
ATLAS-CONF-2013-054
ATLAS-CONF-2013-061
ATLAS-CONF-2013-062
ATLAS-CONF-2013-093
ATLAS-SUSY-2013-02
ATLAS-SUSY-2013-02
CMS-SUS-12-028
CMS-SUS-13-012
CMS-SUS-13-012
CMS-SUS-13-019

How to load all experimental results, including the superseded publications

In [17]:
#By default only non-supersed analyses are loaded:
results = database.getExpResults()
print 'Number of non-superseded results = ',len(results)
Number of non-superseded results =  64
In [18]:
#To load all results (including the superseded ones), set useSuperseded=True
allResults = database.getExpResults(useSuperseded=True)
print 'Including superseded results =',len(allResults)
Including superseded results = 79

How to selected upper-limit and efficiency map results:

In [19]:
#Get only upper-limit results:
ULresults =  database.getExpResults(dataTypes=['upperLimit'])
for exp in ULresults:
    print exp.globalInfo.id,exp.getValuesFor('dataType')
ATLAS-SUSY-2015-09 ['upperLimit']
CMS-SUS-PAS-15-002 ['upperLimit']
ATLAS-CONF-2013-024 ['upperLimit']
ATLAS-CONF-2013-089 ['upperLimit']
ATLAS-CONF-2013-093 ['upperLimit']
ATLAS-SUSY-2013-02 ['upperLimit']
ATLAS-SUSY-2013-04 ['upperLimit']
ATLAS-SUSY-2013-05 ['upperLimit']
ATLAS-SUSY-2013-08 ['upperLimit']
ATLAS-SUSY-2013-09 ['upperLimit']
ATLAS-SUSY-2013-11 ['upperLimit']
ATLAS-SUSY-2013-12 ['upperLimit']
ATLAS-SUSY-2013-15 ['upperLimit']
ATLAS-SUSY-2013-16 ['upperLimit']
ATLAS-SUSY-2013-18 ['upperLimit']
ATLAS-SUSY-2013-19 ['upperLimit']
ATLAS-SUSY-2013-23 ['upperLimit']
CMS-PAS-SUS-13-015 ['upperLimit']
CMS-PAS-SUS-13-016 ['upperLimit']
CMS-PAS-SUS-13-018 ['upperLimit']
CMS-PAS-SUS-13-023 ['upperLimit']
CMS-PAS-SUS-14-011 ['upperLimit']
CMS-SUS-12-024 ['upperLimit']
CMS-SUS-12-028 ['upperLimit']
CMS-SUS-13-002 ['upperLimit']
CMS-SUS-13-004 ['upperLimit']
CMS-SUS-13-006 ['upperLimit']
CMS-SUS-13-007 ['upperLimit']
CMS-SUS-13-011 ['upperLimit']
CMS-SUS-13-012 ['upperLimit']
CMS-SUS-13-013 ['upperLimit']
CMS-SUS-13-019 ['upperLimit']
CMS-SUS-14-010 ['upperLimit']
CMS-SUS-14-021 ['upperLimit']
In [20]:
#Get only efficiency map results:
EMresults =  database.getExpResults(dataTypes=['efficiencyMap'])
for exp in EMresults:
    print exp.globalInfo.id,exp.getValuesFor('dataType')
ATLAS-CONF-2013-024 ['efficiencyMap']
ATLAS-CONF-2013-035 ['efficiencyMap']
ATLAS-CONF-2013-037 ['efficiencyMap']
ATLAS-CONF-2013-047 ['efficiencyMap']
ATLAS-CONF-2013-048 ['efficiencyMap']
ATLAS-CONF-2013-049 ['efficiencyMap']
ATLAS-CONF-2013-053 ['efficiencyMap']
ATLAS-CONF-2013-054 ['efficiencyMap']
ATLAS-CONF-2013-061 ['efficiencyMap']
ATLAS-CONF-2013-062 ['efficiencyMap']
ATLAS-CONF-2013-093 ['efficiencyMap']
ATLAS-SUSY-2013-02 ['efficiencyMap']
ATLAS-SUSY-2013-04 ['efficiencyMap']
ATLAS-SUSY-2013-05 ['efficiencyMap']
ATLAS-SUSY-2013-09 ['efficiencyMap']
ATLAS-SUSY-2013-11 ['efficiencyMap']
ATLAS-SUSY-2013-15 ['efficiencyMap']
ATLAS-SUSY-2013-16 ['efficiencyMap']
ATLAS-SUSY-2013-18 ['efficiencyMap']
ATLAS-SUSY-2013-21 ['efficiencyMap']
ATLAS-SUSY-2014-03 ['efficiencyMap']
CMS-PAS-SUS-13-015 ['efficiencyMap']
CMS-PAS-SUS-13-016 ['efficiencyMap']
CMS-SUS-12-024 ['efficiencyMap']
CMS-SUS-13-006 ['efficiencyMap']
CMS-SUS-13-007 ['efficiencyMap']
CMS-SUS-13-011 ['efficiencyMap']
CMS-SUS-13-012 ['efficiencyMap']
CMS-SUS-13-013 ['efficiencyMap']
CMS-SUS-14-021 ['efficiencyMap']
In [ ]: