Пример #1
0
# Set matrix of ploats
canvas.setPlotMatrix ( 3, 3 )

from hippo import Display, Cut

#
# Create a 1D histogram
#
hist = Display ( "Histogram", events, ('GLON', ) )
canvas.addDisplay ( hist )

#
# First create cuts individually 
#
from hippo import Cut
cut1 = Cut ( events, ( 'zenith_angle', ) )
canvas.addDisplay ( cut1 )
cut1.setCutRange (  80., 100., 'x' )

#
# Create a another cut and set its range
#
cut2 = Cut ( events, ( 'energy', ) )
canvas.addDisplay ( cut2 )
cut2.setCutRange ( 1e3, 1e4, 'x' )
cut2.setLog ( 'x', True )
cut2.setLog ( 'y', True )

cuts = ( cut1, cut2 )
#
# Add the list of cuts to display
Пример #2
0
labels = events.getLabels()
print labels

from hippo import Display

#
# Create a 1D histogram
#
hist = Display("Histogram", events, ('GLON', ))
canvas.addDisplay(hist)

#
# Create a cut and set its range
#
from hippo import Cut
cut1 = Cut(events, ('zenith_angle', ))
canvas.addDisplay(cut1)
cut1.setCutRange(80., 100., 'x')

#
# Create a another cut and set its range
#
cut2 = Cut(events, ('energy', ))
canvas.addDisplay(cut2)
cut2.setCutRange(1e3, 1e4, 'x')
cut2.setLog('x', True)
cut2.setLog('y', True)

cuts = (cut1, cut2)
#
# Add the list of cuts to display
Пример #3
0
# Create a histogram for one of the columns and add it to the canvas
hist = Display ( "Histogram", ntuple, ('TkrEnergy', ) )

# Up to now, we didn't need the HippoDraw application running.
# Now we do in order to view the data.
app = HDApp()
canvas = app.canvas()
canvas.addDisplay ( hist )

# Set the Y axis on log scale of better viewing
hist.setLog ( 'y', True )

# Add a cut from data in another column
from hippo import Cut
hits_cut = Cut ( ntuple, ('TkrTotalHits',) )
canvas.addDisplay ( hits_cut )
hits_cut.setLog ( 'y', True )

hits_cut.addTarget ( hist )
hits_cut.setCutRange ( 4, 110, 'x' )

# Change the range of the displayed data
hist.setRange ( 'x', 40, 700 )

# fit a function to the histogram
from hippo import Function
datarep = hist.getDataRep ()

exp1 = Function ( "Exponential", datarep )
exp1.addTo ( hist )