#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/"))
#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 database:
databasePath = os.path.join(os.getenv("HOME"),"smodels-database/")
db = Database(databasePath)
#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
#Define the desired mass vector (must be consistent with the txname/simplified model):
masses = [[500*GeV, 150*GeV],[500*GeV, 150*GeV]]
print 'UL for mass\n',masses,' is: ',expResult.getUpperLimitFor(mass=masses,txname="T1tttt")
#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
#For an efficiency map result one only needs to specify the desired signal region (dataset)
datasetID = 'sr0'
print 'UL for dataset',datasetID,' is: ',expResult.getUpperLimitFor(dataID=datasetID)