Show two sets of experimental data from HepData (aida format)
Source code name: "real_life_read_aida.py"
Programming language: Python
Topic: Physics/HEP
DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/real_life_read_aida_1782.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
from jhplot  import *
from jhplot.io  import *
from cern.jet.random.engine import  *
from cern.jet.random import *
import urllib


#dir=SystemDir+fSep+"macros"+fSep+"examples"+fSep+"data"+fSep    
#a1=FileAida( dir+"UA1.aida")
#a2=FileAida( dir+"Atlas.aida")

# get from URL

wfile1="UA1.aida"
urllib.urlretrieve ("http://datamelt.org/examples/data/"+wfile1,wfile1)

wfile2="Atlas.aida"
urllib.urlretrieve ("http://datamelt.org/examples/data/"+wfile2,wfile2)

a1=FileAida( wfile1 )
a2=FileAida( wfile2 )


ds_UA1=a1.get("/REF/UA1_1990_S2044935/d01-x01-y03") 
ds_ATLAS=a2.get("/REF/ATLAS_2010_S8591806/d04-x01-y01")

p1=P1D(ds_UA1)
p1.setTitle("UA1 data")
p1.setColor(Color.blue)
int=p1.integral()
# normalize to 1
p1.operScale(1,1.0/int)

p2=P1D(ds_ATLAS)
print p2.toString()
p2.setColor(Color.red)
  
  
c1 = HPlot("Canvas",600,400)
c1.setGTitle("UA1 data vs ATLAS")
c1.visible()
c1.setNameX("P_{n}")
c1.setNameY("Probability")
c1.setRange(0,100,0.0000001,1)
c1.setLegendPos(0.6,0.9,"NDC")
     
c1.setLogScale(1,1)
c1.draw(p1)
c1.draw(p2)


You see the box below because you did not login.