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; sys.path.append("."); import smodels_paths
In [2]:
from smodels.experiment.databaseObj import Database
from smodels.base.physicsUnits import GeV
In [3]:
## Load the official database:
database = Database("official")
How to select results from one publication (or conference note)¶
In [4]:
#Select only the CMS SUS-12-028 conference note
expID=["CMS-SUS-12-028"]
In [5]:
#Loads the selected analyses
#(The INFO tells you that superseded analyses are not loaded, see below)
results = database.getExpResults(analysisIDs=expID)
In [6]:
#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:(0):T1,T1bbbb,T1tttt,T2,T2bb(5) T1 = [[['jet','jet']],[['jet','jet']]] T1bbbb = [[['b','b']],[['b','b']]] T1tttt = [[['t','t']],[['t','t']]] T2 = [[['jet']],[['jet']]] T2bb = [[['b']],[['b']]]
In [7]:
#Print ALL info fields available:
exp = results[0]
print (exp.getAttributes())
['y_values', 'txName', 'contact', 'txnameDataExp', 'finalState', 'dataMap', 'private', 'dataType', 'supersedes', 'npoints', 'reweightF', 'totalwidth', 'lastUpdate', 'condition', 'max_bound', 'validated', 'Leff_inner', 'furthest_site', 'intermediateState', 'conditionDescription', 'isSM', 'simplices', 'prettyName', 'susyProcess', 'sqrts', 'eCharge', 'paraboloid_shift', 'arxiv', 'delta_x', 'Leff_outer', 'SMparticles', 'dimensionality', 'comment', 'good', 'txnameList', 'particles', 'y_unit', 'label', 'dataId', 'dataInfo', 'dataUrl', 'publication', 'spin', 'arrayMap', 'canonName', 'equations', 'url', 'colordim', 'mass', 'constraint', 'source', 'figureUrl', 'id', 'full_dimensionality', 'tri', 'txnameData', 'min_bound', 'inputFile', 'datasets', 'type', 'lumi', 'neighbors', 'pdg', 'smsMap', 'paraboloid_scale', 'axes', 'ndim', 'implementedBy', 'globalInfo', 'BSMparticles', 'nsimplex', 'allBSMparticles', 'path', 'coplanar', 'vertices']
In [8]:
#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= ['T1', 'T1bbbb', 'T1tttt', 'T2', 'T2bb']
In [9]:
#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+03 [fb]
In [10]:
#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+03 [fb]
In [11]:
#If you try with the wrong mass format, an error will be printed:
masses = [[300*GeV,50*GeV],[300*GeV,50*GeV]]
print ('xsection upper limit = ',exp.getUpperLimitFor(mass=masses,txname='T2'))
xsection upper limit = 1.07E+03 [fb]
How to load results for one simplified model (txname)¶
In [12]:
#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 [13]:
#Print all the results constraining the required Txname:
for exp in T1results:
print (exp.globalInfo.id) #(or print exp.getValuesFor('id'))
ATLAS-SUSY-2015-06 ATLAS-SUSY-2016-07 ATLAS-SUSY-2016-07 ATLAS-SUSY-2018-22 ATLAS-SUSY-2018-22 CMS-PAS-SUS-15-002 CMS-PAS-SUS-16-014 CMS-PAS-SUS-16-015 CMS-SUS-15-002 CMS-SUS-16-033 CMS-SUS-16-033 CMS-SUS-16-036 CMS-SUS-19-006 CMS-SUS-19-006-agg CMS-SUS-19-006 ATLAS-CONF-2013-047 ATLAS-CONF-2013-047 ATLAS-CONF-2013-054 ATLAS-CONF-2013-062 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 [14]:
#By default only non-supersed analyses are loaded:
results = database.getExpResults()
print ('Number of non-superseded results = ',len(results))
Number of non-superseded results = 185
In [ ]:
database = Database("official+superseded")
#To load all results (including the superseded ones), load also the superseded database
allResults = database.getExpResults()
print ('Including superseded results =',len(allResults))
WARNING in databaseObj.fetchFromScratch() in 668: downloading the database from https://smodels.github.io/database/superseded300-beta and caching in /home/lessa/.cache/smodels. If you want the pickled database file to be cached in a different location, set the environment variable SMODELS_CACHEDIR, e.g. to '/tmp'.
loading >................
How to selected upper-limit and efficiency map results:¶
In [ ]:
#Get only upper-limit results:
ULresults = database.getExpResults(dataTypes=['upperLimit'])
for exp in ULresults:
print (exp.globalInfo.id,exp.datasets[0].dataInfo.dataType)
In [ ]:
#Get only efficiency map results:
EMresults = database.getExpResults(dataTypes=['efficiencyMap'])
for exp in EMresults:
print (exp.globalInfo.id,exp.datasets[0].dataInfo.dataType)
In [ ]: