


SetParameter ( 1, f_decay ) #print f_norm, f_decay, getChi2(f_expo,hist) chi2 = getChi2 ( f_expo, hist ) chi2_vs_pars. time () print 'Begin chi2 minimisation scan' from numpy import arange for f_norm in arange ( binrangex, binrangex ,( binrangex - binrangex ) / Nbins ): for f_decay in arange ( binrangey, binrangey ,( binrangey - binrangey ) / Nbins ): f_expo. SetXTitle ( 'Decay constant' ) # Use numpy to get a float range chi2min = 1e20 pars_chi2min = ( 0. You can adjust the axes to positive numbers, make more implementations with densities/etc, but this is a simple graphic Ive seen people use. I simply take the negative number of counts to flip the histogram over the x-axis. But if you add other data, you need to shift them also. SetXTitle ( 'Normalisation factor' ) chi2_vs_pars. The code calculates the histograms for each distribution and stores the information. data <- ame (number c (5, 10, 11 ,12,12,12,13,15,15)) ggplot (data,aes (x number)) + geomhistogram (binwidth 0.5) Here is a trick with the tick label to get the bar align on the left. TH2D ( 'chi2_vs_pars', 'Chi2 for choices of fn pars', Nbins, binrangex, binrangex, Nbins, binrangey, binrangey ) chi2_vs_pars. # Exercise 1 # Let's fill a 2D histogram with the chi2 values for a range of hypotheses Nbins = 100 binrangex = ( 1, 101 ) binrangey = ( - 0.05, 0.
