ret = np.sum(-1 * np.log(pdf(p, x, fixed_parameters))) - poisson_term
    return ret


################################################################################
# Importing the dark matter data
################################################################################
#
# This is the ``time" of the first event, in some digitial units used
# by the detector
first_event = 2750361.2
# Full path to the directory
infile_name = '/Users/lm27apic/Documents/Fall_2012/Dark_Matter_Research/dark_matter_data/low_gain.txt'

tdays, energies = cu.get_cogent_data(infile_name,
                                     first_event=first_event,
                                     calibration=999)

xlo = 0.133
xhi = 0.1470
mu = (xlo + xhi) / 2
sigma = 0.0085
slope = 0.5

# Index the range of energies
index0 = energies > xlo
index1 = energies < xhi
index = index0 * index1

x = energies[index]
    ret = np.sum(-1*np.log(pdf(p,x,fixed_parameters))) - poisson_term
    return ret


################################################################################
# Importing the dark matter data
################################################################################
#
# This is the ``time" of the first event, in some digitial units used
# by the detector
first_event = 2750361.2
# Full path to the directory 
infile_name = '/Users/lm27apic/Documents/Fall_2012/Dark_Matter_Research/dark_matter_data/low_gain.txt'

tdays,energies = cu.get_cogent_data(infile_name,first_event=first_event,calibration=999)

xlo = 0.133
xhi = 0.1470
mu = (xlo + xhi) / 2
sigma = 0.0085
slope = 0.5

# Index the range of energies
index0 = energies>xlo
index1 = energies<xhi
index = index0*index1

x = energies[index]

plt.figure()