# Set up the path to SModelS installation folder
import sys; sys.path.append("."); import smodels_paths
# Import those parts of smodels that are needed for this exercise
from smodels.tools.physicsUnits import GeV
from smodels.experiment.databaseObj import Database
## Load the official database:
db = Database("official")
# Select desired result:
resultID = ["CMS-PAS-SUS-13-016"]
txname = ["T1tttt"]
expResult = db.getExpResults(analysisIDs=resultID,txnames=txname,dataTypes='upperLimit')[0]
print ('selected result:',expResult)
selected result: CMS-PAS-SUS-13-016:(0):T1tttt(1)
# Define the desired mass vector (must be consistent with the txname/simplified model):
massesA = [[500*GeV, 150*GeV],[500*GeV, 150*GeV]]
massesB = [[5000*GeV, 150*GeV],[5000*GeV, 150*GeV]]
# For UL-type results, the efficiency is 1, if the mass is inside the grid or zero if it is outside:
print ('efficiency for mass\n',massesA,' is: ',expResult.getEfficiencyFor(mass=massesA,txname="T1tttt"))
print ('efficiency for mass\n',massesB,' is: ',expResult.getEfficiencyFor(mass=massesB,txname="T1tttt"))
efficiency for mass [[5.00E+02 [GeV], 1.50E+02 [GeV]], [5.00E+02 [GeV], 1.50E+02 [GeV]]] is: 1.0 efficiency for mass [[5.00E+03 [GeV], 1.50E+02 [GeV]], [5.00E+03 [GeV], 1.50E+02 [GeV]]] is: 0.0
# Select desired result:
resultID = ["CMS-PAS-SUS-13-016"]
txname = ["T1tttt"]
expResult = db.getExpResults(analysisIDs=resultID,txnames=txname,dataTypes='efficiencyMap')[0]
print ('selected result:',expResult)
selected result: CMS-PAS-SUS-13-016: sr0(1):T1tttt(1)
# For an efficiency map result one needs to specify the desired signal region (dataset) and mass
masses = [[500*GeV, 150*GeV],[500*GeV, 150*GeV]]
datasetID = 'sr0'
print ('efficinecy for mass\n ',masses,'\n in dataset',datasetID,' is: ',expResult.getEfficiencyFor(mass=masses,txname="T1tttt",dataset=datasetID))
efficinecy for mass [[5.00E+02 [GeV], 1.50E+02 [GeV]], [5.00E+02 [GeV], 1.50E+02 [GeV]]] in dataset sr0 is: 0.0010565