# # 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 # ## datarep = hist.getDataRep() ## datarep.applyCuts ( cuts ) hist.applyCuts(cuts) # # If applying only one cut one would do # datarep.applyCut ( cut1 ) # print "Added multiple cuts to one display"
# # 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 # ## datarep = hist.getDataRep() ## datarep.applyCuts ( cuts ) hist.applyCuts ( cuts ) # # If applying only one cut one would do # datarep.applyCut ( cut1 ) # print "Added multiple cuts to one display"
# # 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 # datarep = hist.getDataRep() datarep.applyCuts ( cuts ) hist.applyCuts ( cuts ) # # If applying only one cut one would do # datarep.applyCut ( cut1 ) # print "Added multiple cuts to one display"
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 ) exp1.fit ()