Beispiel #1
0
import pyWIMP.DMModels.wimp_model as wimp_model
import pyWIMP.DMModels.base_model as base_model
import ROOT
import sys

#ROOT.gROOT.SetBatch()
basevars = base_model.BaseVariables(0, 1. / 365., 0, 100)
time = basevars.get_time()
energy = basevars.get_energy()
time.setVal(0)
time.setConstant(True)
model_normal = ROOT.RooRealVar("model_normal", \
                               "model_normal", \
                               1, 0, 100000)
print model_normal.getVal()
wm = wimp_model.WIMPModel(basevars, mass_of_wimp=10, kilograms=1)
wm2 = wimp_model.WIMPModel(basevars, mass_of_wimp=7, kilograms=1)

c1 = ROOT.TCanvas()
model = wm.get_model()
model_extend = wm.get_simple_model()
model_extend2 = wm2.get_simple_model()
model_extend = wm.get_model()
model_extend2 = wm2.get_model()

print model_extend.getNorm(0)
print "Model extend: ", model_extend.expectedEvents(ROOT.RooArgSet(energy))
print "Model extend, ratio: ", model_extend.expectedEvents(
    ROOT.RooArgSet(energy)) * (0.751 / 0.561)
print "Model extend: ", model_extend2.expectedEvents(ROOT.RooArgSet(energy))
print "Model extend, ratio: ", model_extend2.expectedEvents(
import pyWIMP.DMModels.wimp_model as wimp_model
import pyWIMP.DMModels.base_model as base_model
import ROOT
#ROOT.gROOT.SetBatch()
basevars = base_model.BaseVariables(0, 2, 4, 50)
wm = wimp_model.WIMPModel(basevars, mass_of_wimp=20)

test3 = wm.get_WIMP_model_with_escape_vel()
test2 = wm.get_WIMP_model()
energy = basevars.get_energy()
time = basevars.get_time()

precision = ROOT.RooNumIntConfig.defaultConfig()
new_config = precision  #ROOT.RooNumIntConfig(precision)

new_config.setEpsRel(1e-9)
new_config.setEpsAbs(1e-9)
new_config.method2D().setLabel("RooIntegrator2D")
#test3.setIntegratorConfig(new_config)
new_config.Print('v')
integral = test3.createIntegral(ROOT.RooArgSet(time, energy))
print integral.getVal()
integral = test3.createIntegral(ROOT.RooArgSet(time, energy))
print integral.getVal()
integral = test3.createIntegral(ROOT.RooArgSet(energy))
print integral.getVal()
integral = test3.createIntegral(ROOT.RooArgSet(time))
print integral.getVal()
Beispiel #3
0
#!/usr/bin/env python

from pyWIMP.DMModels.base_model import BaseVariables
import pyWIMP.DMModels.wimp_model as wimp_model
import ROOT
import re
mass_of_wimp = 7
basevars = BaseVariables(0.0, 4.0, 0, 10, True, 0.0)
time = basevars.get_time()
time.setConstant()
time.setVal(0)
wm = wimp_model.WIMPModel(basevars, mass_of_wimp, nucl_recoil=True)
model = wm.get_WIMP_model()
expected_events = model.expectedEvents(ROOT.RooArgSet(basevars.get_energy()))
hist = model.createHistogram("hist", basevars.get_energy(), \
                          ROOT.RooFit.Binning(200),\
                          ROOT.RooFit.YVar(basevars.get_time(), \
                          ROOT.RooFit.Binning(4*36)))
hist.SetLineColor(4)
hist.GetXaxis().CenterTitle()
hist.GetXaxis().SetTitle("Energy (keVnr)")
hist.GetXaxis().SetTitleOffset(1.5)
hist.GetYaxis().CenterTitle()
hist.GetYaxis().SetTitle("Time (years)")
hist.GetYaxis().SetTitleOffset(1.5)
hist.GetYaxis().SetNdivisions(507)
hist.GetZaxis().CenterTitle()
hist.GetZaxis().SetTitle("Amplitude (a.u.)")
hist.GetZaxis().SetTitle("#frac{dR}{dE} #sigma^{-1} (counts/keV/kg/yr/pb)")
hist.GetZaxis().SetTitleOffset(1.1)
hist.GetZaxis().SetNdivisions(509)