P1D data holder and evaluation of systematics
Code: "p1d_systematics.py". Programming language: Python
DMelt Version 1. Last modified: 12/08/2015. License: Pro
https://datamelt.org/code/cache/p1d_systematics_2601.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from java.awt import Color,Font
from java.util import Random
from jhplot import HPlot, P1D
c1 = HPlot("Canvas",600,400,2,1)
c1.visible(1)
c1.setAutoRange()
c1.setGTitle("Systematical uncertainties", Color.blue) #put title
c1.viewHisto(0) # make sure starts from 0
# fill first data set
# this is a default measurement
p1= P1D("Default cuts")
p1.setColor(Color.blue)
p1.add(10,100,5,5)
p1.add(20,80,5,5)
p1.add(30,90,5,5)
# build a tuple with measurements
# representing systematical variations
pp=[]
# fill 2nd data set
# no need to put stat. errors
p2= P1D("variation 1")
p2.add(10,90,5,5)
p2.add(20,75,5,5)
p2.add(30,80,5,5)
pp.append(p2)
# fill 3rd data set
# no need to put stat errors
p3= P1D("variation 2")
p3.add(10,110,6,6)
p3.add(20,96,6,6)
p3.add(30,120,6,6)
pp.append(p3)
c1.draw(p1)
c1.draw(p2)
c1.draw(p3)
# evaluate systematical error for p1
psys=p1.getSys(pp)
psys.setTitle("final measurement")
# show in table
# psys.toTable()
print psys.toString()
# show points with statistical errors in y
c1.cd(2,1)
c1.setAutoRange()
psys.setErr(1)
c1.draw(psys)
You see the box below because you did not login.