How To: Print out the theory predictions

In [1]:
# Set up the path to SModelS installation folder 
import sys; sys.path.append("."); import smodels_paths
In [2]:
# Import those parts of smodels that are needed for this exercise
# (We will assume the input is a SLHA file. For LHE files, use the lheDecomposer instead)
from smodels.theory import slhaDecomposer
from smodels.installation import installDirectory
from smodels.tools.physicsUnits import fb, GeV
from smodels.theory.theoryPrediction import theoryPredictionsFor
from smodels.experiment.databaseObj import Database
In [3]:
# load the official database:
database = Database( "official")
# Get list of desired experimental results (by default all results):
expResults = database.getExpResults()
In [4]:
# Define the SLHA input file name
filename="%s/inputFiles/slha/gluino_squarks.slha" % installDirectory()
In [5]:
# Perform the decomposition:
topList = slhaDecomposer.decompose(filename, sigcut = 0.03 * fb, doCompress=True, doInvisible=True,minmassgap = 5* GeV)
In [6]:
# Compute the theory prediction for each selected experimental result using the output from the decomposition:
allThPredictions = [theoryPredictionsFor(exp, topList) for exp in expResults]
In [7]:
# Print information about each theory prediction for each result:
for thPreds in allThPredictions:
    if not thPreds: continue #skip results with no predictions
    for theoryPred in thPreds:
        print ("\nExperimental Result: ",theoryPred.expResult.globalInfo.id,"(%s-type)" %theoryPred.dataset.dataInfo.dataType) #Result ID
        print ("Theory prediction xsec = ",theoryPred.xsection.value) #Signal xsection*efficiency*BR
        print ("Conditions violation (if any) = ",theoryPred.conditions) #Condition values (for UL-type results)
        print ("Dataset:",theoryPred.dataset.dataInfo.dataId)  #Corresponding signal region (for EM-type results)
        print ("Txnames = ",[str(tx) for tx in theoryPred.txnames]) #List of simplified models (txnames) contributing to the signal xsec        
Experimental Result:  ATLAS-SUSY-2015-06 (efficiencyMap-type)
Theory prediction xsec =  2.79E-04 [pb]
Conditions violation (if any) =  None
Dataset: SR5j
Txnames =  ['T1']

Experimental Result:  CMS-PAS-SUS-16-022 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-PAS-SUS-17-004 (upperLimit-type)
Theory prediction xsec =  3.99E-02 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWZ']

Experimental Result:  CMS-PAS-SUS-17-004 (upperLimit-type)
Theory prediction xsec =  2.07E-01 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWH']

Experimental Result:  CMS-SUS-16-033 (upperLimit-type)
Theory prediction xsec =  7.53E-03 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1']

Experimental Result:  CMS-SUS-16-033 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-033 (upperLimit-type)
Theory prediction xsec =  1.15E-02 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T2']

Experimental Result:  CMS-SUS-16-034 (upperLimit-type)
Theory prediction xsec =  3.99E-02 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWZ']

Experimental Result:  CMS-SUS-16-035 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-036 (upperLimit-type)
Theory prediction xsec =  7.53E-03 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1']

Experimental Result:  CMS-SUS-16-036 (upperLimit-type)
Theory prediction xsec =  1.15E-02 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T2']

Experimental Result:  CMS-SUS-16-036 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-037 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-039 (upperLimit-type)
Theory prediction xsec =  3.99E-02 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWZ']

Experimental Result:  CMS-SUS-16-039 (upperLimit-type)
Theory prediction xsec =  2.07E-01 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWH']

Experimental Result:  CMS-SUS-16-041 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-042 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-043 (upperLimit-type)
Theory prediction xsec =  2.07E-01 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWH']

Experimental Result:  CMS-SUS-16-045 (upperLimit-type)
Theory prediction xsec =  2.07E-01 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['TChiWH']

Experimental Result:  CMS-SUS-16-050 (upperLimit-type)
Theory prediction xsec =  3.50E-05 [pb]
Conditions violation (if any) =  None
Dataset: None
Txnames =  ['T1tttt']

Experimental Result:  CMS-SUS-16-050-agg (efficiencyMap-type)
Theory prediction xsec =  1.38E-07 [pb]
Conditions violation (if any) =  None
Dataset: ar56
Txnames =  ['T1tttt']
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-99ec66b3853a> in <module>()
      3     if not thPreds: continue #skip results with no predictions
      4     for theoryPred in thPreds:
----> 5         print ("\nExperimental Result: ",theoryPred.expResult.globalInfo.id,"(%s-type)" %theoryPred.dataset.dataInfo.dataType) #Result ID
      6         print ("Theory prediction xsec = ",theoryPred.xsection.value) #Signal xsection*efficiency*BR
      7         print ("Conditions violation (if any) = ",theoryPred.conditions) #Condition values (for UL-type results)

AttributeError: 'CombinedDataSet' object has no attribute 'dataInfo'