├── fasimov.egg-info ├── dependency_links.txt ├── top_level.txt ├── requires.txt ├── SOURCES.txt └── PKG-INFO ├── dist └── fasimov-0.0.1-py2.7.egg ├── docs ├── VisualizeDifference.pdf ├── FastAsimovUtils.cxx └── .ipynb_checkpoints │ └── demo-notebook-checkpoint.ipynb ├── validation ├── data │ └── histograms.root ├── med_sig_checks │ ├── medsig.tar │ ├── medsigMC.root │ ├── GNUmakefile │ ├── Experiment.h │ ├── medsig_s10_rel_bi.txt │ ├── medsig_s5_rel_bi_1.txt │ ├── medsig_s5_rel_bi.txt │ ├── medsig_s5_rel_bi_2012.txt │ ├── medsigMC.cc │ ├── Experiment.cc │ ├── medsig_s10_rel_bi.eps │ ├── medsig_s5_rel_bi.eps │ ├── draw_medsig_s2_rel_bi.C │ ├── draw_medsig_s10_rel_bi.C │ └── draw_medsig_s5_rel_bi.C ├── results │ └── example_DataDriven_combined_GaussExample_model.root ├── config │ ├── example_DataDriven.xml │ ├── example_DataDriven_controlRegion.xml │ ├── example_DataDriven_signalRegion.xml │ └── HistFactorySchema.dtd └── makeHists.C ├── .gitignore ├── setup.py ├── README.md └── fasimov └── __init__.py /fasimov.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /fasimov.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | fasimov 2 | -------------------------------------------------------------------------------- /fasimov.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | scipy 2 | numpy -------------------------------------------------------------------------------- /dist/fasimov-0.0.1-py2.7.egg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/dist/fasimov-0.0.1-py2.7.egg -------------------------------------------------------------------------------- /docs/VisualizeDifference.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/docs/VisualizeDifference.pdf -------------------------------------------------------------------------------- /validation/data/histograms.root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/validation/data/histograms.root -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/validation/med_sig_checks/medsig.tar -------------------------------------------------------------------------------- /validation/med_sig_checks/medsigMC.root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/validation/med_sig_checks/medsigMC.root -------------------------------------------------------------------------------- /validation/results/example_DataDriven_combined_GaussExample_model.root: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cranmer/fast-asimov-utils/master/validation/results/example_DataDriven_combined_GaussExample_model.root -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.pyc 3 | 4 | *.d 5 | 6 | *.so 7 | 8 | .ipynb_checkpoints/* 9 | 10 | demo-notebook.slides.html 11 | 12 | demo-notebook.ipynb 13 | 14 | demo-notebook.ipynb 15 | 16 | demo-notebook.ipynb 17 | -------------------------------------------------------------------------------- /fasimov.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | setup.py 2 | fasimov/__init__.py 3 | fasimov.egg-info/PKG-INFO 4 | fasimov.egg-info/SOURCES.txt 5 | fasimov.egg-info/dependency_links.txt 6 | fasimov.egg-info/requires.txt 7 | fasimov.egg-info/top_level.txt -------------------------------------------------------------------------------- /fasimov.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: fasimov 3 | Version: 0.0.1 4 | Summary: fast Asimov statistical tools 5 | Home-page: UNKNOWN 6 | Author: Kyle Cranmer 7 | Author-email: kyle.cranmer@nyu.edu 8 | License: UNKNOWN 9 | Description: UNKNOWN 10 | Platform: UNKNOWN 11 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, find_packages 2 | 3 | setup( 4 | name = 'fasimov', 5 | version = '0.0.1', 6 | description = 'fast Asimov statistical tools', 7 | url = '', 8 | author = 'Kyle Cranmer', 9 | author_email = 'kyle.cranmer@nyu.edu', 10 | packages = find_packages(), 11 | include_package_data = True, 12 | install_requires = [ 13 | 'scipy', 14 | 'numpy', 15 | ], 16 | dependency_links = [ ] 17 | ) -------------------------------------------------------------------------------- /validation/med_sig_checks/GNUmakefile: -------------------------------------------------------------------------------- 1 | # Glen Cowan, RHUL Physics, June 2010 2 | 3 | PROGNAME = medsigMC 4 | SOURCES = medsigMC.cc Experiment.cc 5 | INCLUDES = Experiment.h 6 | OBJECTS = $(patsubst %.cc, %.o, $(SOURCES)) 7 | ROOTCFLAGS := $(shell root-config --cflags) 8 | ROOTLIBS := $(shell root-config --libs) 9 | ROOTGLIBS := $(shell root-config --glibs) 10 | ROOTLIBS := $(shell root-config --nonew --libs) 11 | CFLAGS += $(ROOTCFLAGS) 12 | LIBS += $(ROOTLIBS) 13 | # Not sure why Minuit isn't being included -- put in by hand 14 | # 15 | LIBS += -lMinuit 16 | LDFLAGS = -O 17 | 18 | $(PROGNAME): $(OBJECTS) 19 | g++ -o $@ $(OBJECTS) $(LDFLAGS) $(LIBS) 20 | 21 | %.o : %.cc $(INCLUDES) 22 | g++ ${CFLAGS} -c -g -o $@ $< 23 | 24 | test: 25 | @echo $(ROOTCFLAGS) 26 | 27 | clean: 28 | -rm -f ${PROGNAME} ${OBJECTS} 29 | -------------------------------------------------------------------------------- /validation/med_sig_checks/Experiment.h: -------------------------------------------------------------------------------- 1 | #ifndef EXPERIMENT_H 2 | #define EXPERIMENT_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace std; 12 | 13 | class Experiment { 14 | 15 | public: 16 | 17 | Experiment (double s, double b, double tau, TRandom3* ran); 18 | void generateData(double s, double b, double tau); 19 | double lnL(int n, int m, double s, double b, double tau); 20 | double lnL(int n, int m); 21 | double q0(int n, int m); 22 | double q0(); 23 | double Z0(); 24 | double s() { return m_s; } 25 | double b() { return m_b; } 26 | double tau() { return m_tau; } 27 | int n() { return m_n; } 28 | int m() { return m_m; } 29 | int Ntot(double sigrel); 30 | 31 | private: 32 | 33 | int m_n; 34 | int m_m; 35 | double m_nd; 36 | double m_md; 37 | double m_s; 38 | double m_b; 39 | double m_tau; 40 | TRandom3* m_ran; 41 | 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /validation/config/example_DataDriven.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | 15 | 16 | 17 | 18 | 19 | ./config/example_DataDriven_signalRegion.xml 20 | ./config/example_DataDriven_controlRegion.xml 21 | 22 | 23 | SigXsecOverSM 24 | Lumi 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /validation/makeHists.C: -------------------------------------------------------------------------------- 1 | makeHist(double bExp, double deltaB){ 2 | 3 | TFile *tf = new TFile("data/histograms.root","recreate"); 4 | TH1F *sigData = new TH1F("signalData","",1,0,1); 5 | TH1F *controlData = new TH1F("controlData","",1,0,1); 6 | TH1F *bkgExp = new TH1F("bExp","",1,0,1); 7 | TH1F *tauHist = new TH1F("tau","",1,0,1); 8 | TH1F *unit = new TH1F("unit","",1,0,1); 9 | 10 | double tau = bExp/deltaB/deltaB; 11 | 12 | sigData->Fill(0.5,bExp); 13 | controlData->Fill(0.5,bExp*tau); 14 | bkgExp->Fill(0.5, bExp); 15 | tauHist->Fill(0.5, tau); 16 | 17 | unit->Fill(0.5,1); 18 | 19 | //hd_neg->Write("histograms.root"); 20 | tf->Write(); 21 | tf->Close(); 22 | 23 | } 24 | 25 | void runAll(double bExp=50, double deltaB=3.){ 26 | makeHist(bExp,deltaB); 27 | gSystem->Exec("hist2workspace config/example_DataDriven.xml"); 28 | gSystem->Load("$ROOTSYS/tutorials/roostats/StandardHypoTestInvDemo.C"); 29 | StandardHypoTestInvDemo("results/example_DataDriven_combined_GaussExample_model.root", "combined", "ModelConfig","","obsData",2,3,true,10,0,2*sqrt(bExp)+2*deltaB); 30 | } 31 | 32 | void makeHists(){ 33 | runAll(50,7); 34 | runAll(100,0.1); 35 | runAll(50,50); 36 | 37 | 38 | } -------------------------------------------------------------------------------- /validation/config/example_DataDriven_controlRegion.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /validation/config/example_DataDriven_signalRegion.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s10_rel_bi.txt: -------------------------------------------------------------------------------- 1 | 0.1 31.5597 31.2348 30.1511 8.34776 7.64154 6.47357 7.84968 7.44466 6.4379 8.04109 7.51745 6.92516 8.20954 7.44488 6.18584 2 | 0.143845 26.291 25.9048 24.653 7.9251 7.18433 5.96694 7.99604 7.3765 6.10913 8.2985 7.53786 6.85366 7.7866 6.98303 5.66752 3 | 0.206914 21.8935 21.4365 20.0109 7.4871 6.70851 5.44383 7.60686 6.84818 5.33299 7.77007 7.21265 7.01444 7.34801 6.50229 5.13111 4 | 0.297635 18.2217 17.6837 16.0909 7.03348 6.21395 4.90798 6.85031 6.15753 4.98971 7.04437 6.47423 6.86424 6.89352 6.00234 4.58014 5 | 0.428133 15.1539 14.5255 12.7887 6.56437 5.70135 4.36533 6.93936 5.54868 4.65665 7.12687 5.97956 999 6.42363 5.48382 4.02032 6 | 0.615848 12.5886 11.8623 10.0245 6.08049 5.17263 3.82414 6.0809 4.9678 3.91116 6.46946 5.53394 999 5.93918 4.94859 3.4598 7 | 0.885867 10.4413 9.61335 7.73678 5.58335 4.63142 3.29467 5.41113 4.6657 3.31774 5.81117 4.89164 999 5.44177 4.40025 2.90883 8 | 1.27427 8.64118 7.71466 5.87418 5.07552 4.08362 2.78821 4.97927 4.285 2.88964 5.02631 4.32991 3.99165 4.934 3.84465 2.37887 9 | 1.83298 7.12946 6.11654 4.38833 4.56083 3.53768 2.3157 4.48157 3.54954 2.48953 4.42825 3.46349 3.40081 4.41977 3.29028 1.8813 10 | 2.63665 5.85735 4.78112 3.22941 4.04457 3.00456 1.8864 3.92796 2.93962 2.05857 3.99475 2.74588 2.49452 3.90437 2.74818 1.42605 11 | 3.79269 4.78471 3.67885 2.34551 3.53348 2.49702 1.50683 3.56906 2.34687 1.73675 3.61599 2.17249 1.81531 3.39454 2.2313 1.02048 12 | 5.45559 3.87896 2.78461 1.68504 3.03565 2.02811 1.18031 2.99693 2.05712 1.31459 3.00579 1.86588 0.956738 2.89828 1.75296 0.668908 13 | 7.8476 3.11422 2.07418 1.2001 2.56009 1.60916 0.907067 2.60279 1.62897 1.12329 2.64061 1.54217 0.534612 2.42442 1.32483 0.372465 14 | 11.2884 2.47042 1.52242 0.849057 2.11603 1.24792 0.684584 2.09095 1.42372 0.779711 2.10624 1.27981 0.343592 1.98199 0.955025 0.129379 15 | 16.2378 1.93223 1.10328 0.597718 1.71207 0.947361 0.508191 1.61993 1.00983 0.584143 1.59432 0.923022 0.330555 1.57939 0.646798 -0.064564 16 | 23.3572 1.48775 0.791195 0.419253 1.35513 0.705645 0.371805 1.61389 0.988835 0.457702 1.59272 0.897947 0.327437 1.22341 0.39852 -0.215325 17 | 33.5982 1.12686 0.562715 0.293302 1.04951 0.517148 0.268711 0.990592 0.409065 0.303058 0.965205 0.31539 0.303262 0.918321 0.204632 -0.329784 18 | 48.3293 0.839897 0.397697 0.204806 0.796209 0.374011 0.192288 0.695009 0.73049 0.257434 0.668209 0.679433 0.305481 0.665176 0.0572226 -0.414925 19 | 69.5193 0.616818 0.279754 0.142821 0.592889 0.267677 0.136538 0.620269 0.149572 0.231469 0.625166 0.060886 0.299384 0.461741 -0.0523919 -0.477199 20 | 100 0.447214 0.196116 0.0995037 0.434463 0.190048 0.0963826 0.483602 0.115438 0.0963826 0.456155 0.0375838 0.135774 0.303055 -0.132477 -0.522141 21 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s5_rel_bi_1.txt: -------------------------------------------------------------------------------- 1 | 0.1 15.7799 15.6174 15.0756 5.40082 5.05905 4.3825 5.33108 4.97533 4.33161 5.87085 5.02631 4.68047 5.21928 4.81681 4.03299 2 | 0.143845 13.1455 12.9524 12.3265 5.08557 4.72475 4.01758 5.10037 4.68527 3.9492 5.60151 4.67082 4.32979 4.90349 4.47828 3.65558 3 | 0.206914 10.9468 10.7182 10.0055 4.75995 4.37801 3.64147 4.83066 4.48507 3.55029 5.02631 4.63906 4.07214 4.57768 4.12709 3.26546 4 | 0.297635 9.11083 8.84185 8.04547 4.42453 4.01939 3.25722 4.45862 3.88579 3.11673 4.47898 3.79327 3.62585 4.24252 3.76379 2.86551 5 | 0.428133 7.57693 7.26273 6.39435 4.08039 3.6502 2.86952 3.62663 3.7275 2.95912 3.70978 3.53634 3.38323 3.89923 3.38971 2.46034 6 | 0.615848 6.29432 5.93113 5.01225 3.72933 3.27284 2.48484 3.584 3.22749 2.40576 3.60532 3.13595 2.38736 3.54972 3.00724 2.05643 7 | 0.885867 5.22065 4.80668 3.86839 3.37397 2.89108 2.11118 3.23236 2.89159 2.45858 3.34104 2.79668 2.59639 3.19674 2.62016 1.66195 8 | 1.27427 4.32059 3.85733 2.93709 3.0178 2.5103 1.75728 3.29339 2.40784 1.86432 3.34255 2.41344 1.66882 2.84387 2.23387 1.28605 9 | 1.83298 3.56473 3.05827 2.19416 2.66519 2.13758 1.43158 2.61111 2.16729 1.4662 2.62144 2.01471 1.26183 2.49548 1.85548 0.9378 10 | 2.63665 2.92867 2.39056 1.6147 2.32118 1.78135 1.14097 2.18539 1.63028 1.20333 2.19139 1.52878 0.897588 2.1565 1.49349 0.624923 11 | 3.79269 2.39235 1.83943 1.17275 1.99113 1.45059 0.889921 1.60964 1.62239 1.05476 1.64214 1.557 0.617405 1.83204 1.15696 0.35275 12 | 5.45559 1.93948 1.39231 0.842521 1.68028 1.1535 0.679968 1.60997 1.2673 0.847528 1.65675 1.15985 0.417601 1.52695 0.854215 0.123611 13 | 7.8476 1.55711 1.03709 0.600052 1.39329 0.896062 0.509834 1.33791 0.993452 0.608826 1.40147 0.944397 0.28726 1.24546 0.591414 -0.0632081 14 | 11.2884 1.23521 0.761208 0.424529 1.13397 0.681012 0.375969 1.15182 0.721549 0.724688 1.19059 0.686495 0.347787 0.99096 0.371465 -0.210989 15 | 16.2378 0.966116 0.55164 0.298859 0.90502 0.507581 0.273388 1.08285 0.553477 0.261385 1.06149 0.463555 0.201893 0.765876 0.193742 -0.324743 16 | 23.3572 0.743873 0.395597 0.209626 0.707939 0.372104 0.196542 0.666544 0.416911 0.25617 0.684145 0.332051 0.26112 0.571617 0.0546605 -0.410268 17 | 33.5982 0.56343 0.281358 0.146651 0.54287 0.269134 0.140039 0.513007 0.536289 0.177154 0.493061 0.455677 0.188859 0.408405 -0.0512171 -0.473332 18 | 48.3293 0.419948 0.198848 0.102403 0.408512 0.192612 0.0991023 0.157263 0.29079 0.0927679 0.162646 0.19309 0.0953964 0.275136 -0.130006 -0.519119 19 | 69.5193 0.308409 0.139877 0.0714107 0.302219 0.136742 0.0697783 0.367155 0.212811 0.116551 0.33841 0.113039 0.19678 0.169391 -0.187592 -0.551971 20 | 100 0.223607 0.0980581 0.0497519 0.220339 0.0964995 0.0489499 0.379736 0.280873 0.151464 0.35457 0.191148 0.276238 0.0877245 -0.229104 -0.575332 21 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s5_rel_bi.txt: -------------------------------------------------------------------------------- 1 | 0.1 15.7799 15.6174 15.0756 5.40082 5.05905 4.3825 5.43647 5.16709 4.37986 6.36567 5.63723 4.75342 5.21928 4.81681 4.03299 2 | 0.143845 13.1455 12.9524 12.3265 5.08557 4.72475 4.01758 4.88732 4.48294 3.9492 5.60151 4.24356 4.46518 4.90349 4.47828 3.65558 3 | 0.206914 10.9468 10.7182 10.0055 4.75995 4.37801 3.64147 4.58939 4.45415 3.55029 4.61138 4.41717 3.9535 4.57768 4.12709 3.26546 4 | 0.297635 9.11083 8.84185 8.04547 4.42453 4.01939 3.25722 4.60935 3.7428 3.43212 4.75342 3.71523 3.71699 4.24252 3.76379 2.86551 5 | 0.428133 7.57693 7.26273 6.39435 4.08039 3.6502 2.86952 4.01226 3.43674 2.71162 4.05563 3.43913 3.33248 3.89923 3.38971 2.46034 6 | 0.615848 6.29432 5.93113 5.01225 3.72933 3.27284 2.48484 3.53206 3.22749 2.40576 3.55176 3.13741 2.40725 3.54972 3.00724 2.05643 7 | 0.885867 5.22065 4.80668 3.86839 3.37397 2.89108 2.11118 3.4851 2.89159 2.14338 3.53953 2.80699 2.55484 3.19674 2.62016 1.66195 8 | 1.27427 4.32059 3.85733 2.93709 3.0178 2.5103 1.75728 3.02369 2.40784 2.15241 3.07861 2.41342 2.18496 2.84387 2.23387 1.28605 9 | 1.83298 3.56473 3.05827 2.19416 2.66519 2.13758 1.43158 2.4942 2.11112 1.61627 2.51543 1.95281 1.27203 2.49548 1.85548 0.9378 10 | 2.63665 2.92867 2.39056 1.6147 2.32118 1.78135 1.14097 2.29174 1.69719 1.36691 2.34706 1.60477 0.921454 2.1565 1.49349 0.624923 11 | 3.79269 2.39235 1.83943 1.17275 1.99113 1.45059 0.889921 1.71475 1.62376 1.05476 1.756 1.55757 0.608177 1.83204 1.15696 0.35275 12 | 5.45559 1.93948 1.39231 0.842521 1.68028 1.1535 0.679968 1.84001 1.44462 0.627703 1.86771 1.30502 0.312233 1.52695 0.854215 0.123611 13 | 7.8476 1.55711 1.03709 0.600052 1.39329 0.896062 0.509834 1.07633 1.01437 0.608826 1.09758 0.963541 0.310738 1.24546 0.591414 -0.0632081 14 | 11.2884 1.23521 0.761208 0.424529 1.13397 0.681012 0.375969 1.211 0.645373 0.487543 1.22689 0.568611 0.298459 0.99096 0.371465 -0.210989 15 | 16.2378 0.966116 0.55164 0.298859 0.90502 0.507581 0.273388 1.03362 0.485185 0.406961 1.02252 0.410864 0.296823 0.765876 0.193742 -0.324743 16 | 23.3572 0.743873 0.395597 0.209626 0.707939 0.372104 0.196542 0.692779 0.387882 0.425687 0.709523 0.331091 0.322027 0.571617 0.0546605 -0.410268 17 | 33.5982 0.56343 0.281358 0.146651 0.54287 0.269134 0.140039 0.479965 0.390637 0.150766 0.461928 0.300995 0.152463 0.408405 -0.0512171 -0.473332 18 | 48.3293 0.419948 0.198848 0.102403 0.408512 0.192612 0.0991023 0.458405 0.29259 0.0733725 0.423765 0.20911 0.0551738 0.275136 -0.130006 -0.519119 19 | 69.5193 0.308409 0.139877 0.0714107 0.302219 0.136742 0.0697783 0.34976 0.0686121 0.0898477 0.32783 -0.0100267 0.130716 0.169391 -0.187592 -0.551971 20 | 100 0.223607 0.0980581 0.0497519 0.220339 0.0964995 0.0489499 0.184123 0.226693 0.0775837 0.162716 0.137077 0.0953964 0.0877245 -0.229104 -0.575332 21 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s5_rel_bi_2012.txt: -------------------------------------------------------------------------------- 1 | 0.1 15.7799 15.6174 15.0756 5.40082 5.05905 4.3825 5.36507 4.84971 4.33161 5.95547 4.89164 4.78412 5.21928 4.81681 4.03299 2 | 0.143845 13.1455 12.9524 12.3265 5.08557 4.72475 4.01758 4.92022 4.63937 4.07275 4.89164 4.61138 4.51284 4.90349 4.47828 3.65558 3 | 0.206914 10.9468 10.7182 10.0055 4.75995 4.37801 3.64147 4.74483 4.26145 3.75608 4.75342 4.32152 4.09235 4.57768 4.12709 3.26546 4 | 0.297635 9.11083 8.84185 8.04547 4.42453 4.01939 3.25722 4.41207 4.06757 3.13666 4.41717 4.19358 3.75039 4.24252 3.76379 2.86551 5 | 0.428133 7.57693 7.26273 6.39435 4.08039 3.6502 2.86952 4.06213 3.65897 2.95912 4.13562 3.46337 3.36331 3.89923 3.38971 2.46034 6 | 0.615848 6.29432 5.93113 5.01225 3.72933 3.27284 2.48484 3.46958 3.22749 2.60643 3.49734 3.12576 2.95572 3.54972 3.00724 2.05643 7 | 0.885867 5.22065 4.80668 3.86839 3.37397 2.89108 2.11118 3.30416 2.88803 2.14338 3.35749 2.78822 2.57698 3.19674 2.62016 1.66195 8 | 1.27427 4.32059 3.85733 2.93709 3.0178 2.5103 1.75728 2.8284 2.40784 1.93002 2.88442 2.42174 2.1473 2.84387 2.23387 1.28605 9 | 1.83298 3.56473 3.05827 2.19416 2.66519 2.13758 1.43158 2.72676 2.16729 1.61627 2.76135 2.00845 1.28207 2.49548 1.85548 0.9378 10 | 2.63665 2.92867 2.39056 1.6147 2.32118 1.78135 1.14097 2.31958 1.63028 1.20333 2.34283 1.52425 0.907466 2.1565 1.49349 0.624923 11 | 3.79269 2.39235 1.83943 1.17275 1.99113 1.45059 0.889921 1.96281 1.4702 1.18257 2.00354 1.39703 0.616186 1.83204 1.15696 0.35275 12 | 5.45559 1.93948 1.39231 0.842521 1.68028 1.1535 0.679968 1.64017 1.25108 0.847528 1.69177 1.10628 0.422455 1.52695 0.854215 0.123611 13 | 7.8476 1.55711 1.03709 0.600052 1.39329 0.896062 0.509834 1.22432 1.01437 0.690734 1.24515 0.946809 0.322141 1.24546 0.591414 -0.0632081 14 | 11.2884 1.23521 0.761208 0.424529 1.13397 0.681012 0.375969 1.16549 0.767404 0.423209 1.17222 0.670056 0.273902 0.99096 0.371465 -0.210989 15 | 16.2378 0.966116 0.55164 0.298859 0.90502 0.507581 0.273388 0.908366 0.553477 0.406961 0.913979 0.466516 0.296441 0.765876 0.193742 -0.324743 16 | 23.3572 0.743873 0.395597 0.209626 0.707939 0.372104 0.196542 0.820527 0.38097 0.25617 0.831126 0.286983 0.209574 0.571617 0.0546605 -0.410268 17 | 33.5982 0.56343 0.281358 0.146651 0.54287 0.269134 0.140039 0.641223 0.294975 0.150766 0.617218 0.244475 0.151135 0.408405 -0.0512171 -0.473332 18 | 48.3293 0.419948 0.198848 0.102403 0.408512 0.192612 0.0991023 0.473373 0.29079 0.130851 0.460636 0.207229 0.161302 0.275136 -0.130006 -0.519119 19 | 69.5193 0.308409 0.139877 0.0714107 0.302219 0.136742 0.0697783 0.293955 0.25433 0.129735 0.2766 0.181468 0.2033 0.169391 -0.187592 -0.551971 20 | 100 0.223607 0.0980581 0.0497519 0.220339 0.0964995 0.0489499 0.184123 0.115438 0.0775837 0.161749 0.0374916 0.130716 0.0877245 -0.229104 -0.575332 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Fast Asimov Utils 2 | 3 | *Kyle Cranmer & Glen Cowan* 4 | 5 | *License LGPL v2.1 (for ROOT compatibility, happy to make it BSD for other purposes)* 6 | 7 | 8 | This code quickly calculates expected discovery significance and upper limits 9 | based on an expected signal `sExp`, expected background, `bExp`, and uncertainty on the 10 | background estimate, `deltaB`. In this situation, most of the problem can be done 11 | analytically, and no minimization algorithms are necessary. Observed versions and 12 | +/- 1,2 sigma bands on the expected limit are in the works. 13 | 14 | 15 | ### Expected Limit 16 | 17 | The expected 95% CLs upper limit on the number of 18 | signal events, `s`, given an expected background, `bExp`, and 19 | uncertainty on the background estimate, `deltaB`. The background uncertainty is absolute (not relative) and is uncertainty 20 | on the mean background (so you don't include sqrt(bExp) Poisson fluctuations in this number). 21 | 22 | Example Usage: 23 | 24 | * you expect 50 +/- 7 background events 25 | * `ExpectedLimit(50,7)` 26 | * returns s_95 = 19.7 events 27 | 28 | ### Expected Significance 29 | 30 | Similar code for expected discovery significance is also included. 31 | 32 | Example Usage: 33 | 34 | * you expect 50 signal events, 100 +/- 7 background events 35 | * `ExpectedSignificance(50,100,7)` 36 | * returns 3.72 sigma 37 | 38 | ## Details 39 | 40 | The derivations of these formulae are based on a statistical model: 41 | 42 | Pois(n | s+b ) * Pois(m | tau * b) 43 | 44 | The first term is the standard "number counting" signal region. 45 | The second term is a idealized auxiliary measurement used to 46 | constrain the background resulting in some characteristic relative uncertainty. 47 | The tau quantity is calculated from `tau=bExp/deltaB/deltaB`. 48 | See [arXiv:physics/0702156](http://arxiv.org/abs/physics/0702156) 49 | for motivation of this model. 50 | The maximum likelihood estimate and conditional maximum likelihood estimate 51 | were solved analytically and coded here. 52 | The log-likelihood ratio and the profile log likelihood ratio follow immediately. 53 | The b-only and s+b p-values needed for CLs are calculated using the 54 | asymptotic distributions in 55 | > Cowan, Cranmer, Gross, Vitells, Eur. Phys. J. C 71 (2011) 1554. 56 | [arXiv:1007.1727](http://arxiv.org/abs/1007.1727) 57 | 58 | The ExpectedSignificance formulae was derived by Cowan and the numerical solution 59 | for the Expected upper limit was written by Cranmer as correlaries to that paper. 60 | 61 | Note, the ExpectedSignificance equation is the same as Eq.(17) of 62 | > Tipei Li and Yuqian Ma, Astrophysical Journal 272 (1983) 317–324. 63 | 64 | and Eq.(25) of 65 | > Robert D. Cousins, James T. Linnemann and Jordan Tucker, NIM A 595 (2008) 480– 501; [arXiv:physics/0702156](http://arxiv.org/abs/physics/0702156). 66 | 67 | after making the replacements `n=bExp` and `m=bExp*tau`. 68 | 69 | ## Validation 70 | 71 | This code could use more validation, but there are a series of tests that run that check against results from the mathematica notebook and the equivalent HistFactory example. 72 | The HistFactory validation is in the directory `validation` and includes: 73 | * A HistFactory model in xml that defines the statistical model above 74 | * The top-level script `makeHists.C` that writes histograms to file `data/histograms.root` based on the values of `bExp` and `deltaB`, then runs HistFactory's `hist2workspace` + `RooStats/StandardHypoTestInvDemo.C` with the `AsymptoticCalculator` using the 1-sided profile likelihood ratio test statistic and CLs=True. 75 | 76 | 77 | ## To Do 78 | 79 | This is a work in progress! 80 | * C++ to be updated to use Brent q root finding instead of simple scan 81 | * remove ROOT dependency in C++ verison entirely? 82 | * add +/- 1,2 sigma bands for the expected upper limit 83 | * could do same for observed upper limit. 84 | * add a Mathematica version 85 | 86 | Extension: 87 | * Include uncertainty on signal efficiency for upper limit. Those equations are big! (See ExpectedLimitWithSignalUncert.nb) 88 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsigMC.cc: -------------------------------------------------------------------------------- 1 | // Program to illustrate simple statistical test 2 | // Glen Cowan, RHUL Physics, June 2010 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include "Experiment.h" 15 | 16 | using namespace std; 17 | 18 | int main(){ 19 | 20 | // Open output file (apparently needs to be done before booking) 21 | 22 | TFile* file = new TFile("medsigMC.root", "recreate"); 23 | 24 | // Book histograms 25 | 26 | TH1D* h_q0 = new TH1D("h_q0", "q0", 400, 0., 40.); 27 | 28 | // Create a TRandom3 object to generate random numbers 29 | 30 | int seed = 12345; 31 | TRandom3* ran = new TRandom3(seed); 32 | 33 | int numSigval = 3; 34 | vector sigVec(numSigval); 35 | sigVec[0] = 0.5; 36 | sigVec[1] = 1.0; 37 | sigVec[2] = 2.0; 38 | 39 | vector relSigVec(numSigval); 40 | relSigVec[0] = 0.2; 41 | relSigVec[1] = 0.5; 42 | relSigVec[2] = 1.0; 43 | 44 | vector tauVec(numSigval); 45 | tauVec[0] = 0.5; 46 | tauVec[1] = 1.0; 47 | tauVec[2] = 2.0; 48 | 49 | double s = 5.; 50 | 51 | double bMin = 0.1; 52 | double bMax = 100; 53 | double logbMin = log(bMin)/log(10); 54 | double logbMax = log(bMax)/log(10); 55 | int numBval = 20; 56 | 57 | vector Z_naive(numSigval); 58 | vector Z_wald(numSigval); 59 | vector meanZ0(numSigval); // sqrt(q0) 60 | vector medZ0(numSigval); // sqrt(q0) 61 | vector medZ0MC(numSigval); // exact 62 | vector Z_bi(numSigval); // Asimov w/ binomial 63 | 64 | for (int i=0; i(i) / 66 | static_cast(numBval-1) + logbMin; 67 | double b = pow(10., logb); 68 | 69 | for (int j=0; j 0 ) { tau = b / (sig*sig); } 76 | 77 | // double tau = tauVec[j]; 78 | // double sig = sqrt(b/tau); 79 | 80 | Z_naive[j] = s/sqrt(b + sig*sig); 81 | double p_bi = TMath::BetaIncomplete(1./(1.+tau), s+b, tau*b + 1.); 82 | Z_bi[j] = TMath::NormQuantile(1. - p_bi); 83 | if ( sig == 0 ) { 84 | Z_wald[j] = sqrt( 2.*((s + b)*log(1. + s/b) - s) ); 85 | } 86 | else { 87 | double X = (s+b)*log( (s+b)*(b+sig*sig)/(b*b + (s+b)*sig*sig) ); 88 | double Y = (b*b/(sig*sig))*log(1. + sig*sig*s/(b*(b+sig*sig))); 89 | Z_wald[j] = sqrt(2.*(X - Y)); 90 | } 91 | 92 | Experiment exper(s, b, tau, ran); 93 | int numExp = 101; 94 | int middle = (numExp - 1)/2; 95 | vector Z0Vec; 96 | vector Z0MCVec; 97 | for (int k=0; k 0. ) { Z0 = sqrt(q0); } 102 | 103 | double Z0MC = exper.Z0(); 104 | // cout << s << " " << b << " " << exper.n() << " " << exper.m() 105 | // << " " << Z0 << " " << Z0MC << endl; 106 | 107 | 108 | if ( j == 3 && i == 40 ) { 109 | h_q0->Fill(q0); 110 | int n = exper.n(); 111 | int m = exper.m(); 112 | double bHat = static_cast(m)/tau; 113 | // cout << b << " " << tau << " " << bHat << " " 114 | // << n << " " << m << " " << q0 << " " << Z0 << endl; 115 | } 116 | Z0Vec.push_back(Z0); 117 | Z0MCVec.push_back(Z0MC); 118 | // if ( k%10 == 0 ) { cout << "generated exp " << k+1 << endl; } 119 | } 120 | sort(Z0Vec.begin(), Z0Vec.end()); 121 | medZ0[j] = Z0Vec[middle]; 122 | sort(Z0MCVec.begin(), Z0MCVec.end()); 123 | medZ0MC[j] = Z0MCVec[middle]; 124 | 125 | 126 | 127 | 128 | } 129 | 130 | cout << b << " " << Z_naive[0] << " " << 131 | Z_naive[1] << " " << Z_naive[2] << " " << 132 | Z_wald[0] << " " << Z_wald[1] << " " << 133 | Z_wald[2] << " " << medZ0[0] << " " << 134 | medZ0[1] << " " << medZ0[2] << " " << 135 | medZ0MC[0] << " " << medZ0MC[1] << " " << 136 | medZ0MC[2] << " " << Z_bi[0] << " " << 137 | Z_bi[1] << " " << Z_bi[2] << " " << endl; 138 | 139 | } 140 | 141 | // Store all histograms in the output file and close up 142 | 143 | file->Write(); 144 | file->Close(); 145 | 146 | return 0; 147 | } 148 | -------------------------------------------------------------------------------- /validation/med_sig_checks/Experiment.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "Experiment.h" 12 | 13 | using namespace std; 14 | 15 | Experiment::Experiment(double s, double b, double tau, TRandom3* ran){ 16 | m_s = s; 17 | m_b = b; 18 | m_tau = tau; 19 | m_n = -1; // negative data value indicates not yet generated 20 | m_m = -1; 21 | m_nd = -1.; 22 | m_md = -1.; 23 | m_ran = ran; 24 | } 25 | 26 | void Experiment::generateData(double s, double b, double tau){ 27 | m_n = m_ran->Poisson(s+b); 28 | m_nd = static_cast(m_n); 29 | m_m = m_ran->Poisson(tau*b); 30 | m_md = static_cast(m_m); 31 | } 32 | 33 | double Experiment::lnL(int n, int m, double s, double b, double tau){ 34 | double nd = static_cast(n); 35 | double md = static_cast(m); 36 | double A = 0.; 37 | if ( n != 0 ) { A = nd*log(s + b); } 38 | double B = 0.; 39 | if ( m != 0 ) { B = md*log(tau*b); } 40 | double logL = A - (s + b) + B - tau*b; 41 | return logL; 42 | } 43 | 44 | double Experiment::lnL(int n, int m){ // uses object's values of s, b, tau 45 | double s = m_s; 46 | double b = m_b; 47 | double tau = m_tau; 48 | return this->lnL(n, m, s, b, tau); 49 | } 50 | 51 | double Experiment::q0(int n, int m){ 52 | double s = m_s; 53 | double b = m_b; 54 | double tau = m_tau; 55 | double nd = static_cast(n); 56 | double md = static_cast(m); 57 | double bHatHat0 = (nd + md)/(1. + m_tau); 58 | double bHat = md/m_tau; 59 | double sHat = nd - bHat; 60 | double lnLambda0 = this->lnL(n, m, 0, bHatHat0, tau) - 61 | this->lnL(n, m, sHat, bHat, tau); 62 | double qZero = 0.; 63 | if ( sHat > 0. ) { 64 | qZero = - 2.*lnLambda0; 65 | } 66 | return qZero; 67 | } 68 | 69 | double Experiment::q0(){ 70 | int n = m_n; 71 | int m = m_m; 72 | return this->q0(n, m); 73 | } 74 | 75 | int Experiment::Ntot(double sigrel){ 76 | 77 | // sigrel = specified relative accuracy for Z 78 | // return value is number of MC iterations needed to achieve this 79 | 80 | const double pi = 3.14159265; 81 | const double rootTwoPi = sqrt(2.*pi); 82 | double q0Obs = this->q0(); // based on m_n and m_m 83 | double Z = sqrt(q0Obs); // Asymptotic value 84 | double p = 1. - TMath::Freq(Z); 85 | double u = -2.*log(rootTwoPi*p); 86 | double dZdp = (1 - u)/(u*p*Z); 87 | double N = dZdp*dZdp*p*(1.-p)/(Z*Z*sigrel*sigrel); 88 | int ntot = static_cast(N); 89 | // cout << "q0obs, ntot = " << q0Obs << " " << ntot << endl; 90 | return ntot; 91 | } 92 | 93 | double Experiment::Z0(){ 94 | 95 | const double pi = 3.14159265; 96 | const double rootTwoPi = sqrt(2.*pi); 97 | 98 | // computes p-value of s=0 using objects vales 99 | // of m_n and m_m 100 | 101 | int ntotMin = 1000; 102 | int nq0HigherMin = 5; 103 | int ntotMax = 40000000; 104 | double ZCut = 5.5; // for ZAsymp > ZCut, use ZAsymp 105 | 106 | double q0Obs = this->q0(); // based on m_n and m_m 107 | double ZAsymp = sqrt(q0Obs); 108 | double Z = 999.; 109 | 110 | // cout << "n, m, ZAsymp" << " " << m_n << " " << m_m << " " 111 | // << ZAsymp << endl; 112 | 113 | if ( m_n == 0 ) { 114 | Z = 0.; // no discovery if n = 0 115 | } 116 | else if ( ZAsymp >= ZCut ) { 117 | Z = ZAsymp; // this should not happen more than half the time 118 | } 119 | else { 120 | int nq0Higher = 0; 121 | // bool stopLoop = false; 122 | 123 | // estimate how many iterations needed to find Z to within 124 | // a specified relative uncertainty, sigrel. 125 | 126 | double sigrel = 0.01; 127 | int ntot = this->Ntot(sigrel); 128 | // cout << "n, m, ZAsymp, ntot = " << m_n << " " << m_m << " " << 129 | // ZAsymp << " " << ntot << endl; 130 | 131 | if ( ntot < ntotMin ) { ntot = ntotMin; } 132 | if ( ntot > ntotMax ) { ntot = ntotMax; } 133 | 134 | // while ( !stopLoop ) { 135 | for (int i=0; iPoisson(m_b); // bkg-only 137 | int m = m_ran->Poisson(m_tau*m_b); 138 | double qZero = this->q0(n, m); 139 | if ( qZero >= q0Obs ) { nq0Higher++; } 140 | 141 | 142 | /// ntot++; 143 | // double sigmaZ_over_Z = 999.; 144 | // if ( ntot%1000 == 0 && nq0Higher >= 1 ) { 145 | // double p = static_cast(nq0Higher)/static_cast(ntot); 146 | // double u = -2.*log(rootTwoPi*p); 147 | // double Z = sqrt(u - log(u)); 148 | // double Vp = p*(1.-p) / static_cast(ntot); 149 | // double dZdp = (1 - u)/(u*p*Z); 150 | // double VZ = dZdp*dZdp*Vp; 151 | // sigmaZ_over_Z = sqrt(VZ)/Z; 152 | 153 | } 154 | // stopLoop = sigmaZ_over_Z < 0.02; 155 | 156 | // stopLoop = (ntot >= ntotMin && nq0Higher >= nq0HigherMin) 157 | // || ntot >= ntotMax; 158 | 159 | double one_minus_p0 = static_cast(ntot-nq0Higher) / 160 | static_cast(ntot); 161 | 162 | Z = 0.; 163 | if ( one_minus_p0 >= 1. ) { 164 | Z = 999.; 165 | } 166 | else if ( one_minus_p0 <= 0. ) { 167 | Z = -999.; 168 | } 169 | else { 170 | Z = ROOT::Math::normal_quantile(one_minus_p0, 1.); 171 | } 172 | 173 | } 174 | 175 | // cout << "ntot, nq0Higher = " << ntot << " " << nq0Higher << endl; 176 | // cout << "returning Z = " << Z << endl; 177 | 178 | return Z; 179 | 180 | } 181 | -------------------------------------------------------------------------------- /docs/FastAsimovUtils.cxx: -------------------------------------------------------------------------------- 1 | // Author: Kyle Cranmer October 2014 2 | /************************************************************************* 3 | * Copyright (C) Kyle Cranmer 4 | _ License LGPL v2.1 (for ROOT compatibility, happy to make it BSD for other purposes) _ 5 | 6 | This code quickly calculates the expected 95% CLs upper limit on the number of 7 | signal events, s, given an expected background, bExp, and 8 | uncertainty on the background estimate, deltaB. 9 | The background uncertainty is absolute (not relative) and is uncertainty 10 | on the mean background (so you don't include sqrt(bExp) Poisson fluctuatiosn in this number). 11 | Example Usage: 12 | * you expect 50 +/- 3 background events 13 | * ExpectedLimit(50,3) 14 | * returns s_95 = 13.4 events 15 | 16 | Similar code for expected discovery significance is also included 17 | Example Usage: 18 | * you expect 50 +/- 7 background events 19 | * ExpectedLimit(50,7) 20 | * returns s_95 = 19.7 events 21 | 22 | The derivations of these formulae are based on a statistical model: 23 | Pois(n | s+b ) * Pois(m | tau * b) 24 | The tau quantity is calculated from tau=bExp/deltaB/deltaB. 25 | See arXiv:physics/0702156 for motivation of this model. 26 | The maximum likelihood estimate and conditional maximum likelihood estimate 27 | were solved analytically and coded here. 28 | The log-likelihood ratio and the profile log likelihood ratio follow immediately. 29 | The b-only and s+b p-values needed for CLs are calculated using the 30 | asymptotic distributions in 31 | Cowan, Cranmer, Gross, Vitells, 32 | Eur. Phys. J. C 71 (2011) 1554. 33 | arXiv:1007.1727. 34 | The ExpectedSignificance formulae was derived by Cowan and the numerical solution 35 | for the Expected upper limit was written by Cranmer as correlaries to that paper. 36 | 37 | Note, the ExpectedSignificance euqation is the same as Eq.(17) of 38 | Tipei Li and Yuqian Ma, Astrophysical Journal 272 (1983) 317–324. 39 | and Eq.(25) of 40 | Robert D. Cousins, James T. Linnemann and Jordan Tucker, NIM A 595 (2008) 480– 501; arXiv:physics/0702156. 41 | after making the replacements `n=bExp` and `m=bExp*tau`. 42 | 43 | *************************************************************************/ 44 | 45 | 46 | #ifndef ROOT_Math_DistFuncMathCore 47 | #include"Math/DistFuncMathCore.h" 48 | #endif 49 | #include 50 | 51 | double bhathat(double n, double m, double s, double tau){ 52 | return (m+n-s-s*tau + sqrt(4*m*s*(1+tau) + pow(s+s*tau-m-n,2) ) ) / (2 * (1+tau )) ; 53 | } 54 | 55 | double shat(double n, double m, double tau){ 56 | return (n*tau -m )/tau; 57 | } 58 | 59 | double bhat(double n, double m, double tau){ 60 | return m/tau; 61 | } 62 | 63 | 64 | double logL(double n, double m, double s, double b, double tau){ 65 | return (s+b) - n * log(s+b) + (tau*b) - m * log(tau*b); 66 | } 67 | 68 | double logLambda(double n, double m, double s, double tau){ 69 | return logL(n, m, s, bhathat(n,m,s,tau), tau) 70 | - logL(n,m,shat(n,m,tau), bhat(n,m,tau), tau); 71 | } 72 | 73 | double sigma(double n, double m, double s, double tau){ 74 | double fisher = 8*m*n*pow(1+tau,2)* 75 | (m*m+2*m*n+n*n+m*s-n*s+m*s*tau-n*s*tau+(n+m)*sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2))) 76 | /sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)) 77 | /pow(m+n-s-s*tau+sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)),2) 78 | /pow(m+n+s+s*tau+sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)),2) ; 79 | //from asimov approach 80 | if(s>0 && logLambda(n,m,s,tau) > 0 ) 81 | return s/sqrt(2.*logLambda(n,m,s,tau)); 82 | else 83 | return 1./sqrt(fisher) ; 84 | 85 | } 86 | 87 | double F(double qmu, double mu, double muprime, double sigma){ 88 | if(qmu < mu*mu/sigma/sigma){ 89 | //print "s = ", mu, "using first part", qmu, " ", sigma 90 | //print "debug ", sqrt(qmu), (mu-muprime)/sigma 91 | return ROOT::Math::normal_cdf(sqrt(qmu)-(mu-muprime)/sigma); 92 | } else{ 93 | //print "s = ", mu, "using second part", qmu, " ", sigma 94 | return ROOT::Math::normal_cdf( (qmu-(mu*mu-2*mu*muprime)/sigma/sigma) / (2*mu/sigma) ); 95 | } 96 | } 97 | 98 | double CLs(double n, double m, double s, double tau){ 99 | double qmu = 2*logLambda(n,m,s,tau); 100 | double sig = sigma(n,m,s,tau); 101 | if(shat(n,m,tau) > s) 102 | qmu=0.; 103 | 104 | return (1.-F(qmu,s,s,sig))/(1.-F(qmu,s,0,sig)); 105 | } 106 | 107 | // function class with a member function for root finder 108 | struct CLsHelper { 109 | double n=0; 110 | double m=0; 111 | double tau=0; 112 | double evalCLs (double s ) const { 113 | return CLs(n,m,s,tau); 114 | } 115 | }; 116 | 117 | 118 | double ExpectedLimit(double bExp, double deltaB) { 119 | 120 | double tau = bExp/deltaB/deltaB; 121 | 122 | double s=0.1; 123 | while(CLs(bExp,bExp*tau,s,tau) > 0.05 ) 124 | s+=0.01; 125 | //cout << "Approximate expected 95% CLs upper-limit = " << s << endl; 126 | 127 | /* 128 | // to do, add a real root finder algorithm here 129 | CLsHelper helper; 130 | helper.n=bExp; 131 | helper.m=bExp*tau; 132 | helper.tau=tau; 133 | 134 | ROOTMathFunctor1D thisFunc(helper, &(helper.evalCLs)); 135 | 136 | ROOTMathFunctor1D f1D(&thisFunc); 137 | 138 | ROOTMathBrentRootFinder brf; 139 | brf.SetFunction(f1D); 140 | */ 141 | return s; 142 | 143 | } 144 | 145 | 146 | double ExpectedSignificance(double s, double b, double deltaB){ 147 | // same idea, but this is expected significance (in sigma) 148 | return sqrt(2*( (s+b)*log( ((s+b)*(b+deltaB*deltaB)) / (b*b+(s+b)*deltaB*deltaB) ) 149 | -( b*b/deltaB/deltaB)*log(1.+ (s*deltaB*deltaB)/(b*(b+deltaB*deltaB)) ) 150 | ) 151 | ); 152 | } 153 | 154 | void tests(){ 155 | 156 | if( shat(100,50,1)==50) 157 | cout << "ok" << endl; 158 | else 159 | cout << "oops" << endl; 160 | 161 | if( bhat(100,50,1)==50) 162 | cout << "ok" << endl; 163 | else 164 | cout << "oops" << endl; 165 | 166 | if( bhathat(100,50,50,1)==50) 167 | cout << "ok" << endl; 168 | else 169 | cout << "oops" << endl; 170 | 171 | if( 12.2 < sigma(100,50,50,1) && sigma(100,50,50,1) <12.3) 172 | cout << "ok" << endl; 173 | else 174 | cout << "oops" << endl; 175 | 176 | if( logLambda(100,50,50,1)==0) 177 | cout << "ok" << endl; 178 | else 179 | cout << "oops" << endl; 180 | 181 | if(ExpectedSignificance(50,100,10)>3. && ExpectedSignificance(50,100,10)<3.2) 182 | cout << "ok" << "approximate significance for s=50,b=100+/-10 is" << ExpectedSignificance(50,100,10) << endl; 183 | else 184 | cout << "oops" << endl; 185 | 186 | if(ExpectedLimit(50,7)>19.7 && ExpectedLimit(50,7)<19.8 ) 187 | cout << "ok " << "approximate limit for 50+/-7 is " << ExpectedLimit(50,7) << endl; 188 | else 189 | cout << "oops" << endl; 190 | 191 | if( ExpectedLimit(100,.1)>20. && ExpectedLimit(100,.1)<21 ) 192 | cout << "ok " << "approximate limit for 100+/-0.1 is " << ExpectedLimit(100,0.1) << endl; 193 | else 194 | cout << "oops" << endl; 195 | 196 | if( ExpectedLimit(50,50)>51 && ExpectedLimit(50,50)<53 ) 197 | cout << "ok " << "approximate limit for 50+/-50 is " << ExpectedLimit(50,50) << endl; 198 | else 199 | cout << "oops" << endl; 200 | 201 | } 202 | 203 | -------------------------------------------------------------------------------- /validation/config/HistFactorySchema.dtd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 10 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 53 | 54 | 55 | 56 | 57 | 58 | 62 | 63 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 81 | 82 | 87 | 88 | 89 | 93 | 94 | 95 | 96 | 97 | 104 | 105 | 106 | 107 | 113 | 114 | 115 | 125 | 126 | 127 | 128 | 133 | 134 | 135 | 136 | 143 | 144 | 145 | 146 | 153 | 154 | 155 | 156 | 157 | 164 | 165 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s10_rel_bi.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-2.0 EPSF-2.0 2 | %%BoundingBox: 0 0 567 539 3 | %%Title: medsig_s10_rel_bi.eps: canvas 4 | %%Creator: ROOT Version 5.34/14 5 | %%CreationDate: Tue May 13 22:33:32 2014 6 | %%EndComments 7 | %%BeginProlog 8 | 80 dict begin 9 | /s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def 10 | /r {rotate} def /rl {roll} def /R {repeat} def 11 | /d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def 12 | /c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def 13 | /cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def 14 | /box {m dup 0 exch d exch 0 d 0 exch neg d cl} def 15 | /NC{systemdict begin initclip end}def/C{NC box clip newpath}def 16 | /bl {box s} def /bf {box f} def /Y { 0 exch d} def /X { 0 d} def 17 | /K {{pop pop 0 moveto} exch kshow} bind def 18 | /ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def 19 | /mp {newpath /y exch def /x exch def} def 20 | /side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def 21 | /mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def 22 | /mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def 23 | /mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def 24 | /m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def 25 | /m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def 26 | /m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def 27 | /m28 {mp x w2 sub y w2 sub w3 add m w3 0 d 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d 0 w3 neg d w3 neg 0 d cl s } def 28 | /m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t 4 {side} repeat cl fill gr} def 29 | /m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t 4 {side} repeat cl s gr} def 30 | /m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d x w2 sub y w2 add m w w neg d x w2 sub y w2 sub m w w d s} def 31 | /m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def 32 | /m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def 33 | /m34 {mp x w2 sub y w2 sub w3 add m w3 0 d 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d 0 w3 neg d w3 neg 0 d cl f } def 34 | /m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def 35 | /m5 {mp x w2 sub y w2 sub m w w d x w2 sub y w2 add m w w neg d s} def 36 | /reEncode {exch findfont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse } forall /Encoding exch def currentdict end dup /FontName get exch definefont pop } def [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica /Helvetica-Oblique 37 | /Helvetica-Bold /Helvetica-BoldOblique /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi /Bookman-DemiItalic /Bookman-Light 38 | /Bookman-LightItalic /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic /Palatino-Bold 39 | /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman ] {ISOLatin1Encoding reEncode } forall 40 | %%EndProlog 41 | %%BeginSetup 42 | %%EndSetup 43 | newpath gsave .25 .25 scale gsave 0 0 t black[ ] 0 sd 3 lw 1 1 1 c 2268 2158 0 0 bf black 1 1 1 c 1814 1640 340 367 bf black 1814 1640 340 367 bl 340 367 m 1814 X s 44 | gsave 2268 2158 0 0 C 2098.55 118.872 t 0 r /Helvetica findfont 100.584 sf 0 0 m (b) show NC gr 340 393 m -26 Y s 45 | gsave 2268 2158 0 0 C 365.761 278.893 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (\2551) show NC gr 46 | gsave 2268 2158 0 0 C 256.033 233.172 t 0 r /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 522 380 m -13 Y s 629 380 m -13 Y s 704 380 m -13 Y s 763 380 m -13 Y s 811 380 m -13 Y s 851 380 m -13 Y s 886 380 m -13 Y s 917 380 m -13 Y s 945 47 | 393 m -26 Y s 48 | gsave 2268 2158 0 0 C 944.882 231.984 t 0 r -28 0 t /Helvetica findfont 100.584 sf 0 0 m (1) show NC gr 1127 380 m -13 Y s 1233 380 m -13 Y s 1309 380 m -13 Y s 1368 380 m -13 Y s 1415 380 m -13 Y s 1456 380 m -13 Y s 1491 380 m -13 Y s 1522 380 49 | m -13 Y s 1550 393 m -26 Y s 50 | gsave 2268 2158 0 0 C 1549.61 231.984 t 0 r -56 0 t /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 1732 380 m -13 Y s 1838 380 m -13 Y s 1914 380 m -13 Y s 1972 380 m -13 Y s 2020 380 m -13 Y s 2061 380 m -13 Y s 2096 380 m -13 Y s 2127 380 51 | m -13 Y s 2154 393 m -26 Y s 52 | gsave 2268 2158 0 0 C 2189.99 278.893 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (2) show NC gr 53 | gsave 2268 2158 0 0 C 2080.26 233.172 t 0 r /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 340 367 m 1640 Y s 54 | gsave 2268 2158 0 0 C 164.592 1623.06 t 90 r /Helvetica findfont 100.584 sf 0 0 m (med[Z|s]) show NC gr 366 367 m -26 X s 366 777 m -26 X s 366 1187 m -26 X s 366 1597 m -26 X s 366 2007 m -26 X s 55 | gsave 2268 2158 0 0 C 269.749 333.757 t 0 r /Helvetica findfont 100.584 sf 0 0 m (0) show NC gr 56 | gsave 2268 2158 0 0 C 269.749 736.094 t 0 r /Helvetica findfont 100.584 sf 0 0 m (2) show NC gr 57 | gsave 2268 2158 0 0 C 269.749 1147.57 t 0 r /Helvetica findfont 100.584 sf 0 0 m (4) show NC gr 58 | gsave 2268 2158 0 0 C 269.749 1563.63 t 0 r /Helvetica findfont 100.584 sf 0 0 m (6) show NC gr 59 | gsave 2268 2158 0 0 C 269.749 1970.54 t 0 r /Helvetica findfont 100.584 sf 0 0 m (8) show NC gr 1 0 0 c[ 12 12] 0 sd 6 lw black 1 0 0 c 1049 2007 m 55 -179 d s 1104 1828 m 96 -260 d 95 -220 d 95 -186 d 96 -157 d 95 -132 d 96 -110 d 95 -91 d 96 -74 60 | d 95 -59 d 96 -46 d 95 -34 d s black 1 0 0 c 994 2007 m 15 -59 d s 1009 1948 m 95 -327 d 96 -274 d 95 -226 d 95 -183 d 96 -146 d 95 -113 d 96 -86 d 95 -64 d 96 -47 d 95 -34 d 96 -24 d 95 -17 d s 0 0 1 c[ ] 0 sd black 0 0 1 c 419 2007 m 17 -15 d s 61 | 436 1992 m 95 -90 d 96 -93 d 95 -96 d 96 -100 d 95 -102 d 96 -104 d 95 -105 d 96 -106 d 95 -105 d 95 -102 d 96 -97 d 95 -91 d 96 -83 d 95 -73 d 96 -63 d 95 -52 d 96 -42 d 95 -32 d s black 0 0 1 c 340 1933 m 96 -93 d 95 -98 d 96 -101 d 95 -105 d 96 62 | -109 d 95 -111 d 96 -112 d 95 -112 d 96 -109 d 95 -104 d 95 -96 d 96 -86 d 95 -74 d 96 -62 d 95 -49 d 96 -39 d 95 -29 d 96 -22 d 95 -16 d s black[ 12 12] 0 sd[ ] 0 sd 3 lw /w 29 def /w2 {w 2 div} def /w3 {w 3 div} def 531 1960 627 1811 722 1828 818 63 | 1693 913 1558 1009 1397 1104 1275 1200 1186 1295 1108 1390 983 1486 908 1581 799 1677 694 1772 693 1868 565 1963 504 2059 495 2154 460 18 { m20} R[ 12 12] 0 sd 6 lw[ ] 0 sd 3 lw 340 1908 436 1912 531 1846 627 1694 722 1593 818 1501 913 1370 1009 64 | 1255 1104 1077 1200 930 1295 812 1390 749 1486 683 1581 629 1677 556 1772 551 1868 432 1963 506 2059 379 2154 375 20 { m20} R[ 12 12] 0 sd 6 lw[ ] 0 sd 3 lw 1 1 1 c 952 539 1202 1036 bf black 65 | gsave 2268 2158 0 0 C 1924.82 1481.33 t 0 r /Helvetica-Bold findfont 68.5801 sf 0 0 m (2) show NC gr 66 | gsave 2268 2158 0 0 C 1924.82 1417.32 t 0 r /Helvetica-Bold findfont 68.5801 sf 0 0 m (b) show NC gr 67 | gsave 2268 2158 0 0 C 1865.38 1449.33 t 0 r /Symbol findfont 100.584 sf 0 0 m (s) show NC gr 68 | gsave 2268 2158 0 0 C 1673.36 1449.33 t 0 r /Helvetica-Bold findfont 100.584 sf 0 0 m (b + ) show NC gr 6 lw 1628 1532 m 18 -119 d s 3 lw 1646 1413 m 18 146 d s 1664 1559 m 302 X s 69 | gsave 2268 2158 0 0 C 1435.61 1449.33 t 0 r /Helvetica-Bold findfont 100.584 sf 0 0 m ( s / ) show NC gr 1 0 0 c[ 12 12] 0 sd 6 lw 1238 1485 m 166 X s black 70 | gsave 2268 2158 0 0 C 1549.91 1239.01 t 0 r /Helvetica-Bold findfont 68.5801 sf 0 0 m (A) show NC gr 71 | gsave 2268 2158 0 0 C 1435.61 1266.45 t 0 r /Helvetica-Bold findfont 100.584 sf 0 0 m ( Z) show NC gr 0 0 1 c[ ] 0 sd 1238 1306 m 166 X s black 72 | gsave 2268 2158 0 0 C 1435.61 1088.14 t 0 r /Helvetica-Bold findfont 100.584 sf 0 0 m ( Monte Carlo) show NC gr 3 lw 1321 1126 m20 6 lw 73 | gsave 2268 2158 0 0 C 1229.87 1664.21 t 0 r /Helvetica findfont 100.584 sf 0 0 m (/b = 0.2, 0.5) show NC gr 74 | gsave 2268 2158 0 0 C 1193.29 1632.21 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (b) show NC gr 75 | gsave 2268 2158 0 0 C 1133.86 1664.21 t 0 r /Symbol findfont 100.584 sf 0 0 m (s) show NC gr 76 | gsave 2268 2158 0 0 C 1133.86 1837.95 t 0 r /Helvetica findfont 100.584 sf 0 0 m (s = 10) show NC gr 3 lw 340 367 m 1814 X s 2154 367 m 1640 Y s 340 2007 m 1814 X s 340 367 m 1640 Y s 77 | gr gr showpage 78 | end 79 | %%EOF 80 | -------------------------------------------------------------------------------- /validation/med_sig_checks/medsig_s5_rel_bi.eps: -------------------------------------------------------------------------------- 1 | %!PS-Adobe-2.0 EPSF-2.0 2 | %%BoundingBox: 0 0 567 539 3 | %%Title: medsig_s5_rel_bi.eps: canvas 4 | %%Creator: ROOT Version 5.34/14 5 | %%CreationDate: Fri Jun 20 09:18:25 2014 6 | %%EndComments 7 | %%BeginProlog 8 | 80 dict begin 9 | /s {stroke} def /l {lineto} def /m {moveto} def /t {translate} def 10 | /r {rotate} def /rl {roll} def /R {repeat} def 11 | /d {rlineto} def /rm {rmoveto} def /gr {grestore} def /f {eofill} def 12 | /c {setrgbcolor} def /black {0 setgray} def /sd {setdash} def 13 | /cl {closepath} def /sf {scalefont setfont} def /lw {setlinewidth} def 14 | /box {m dup 0 exch d exch 0 d 0 exch neg d cl} def 15 | /NC{systemdict begin initclip end}def/C{NC box clip newpath}def 16 | /bl {box s} def /bf {box f} def /Y { 0 exch d} def /X { 0 d} def 17 | /K {{pop pop 0 moveto} exch kshow} bind def 18 | /ita {/ang 15 def gsave [1 0 ang dup sin exch cos div 1 0 0] concat} def 19 | /mp {newpath /y exch def /x exch def} def 20 | /side {[w .77 mul w .23 mul] .385 w mul sd w 0 l currentpoint t -144 r} def 21 | /mr {mp x y w2 0 360 arc} def /m24 {mr s} def /m20 {mr f} def 22 | /mb {mp x y w2 add m w2 neg 0 d 0 w neg d w 0 d 0 w d cl} def 23 | /mt {mp x y w2 add m w2 neg w neg d w 0 d cl} def 24 | /m21 {mb f} def /m25 {mb s} def /m22 {mt f} def /m26{mt s} def 25 | /m23 {mp x y w2 sub m w2 w d w neg 0 d cl f} def 26 | /m27 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl s} def 27 | /m28 {mp x w2 sub y w2 sub w3 add m w3 0 d 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d 0 w3 neg d w3 neg 0 d cl s } def 28 | /m29 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t 4 {side} repeat cl fill gr} def 29 | /m30 {mp gsave x w2 sub y w2 add w3 sub m currentpoint t 4 {side} repeat cl s gr} def 30 | /m31 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d x w2 sub y w2 add m w w neg d x w2 sub y w2 sub m w w d s} def 31 | /m32 {mp x y w2 sub m w2 w d w neg 0 d cl s} def 32 | /m33 {mp x y w2 add m w3 neg w2 neg d w3 w2 neg d w3 w2 d cl f} def 33 | /m34 {mp x w2 sub y w2 sub w3 add m w3 0 d 0 w3 neg d w3 0 d 0 w3 d w3 0 d 0 w3 d w3 neg 0 d 0 w3 d w3 neg 0 d 0 w3 neg d w3 neg 0 d cl f } def 34 | /m2 {mp x y w2 sub m 0 w d x w2 sub y m w 0 d s} def 35 | /m5 {mp x w2 sub y w2 sub m w w d x w2 sub y w2 add m w w neg d s} def 36 | /reEncode {exch findfont dup length dict begin {1 index /FID eq {pop pop} {def} ifelse } forall /Encoding exch def currentdict end dup /FontName get exch definefont pop } def [/Times-Bold /Times-Italic /Times-BoldItalic /Helvetica /Helvetica-Oblique 37 | /Helvetica-Bold /Helvetica-BoldOblique /Courier /Courier-Oblique /Courier-Bold /Courier-BoldOblique /Times-Roman /AvantGarde-Book /AvantGarde-BookOblique /AvantGarde-Demi /AvantGarde-DemiOblique /Bookman-Demi /Bookman-DemiItalic /Bookman-Light 38 | /Bookman-LightItalic /Helvetica-Narrow /Helvetica-Narrow-Bold /Helvetica-Narrow-BoldOblique /Helvetica-Narrow-Oblique /NewCenturySchlbk-Roman /NewCenturySchlbk-Bold /NewCenturySchlbk-BoldItalic /NewCenturySchlbk-Italic /Palatino-Bold 39 | /Palatino-BoldItalic /Palatino-Italic /Palatino-Roman ] {ISOLatin1Encoding reEncode } forall 40 | %%EndProlog 41 | %%BeginSetup 42 | %%EndSetup 43 | newpath gsave .25 .25 scale gsave 0 0 t black[ ] 0 sd 3 lw 1 1 1 c 2268 2158 0 0 bf black 1 1 1 c 1814 1640 340 367 bf black 1814 1640 340 367 bl 340 367 m 1814 X s 44 | gsave 2268 2158 0 0 C 2098.55 118.872 t 0 r /Helvetica findfont 100.584 sf 0 0 m (b) show NC gr 340 393 m -26 Y s 45 | gsave 2268 2158 0 0 C 365.761 278.893 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (\2551) show NC gr 46 | gsave 2268 2158 0 0 C 256.033 233.172 t 0 r /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 522 380 m -13 Y s 629 380 m -13 Y s 704 380 m -13 Y s 763 380 m -13 Y s 811 380 m -13 Y s 851 380 m -13 Y s 886 380 m -13 Y s 917 380 m -13 Y s 945 47 | 393 m -26 Y s 48 | gsave 2268 2158 0 0 C 944.882 231.984 t 0 r -28 0 t /Helvetica findfont 100.584 sf 0 0 m (1) show NC gr 1127 380 m -13 Y s 1233 380 m -13 Y s 1309 380 m -13 Y s 1368 380 m -13 Y s 1415 380 m -13 Y s 1456 380 m -13 Y s 1491 380 m -13 Y s 1522 380 49 | m -13 Y s 1550 393 m -26 Y s 50 | gsave 2268 2158 0 0 C 1549.61 231.984 t 0 r -56 0 t /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 1732 380 m -13 Y s 1838 380 m -13 Y s 1914 380 m -13 Y s 1972 380 m -13 Y s 2020 380 m -13 Y s 2061 380 m -13 Y s 2096 380 m -13 Y s 2127 380 51 | m -13 Y s 2154 393 m -26 Y s 52 | gsave 2268 2158 0 0 C 2189.99 278.893 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (2) show NC gr 53 | gsave 2268 2158 0 0 C 2080.26 233.172 t 0 r /Helvetica findfont 100.584 sf 0 0 m (10) show NC gr 340 367 m 1640 Y s 54 | gsave 2268 2158 0 0 C 164.592 1623.06 t 90 r /Helvetica findfont 100.584 sf 0 0 m (med[Z|s]) show NC gr 366 367 m -26 X s 366 777 m -26 X s 366 1187 m -26 X s 366 1597 m -26 X s 366 2007 m -26 X s 55 | gsave 2268 2158 0 0 C 269.749 333.757 t 0 r /Helvetica findfont 100.584 sf 0 0 m (0) show NC gr 56 | gsave 2268 2158 0 0 C 269.749 736.094 t 0 r /Helvetica findfont 100.584 sf 0 0 m (2) show NC gr 57 | gsave 2268 2158 0 0 C 269.749 1147.57 t 0 r /Helvetica findfont 100.584 sf 0 0 m (4) show NC gr 58 | gsave 2268 2158 0 0 C 269.749 1563.63 t 0 r /Helvetica findfont 100.584 sf 0 0 m (6) show NC gr 59 | gsave 2268 2158 0 0 C 269.749 1970.54 t 0 r /Helvetica findfont 100.584 sf 0 0 m (8) show NC gr 1 0 0 c[ 12 12] 0 sd 6 lw black 1 0 0 c 696 2007 m 26 -87 d s 722 1920 m 96 -263 d 95 -220 d 96 -184 d 95 -155 d 96 -131 d 95 -110 d 95 -93 d 96 -78 d 60 | 95 -66 d 96 -55 d 95 -46 d 96 -37 d 95 -29 d 96 -23 d 95 -17 d s black 1 0 0 c 678 2007 m 44 -151 d s 722 1856 m 96 -273 d 95 -231 d 96 -194 d 95 -164 d 96 -137 d 95 -113 d 95 -92 d 96 -73 d 95 -56 d 96 -43 d 95 -32 d 96 -23 d 95 -17 d 96 -12 d 95 61 | -9 d s 0 0 1 c[ ] 0 sd black 0 0 1 c 340 1474 m 96 -65 d 95 -66 d 96 -69 d 95 -71 d 96 -72 d 95 -72 d 96 -73 d 95 -73 d 96 -70 d 95 -68 d 95 -64 d 96 -59 d 95 -53 d 96 -47 d 95 -40 d 96 -34 d 95 -27 d 96 -22 d 95 -17 d s black 0 0 1 c 340 1404 m 96 62 | -69 d 95 -71 d 96 -73 d 95 -76 d 96 -77 d 95 -78 d 96 -79 d 95 -76 d 96 -73 d 95 -68 d 95 -61 d 96 -52 d 95 -45 d 96 -35 d 95 -28 d 96 -21 d 95 -16 d 96 -11 d 95 -8 d s black[ 12 12] 0 sd[ ] 0 sd 3 lw /w 29 def /w2 {w 2 div} def /w3 {w 3 div} def 63 | 340 1672 436 1515 531 1312 627 1341 722 1198 818 1095 913 1092 1009 998 1104 883 1200 848 1295 727 1390 750 1486 592 1581 618 1677 576 1772 512 1868 462 1963 454 2059 434 2154 400 20 { m20} R[ 12 12] 0 sd 6 lw[ ] 0 sd 3 lw 340 1523 436 1237 531 64 | 1272 627 1129 722 1072 818 1010 913 942 1009 862 1104 767 1200 696 1295 686 1390 634 1486 564 1581 483 1677 451 1772 435 1868 429 1963 410 18 { m20} R[ 12 12] 0 sd 6 lw[ ] 0 sd 3 lw 2154 395 m20[ 12 12] 0 sd 6 lw[ ] 0 sd 3 lw 1 1 1 c 952 539 1202 65 | 1036 bf black 66 | gsave 2268 2158 0 0 C 1888.24 1481.33 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (2) show NC gr 67 | gsave 2268 2158 0 0 C 1888.24 1417.32 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (b) show NC gr 68 | gsave 2268 2158 0 0 C 1828.8 1449.33 t 0 r /Symbol findfont 100.584 sf 0 0 m (s) show NC gr 69 | gsave 2268 2158 0 0 C 1655.07 1449.33 t 0 r /Helvetica findfont 100.584 sf 0 0 m (b + ) show NC gr 6 lw 1609 1532 m 19 -119 d s 3 lw 1628 1413 m 18 146 d s 1646 1559 m 279 X s 70 | gsave 2268 2158 0 0 C 1435.61 1449.33 t 0 r /Helvetica findfont 100.584 sf 0 0 m ( s / ) show NC gr 1 0 0 c[ 12 12] 0 sd 6 lw 1238 1485 m 166 X s black 71 | gsave 2268 2158 0 0 C 1554.48 1239.01 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (A) show NC gr 72 | gsave 2268 2158 0 0 C 1435.61 1266.45 t 0 r /Helvetica findfont 100.584 sf 0 0 m ( Z) show NC gr 0 0 1 c[ ] 0 sd 1238 1306 m 166 X s black 73 | gsave 2268 2158 0 0 C 1435.61 1088.14 t 0 r /Helvetica findfont 100.584 sf 0 0 m ( Monte Carlo) show NC gr 3 lw 1321 1126 m20 6 lw 74 | gsave 2268 2158 0 0 C 1229.87 1664.21 t 0 r /Helvetica findfont 100.584 sf 0 0 m (/b = 0.2, 0.5) show NC gr 75 | gsave 2268 2158 0 0 C 1193.29 1632.21 t 0 r /Helvetica findfont 68.5801 sf 0 0 m (b) show NC gr 76 | gsave 2268 2158 0 0 C 1133.86 1664.21 t 0 r /Symbol findfont 100.584 sf 0 0 m (s) show NC gr 77 | gsave 2268 2158 0 0 C 1133.86 1837.95 t 0 r /Helvetica findfont 100.584 sf 0 0 m (s = 5) show NC gr 3 lw 340 367 m 1814 X s 2154 367 m 1640 Y s 340 2007 m 1814 X s 340 367 m 1640 Y s 78 | gr gr showpage 79 | end 80 | %%EOF 81 | -------------------------------------------------------------------------------- /validation/med_sig_checks/draw_medsig_s2_rel_bi.C: -------------------------------------------------------------------------------- 1 | // a macro to read in xy data from a file and make a plot 2 | // First run root, then 3 | // .L drawXY.C 4 | // draw() 5 | 6 | 7 | #include "Riostream.h" 8 | void draw() { 9 | 10 | gROOT->Reset(); 11 | 12 | // first make a canvas and a 2D histogram for the axes 13 | 14 | TCanvas* canvas = new TCanvas("canvas", "canvas", 10, 10, 500, 500); 15 | canvas->SetFillColor(0); 16 | canvas->SetBorderMode(0); 17 | canvas->SetFrameBorderMode(0); // need this to turn off red hist frame! 18 | 19 | gROOT->SetStyle("Plain"); 20 | canvas->UseCurrentStyle(); 21 | 22 | gPad->SetLeftMargin(0.15); 23 | gPad->SetRightMargin(0.05); 24 | gPad->SetTopMargin(0.07); 25 | gPad->SetBottomMargin(0.17); 26 | 27 | gStyle->SetOptStat(0); 28 | gStyle->SetTitleBorderSize(0); 29 | gStyle->SetTitleSize(0.04); 30 | 31 | gStyle->SetTextFont(42); 32 | gStyle->SetTextSize(0.04); 33 | gStyle->SetTitleFont(42, "hxy"); // for histogram and axis title 34 | gStyle->SetLabelFont(42, "xyz"); // for axis labels (values) 35 | 36 | gStyle->SetTitleOffset(0.8, "h"); // what does this do? 37 | gStyle->SetTitleX(0.15); 38 | gStyle->SetTitleY(0.99); 39 | 40 | gROOT->ForceStyle(); 41 | 42 | // can make histogram or alternatively use the histograms automatically 43 | // connected to the TF1 or TGraph objects 44 | 45 | double xMin = 0.1; 46 | double xMax = 100.; 47 | // double yMin = 0.1; 48 | // double yMax = 10.; 49 | double yMin = 0.; 50 | double yMax = 8.; 51 | TH2F* axhist = new TH2F("axhist", "title", 10, xMin, xMax, 10, yMin, yMax); 52 | axhist->SetTitle(""); 53 | axhist->SetXTitle("b"); 54 | axhist->SetYTitle("med[Z|s]"); 55 | gPad->SetLogx(1); 56 | gPad->SetLogy(0); 57 | 58 | double u[20]; 59 | double x[20][500]; 60 | 61 | // Read in data from file and insert in TTree 62 | 63 | TString fileName; 64 | // cout << "Enter file name: "; 65 | // cin >> fileName; 66 | fileName = "medsig_s2_rel_bi.txt"; 67 | 68 | ifstream inFile; 69 | inFile.open(fileName); 70 | if (inFile.fail()) { 71 | cout << "Couldn't open file!" << endl; 72 | exit(1); 73 | } 74 | 75 | bool readLine = true; 76 | int lineNum = 0; 77 | int ncol; 78 | while ( readLine ){ 79 | 80 | TString line; 81 | stringstream ss; 82 | line.ReadLine(inFile); 83 | readLine = inFile.good(); 84 | 85 | if ( readLine ) { 86 | 87 | TString firstChar = line(0,1); 88 | bool useLine = firstChar != "#"; 89 | 90 | if ( useLine ){ 91 | 92 | int i = 0; 93 | stringstream ss; 94 | ss << line; // put whole line into ss 95 | TString token; 96 | bool getToken = true; 97 | 98 | while ( getToken ) { 99 | ss >> token; // extracts one token 100 | if ( token.Length() > 0 ) { 101 | u[i] = token.Atof(); 102 | i++; 103 | } 104 | else { 105 | getToken = false; 106 | } 107 | } // getToken 108 | ncol = i; 109 | 110 | for (int i=0; iGetXaxis(); 146 | TAxis* ya = axhist->GetYaxis(); 147 | 148 | xa->SetTitleOffset(1.2); // factor multiplies default offset 149 | ya->SetTitleOffset(1.1); 150 | 151 | xa->SetLabelOffset(0.005); 152 | ya->SetLabelOffset(0.005); 153 | 154 | xa->SetTickLength(0.015); // default = 0.03 155 | ya->SetTickLength(0.015); // default = 0.03 156 | 157 | xa->SetTitleSize(0.05); 158 | ya->SetTitleSize(0.05); 159 | 160 | // gPad->SetLogx(1); 161 | // xa->SetLimits(90., 700.); 162 | 163 | xa->SetNdivisions(-5); // negative value should force number of divisions? 164 | ya->SetNdivisions(-4); 165 | 166 | xa->SetLabelSize(0.05); 167 | ya->SetLabelSize(0.05); 168 | 169 | // Draw axes and then add stuff 170 | 171 | // kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, 172 | // kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, 173 | // kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, 174 | // kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, 175 | // kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, 176 | // kFullStar=29, kOpenStar=30 177 | 178 | axhist->Draw(); 179 | 180 | tg1->SetLineColor(kRed); 181 | tg1->SetLineWidth(2); 182 | tg1->SetLineStyle(2); 183 | tg1->SetMarkerColor(kRed); 184 | tg1->SetMarkerSize(0.8); 185 | tg1->SetMarkerStyle(20); 186 | tg1->Draw("L,same"); // or P for points 187 | 188 | tg2->SetLineColor(kRed); 189 | tg2->SetLineWidth(2); 190 | tg2->SetLineStyle(2); 191 | tg2->SetMarkerColor(kRed); 192 | tg2->SetMarkerSize(0.8); 193 | tg2->SetMarkerStyle(20); 194 | tg2->Draw("L,same"); // or P for points 195 | 196 | tg3->SetLineColor(kRed); 197 | tg3->SetLineWidth(2); 198 | tg3->SetLineStyle(2); 199 | tg3->SetMarkerColor(kRed); 200 | tg3->SetMarkerSize(0.8); 201 | tg3->SetMarkerStyle(20); 202 | // tg3->Draw("L,same"); // or P for points 203 | 204 | tg4->SetLineColor(kBlue); 205 | tg4->SetLineWidth(2); 206 | tg4->SetLineStyle(1); 207 | tg4->SetMarkerColor(kBlue); 208 | tg4->SetMarkerSize(0.8); 209 | tg4->SetMarkerStyle(20); 210 | tg4->Draw("L,same"); // or P for points 211 | 212 | tg5->SetLineColor(kBlue); 213 | tg5->SetLineWidth(2); 214 | tg5->SetLineStyle(1); 215 | tg5->SetMarkerColor(kBlue); 216 | tg5->SetMarkerSize(0.8); 217 | tg5->SetMarkerStyle(20); 218 | tg5->Draw("L,same"); // or P for points 219 | 220 | tg6->SetLineColor(kBlue); 221 | tg6->SetLineWidth(2); 222 | tg6->SetLineStyle(1); 223 | tg6->SetMarkerColor(kBlue); 224 | tg6->SetMarkerSize(0.8); 225 | tg6->SetMarkerStyle(20); 226 | // tg6->Draw("L,same"); // or P for points 227 | 228 | tg7->SetLineColor(kRed); 229 | tg7->SetLineWidth(2); 230 | tg7->SetLineStyle(1); 231 | tg7->SetMarkerColor(kRed); 232 | tg7->SetMarkerSize(0.8); 233 | tg7->SetMarkerStyle(21); 234 | // tg7->Draw("P,same"); // or P for points 235 | 236 | tg8->SetLineColor(kRed); 237 | tg8->SetLineWidth(2); 238 | tg8->SetLineStyle(1); 239 | tg8->SetMarkerColor(kRed); 240 | tg8->SetMarkerSize(0.8); 241 | tg8->SetMarkerStyle(21); 242 | // tg8->Draw("P,same"); // or P for points 243 | 244 | tg9->SetLineColor(kRed); 245 | tg9->SetLineWidth(2); 246 | tg9->SetLineStyle(2); 247 | tg9->SetMarkerColor(kRed); 248 | tg9->SetMarkerSize(0.8); 249 | tg9->SetMarkerStyle(21); 250 | // tg9->Draw("P,same"); // or P for points 251 | 252 | tg10->SetLineColor(kBlack); 253 | tg10->SetLineWidth(2); 254 | tg10->SetLineStyle(2); 255 | tg10->SetMarkerColor(kBlack); 256 | tg10->SetMarkerSize(0.8); 257 | tg10->SetMarkerStyle(20); 258 | tg10->Draw("P,same"); // or P for points 259 | 260 | tg11->SetLineColor(kBlack); 261 | tg11->SetLineWidth(2); 262 | tg11->SetLineStyle(2); 263 | tg11->SetMarkerColor(kBlack); 264 | tg11->SetMarkerSize(0.8); 265 | tg11->SetMarkerStyle(20); 266 | tg11->Draw("P,same"); // or P for points 267 | 268 | tg12->SetLineColor(kBlack); 269 | tg12->SetLineWidth(2); 270 | tg12->SetLineStyle(2); 271 | tg12->SetMarkerColor(kBlack); 272 | tg12->SetMarkerSize(0.8); 273 | tg12->SetMarkerStyle(20); 274 | // tg12->Draw("P,same"); // or P for points 275 | 276 | tg13->SetLineColor(kBlack); 277 | tg13->SetLineWidth(2); 278 | tg13->SetLineStyle(3); 279 | tg13->SetMarkerColor(kBlack); 280 | tg13->SetMarkerSize(0.8); 281 | tg13->SetMarkerStyle(20); 282 | // tg13->Draw("L,same"); // or P for points 283 | 284 | tg14->SetLineColor(kBlack); 285 | tg14->SetLineWidth(2); 286 | tg14->SetLineStyle(3); 287 | tg14->SetMarkerColor(kBlack); 288 | tg14->SetMarkerSize(0.8); 289 | tg14->SetMarkerStyle(20); 290 | // tg14->Draw("L,same"); // or P for points 291 | 292 | tg15->SetLineColor(kBlack); 293 | tg15->SetLineWidth(2); 294 | tg15->SetLineStyle(3); 295 | tg15->SetMarkerColor(kBlack); 296 | tg15->SetMarkerSize(0.8); 297 | tg15->SetMarkerStyle(20); 298 | // tg15->Draw("L,same"); // or P for points 299 | 300 | 301 | TLegend* leg = new TLegend(0.53, 0.38, 0.95, .73); // x1, y1, x2, y2 302 | leg->SetTextSize(0.05); 303 | leg->SetBorderSize(0); 304 | leg->SetFillColor(0); 305 | leg->AddEntry(tg1, " s / #sqrt{b + #sigma_{b}^{2}}", "l"); 306 | leg->AddEntry(tg4, " Z_{A}", "l"); 307 | // leg->AddEntry(tg7, " #sqrt{q0}, MC median", "p"); 308 | leg->AddEntry(tg10, " Monte Carlo", "p"); 309 | // leg->AddEntry(tg13, " Z_{bi}" , "l"); 310 | // leg->AddEntry(tg4, "s = 0.03", "l"); 311 | leg->Draw(); 312 | 313 | TLatex* tl = new TLatex(); 314 | tl->SetTextAlign(11); 315 | tl->SetTextSize(0.05); 316 | tl->SetTextFont(42); 317 | tl->SetNDC(); 318 | // tl->DrawLatex(.76, 0.33, "s = 2"); 319 | // tl->DrawLatex(.76, 0.465, "s = 5"); 320 | // tl->DrawLatex(.76, 0.6, "s = 10"); 321 | // tl->DrawLatex(.76, 0.73, "s = 20"); 322 | 323 | tl->DrawLatex(.5, .77, "#sigma_{b}/b = 0.2, 0.5, 1"); 324 | tl->DrawLatex(.5, .85, "s = 2"); 325 | 326 | // Fix idiotic problem with frame 327 | 328 | TLine* tli = new TLine(); 329 | tli->SetLineStyle(1); 330 | tli->SetLineWidth(1); 331 | tli->DrawLine(xMin, yMin, xMax, yMin); 332 | tli->DrawLine(xMax, yMin, xMax, yMax); 333 | tli->DrawLine(xMin, yMax, xMax, yMax); 334 | tli->DrawLine(xMin, yMin, xMin, yMax); 335 | 336 | TPostScript psfile("medsig_s2_rel_bi.eps", 113); // 113 makes eps 337 | canvas->Draw(); 338 | psfile.Close(); 339 | // canvas->Print("plot.gif", "gif"); 340 | 341 | } 342 | 343 | -------------------------------------------------------------------------------- /validation/med_sig_checks/draw_medsig_s10_rel_bi.C: -------------------------------------------------------------------------------- 1 | // a macro to read in xy data from a file and make a plot 2 | // First run root, then 3 | // .L drawXY.C 4 | // draw() 5 | 6 | 7 | #include "Riostream.h" 8 | void draw() { 9 | 10 | gROOT->Reset(); 11 | 12 | // first make a canvas and a 2D histogram for the axes 13 | 14 | TCanvas* canvas = new TCanvas("canvas", "canvas", 10, 10, 500, 500); 15 | canvas->SetFillColor(0); 16 | canvas->SetBorderMode(0); 17 | canvas->SetFrameBorderMode(0); // need this to turn off red hist frame! 18 | 19 | gROOT->SetStyle("Plain"); 20 | canvas->UseCurrentStyle(); 21 | 22 | gPad->SetLeftMargin(0.15); 23 | gPad->SetRightMargin(0.05); 24 | gPad->SetTopMargin(0.07); 25 | gPad->SetBottomMargin(0.17); 26 | 27 | gStyle->SetOptStat(0); 28 | gStyle->SetTitleBorderSize(0); 29 | gStyle->SetTitleSize(0.04); 30 | 31 | gStyle->SetTextFont(42); 32 | gStyle->SetTextSize(0.04); 33 | gStyle->SetTitleFont(42, "hxy"); // for histogram and axis title 34 | gStyle->SetLabelFont(42, "xyz"); // for axis labels (values) 35 | 36 | gStyle->SetTitleOffset(0.8, "h"); // what does this do? 37 | gStyle->SetTitleX(0.15); 38 | gStyle->SetTitleY(0.99); 39 | 40 | gROOT->ForceStyle(); 41 | 42 | // can make histogram or alternatively use the histograms automatically 43 | // connected to the TF1 or TGraph objects 44 | 45 | double xMin = 0.1; 46 | double xMax = 100.; 47 | // double yMin = 0.1; 48 | // double yMax = 10.; 49 | double yMin = 0.; 50 | double yMax = 8.; 51 | TH2F* axhist = new TH2F("axhist", "title", 10, xMin, xMax, 10, yMin, yMax); 52 | axhist->SetTitle(""); 53 | axhist->SetXTitle("b"); 54 | axhist->SetYTitle("med[Z|s]"); 55 | gPad->SetLogx(1); 56 | gPad->SetLogy(0); 57 | 58 | double u[20]; 59 | double x[20][500]; 60 | 61 | // Read in data from file and insert in TTree 62 | 63 | TString fileName; 64 | // cout << "Enter file name: "; 65 | // cin >> fileName; 66 | fileName = "medsig_s10_rel_bi.txt"; 67 | 68 | ifstream inFile; 69 | inFile.open(fileName); 70 | if (inFile.fail()) { 71 | cout << "Couldn't open file!" << endl; 72 | exit(1); 73 | } 74 | 75 | bool readLine = true; 76 | int lineNum = 0; 77 | int ncol; 78 | while ( readLine ){ 79 | 80 | TString line; 81 | stringstream ss; 82 | line.ReadLine(inFile); 83 | readLine = inFile.good(); 84 | 85 | if ( readLine ) { 86 | 87 | TString firstChar = line(0,1); 88 | bool useLine = firstChar != "#"; 89 | 90 | if ( useLine ){ 91 | 92 | int i = 0; 93 | stringstream ss; 94 | ss << line; // put whole line into ss 95 | TString token; 96 | bool getToken = true; 97 | 98 | while ( getToken ) { 99 | ss >> token; // extracts one token 100 | if ( token.Length() > 0 ) { 101 | u[i] = token.Atof(); 102 | i++; 103 | } 104 | else { 105 | getToken = false; 106 | } 107 | } // getToken 108 | ncol = i; 109 | 110 | for (int i=0; iGetXaxis(); 146 | TAxis* ya = axhist->GetYaxis(); 147 | 148 | xa->SetTitleOffset(1.2); // factor multiplies default offset 149 | ya->SetTitleOffset(1.1); 150 | 151 | xa->SetLabelOffset(0.005); 152 | ya->SetLabelOffset(0.005); 153 | 154 | xa->SetTickLength(0.015); // default = 0.03 155 | ya->SetTickLength(0.015); // default = 0.03 156 | 157 | xa->SetTitleSize(0.05); 158 | ya->SetTitleSize(0.05); 159 | 160 | // gPad->SetLogx(1); 161 | // xa->SetLimits(90., 700.); 162 | 163 | xa->SetNdivisions(-5); // negative value should force number of divisions? 164 | ya->SetNdivisions(-4); 165 | 166 | xa->SetLabelSize(0.05); 167 | ya->SetLabelSize(0.05); 168 | 169 | // Draw axes and then add stuff 170 | 171 | // kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, 172 | // kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, 173 | // kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, 174 | // kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, 175 | // kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, 176 | // kFullStar=29, kOpenStar=30 177 | 178 | axhist->Draw(); 179 | 180 | tg1->SetLineColor(kRed); 181 | tg1->SetLineWidth(2); 182 | tg1->SetLineStyle(2); 183 | tg1->SetMarkerColor(kRed); 184 | tg1->SetMarkerSize(0.8); 185 | tg1->SetMarkerStyle(20); 186 | tg1->Draw("L,same"); // or P for points 187 | 188 | tg2->SetLineColor(kRed); 189 | tg2->SetLineWidth(2); 190 | tg2->SetLineStyle(2); 191 | tg2->SetMarkerColor(kRed); 192 | tg2->SetMarkerSize(0.8); 193 | tg2->SetMarkerStyle(20); 194 | tg2->Draw("L,same"); // or P for points 195 | 196 | tg3->SetLineColor(kRed); 197 | tg3->SetLineWidth(2); 198 | tg3->SetLineStyle(2); 199 | tg3->SetMarkerColor(kRed); 200 | tg3->SetMarkerSize(0.8); 201 | tg3->SetMarkerStyle(20); 202 | // tg3->Draw("L,same"); // or P for points 203 | 204 | tg4->SetLineColor(kBlue); 205 | tg4->SetLineWidth(2); 206 | tg4->SetLineStyle(1); 207 | tg4->SetMarkerColor(kBlue); 208 | tg4->SetMarkerSize(0.8); 209 | tg4->SetMarkerStyle(20); 210 | tg4->Draw("L,same"); // or P for points 211 | 212 | tg5->SetLineColor(kBlue); 213 | tg5->SetLineWidth(2); 214 | tg5->SetLineStyle(1); 215 | tg5->SetMarkerColor(kBlue); 216 | tg5->SetMarkerSize(0.8); 217 | tg5->SetMarkerStyle(20); 218 | tg5->Draw("L,same"); // or P for points 219 | 220 | tg6->SetLineColor(kBlue); 221 | tg6->SetLineWidth(2); 222 | tg6->SetLineStyle(1); 223 | tg6->SetMarkerColor(kBlue); 224 | tg6->SetMarkerSize(0.8); 225 | tg6->SetMarkerStyle(20); 226 | // tg6->Draw("L,same"); // or P for points 227 | 228 | tg7->SetLineColor(kRed); 229 | tg7->SetLineWidth(2); 230 | tg7->SetLineStyle(1); 231 | tg7->SetMarkerColor(kRed); 232 | tg7->SetMarkerSize(0.8); 233 | tg7->SetMarkerStyle(21); 234 | // tg7->Draw("P,same"); // or P for points 235 | 236 | tg8->SetLineColor(kRed); 237 | tg8->SetLineWidth(2); 238 | tg8->SetLineStyle(1); 239 | tg8->SetMarkerColor(kRed); 240 | tg8->SetMarkerSize(0.8); 241 | tg8->SetMarkerStyle(21); 242 | // tg8->Draw("P,same"); // or P for points 243 | 244 | tg9->SetLineColor(kRed); 245 | tg9->SetLineWidth(2); 246 | tg9->SetLineStyle(2); 247 | tg9->SetMarkerColor(kRed); 248 | tg9->SetMarkerSize(0.8); 249 | tg9->SetMarkerStyle(21); 250 | // tg9->Draw("P,same"); // or P for points 251 | 252 | tg10->SetLineColor(kBlack); 253 | tg10->SetLineWidth(2); 254 | tg10->SetLineStyle(2); 255 | tg10->SetMarkerColor(kBlack); 256 | tg10->SetMarkerSize(0.8); 257 | tg10->SetMarkerStyle(20); 258 | tg10->Draw("P,same"); // or P for points 259 | 260 | tg11->SetLineColor(kBlack); 261 | tg11->SetLineWidth(2); 262 | tg11->SetLineStyle(2); 263 | tg11->SetMarkerColor(kBlack); 264 | tg11->SetMarkerSize(0.8); 265 | tg11->SetMarkerStyle(20); 266 | tg11->Draw("P,same"); // or P for points 267 | 268 | tg12->SetLineColor(kBlack); 269 | tg12->SetLineWidth(2); 270 | tg12->SetLineStyle(2); 271 | tg12->SetMarkerColor(kBlack); 272 | tg12->SetMarkerSize(0.8); 273 | tg12->SetMarkerStyle(20); 274 | // tg12->Draw("P,same"); // or P for points 275 | 276 | tg13->SetLineColor(kBlack); 277 | tg13->SetLineWidth(2); 278 | tg13->SetLineStyle(3); 279 | tg13->SetMarkerColor(kBlack); 280 | tg13->SetMarkerSize(0.8); 281 | tg13->SetMarkerStyle(20); 282 | // tg13->Draw("L,same"); // or P for points 283 | 284 | tg14->SetLineColor(kBlack); 285 | tg14->SetLineWidth(2); 286 | tg14->SetLineStyle(3); 287 | tg14->SetMarkerColor(kBlack); 288 | tg14->SetMarkerSize(0.8); 289 | tg14->SetMarkerStyle(20); 290 | // tg14->Draw("L,same"); // or P for points 291 | 292 | tg15->SetLineColor(kBlack); 293 | tg15->SetLineWidth(2); 294 | tg15->SetLineStyle(3); 295 | tg15->SetMarkerColor(kBlack); 296 | tg15->SetMarkerSize(0.8); 297 | tg15->SetMarkerStyle(20); 298 | // tg15->Draw("L,same"); // or P for points 299 | 300 | 301 | TLegend* leg = new TLegend(0.53, 0.48, 0.95, .73); // x1, y1, x2, y2 302 | leg->SetTextSize(0.05); 303 | leg->SetBorderSize(0); 304 | leg->SetFillColor(0); 305 | leg->AddEntry(tg1, " s / #sqrt{b + #sigma_{b}^{2}}", "l"); 306 | leg->AddEntry(tg4, " Z_{A}", "l"); 307 | // leg->AddEntry(tg7, " #sqrt{q0}, MC median", "p"); 308 | leg->AddEntry(tg10, " Monte Carlo", "p"); 309 | // leg->AddEntry(tg13, " Z_{bi}" , "l"); 310 | // leg->AddEntry(tg4, "s = 0.03", "l"); 311 | leg->Draw(); 312 | 313 | TLatex* tl = new TLatex(); 314 | tl->SetTextAlign(11); 315 | tl->SetTextSize(0.05); 316 | tl->SetTextFont(42); 317 | tl->SetNDC(); 318 | // tl->DrawLatex(.76, 0.33, "s = 2"); 319 | // tl->DrawLatex(.76, 0.465, "s = 5"); 320 | // tl->DrawLatex(.76, 0.6, "s = 10"); 321 | // tl->DrawLatex(.76, 0.73, "s = 20"); 322 | 323 | // tl->DrawLatex(.5, .77, "#sigma_{b}/b = 0.2, 0.5, 1"); 324 | tl->DrawLatex(.5, .77, "#sigma_{b}/b = 0.2, 0.5"); 325 | tl->DrawLatex(.5, .85, "s = 10"); 326 | 327 | // Fix idiotic problem with frame 328 | 329 | TLine* tli = new TLine(); 330 | tli->SetLineStyle(1); 331 | tli->SetLineWidth(1); 332 | tli->DrawLine(xMin, yMin, xMax, yMin); 333 | tli->DrawLine(xMax, yMin, xMax, yMax); 334 | tli->DrawLine(xMin, yMax, xMax, yMax); 335 | tli->DrawLine(xMin, yMin, xMin, yMax); 336 | 337 | TPostScript psfile("medsig_s10_rel_bi.eps", 113); // 113 makes eps 338 | canvas->Draw(); 339 | psfile.Close(); 340 | // canvas->Print("plot.gif", "gif"); 341 | 342 | } 343 | 344 | -------------------------------------------------------------------------------- /validation/med_sig_checks/draw_medsig_s5_rel_bi.C: -------------------------------------------------------------------------------- 1 | // a macro to read in xy data from a file and make a plot 2 | // First run root, then 3 | // .L drawXY.C 4 | // draw() 5 | 6 | 7 | #include "Riostream.h" 8 | void draw() { 9 | 10 | gROOT->Reset(); 11 | 12 | // first make a canvas and a 2D histogram for the axes 13 | 14 | TCanvas* canvas = new TCanvas("canvas", "canvas", 10, 10, 500, 500); 15 | canvas->SetFillColor(0); 16 | canvas->SetBorderMode(0); 17 | canvas->SetFrameBorderMode(0); // need this to turn off red hist frame! 18 | 19 | gROOT->SetStyle("Plain"); 20 | canvas->UseCurrentStyle(); 21 | 22 | gPad->SetLeftMargin(0.15); 23 | gPad->SetRightMargin(0.05); 24 | gPad->SetTopMargin(0.07); 25 | gPad->SetBottomMargin(0.17); 26 | 27 | gStyle->SetOptStat(0); 28 | gStyle->SetTitleBorderSize(0); 29 | gStyle->SetTitleSize(0.04); 30 | 31 | gStyle->SetTextFont(42); 32 | gStyle->SetTextSize(0.04); 33 | gStyle->SetTitleFont(42, "hxy"); // for histogram and axis title 34 | gStyle->SetLabelFont(42, "xyz"); // for axis labels (values) 35 | 36 | gStyle->SetTitleOffset(0.8, "h"); // what does this do? 37 | gStyle->SetTitleX(0.15); 38 | gStyle->SetTitleY(0.99); 39 | 40 | gROOT->ForceStyle(); 41 | 42 | // can make histogram or alternatively use the histograms automatically 43 | // connected to the TF1 or TGraph objects 44 | 45 | double xMin = 0.1; 46 | double xMax = 100.; 47 | // double yMin = 0.1; 48 | // double yMax = 10.; 49 | double yMin = 0.; 50 | double yMax = 8.; 51 | TH2F* axhist = new TH2F("axhist", "title", 10, xMin, xMax, 10, yMin, yMax); 52 | axhist->SetTitle(""); 53 | axhist->SetXTitle("b"); 54 | axhist->SetYTitle("med[Z|s]"); 55 | gPad->SetLogx(1); 56 | gPad->SetLogy(0); 57 | 58 | double u[20]; 59 | double x[20][500]; 60 | 61 | // Read in data from file and insert in TTree 62 | 63 | TString fileName; 64 | // cout << "Enter file name: "; 65 | // cin >> fileName; 66 | fileName = "medsig_s5_rel_bi.txt"; 67 | 68 | ifstream inFile; 69 | inFile.open(fileName); 70 | if (inFile.fail()) { 71 | cout << "Couldn't open file!" << endl; 72 | exit(1); 73 | } 74 | 75 | bool readLine = true; 76 | int lineNum = 0; 77 | int ncol; 78 | while ( readLine ){ 79 | 80 | TString line; 81 | stringstream ss; 82 | line.ReadLine(inFile); 83 | readLine = inFile.good(); 84 | 85 | if ( readLine ) { 86 | 87 | TString firstChar = line(0,1); 88 | bool useLine = firstChar != "#"; 89 | 90 | if ( useLine ){ 91 | 92 | int i = 0; 93 | stringstream ss; 94 | ss << line; // put whole line into ss 95 | TString token; 96 | bool getToken = true; 97 | 98 | while ( getToken ) { 99 | ss >> token; // extracts one token 100 | if ( token.Length() > 0 ) { 101 | u[i] = token.Atof(); 102 | i++; 103 | } 104 | else { 105 | getToken = false; 106 | } 107 | } // getToken 108 | ncol = i; 109 | 110 | for (int i=0; iGetXaxis(); 146 | TAxis* ya = axhist->GetYaxis(); 147 | 148 | xa->SetTitleOffset(1.2); // factor multiplies default offset 149 | ya->SetTitleOffset(1.1); 150 | 151 | xa->SetLabelOffset(0.005); 152 | ya->SetLabelOffset(0.005); 153 | 154 | xa->SetTickLength(0.015); // default = 0.03 155 | ya->SetTickLength(0.015); // default = 0.03 156 | 157 | xa->SetTitleSize(0.05); 158 | ya->SetTitleSize(0.05); 159 | 160 | // gPad->SetLogx(1); 161 | // xa->SetLimits(90., 700.); 162 | 163 | xa->SetNdivisions(-5); // negative value should force number of divisions? 164 | ya->SetNdivisions(-4); 165 | 166 | xa->SetLabelSize(0.05); 167 | ya->SetLabelSize(0.05); 168 | 169 | // Draw axes and then add stuff 170 | 171 | // kDot=1, kPlus, kStar, kCircle=4, kMultiply=5, 172 | // kFullDotSmall=6, kFullDotMedium=7, kFullDotLarge=8, 173 | // kFullCircle=20, kFullSquare=21, kFullTriangleUp=22, 174 | // kFullTriangleDown=23, kOpenCircle=24, kOpenSquare=25, 175 | // kOpenTriangleUp=26, kOpenDiamond=27, kOpenCross=28, 176 | // kFullStar=29, kOpenStar=30 177 | 178 | axhist->Draw(); 179 | 180 | tg1->SetLineColor(kRed); 181 | tg1->SetLineWidth(2); 182 | tg1->SetLineStyle(2); 183 | tg1->SetMarkerColor(kRed); 184 | tg1->SetMarkerSize(0.8); 185 | tg1->SetMarkerStyle(20); 186 | tg1->Draw("L,same"); // or P for points 187 | 188 | tg2->SetLineColor(kRed); 189 | tg2->SetLineWidth(2); 190 | tg2->SetLineStyle(2); 191 | tg2->SetMarkerColor(kRed); 192 | tg2->SetMarkerSize(0.8); 193 | tg2->SetMarkerStyle(20); 194 | tg2->Draw("L,same"); // or P for points 195 | 196 | tg3->SetLineColor(kRed); 197 | tg3->SetLineWidth(2); 198 | tg3->SetLineStyle(2); 199 | tg3->SetMarkerColor(kRed); 200 | tg3->SetMarkerSize(0.8); 201 | tg3->SetMarkerStyle(20); 202 | // tg3->Draw("L,same"); // or P for points 203 | 204 | tg4->SetLineColor(kBlue); 205 | tg4->SetLineWidth(2); 206 | tg4->SetLineStyle(1); 207 | tg4->SetMarkerColor(kBlue); 208 | tg4->SetMarkerSize(0.8); 209 | tg4->SetMarkerStyle(20); 210 | tg4->Draw("L,same"); // or P for points 211 | 212 | tg5->SetLineColor(kBlue); 213 | tg5->SetLineWidth(2); 214 | tg5->SetLineStyle(1); 215 | tg5->SetMarkerColor(kBlue); 216 | tg5->SetMarkerSize(0.8); 217 | tg5->SetMarkerStyle(20); 218 | tg5->Draw("L,same"); // or P for points 219 | 220 | tg6->SetLineColor(kBlue); 221 | tg6->SetLineWidth(2); 222 | tg6->SetLineStyle(1); 223 | tg6->SetMarkerColor(kBlue); 224 | tg6->SetMarkerSize(0.8); 225 | tg6->SetMarkerStyle(20); 226 | // tg6->Draw("L,same"); // or P for points 227 | 228 | tg7->SetLineColor(kRed); 229 | tg7->SetLineWidth(2); 230 | tg7->SetLineStyle(1); 231 | tg7->SetMarkerColor(kRed); 232 | tg7->SetMarkerSize(0.8); 233 | tg7->SetMarkerStyle(21); 234 | // tg7->Draw("P,same"); // or P for points 235 | 236 | tg8->SetLineColor(kRed); 237 | tg8->SetLineWidth(2); 238 | tg8->SetLineStyle(1); 239 | tg8->SetMarkerColor(kRed); 240 | tg8->SetMarkerSize(0.8); 241 | tg8->SetMarkerStyle(21); 242 | // tg8->Draw("P,same"); // or P for points 243 | 244 | tg9->SetLineColor(kRed); 245 | tg9->SetLineWidth(2); 246 | tg9->SetLineStyle(2); 247 | tg9->SetMarkerColor(kRed); 248 | tg9->SetMarkerSize(0.8); 249 | tg9->SetMarkerStyle(21); 250 | // tg9->Draw("P,same"); // or P for points 251 | 252 | tg10->SetLineColor(kBlack); 253 | tg10->SetLineWidth(2); 254 | tg10->SetLineStyle(2); 255 | tg10->SetMarkerColor(kBlack); 256 | tg10->SetMarkerSize(0.8); 257 | tg10->SetMarkerStyle(20); 258 | tg10->Draw("P,same"); // or P for points 259 | 260 | tg11->SetLineColor(kBlack); 261 | tg11->SetLineWidth(2); 262 | tg11->SetLineStyle(2); 263 | tg11->SetMarkerColor(kBlack); 264 | tg11->SetMarkerSize(0.8); 265 | tg11->SetMarkerStyle(20); 266 | tg11->Draw("P,same"); // or P for points 267 | 268 | tg12->SetLineColor(kBlack); 269 | tg12->SetLineWidth(2); 270 | tg12->SetLineStyle(2); 271 | tg12->SetMarkerColor(kBlack); 272 | tg12->SetMarkerSize(0.8); 273 | tg12->SetMarkerStyle(20); 274 | // tg12->Draw("P,same"); // or P for points 275 | 276 | tg13->SetLineColor(kBlack); 277 | tg13->SetLineWidth(2); 278 | tg13->SetLineStyle(3); 279 | tg13->SetMarkerColor(kBlack); 280 | tg13->SetMarkerSize(0.8); 281 | tg13->SetMarkerStyle(20); 282 | // tg13->Draw("L,same"); // or P for points 283 | 284 | tg14->SetLineColor(kBlack); 285 | tg14->SetLineWidth(2); 286 | tg14->SetLineStyle(3); 287 | tg14->SetMarkerColor(kBlack); 288 | tg14->SetMarkerSize(0.8); 289 | tg14->SetMarkerStyle(20); 290 | // tg14->Draw("L,same"); // or P for points 291 | 292 | tg15->SetLineColor(kBlack); 293 | tg15->SetLineWidth(2); 294 | tg15->SetLineStyle(3); 295 | tg15->SetMarkerColor(kBlack); 296 | tg15->SetMarkerSize(0.8); 297 | tg15->SetMarkerStyle(20); 298 | // tg15->Draw("L,same"); // or P for points 299 | 300 | 301 | TLegend* leg = new TLegend(0.53, 0.48, 0.95, .73); // x1, y1, x2, y2 302 | leg->SetTextSize(0.05); 303 | leg->SetTextFont(42); 304 | leg->SetBorderSize(0); 305 | leg->SetFillColor(0); 306 | leg->AddEntry(tg1, " s / #sqrt{b + #sigma_{b}^{2}}", "l"); 307 | leg->AddEntry(tg4, " Z_{A}", "l"); 308 | // leg->AddEntry(tg7, " #sqrt{q0}, MC median", "p"); 309 | leg->AddEntry(tg10, " Monte Carlo", "p"); 310 | // leg->AddEntry(tg13, " Z_{bi}" , "l"); 311 | // leg->AddEntry(tg4, "s = 0.03", "l"); 312 | leg->Draw(); 313 | 314 | TLatex* tl = new TLatex(); 315 | tl->SetTextAlign(11); 316 | tl->SetTextSize(0.05); 317 | tl->SetTextFont(42); 318 | tl->SetNDC(); 319 | // tl->DrawLatex(.76, 0.33, "s = 2"); 320 | // tl->DrawLatex(.76, 0.465, "s = 5"); 321 | // tl->DrawLatex(.76, 0.6, "s = 10"); 322 | // tl->DrawLatex(.76, 0.73, "s = 20"); 323 | 324 | // tl->DrawLatex(.5, .77, "#sigma_{b}/b = 0.2, 0.5, 1"); 325 | tl->DrawLatex(.5, .77, "#sigma_{b}/b = 0.2, 0.5"); 326 | tl->DrawLatex(.5, .85, "s = 5"); 327 | 328 | // Fix idiotic problem with frame 329 | 330 | TLine* tli = new TLine(); 331 | tli->SetLineStyle(1); 332 | tli->SetLineWidth(1); 333 | tli->DrawLine(xMin, yMin, xMax, yMin); 334 | tli->DrawLine(xMax, yMin, xMax, yMax); 335 | tli->DrawLine(xMin, yMax, xMax, yMax); 336 | tli->DrawLine(xMin, yMin, xMin, yMax); 337 | 338 | TPostScript psfile("medsig_s5_rel_bi.eps", 113); // 113 makes eps 339 | canvas->Draw(); 340 | psfile.Close(); 341 | // canvas->Print("plot.gif", "gif"); 342 | 343 | } 344 | 345 | -------------------------------------------------------------------------------- /fasimov/__init__.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Author: Kyle Cranmer October 2014 3 | * Copyright (C) Kyle Cranmer 4 | _ License LGPL v2.1 (for ROOT compatibility, happy to make it BSD for other purposes) _ 5 | 6 | This code quickly calculates the expected 95% CLs upper limit on the number of 7 | signal events, s, given an expected background, bExp, and 8 | uncertainty on the background estimate, deltaB. 9 | The background uncertainty is absolute (not relative) and is uncertainty 10 | on the mean background (so you don't include sqrt(bExp) Poisson fluctuatiosn in this number). 11 | 12 | Example Usage: 13 | * you expect 50 +/- 7 background events 14 | * ExpectedLimit(50,7) 15 | * returns s_95 = 19.7 events 16 | 17 | Similar code for expected discovery significance is also included 18 | Example Usage: 19 | * you expect 50 signal events, 100 +/- 7 background events 20 | * ExpectedSignificance(50,100,7) 21 | * returns 3.72 sigma 22 | 23 | The derivations of these formulae are based on a statistical model: 24 | Pois(n | s+b ) * Pois(m | tau * b) 25 | The tau quantity is calculated from tau=bExp/deltaB/deltaB. 26 | See arXiv:physics/0702156 for motivation of this model. 27 | The maximum likelihood estimate and conditional maximum likelihood estimate 28 | were solved analytically and coded here. 29 | The log-likelihood ratio and the profile log likelihood ratio follow immediately. 30 | The b-only and s+b p-values needed for CLs are calculated using the 31 | asymptotic distributions in 32 | Cowan, Cranmer, Gross, Vitells, 33 | Eur. Phys. J. C 71 (2011) 1554. 34 | arXiv:1007.1727. 35 | The ExpectedSignificance formulae was derived by Cowan and the numerical solution 36 | for the Expected upper limit was written by Cranmer as correlaries to that paper. 37 | 38 | Note, the ExpectedSignificance euqation is the same as Eq.(17) of 39 | Tipei Li and Yuqian Ma, Astrophysical Journal 272 (1983) 317-324 40 | and Eq.(25) of 41 | Robert D. Cousins, James T. Linnemann and Jordan Tucker, NIM A 595 (2008) 480-501; arXiv:physics/0702156. 42 | after making the replacements n=bExp and m=bExp*tau. 43 | ''' 44 | 45 | from __future__ import division 46 | from scipy.stats import norm 47 | from scipy.optimize import brentq 48 | from numpy import sqrt, log, abs 49 | 50 | def bhathat(n, m, s, tau): 51 | return (m+n-s-s*tau + sqrt(4*m*s*(1+tau) + pow(s+s*tau-m-n,2) ) ) / (2 * (1+tau )) 52 | 53 | 54 | def shat(n, m, tau): 55 | return (n*tau -m )/tau 56 | 57 | 58 | def bhat(n, m, tau): 59 | return m/tau 60 | 61 | def logL(n, m, s, b, tau): 62 | return (s+b) - n * log(s+b) + (tau*b) - m * log(tau*b) 63 | 64 | 65 | def logLambda(n, m, s, tau): 66 | return logL(n, m, s, bhathat(n,m,s,tau), tau) \ 67 | - logL(n,m,shat(n,m,tau), bhat(n,m,tau), tau) 68 | 69 | def fisher(n,m,s,tau): 70 | #from fisher information matrix approach 71 | return 8*m*n*pow(1+tau,2)* \ 72 | (m*m+2*m*n+n*n+m*s-n*s+m*s*tau-n*s*tau+(n+m)*sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2))) \ 73 | /sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)) \ 74 | /pow(m+n-s-s*tau+sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)),2) \ 75 | /pow(m+n+s+s*tau+sqrt(4*m*s*(1+tau)+pow(m+n-s*(1+tau),2)),2) 76 | 77 | def sigma(n, m, s, tau): 78 | 79 | #print "sigma_fisher = ", 1./sqrt(fisher), "sig_asimov", float(s)/sqrt(2.*logLambda(n,m,s,tau)) 80 | #from asimov approach 81 | if s>0 and logLambda(n,m,s,tau) > 0: 82 | #print "sigma from qmu" 83 | return float(s)/sqrt(2.*logLambda(n,m,s,tau)) 84 | else: 85 | #print "sigma from fisher", s, logLambda(n,m,s,tau), 1/fisher(n,m,s,tau) 86 | return 1./fisher(m*tau+s,m,s,tau) 87 | 88 | 89 | def F(qmu, mu, muprime, sigma): 90 | #print "debug mu=%f mu'=%f, sigma=%f, qmu=%f, dist_to_boundary = %e" %(mu, muprime, sigma, qmu, qmu-mu*mu/sigma/sigma ) 91 | 92 | if qmu s : 111 | print "hit boundary" 112 | qmu=0 113 | 114 | #print "\ns = ", s, "qmu = ", qmu, "cutoff", s*s/sig/sig 115 | #print "sigma = ", sig 116 | #print "CLb = ", (1-F(qmu,s,0.,sig)) 117 | #print "CLsb = ", F(qmu,s,s,sig) 118 | return (1.-F(qmu,s,s,sig))/(1.-F(qmu,s,0.0,sig)) 119 | 120 | def testReload(): 121 | print "4" 122 | 123 | def CLsArgumentWrapper(s,n,m,tau): 124 | return CLs(float(n),float(m),float(s),float(tau))-0.05 125 | 126 | def CLsArgumentWrapper_qmu(s, bExp, deltaB, sigmaBand): 127 | tau = bExp/deltaB/deltaB 128 | sig = sigma(bExp,bExp*tau,s,tau) 129 | qmu = qmuBand(s, bExp, deltaB, sigmaBand) 130 | return CLs_qmu(float(qmu),float(s),float(sig))-0.05 131 | 132 | def CLbArgumentWrapper(qmu, s,n,m,tau,sigmaBand): 133 | #using this to find value of q_mu that for sigmaBand of the s=0 distribution as a function of mu=s 134 | clbForBand = 1.-norm.cdf( sigmaBand) 135 | sig = sigma(n,m,s,tau) 136 | #sig = sigma(n,m,0.,tau) 137 | if s==0: #qmu is a delta function when mu=0 138 | print "qmu is a delta function when mu=0" 139 | return 1.; 140 | return F(float(qmu),float(s),float(0),float(sig))-clbForBand 141 | 142 | def CLb(n,m,s,tau): 143 | #sig = sigma(n,m,s,tau) 144 | sig = sigma(n,m,s,tau) 145 | qmu = 2.*logLambda(n,m,s,tau) 146 | if shat(n,m,tau) >= s : 147 | print "hit boundary" 148 | qmu=0 149 | 150 | if s==0: #qmu is a delta function when mu=0 151 | print "qmu is a delta function when mu=0" 152 | return 1.; 153 | return F(float(qmu),float(s),float(0),float(sig)) 154 | 155 | def qmuBand(s, bExp, deltaB, sigmaBand) : 156 | # the value of q_mu that corresponds to the (-2,-1,0,1,2)sigmaBand of b-only for a hypothesized mu=s 157 | tau = bExp/deltaB/deltaB 158 | sig = sigma(bExp,bExp*tau,s,tau) 159 | xhi = (3*s/sig)**2 # a reasonable guess, but it breaks down for very small s near 0 160 | if xhi<0.01: xhi=0.01 # hack patch for small s 161 | xlo = xhi/100. 162 | try: 163 | qmuBand = brentq(CLbArgumentWrapper, xlo, xhi, args=(s,bExp,bExp*tau,tau,sigmaBand)) 164 | #print "Approximate expected 95% CLs upper-limit = ", s 165 | return qmuBand 166 | except: 167 | if F(float(0),float(s),float(0),float(sig)) > norm.cdf(sigmaBand): 168 | print "\n brentq failed to find qmuBand, using a simple scan", xlo, xhi 169 | print " P(delta)", F(float(0),float(s),float(0),float(sig)) , "CLb target =", norm.cdf(sigmaBand) 170 | print " CLbArgumentWrapper", (s,bExp,bExp*tau,tau,sigmaBand) 171 | 172 | qmuBand=xlo 173 | #print "\n\ts, bExp, bexp*tau, sigmaBand", s,bExp,bExp*tau,tau,sigmaBand 174 | #print 'clb(0) = ', CLbArgumentWrapper(0, s, bExp,bExp*tau,tau, sigmaBand) 175 | #print 'clb(0.001) = ', CLbArgumentWrapper(0.001, s, bExp,bExp*tau,tau, sigmaBand) 176 | while CLbArgumentWrapper(qmuBand, s, bExp,bExp*tau,tau, sigmaBand) < 0.001 : 177 | qmuBand+=0.01 178 | #print "\n\tApproximate qmuBand = ", qmuBand 179 | return qmuBand 180 | 181 | 182 | def ExpectedLimit(bExp, deltaB) : 183 | 184 | tau = bExp/deltaB/deltaB 185 | xhi = 3*sqrt(bExp)+3*deltaB #a reasonable guess of what is larger than the upper limit 186 | try: 187 | s = brentq(CLsArgumentWrapper, 0.001, xhi, args=(bExp,bExp*tau,tau)) 188 | #print "Approximate expected 95% CLs upper-limit = ", s 189 | return s 190 | except: 191 | print "\n\tbrentq failed (boundaries?) using a simple scan" 192 | s=0.001 193 | while CLs(bExp,bExp*tau,s,tau) < 0.95 : 194 | s+=0.01 195 | print "\n\tApproximate expected 95% CLs upper-limit = ", s 196 | return s 197 | # use http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html#scipy.optimize.brentq 198 | 199 | 200 | def ExpectedLimitBand(bExp, deltaB, sigmaBand) : 201 | xhi = 3*sqrt(bExp)+3*deltaB #a reasonable guess of what is larger than the upper limit 202 | try: 203 | s = brentq(CLsArgumentWrapper_qmu, 0.001, xhi, args=(bExp, deltaB, sigmaBand)) 204 | #print "Approximate expected 95% CLs upper-limit = ", s 205 | return s 206 | except: 207 | print "\n\tbrentq failed (boundaries?) using a simple scan" 208 | s=0.001 209 | while abs(CLsArgumentWrapper_qmu(s, bExp, deltaB, sigmaBand)) < 0.001 : 210 | s+=0.01 211 | print "\n\tCLsArgumentWrapper_qmu", (s, bExp, deltaB, sigmaBand) 212 | print "\n\tApproximate ", sigmaBand, " 95% CLs upper-limit = ", s 213 | return s 214 | 215 | 216 | 217 | 218 | def ObservedLimit(n, bExp, deltaB) : 219 | 220 | tau = bExp/deltaB/deltaB 221 | 222 | xhi = 3*sqrt(bExp)+3*deltaB #a reasonable guess of what is larger than the upper limit 223 | try: 224 | s = brentq(CLsArgumentWrapper, 0.001, xhi, args=(n,bExp*tau,tau)) 225 | #print "Approximate expected 95% CLs upper-limit = ", s 226 | return s 227 | except: 228 | print "brentq failed (boundaries?) using a simple scan" 229 | s=0.01 230 | while CLs(n,bExp*tau,s,tau) < 0.95 : 231 | s+=0.1 232 | print "Approximate expected 95% CLs upper-limit = ", s 233 | return s 234 | 235 | 236 | # use http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.brentq.html#scipy.optimize.brentq 237 | 238 | 239 | 240 | def ExpectedSignificance(s, b, deltaB): 241 | # same idea, but this is expected significance (in sigma) 242 | return sqrt(2*( (s+b)*log( ((s+b)*(b+deltaB*deltaB)) / (b*b+(s+b)*deltaB*deltaB) ) \ 243 | -( b*b/deltaB/deltaB)*log(1.+ (s*deltaB*deltaB)/(b*(b+deltaB*deltaB)) ) 244 | ) 245 | ) 246 | 247 | def ExpectedSignificance2(s, b, deltaB): 248 | tau = b/deltaB/deltaB 249 | q0 = 2.*logLambda(n=s+b,m=tau*b,s=0.,tau=tau) 250 | print q0, tau 251 | return sqrt(q0) 252 | 253 | def ObservedSignificance(n, b, deltaB): 254 | tau = b/deltaB/deltaB 255 | q0 = 2.*logLambda(n=n,m=tau*b,s=0.,tau=tau) 256 | print q0, tau 257 | return sqrt(q0) 258 | 259 | 260 | def ObsExpAndBands_Limits(n,bExp,deltaB): 261 | ol = ObservedLimit(n,bExp,deltaB) 262 | el = ExpectedLimit(bExp,deltaB) 263 | el_m2 = ExpectedLimitBand(bExp,deltaB,-2.) 264 | el_m1 = ExpectedLimitBand(bExp,deltaB,-1.) 265 | el_p1 = ExpectedLimitBand(bExp,deltaB,1.) 266 | el_p2 = ExpectedLimitBand(bExp,deltaB,2.) 267 | return (ol, el_m2, el_m1, el, el_p1, el_p2) 268 | 269 | if __name__ == '__main__': 270 | 271 | print 'qmuband(-1) = ', qmuBand(10, 100., 1., -1.) 272 | print 'qmuband(0) = ', qmuBand(10, 100., 1., 0.) 273 | print 'qmuband(+0.5) = ', qmuBand(10, 100., 1., 0.5) 274 | print 'qmuband(+0.8) = ', qmuBand(10, 100., 1., 0.8) 275 | print 'qmuband(+0.9) = ', qmuBand(10, 100., 1., 0.9) 276 | print 'qmuband(+0.95) = ', qmuBand(10, 100., 1., 0.95) 277 | print 'qmuband(1) = ', qmuBand(10, 100., 1., 1.) 278 | 279 | 280 | print '-2*logLambda = ', 2*logLambda(100, 100.*100., 10., 100) 281 | print '-2*logLambda(93,100) = ', 2*logLambda(93, 100.*100.-sqrt(100.*100./2.), 10., 100) #rough approx 282 | 283 | print 'expected limit ', ExpectedLimit(100, 1.) 284 | print 'expected limit -1',ExpectedLimitBand(100, 1., -1.) 285 | print 'expected limit 0',ExpectedLimitBand(100., 1., 0.) 286 | print 'expected limit +0.5',ExpectedLimitBand(100, 1., 0.5) 287 | #print 'expected limit +0.3',ExpectedLimitBand(100, 1., 0.3) 288 | #print 'expected limit +0.5',ExpectedLimitBand(100, 1., 0.5) 289 | #print 'expected limit +0.7',ExpectedLimitBand(100, 1., 0.7) 290 | print 'expected limit +1',ExpectedLimitBand(100, 1., 1.) 291 | 292 | #careful if shat(nsigma)> s 293 | 294 | print "running some tests" 295 | if shat(100,50,1)==50 : 296 | print "ok" 297 | else: 298 | print "oops" 299 | 300 | if bhat(100,50,1)==50 : 301 | print "ok" 302 | else: 303 | print "oops" 304 | 305 | if bhathat(100,50,50,1)==50 : 306 | print "ok" 307 | else: 308 | print "oops" 309 | 310 | if 12.2 < sigma(100,50,50,1) and sigma(100,50,50,1) <12.3 : 311 | print "ok" 312 | else: 313 | print "oops" 314 | 315 | if logLambda(100,50,50,1)==0 : 316 | print "ok" 317 | else: 318 | print "oops" 319 | 320 | if ExpectedSignificance(50,100,10)>3. and ExpectedSignificance(50,100,10)<3.2 : 321 | print "ok", "approximate significance for s=50,b=100+/-10 is", ExpectedSignificance(50,100,10) 322 | else: 323 | print "oops" 324 | 325 | if ExpectedLimit(50,7)>19.7 and ExpectedLimit(50,7)<19.8 : 326 | print "ok", "approximate limit for 50+/-7 is", ExpectedLimit(50,7) 327 | else: 328 | print "oops" 329 | 330 | if ExpectedLimit(100,.1)>20. and ExpectedLimit(100,.1)<21 : 331 | print "ok" , "approximate limit for 100+/-0.1 is", ExpectedLimit(100,0.1) 332 | else: 333 | print "oops" 334 | 335 | if ExpectedLimit(50,50)>51 and ExpectedLimit(50,50)<53 : 336 | print "ok", "approximate limit for 50+/-50 is", ExpectedLimit(50,50) 337 | else: 338 | print "oops" 339 | 340 | -------------------------------------------------------------------------------- /docs/.ipynb_checkpoints/demo-notebook-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "slideshow": { 7 | "slide_type": "slide" 8 | } 9 | }, 10 | "source": [ 11 | "# A fast and robust statistical tool for simple number counting with uncertainty\n", 12 | "\n", 13 | "Kyle Cranmer, June 18, 2015\n", 14 | "\n", 15 | "[![](https://i.creativecommons.org/l/by/4.0/88x31.png)]( https://creativecommons.org/licenses/by/4.0/)" 16 | ] 17 | }, 18 | { 19 | "cell_type": "markdown", 20 | "metadata": { 21 | "slideshow": { 22 | "slide_type": "slide" 23 | } 24 | }, 25 | "source": [ 26 | "#Introduction\n", 27 | "\n", 28 | "We consider the case of a simple number counting analysis with uncertainty on the background expectation.\n", 29 | "\n", 30 | "First, let us consider the main number counting measurement.\n", 31 | "\n", 32 | "The statistical model is: \n" 33 | ] 34 | }, 35 | { 36 | "cell_type": "markdown", 37 | "metadata": { 38 | "slideshow": { 39 | "slide_type": "fragment" 40 | } 41 | }, 42 | "source": [ 43 | "\\begin{equation}\n", 44 | "P(n|\\nu_s, \\nu_b) = Pois(n | \\nu_s + \\nu_b)\n", 45 | "\\end{equation}\n", 46 | "\n", 47 | "where\n", 48 | " * $n$ is the observed number of events satisfying the selection\n", 49 | " * $\\nu_s$ is the expected signal (the parameter of interest)\n", 50 | " * $\\nu_b$ is the expected background (fixed now, but later a nuisance parameter)\n", 51 | " \n", 52 | "*(Note, I'm using greek letters for parameters instead of $Pois(n|s+b)$)*\n", 53 | "\n" 54 | ] 55 | }, 56 | { 57 | "cell_type": "markdown", 58 | "metadata": { 59 | "slideshow": { 60 | "slide_type": "fragment" 61 | } 62 | }, 63 | "source": [ 64 | "If the background were known exactly, then $\\nu_b$ would be fixed. \n", 65 | "\n", 66 | "But if we have background uncertainty, then $\\nu_b$ is a nuisance parameter that can float in a fit.\n", 67 | "\n", 68 | "At this point, there is nothing indicating that we have some best guess for the background and uncertainty on that estimate.\n" 69 | ] 70 | }, 71 | { 72 | "cell_type": "markdown", 73 | "metadata": { 74 | "slideshow": { 75 | "slide_type": "subslide" 76 | } 77 | }, 78 | "source": [ 79 | "# An intuitive way to add background uncertainty to the model\n", 80 | "\n", 81 | "Let's say that we have some estimate for the background, something like $100 \\pm 7$ events.\n", 82 | "How do we incorporate that into the statistical model. Instead of $100 \\pm 7$, let's write $\\nu_b^{exp} \\pm \\Delta_b$" 83 | ] 84 | }, 85 | { 86 | "cell_type": "markdown", 87 | "metadata": { 88 | "slideshow": { 89 | "slide_type": "fragment" 90 | } 91 | }, 92 | "source": [ 93 | "A common and intuitive approach is that one would randomize the background expectation $\\nu_b$ in the process of \"generating toy Monte Carlo\" to calculate p-values. \n", 94 | "\n", 95 | "In general, using Monte Carlo from to sample from a distribution can be seen as a form of integrtion. So if you were to randomly draw $\\nu_b$ from a Gaussian centered at $\\nu_b^{exp}$ with standard deviation of $\\Delta$, that corresonds to the distribution $Gaus(\\nu_b | \\nu_b^{exp}, \\Delta_b)$. \n", 96 | "\n", 97 | "Thus, the distribution of $n$ would be equivalent to\n", 98 | "\n", 99 | "\\begin{equation}\n", 100 | "\\\\\n", 101 | "P(n \\,|\\,\\nu_s) = \\int Pois(n | \\nu_s + \\nu_b) \\, Gaus(\\nu_b | \\nu_b^{exp}, \\Delta_b) \\, d\\nu_b\n", 102 | "\\end{equation}" 103 | ] 104 | }, 105 | { 106 | "cell_type": "markdown", 107 | "metadata": { 108 | "slideshow": { 109 | "slide_type": "fragment" 110 | } 111 | }, 112 | "source": [ 113 | "Did you notice that this is a Bayesian procedure? If we were to calculate p-values, it would be a hybrid Bayesian-Frequentist procedure (sometimes referred to as the Cousins-Highland method)." 114 | ] 115 | }, 116 | { 117 | "cell_type": "markdown", 118 | "metadata": { 119 | "slideshow": { 120 | "slide_type": "fragment" 121 | } 122 | }, 123 | "source": [ 124 | "You can spot that it is Bayesain easily because we used greek letters for the parameters. Whenever you see a distribution for a parameter -- eg. $Gaus(\\nu_b | \\nu_b^{exp}, \\Delta_b)$ -- then it is Bayesian. " 125 | ] 126 | }, 127 | { 128 | "cell_type": "markdown", 129 | "metadata": { 130 | "slideshow": { 131 | "slide_type": "fragment" 132 | } 133 | }, 134 | "source": [ 135 | "Similarly, whenever you see integration with respect to a parameter (or Monte Carlo sampling of a parameter), then it is Bayesian." 136 | ] 137 | }, 138 | { 139 | "cell_type": "markdown", 140 | "metadata": { 141 | "slideshow": { 142 | "slide_type": "subslide" 143 | } 144 | }, 145 | "source": [ 146 | "# So what if it is Bayesian, it is based on a measurement.\n", 147 | "\n", 148 | "Often the background estimate is based on a measurement. \n", 149 | "\n", 150 | "So while the distribution $Gaus(\\nu_b | \\nu_b^{exp}, \\Delta_b)$ is considered a prior for this statistical model, it is not a completely subjective prior.\n", 151 | "\n", 152 | "That's true, it's better to think of it as a posterior from some other measurement. " 153 | ] 154 | }, 155 | { 156 | "cell_type": "markdown", 157 | "metadata": { 158 | "slideshow": { 159 | "slide_type": "fragment" 160 | } 161 | }, 162 | "source": [ 163 | "So what is that other auxiliary measurement?\n", 164 | " * Let's call it $m$\n", 165 | " * so our example $Gaus(\\nu_b | \\nu_b^{exp}, \\Delta_b)$ can be written schematically $\\pi(\\nu_b | m)$.\n", 166 | "\n", 167 | "And remember Bayes theorem, the posterior is given by:\n", 168 | "\n", 169 | "\\begin{equation}\n", 170 | "\\underbrace{\\pi(\\nu_b | m)}_{posterior} = \\underbrace{N}_{normalizaton} \\,\\,\\, \\underbrace{p(m|\\nu_b)}_{likelihood} \\,\\,\\, \\underbrace{\\eta(\\nu_b )}_{original\\, prior}\n", 171 | "\\end{equation}\n", 172 | "\n", 173 | "The \"problem\", if you will, is that while the likelihood function for the measurement is based on physics considerations, the original prior $\\eta(\\nu_b)$ is more subjective. One can hope that the likelihood dominates the prior, but there is no escaping the presence of some original prior that is not based on an auxiliary experiment." 174 | ] 175 | }, 176 | { 177 | "cell_type": "markdown", 178 | "metadata": { 179 | "slideshow": { 180 | "slide_type": "subslide" 181 | } 182 | }, 183 | "source": [ 184 | "#So what how would you deal with this in a frequentist way?\n" 185 | ] 186 | }, 187 | { 188 | "cell_type": "markdown", 189 | "metadata": { 190 | "slideshow": { 191 | "slide_type": "fragment" 192 | } 193 | }, 194 | "source": [ 195 | "As in all of our statistical problems (whether you are Bayesian or frequentist), the first step is to write down the full statistical model. In this case it involves to parts:\n", 196 | " * the main measurement (the \"on\" source part) $Pois(n| \\nu_s + \\nu_b)$\n", 197 | " * the auxiliary measurement (the \"off\" source part) $p(m | \\nu_b)$\n", 198 | " \n", 199 | "The total model is just the product of the two (assuming that the main and auxiliary measurements are statistically independent -- i.e. they have non-overlapping selection, are disjoint, or \"orthogonal\")\n", 200 | "\\begin{equation}\n", 201 | " P(n,m | \\nu_s, \\nu_b) = Pois(n| \\nu_s + \\nu_b) \\, p(m | \\nu_b)\n", 202 | "\\end{equation}" 203 | ] 204 | }, 205 | { 206 | "cell_type": "markdown", 207 | "metadata": { 208 | "slideshow": { 209 | "slide_type": "fragment" 210 | } 211 | }, 212 | "source": [ 213 | "Now maybe we should think harder about that auxiliary measurement.\n", 214 | " * maybe we only have an best fit value and uncertainty $\\nu_b^{best fit} \\pm \\Delta_b$, then a Gaussian is not a bad choice if $\\Delta_b \\ll \\nu_b^{best fit}$,\n", 215 | " * or maybe it was also a number counting experiment $p(m|\\nu_b) = Pois(m|\\nu_b)$\n", 216 | " \n", 217 | "In what follows, I will assume that the auxiliary measurement is also based on number counting. \n" 218 | ] 219 | }, 220 | { 221 | "cell_type": "markdown", 222 | "metadata": { 223 | "slideshow": { 224 | "slide_type": "subslide" 225 | } 226 | }, 227 | "source": [ 228 | "# The on/off problem\n", 229 | "\n", 230 | "\n", 231 | "When the auxiliary measurement is also number counting, then the full model is \n", 232 | "\\begin{equation}\n", 233 | " P(n,m | \\nu_s, \\nu_b) = Pois(n| \\nu_s + \\nu_b) \\, Pois(m | \\tau \\nu_b) \\,\n", 234 | "\\end{equation}\n", 235 | "where $\\tau$ is a known, constant extrapolation factor that relates the background expectation in the signal region to the control region of the auxiliary measurement. (One can, generalize the situation when there is uncertainty on $\\tau$, but that is beyond the scope of this presentation.\n", 236 | "\n", 237 | "This problem is now quite well studied, and a good prototype for dealing with nuisance parameters in a frequentist way. \n", 238 | "\n", 239 | "The problem is sometimes called the on/off problem (from it's background in astrophysics) or the \"prototype problem\" in some of the PhyStat literature. Relevant publicatons:\n", 240 | " * [Ti-pei Li and Yu-qian Ma, Astrophysical Journal 272 (1983) 317–324.](http://adsabs.harvard.edu/full/1983ApJ...272..317L)\n", 241 | " * Robert D. Cousins, James T. Linnemann and Jordan Tucker, NIM A 595 (2008) 480– 501; [arXiv:physics/0702156](http://arxiv.org/abs/physics/0702156)\n", 242 | "\n" 243 | ] 244 | }, 245 | { 246 | "cell_type": "markdown", 247 | "metadata": { 248 | "slideshow": { 249 | "slide_type": "slide" 250 | } 251 | }, 252 | "source": [ 253 | "# The profile likelihood for this problem\n", 254 | "\n", 255 | "We will base the following statistical analysis on the profile likelihood ratio, which is described in \n", 256 | " * Cowan, Cranmer, Gross, Vitells, Eur. Phys. J. C 71 (2011) 1554.\n", 257 | "[arXiv:1007.1727](http://arxiv.org/abs/1007.1727)\n", 258 | "\n", 259 | "In this case there is one nuisance parameter and one parameter of interest, so the profile likelihood ratio is:\n", 260 | "\\begin{equation}\n", 261 | " \\lambda(\\nu_s) = \\frac{P(n,m | \\nu_s, \\hat{\\hat{\\nu_b}}(\\nu_s) )}{P(n,m | \\hat \\nu_s, \\hat\\nu_b)} \\; ,\n", 262 | "\\end{equation}\n", 263 | "where \n", 264 | " * $\\hat \\nu_s$ and $\\hat\\nu_b$ are the maximum likelihood estimates, and\n", 265 | " * $\\hat{\\hat{\\nu_b}}(\\nu_s)$ is the conditional maximum likelihood estimate of $\\nu_b$ for a fixed value of $\\nu_s$.\n" 266 | ] 267 | }, 268 | { 269 | "cell_type": "markdown", 270 | "metadata": { 271 | "slideshow": { 272 | "slide_type": "fragment" 273 | } 274 | }, 275 | "source": [ 276 | "In this case, $\\hat \\nu_s$, $\\hat\\nu_b$, and $\\hat{\\hat{\\nu_b}}(\\nu_s)$ can all be solved in closed form. Thus one need not run MINUIT or another optimizer. This makes the code fast and robust." 277 | ] 278 | }, 279 | { 280 | "cell_type": "markdown", 281 | "metadata": { 282 | "slideshow": { 283 | "slide_type": "slide" 284 | } 285 | }, 286 | "source": [ 287 | "# Fasimov: \n", 288 | "### fast code using asymptotic approximations to distribution of the profile likelihood and the Asimov data\n", 289 | "\n", 290 | "Below I demo some pure python code for the on/off problem.\n", 291 | "\n", 292 | "The code can be found here:\n", 293 | "[https://github.com/cranmer/fast-asimov-utils](https://github.com/cranmer/fast-asimov-utils)" 294 | ] 295 | }, 296 | { 297 | "cell_type": "code", 298 | "execution_count": 1, 299 | "metadata": { 300 | "collapsed": false, 301 | "slideshow": { 302 | "slide_type": "fragment" 303 | } 304 | }, 305 | "outputs": [ 306 | { 307 | "name": "stdout", 308 | "output_type": "stream", 309 | "text": [ 310 | "Populating the interactive namespace from numpy and matplotlib\n" 311 | ] 312 | } 313 | ], 314 | "source": [ 315 | "#Populate the interactive namespace from numpy and matplotlib\n", 316 | "%pylab inline" 317 | ] 318 | }, 319 | { 320 | "cell_type": "code", 321 | "execution_count": 2, 322 | "metadata": { 323 | "collapsed": false, 324 | "slideshow": { 325 | "slide_type": "skip" 326 | } 327 | }, 328 | "outputs": [], 329 | "source": [ 330 | "#import matplotlib.pyplot as plt\n", 331 | "#import numpy as np" 332 | ] 333 | }, 334 | { 335 | "cell_type": "code", 336 | "execution_count": 3, 337 | "metadata": { 338 | "collapsed": false, 339 | "slideshow": { 340 | "slide_type": "skip" 341 | } 342 | }, 343 | "outputs": [ 344 | { 345 | "data": { 346 | "text/plain": [ 347 | "['CLbArgumentWrapper',\n", 348 | " 'CLs',\n", 349 | " 'CLsArgumentWrapper',\n", 350 | " 'CLsArgumentWrapper_qmu',\n", 351 | " 'CLs_qmu',\n", 352 | " 'ExpectedLimit',\n", 353 | " 'ExpectedLimitBand',\n", 354 | " 'ExpectedSignificance',\n", 355 | " 'ExpectedSignificance2',\n", 356 | " 'F',\n", 357 | " 'ObsExpAndBands_Limits',\n", 358 | " 'ObservedLimit',\n", 359 | " 'ObservedSignificance',\n", 360 | " '__builtins__',\n", 361 | " '__doc__',\n", 362 | " '__file__',\n", 363 | " '__name__',\n", 364 | " '__package__',\n", 365 | " '__path__',\n", 366 | " 'abs',\n", 367 | " 'bhat',\n", 368 | " 'bhathat',\n", 369 | " 'brentq',\n", 370 | " 'division',\n", 371 | " 'log',\n", 372 | " 'logL',\n", 373 | " 'logLambda',\n", 374 | " 'norm',\n", 375 | " 'qmuBand',\n", 376 | " 'shat',\n", 377 | " 'sigma',\n", 378 | " 'sqrt']" 379 | ] 380 | }, 381 | "execution_count": 3, 382 | "metadata": {}, 383 | "output_type": "execute_result" 384 | } 385 | ], 386 | "source": [ 387 | "import fasimov \n", 388 | "dir(fasimov)" 389 | ] 390 | }, 391 | { 392 | "cell_type": "markdown", 393 | "metadata": { 394 | "slideshow": { 395 | "slide_type": "subslide" 396 | } 397 | }, 398 | "source": [ 399 | "# The MLE and Conditional MLE\n", 400 | "\n", 401 | "\n", 402 | "The equations for $\\hat \\nu_s$, $\\hat\\nu_b$, and $\\hat{\\hat{\\nu_b}}(\\nu_s)$ are coded up.\n", 403 | "\n", 404 | "For the code $\\nu_s \\to$ `s` or `s_exp` , $\\nu_b \\to$ `b_exp`" 405 | ] 406 | }, 407 | { 408 | "cell_type": "code", 409 | "execution_count": 4, 410 | "metadata": { 411 | "collapsed": false 412 | }, 413 | "outputs": [ 414 | { 415 | "data": { 416 | "text/plain": [ 417 | "50.0" 418 | ] 419 | }, 420 | "execution_count": 4, 421 | "metadata": {}, 422 | "output_type": "execute_result" 423 | } 424 | ], 425 | "source": [ 426 | "fasimov.bhat(n=120, m=50, tau=1)" 427 | ] 428 | }, 429 | { 430 | "cell_type": "code", 431 | "execution_count": 5, 432 | "metadata": { 433 | "collapsed": false 434 | }, 435 | "outputs": [ 436 | { 437 | "data": { 438 | "text/plain": [ 439 | "70.0" 440 | ] 441 | }, 442 | "execution_count": 5, 443 | "metadata": {}, 444 | "output_type": "execute_result" 445 | } 446 | ], 447 | "source": [ 448 | "fasimov.shat(n=120, m=50, tau=1)" 449 | ] 450 | }, 451 | { 452 | "cell_type": "code", 453 | "execution_count": 6, 454 | "metadata": { 455 | "collapsed": false 456 | }, 457 | "outputs": [ 458 | { 459 | "data": { 460 | "text/plain": [ 461 | "85.0" 462 | ] 463 | }, 464 | "execution_count": 6, 465 | "metadata": {}, 466 | "output_type": "execute_result" 467 | } 468 | ], 469 | "source": [ 470 | "#the best fit background assuming s=0\n", 471 | "fasimov.bhathat(n=120,m=50,tau=1,s=0) " 472 | ] 473 | }, 474 | { 475 | "cell_type": "markdown", 476 | "metadata": { 477 | "slideshow": { 478 | "slide_type": "subslide" 479 | } 480 | }, 481 | "source": [ 482 | "# The profile likelihood ratio\n" 483 | ] 484 | }, 485 | { 486 | "cell_type": "code", 487 | "execution_count": 7, 488 | "metadata": { 489 | "collapsed": false 490 | }, 491 | "outputs": [], 492 | "source": [ 493 | "s = np.linspace(0,150) #make a numpy array for signal values to test" 494 | ] 495 | }, 496 | { 497 | "cell_type": "code", 498 | "execution_count": 8, 499 | "metadata": { 500 | "collapsed": false 501 | }, 502 | "outputs": [ 503 | { 504 | "data": { 505 | "text/plain": [ 506 | "(0, 15)" 507 | ] 508 | }, 509 | "execution_count": 8, 510 | "metadata": {}, 511 | "output_type": "execute_result" 512 | }, 513 | { 514 | "data": { 515 | "image/png": [ 516 | "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEJCAYAAAB2T0usAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", 517 | "AAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm83NP9x/HXN4tECRGxlVSSUkv5NQmqlnLJYtefnaql\n", 518 | "ms1OkNh9iDV2ilhrL1pFqSUJTVttVRJLtUolTUpF7Enr16I4vz/O9yaTZO69s3zPd5l5Px+PeWTm\n", 519 | "3plzPsOd75mzfQ6IiIiIiIiIiIiIiIiIiIiIiIiIiIgAEGUdQBteAL6RdRAiIgXzIjAg6yCS5LIO\n", 520 | "oEKWdQAVsqwDqJBlHUCFLOsAKmBZB1Ahq+OVF2Jcmlwo7Rn0I3CvguucTn01q/na2SXJKEREUmF0\n", 521 | "Bw4Dtkqnws23Ai6G6PN06ktfp6wDEBGpwd7A8xivha/KbQwrrgHcEb6u7KgxqM/UrAOo0NSsA6jQ\n", 522 | "1KwDqNDUrAOowNSsA6jQ1BpfdwRwbYJxtOdE6PNjiD5OqT4pUZQ5AxFJmzEQ43UsjWFu1wfcB+BW\n", 523 | "Cl9XImq+dqpnICJFczhwPcZnKdR1HPAjiD5Moa5MaQJZRIrD6AnsA2wQvjK3EvB9mmSZu3oGIlIk\n", 524 | "hwCPY8xLoa7RwMMQvZFCXZlTz0BEisGI8BPHw8NX5roDxwDDwteVD+oZiEhRbA98CjydQl0HAc9B\n", 525 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aWV/A35L4Bbia4q8FVlqDO2Cre9fqNwME1\n", 652 | "L2OnOItsOxvK3GbgXovTSyi5oBRNwa+dS2uAN+R6gnsI3O8r3o9g7IvxBsZagYNrPsZBcY9gi/JP\n", 653 | "cF3jRHNvk8RpdyLZaIBr5+Ia5A25TuDGxMNGIypabWSMxfgTxmopBNgcjBPi5aMbln+CWx/cNHCP\n", 654 | "glsj3eBEEtUg185FGuwNua+Dew7cI+DaT4fsU14bxitKalcnozPGJRh/jlcPLcF1AndM3FiPqjkJ\n", 655 | "oUh+NNi1swHfkB9/dueAm1fRMITvIczCFkv3LZUyVsJ4NE4M2GvpJ7g+4KaA+x24ddIPUCSIhrt2\n", 656 | "NtwbWsRtHi8/vRPcSu0+1TgqHt6oIKe+LGRsjDET4/Klj6p0XcGdCO49cKeCyyJZo0goDXftbLg3\n", 657 | "tDi3XLxaZR647/vhijb407bexPh6igEWl5+EfxejTBI5tw24P4F7TCklpEE13LWz4d5QeW5TcH+I\n", 658 | "hyoGtvk048A402nbz2l2RheMCRh/w5Y8J8OtCu42/NnEe2puQBpYw107G+4Ntc11Ajc8XtJ4NW2d\n", 659 | "lmXshfE2xuCUA8w/YxWMKRiTMVZe9AvXFdwR+HTTE8Atn12QIqlouGtnw72hjrmVwU2M0x8cVnYs\n", 660 | "29gu7iGcouR2MWOP+L/J+VjrYU2uE7gD4s1jT1aVHkSk2Gq+dua1u+zIb2yBuU2By4BV8aeh3QfR\n", 661 | "Fwt/7TfRpsY3AAAGOUlEQVSk/QR4GzgEY0EGQWbPWAm4CvgWcCjGb+Phn53xif8+AU6F6MkMoxRJ\n", 662 | "W83XTn27zJ1oOrAtcDRwHPAiuD0WjnMb/4h//w9gOsbGWUWaGZ/D6Y/Ah8CAuCHYBvgNMAE4G/iW\n", 663 | "GgKR4mvCYaJyXARul3jD2oz4/qJW308st7FypgEZK2DcGGcc3R5/BOl3wE0FNxufJLBz1mGKZKjh\n", 664 | "rp0N94bq46J4Fcwf46WRoxdOhvo19a9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LOAviWP8xbjSBb9tyw9zjNvcV6Pj2U6+YtzJIsWZLRqK64s4y0XZx4/S+XibJWnz1O5\n", 678 | "OIvyeapIJZvRsjQEuC6+vyJ+mSXkM+6x+FVafePHeYuxP/6PE/wfaOv9vMVZuidmIPmKczL+//GJ\n", 679 | "JT9rK64s4y0XZx4/S+XibJWnz1O5OBP5POXpcJu8b0abhW9lARaw6A84b3H3x8c0o+RneYtxb+De\n", 680 | "+P5sYPv4ft7ifL/k/solj/MQ51D84ovS5eFtxZVlvOXizONnqVyckL/PU7k4E/k85akx6IV/I3k1\n", 681 | "G5jDolb4wvjneYt7Ir7LWPrHkrcYewGbsaj7ulnJz/MU5/PxvzPxsY6LH+ctzlZtxZW3eIvyWYIm\n", 682 | "+jxlsbS0Le/j/zha9cwqkHaMBfYBhgMvxD/LU9wj8d3IOfHj1j/gPMVYahh+mGA2/g83b3GOxX8j\n", 683 | "HIbvfk/Gb+jJW5yt2oorj/Hm/bMETfZ5ylPPYAq+CwR+rGtyhrGUsze+27UZi/54IV9xD4pjmYT/\n", 684 | "I7gPfxHLU4zE9bcODXRiUXKtvMXZi0Vxzo8fQ/7ibNVWXHmLtwifpdYYmubzlKeeQd43ow3Bj7nN\n", 685 | "jB87YF3yFffokvvT8N+85sSP8xIjwJP4P9Lp+G8rI+Kf5+m/JcAFwE/wJ8j1xH+LhXzFWZpYsK24\n", 686 | "8hBvaZx5/iyVxpnnz1NpnEX5PImIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIg0hJ74TTt948dj8Vv+\n", 687 | "RRpKntJRiOTR/Pg2J348BJ9pU6ShqDEQqdxIFmXYFGkonbMOQCTn+uOHhf4DdAcejX8+Algpvj8/\n", 688 | "g7hEEqWegUj7Bpfcv7/kfk984rI85bUXEZEUDcYfIzi8oyeKiIiIiIiIiIiIiIiIiIiIiIiIiIiI\n", 689 | "iIiIiIiIFM7/A7iwNgB/E438AAAAAElFTkSuQmCC\n" 690 | ], 691 | "text/plain": [ 692 | "" 693 | ] 694 | }, 695 | "metadata": {}, 696 | "output_type": "display_data" 697 | } 698 | ], 699 | "source": [ 700 | "bhathat = s.copy() \n", 701 | "expSig = s.copy() \n", 702 | "logL = s.copy()\n", 703 | "logLambda = s.copy()\n", 704 | "for i, ss in enumerate(s):\n", 705 | " bhathat[i] = fasimov.bhathat(150,100,ss,1)\n", 706 | " expSig[i] = fasimov.ExpectedSignificance(ss,100,.1)\n", 707 | " logL[i] = fasimov.logL(150,100,ss,bhathat[i],1)+1000-37\n", 708 | " logL[i] = fasimov.logL(150,100,ss,100,1)+1000-38\n", 709 | " logLambda[i] = fasimov.logLambda(150,100,ss,1)\n", 710 | "plt.plot(s,logLambda) \n", 711 | "plt.plot(s,logL) \n", 712 | "\n", 713 | "# use latex for font rendering\n", 714 | "mpl.rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})\n", 715 | "mpl.rc('text', usetex=True)\n", 716 | "\n", 717 | "plt.xlabel(r'$\\nu_s$')\n", 718 | "plt.ylabel(r'$-\\log \\lambda(\\nu_s)$')\n", 719 | "plt.ylim(0,15)\n", 720 | "\n" 721 | ] 722 | }, 723 | { 724 | "cell_type": "markdown", 725 | "metadata": { 726 | "slideshow": { 727 | "slide_type": "subslide" 728 | } 729 | }, 730 | "source": [ 731 | "#Limits and Significance" 732 | ] 733 | }, 734 | { 735 | "cell_type": "code", 736 | "execution_count": 9, 737 | "metadata": { 738 | "collapsed": false 739 | }, 740 | "outputs": [ 741 | { 742 | "data": { 743 | "text/plain": [ 744 | "1.8473277707512268" 745 | ] 746 | }, 747 | "execution_count": 9, 748 | "metadata": {}, 749 | "output_type": "execute_result" 750 | } 751 | ], 752 | "source": [ 753 | "fasimov.ExpectedSignificance(s=27.85,b=100,deltaB=10)" 754 | ] 755 | }, 756 | { 757 | "cell_type": "code", 758 | "execution_count": 10, 759 | "metadata": { 760 | "collapsed": false 761 | }, 762 | "outputs": [ 763 | { 764 | "name": "stdout", 765 | "output_type": "stream", 766 | "text": [ 767 | "3.41261989259 1.0\n" 768 | ] 769 | }, 770 | { 771 | "data": { 772 | "text/plain": [ 773 | "1.8473277707512374" 774 | ] 775 | }, 776 | "execution_count": 10, 777 | "metadata": {}, 778 | "output_type": "execute_result" 779 | } 780 | ], 781 | "source": [ 782 | "fasimov.ObservedSignificance(n=127.85,b=100,deltaB=10)" 783 | ] 784 | }, 785 | { 786 | "cell_type": "code", 787 | "execution_count": 11, 788 | "metadata": { 789 | "collapsed": false 790 | }, 791 | "outputs": [ 792 | { 793 | "name": "stdout", 794 | "output_type": "stream", 795 | "text": [ 796 | "hit boundary\n", 797 | "obs=38.59, -2 sigma=14.89, -1 sigma=20.02, exp=27.85, +1 sigma = 38.92, +2 sigma = 52.54\n" 798 | ] 799 | } 800 | ], 801 | "source": [ 802 | "[obs, m2,m1,exp, p1,p2] = fasimov.ObsExpAndBands_Limits(nObs=110,bExp=100,deltaB=10)\n", 803 | "print \"obs=%.2f, -2 sigma=%.2f, -1 sigma=%.2f, exp=%.2f, +1 sigma = %.2f, +2 sigma = %.2f\" %(obs,m2,m1,exp,p1,p2)" 804 | ] 805 | }, 806 | { 807 | "cell_type": "code", 808 | "execution_count": 12, 809 | "metadata": { 810 | "collapsed": false 811 | }, 812 | "outputs": [ 813 | { 814 | "data": { 815 | "text/plain": [ 816 | "20.018156448334437" 817 | ] 818 | }, 819 | "execution_count": 12, 820 | "metadata": {}, 821 | "output_type": "execute_result" 822 | } 823 | ], 824 | "source": [ 825 | "fasimov.ExpectedLimitBand(bExp=100,deltaB=10,sigmaBand=-1)" 826 | ] 827 | }, 828 | { 829 | "cell_type": "code", 830 | "execution_count": 13, 831 | "metadata": { 832 | "collapsed": false 833 | }, 834 | "outputs": [ 835 | { 836 | "data": { 837 | "text/plain": [ 838 | "2.0227824543154633" 839 | ] 840 | }, 841 | "execution_count": 13, 842 | "metadata": {}, 843 | "output_type": "execute_result" 844 | } 845 | ], 846 | "source": [ 847 | "fasimov.ExpectedSignificance(s=20.9,b=100,deltaB=.1)" 848 | ] 849 | }, 850 | { 851 | "cell_type": "code", 852 | "execution_count": 14, 853 | "metadata": { 854 | "collapsed": false 855 | }, 856 | "outputs": [ 857 | { 858 | "data": { 859 | "text/plain": [ 860 | "[]" 861 | ] 862 | }, 863 | "execution_count": 14, 864 | "metadata": {}, 865 | "output_type": "execute_result" 866 | }, 867 | { 868 | "data": { 869 | "image/png": [ 870 | "iVBORw0KGgoAAAANSUhEUgAAAYMAAAD/CAYAAAAT87ocAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", 871 | "AAALEgAACxIB0t1+/AAAElhJREFUeJzt3W+sZGddwPHvbLctf0p7dxeBQGOz21bESOhdihZK4dpZ\n", 872 | "ERXQdJtVAvqqd2OIGF64BvQFG99YINHEFwRYEqIxCkg18U/QdhdXKX+Ewi6CVKBdUi0IpXt3aYv8\n", 873 | "U36+OM/lTu/O3Jm558w85zzz/SQn55w5Z875PZOZ5zfnec4fkCRJkiRJkiRJkiRJkiSAXgPbOAic\n", 874 | "B/YBx4YsX03jq4E3NrA/SVLDdtR8//40PpHGy5uW94HjVEliX5qXJLVM3WRwCDiXps8ABzYt3zfw\n", 875 | "2pk0L0lqmZ01378ErA3M79m0fLDZaD/w3pr7kyTNQN0jA5is32E/8CngdAP7kyQ1rO6RwXlgd5re\n", 876 | "BZwdsV4feNOIZfdRdS5LkiZzP3BN7iAGLbNxttAR4Lo0vTSwzuGB6WEdyDGDuBbV0dwBFOZo7gAK\n", 877 | "czR3AAVpvN6s20x0Ko37VEcJ681Ax9P4AHA71b//Naz4JamV6jYTwUYn8YmB165P4+NsNCNJklqq\n", 878 | "iQ5ktcfJ3AEU5mTuAApzMncAajebjiRpOq3rM5AkFcBkIEkyGUiSTAaSJEwGkiRMBpIkTAaSJEwG\n", 879 | "kiRMBpIkmrk3kToresBlVLcfvxx4ShqeDDwpDU8EngBcAlyaxhenYefAcNHAsGPI0EvD+jQDrw3O\n", 880 | "M2R6syae3S11WPM/AZNBseJSqvud7wWuAn4UeBbwDODpwNOobiL4XapHlz4CPJqGx4D/Ab6dhu8A\n", 881 | "30vrfgv4fhr+d2D8fwPDD6gulx+cjk3T65fTD5tnyPQFBZzm05AKc3PTG2zDP6ygHXF0VPSAZ1Ld\n", 882 | "KfZ6qmdKPAe4EniA6tnT/5mmHwS+DnwNeAhYg953MwQtqZ7G6802VMImg6nFs6ieIdGn+ofwBOCT\n", 883 | "wD1Uz5i4FzgDve9lC1HSLBVZb3q4P5HYC3EE4hMQZyH+EuI3IH4sHR1IWhxF1ptFFqoZcQnEqyE+\n", 884 | "DPEQxDshDkDY1yMttiLrzSILVU/shvh9iK9BHIe4BeLi3FFJao0i680iC7U9cTnEmyEehjgG8eO5\n", 885 | "I5LUSkXWm0UWajqxA+Jwagr6E4irc0ckqdWKrDeLLNTk4icg7ob4GMRzc0cjqROKrDeLLNR4sQPi\n", 886 | "dyG+AfG6al6SJlJkvVlkobYWeyA+CPEvEFfmjkZS5xRZbxZZqNHipyEegHirp4hK2qYi680iCzVc\n", 887 | "3JI6iX85dySSOq3IerPIQl0oboP4KsRy7kgkdV6R9WaRhXq8+B2IL0NcmzsSSUVoZb15kOqGaatb\n", 888 | "rPOWLZa1slDNid+D+Pd0czlJakLr6s39VMkAqmQwrAnkMHDfFttoXaGaE4ch7od4Ru5IJBWldfXm\n", 889 | "7Ww8ZKEPHBmx3p1bbKN1hWpG3JL6CK7JHYmk4jReb9Y9tXEJWBuY31Nze4WIlwLvAF4Ova2OiiSp\n", 890 | "FZq46tV76T9OXAW8H3g19D6dOxpJmkTdZHCe6jm6UD1U/WzN7XVcXAp8AHgr9E7kjkaSJlU3GbwP\n", 891 | "2Jem9wJ3pemlmtvtqj+iet7wH+YORJKmUbfP4BTVQ9j7VEcJp9Prx9PrALem6duAd4/YztGB6ZNp\n", 892 | "6Jj4NarP4QXQK7RTXFImK2koWgEVZzw73X3UW1BLmocC6s0LdbxQcRHERyBenzsSSQuj4/XmcB0v\n", 893 | "VLwh3Yra5xFImpeO15vDdbhQcU16XrEXlkmapw7Xm6N1tFCxIx0RvCF3JJIWTkfrza11tFDxutRX\n", 894 | "cFHuSCQtnI7Wm1vrYKFid3pIjWcPScqhg/XmeB0sVPwxxNtzRyFpYXWw3hyvY4WK56RrCp6aOxJJ\n", 895 | "C6tj9eZkOlao+KCdxpIy61i9OZkOFSp+AeILEJfkjkTSQutQvTm5jhQqLoL4PMQv5o5E0sLrSL05\n", 896 | "nY4UKl4D8WEIn98gKbeO1JvT6UCh4qLUPNTPHYkk0Yl6c3odKFS81qMCSS3SgXpzei0vVOz0qEBS\n", 897 | "y7S83tyelhcqXpvuQeRRgaS2aHm9uT0tLlTshPgixM25I5GkAS2uN7evxYWKX4W426MCSS3T4npz\n", 898 | "+1paqOhBfALil3JHIkmbtLTerKelhYobIb7kLaoltVBL6816WlqouAPiN3NHIUlDtLTerKeFhYp9\n", 899 | "6XGWl+WORJKGaLze9CHuw/0W8G7oPZY7EElaFC07MogrINYgrswdiSSN4JHBHNwGfBB6D+YORJIW\n", 900 | "SYuODGJHOoPohtyRSNIWWlRvNqdFhYqbIf7Ni8wktVyL6s3mtKhQ8RcQr88dhSSN0aJ6szktKVQ8\n", 901 | "FeI8xK7ckUjSGHYgz9CvA38DvXO5A5GkLjoI9IHVbS5vwZFB9CDuhbgpdySSNIHWHRnsT+MTabw8\n", 902 | "5fK2eHEa3501CknKpG4yOASsN6ucAQ5MubwtVoFj0GvBUYokzV/dZLAErA3M75lyeQvEFcCrgD/N\n", 903 | "HYkk5dJEB/K4c/Lbfs7+QeCfoPdw7kAkKZedNd9/HtidpncBZ6dcvu7owPTJNMzLa4C3z3F/kjSt\n", 904 | "lTS01jIbZwkdAa5L00tjlg/K2E4fz0o3pXtCvhgkaWqtO5voVBr3qY4CTqf542OWt8Wrgb+G3ndy\n", 905 | "ByJJiy7nkcFpiJ/Jt39J2pYiz3zMVKj4SYgHqzuVSlKntK6ZqMteA/w59H6QOxBJUpYjg9gB8QDE\n", 906 | "8+a/b0mqzWaihnb5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GYckLZL7gWtyB7HZKheeWnrPkHW+BFw3r6AkSZI2G3c9zLDlo97zlim3XaJZfp7r\n", 945 | "84v0eWbX9BXITX1BpvkilWyWn+ci/eDGXQ8zbPmo9xxmo/lzkm2XaJafJ2y0JNxfO9LuaOq3vpqG\n", 946 | "26fYNtBsMmjqCzLNF6lks/w8YbF+cOOuhxm2/BBVv9fm97wrzU+67RLN8vOE6rt5LfCh5kJutaZ+\n", 947 | "633gOFUf7r40vzxkvaGaTAZNfUEmfa10s/w8YbF+cOOuhxm2fJJraCbZdolm+XlCdYZin8W5hU1T\n", 948 | "v/V9A+89k+Z/Zch6QzWZDJr6gtT9IpVilp8nLN4PbtyZc3XOrKt7Vl4XzfLzPEb1T3YP1Xe0dE39\n", 949 | "1o+lAaojh3vSemc3rTdU030Gs/yCLCJ/cM0Ydz3M4PL1H8+490y67RLN8vNcZaMP4SzVv9tF0ORv\n", 950 | "fT/wKTZO45/ovU0mg7pfkElf8wd34fJpP89F+8G9j40y7qW6Hgaqz2Pz8n1p+aj3TLrtks3y8zxD\n", 951 | "1e4N1R+VTzYTcqs1nVz7wJsm3PYPNZkM6n5BJn3NH9yFy6f5PI+zeD+49X9Ifaofx+k0f3yL5aPe\n", 952 | "cyvVhZa3jdl2yWb5eZ6gatc+CDzMYnyeTSbXw8Db0nR/i/VmbtwFaMOW13mtdLP8PA+m4bcbjFfS\n", 953 | "9jTxWz9A1Y9wXxrfvMV7JUmSJEmSJEmSJEmSJEmSJEmSJEka7f8BTK/2noup1Q4AAAAASUVORK5C\n", 954 | "YII=\n" 955 | ], 956 | "text/plain": [ 957 | "" 958 | ] 959 | }, 960 | "metadata": {}, 961 | "output_type": "display_data" 962 | } 963 | ], 964 | "source": [ 965 | "qmuTest = np.linspace(0,.002,100)\n", 966 | "\n", 967 | "CLb = qmuTest.copy()\n", 968 | "for i,qq in enumerate(qmuTest):\n", 969 | " CLb[i] = fasimov.CLbArgumentWrapper(qq, 0.001, 100, 10000.0, 100.0, -1.0)\n", 970 | " #CLb[i] = fau.F(float(qq),float(30.),float(0),float(sig))\n", 971 | "plt.plot(qmuTest,CLb)" 972 | ] 973 | }, 974 | { 975 | "cell_type": "code", 976 | "execution_count": 3, 977 | "metadata": { 978 | "collapsed": false 979 | }, 980 | "outputs": [ 981 | { 982 | "name": "stdout", 983 | "output_type": "stream", 984 | "text": [ 985 | "Populating the interactive namespace from numpy and matplotlib\n" 986 | ] 987 | } 988 | ], 989 | "source": [ 990 | "%pylab inline\n", 991 | "import fasimov " 992 | ] 993 | }, 994 | { 995 | "cell_type": "code", 996 | "execution_count": 4, 997 | "metadata": { 998 | "collapsed": false 999 | }, 1000 | "outputs": [ 1001 | { 1002 | "name": "stdout", 1003 | "output_type": "stream", 1004 | "text": [ 1005 | "hit boundary\n", 1006 | "hit boundary\n", 1007 | "hit boundary\n", 1008 | "hit boundary\n", 1009 | "hit boundary\n", 1010 | "hit boundary\n", 1011 | "hit boundary\n", 1012 | "hit boundary\n", 1013 | "hit boundary\n", 1014 | "hit boundary\n", 1015 | "hit boundary\n", 1016 | "hit boundary\n", 1017 | "hit boundary\n", 1018 | "hit boundary\n", 1019 | "hit boundary\n", 1020 | "hit boundary\n", 1021 | "hit boundary\n", 1022 | "hit boundary\n", 1023 | "hit boundary\n" 1024 | ] 1025 | }, 1026 | { 1027 | "data": { 1028 | "text/plain": [ 1029 | "(0, 1)" 1030 | ] 1031 | }, 1032 | "execution_count": 4, 1033 | "metadata": {}, 1034 | "output_type": "execute_result" 1035 | }, 1036 | { 1037 | "data": { 1038 | "image/png": [ 1039 | "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEACAYAAABMEua6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\n", 1040 | "AAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xe8FdW1wPHfcC8dC4KIAopdY8EoBEFFRI1YYoslahJ7\n", 1041 | "7CbPaEBjnpjEkqomscRnLLG3aDQaCyqxG1FRLChYARUV0RhNEHS9P9YcOPfc08/M7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"pvzm0u8DAxKOpVQA3E08uy8Z0yxvc6e3gTVKYBmBW0X72eOs8tgN+C3aLTA6xuskaRwwpeSxLuhK\n", 1093 | "Ux+2m1sHHTTNWi0gk17e5k5vA2uGQBeBHwu8K7BrDJdYE3gSXWXp45L/Zg0Dppc8tgK60tQXZwFX\n", 1094 | "uw7CmJC3udPbwFohMFrgDYHfi65QjMI+6HTF4/F3jnyzBgNvlzy2NjDLQSyV9EZr0G/tOhBj8Dh3\n", 1095 | "ehtYqwT6Ctwo8Ky0NtjXE7gITXDDo4nOOz2BhXT8sBoFPOEmnIr2Qr9R2KCpcc3b3OltYFEIpz0e\n", 1096 | "LvC+wKFNrELdBF3Jeh2wbPQReuVToE/R/V3QQmQ+CYB7sUFT4563udPbwKIk8BWB5wRukvpmc3QD\n", 1097 | "JqHdLd8le90t5bwFrFZ0/0B0palv1kUHTbO+5aHxm60odSnQzSlGotX/pgvsX6XVPgztdhgBfBVN\n", 1098 | "bHn48JsP9C+63x93q0mreRm4ADjHdSDG+CgPyaoDgRGiif32kn1QuwL/i87NPoh8tM6LTQa+XnT/\n", 1099 | "THSlqY96oh/QO7oOxORW5C318ehqv5nAhAqvGYtu5vs8necg51agUxI3A54Cpgkc1hU2Rlvno9DW\n", 1100 | "+eXk7wPvAzqWOehH5W3uXPsPcAzwBzTBG5NqbehMjKFo63IanWd3LI8urS70O/anvLwlrg6mwqjX\n", 1101 | "Yd798Pl4/XDMW+u82PnAsUX3b0ZXmvrsBmxPU+NGpLlzFHBX0f2J4VHsaOCndZwrr0k9APYH5naD\n", 1102 | "S9+FSQIfCPxc8rub/U/RKpMFU9CVpj4bhHaXrec6EJM7kXa/DAJmF92fQ+ea02ujKwIfAKaidb6N\n", 1103 | "+gpwP3ASsNfncMhAnekyDFgdeElgX4834YhL6UCpz90vBXPRlvoF5O/vy6RIraRezydEV2BTYCdg\n", 1104 | "B+AnaKLPs2XQmuf/QLsWRgCPFZ4MYG4AB6At+InAFNFEnxelNdV9nf1S6gK0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b\n", 1193 | "90u+PYlu7jIOXa0+wG04plk2T70phQqGsoLrSKIje4AUffWWT0CWcRePcaQdrfA4B/02asrzNnd6\n", 1194 | "G5jf5FiQa11HES3ZBmRKeLs9rKVupVvzazzwLnAK1ntQjre509vA/CUByLNaPz1L5Ksg08Lb/UDm\n", 1195 | "u43HeGAw8DDaHbOi41h8YytKM2QzYBkgaxUMi/vUbeaLAe2C2QYtGPh0eNt4zlrqDZMLQU51HUX0\n", 1196 | "ZHmQj8Pbw0Gmuo3HeGY8MBf4LbrBdd55mzu9DcxP0hvkQ5DBriOJnnQJa6q3hXuWTnYdkfFOP+AG\n", 1197 | "4EX0G2ueeZs7vQ3MT3IgyB2uo4iPfBTO7NkLJK1b85l4BcB+aLXH/yW/tWOsTz0jDkXr1GdVoV/d\n", 1198 | "5qibSgS4FvgqWhjsEWBdpxGlgCV1L8m6wDrA31xHEiNL6qZec9F+9svQxH4yugubKcOSup8OBf4M\n", 1199 | "wSLXgcSoUFO9L1YiwNQmwIXoStQxwFPAaKcRGetTr490BXk3bK1nmNwCsifI+SDHuI7GpEoA7IO2\n", 1200 | "4C+kY8mJLLI+9ZTbBZgJwcuuA4mZdb+YZgk6M2aD8P6LwL5oss89S+r+OYxsD5AWWFI3rfoIOArY\n", 1201 | "CzgVXY26QdXfyAFL6l6RwcAoIA9T/Cypm6g8CmwK3Imuvj6fHO+wZEndLwcBN0DwqetAEmADpSZK\n", 1202 | "i4DzgPXR+uwvAT8EursMKutsoLQqaQd5HWSE60iSId8FuRLkbZBVXEdjMmc9dErwLGAP0t3f7m3u\n", 1203 | "9DYwP8h+IA+5jiI5sivI7SCfgfRyHY3JrO3RLfQeRTflSCNvc6e3gbm3pMTuzq4jSY6MAfknyOdW\n", 1204 | "S93ErA04AN1G7wHSt9evt7nT28Dckx1BnstXcpONQeaBvOc6EpMb7cDBwOvAPcBIt+HUzdvc6W1g\n", 1205 | "7smDIPu7jiJZsiqIgLziOhKTO92AI4DZaL+77ytTvc2d3gbml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z6ex/ejB/AE2p35IjpwBvl8LwragGeA28P7eX0v3kDLDzyDrlAFz96LehYvZdlW\n", 1219 | "6Arb4qT+S+BH4e0JwNlJB+XIQHSUH6AP2qW3Pvl9P3qFP9vRcagtye97AXACcDVwW3g/r+/F62gS\n", 1220 | "L+bVe1HP4qWsG0rHpF68OGtgeD+PbgW2w96PXuiKww3I73sxGJiMVkEstNTz+l68DvQreayh9yLu\n", 1221 | "spH1LF7Km5XQLhnCnz7srJK0oeg3mCfI7/vRBf3mOo+l3VJ5fS/OAU4Cvix6LK/vhaAfcFOBw8PH\n", 1222 | "Gnov4t7sOMfz0usi5O896gPcDHwf+KTkuTy9H1+i3VHLAXejrdRieXkvdkFXVj5D5XoveXkvALZA\n", 1223 | "Kz6uiPajl7bKa74XcbfU61m8lDfzWFqac2X0H3RedEUT+pVo9wvk+/0A+Bi4A9iMfL4Xo4Fd0W6H\n", 1224 | "a4Fx6L+PPL4XoAkd4H3gFuBrNPhexJ3UpwJrs3Tx0r4sHQjJq9uAA8PbB7I0uWVdAPwJne1xbtHj\n", 1225 | "eXw/+rN0BkNPYHu0pZrH9+IUtLG3OvAt4H7gO+TzvegFLBPe7g18HR2P8+69KLd4KS+uRYv3fI6O\n", 1226 | "LRyMjmxPxpPpSQnaEu1ymIYmsGfQ6a55fD82Ap5G34vn0P5kyOd7UWxrljb68vherI7+m5iGTvst\n", 1227 | "5Ms8vhfGGGOMMcYYY4wxxhhjjDHGGGOMMcYYY4wxxhhjjDHGmKj9P5nqhBu2MmgnAAAAAElFTkSu\n", 1228 | "QmCC\n" 1229 | ], 1230 | "text/plain": [ 1231 | "" 1232 | ] 1233 | }, 1234 | "metadata": {}, 1235 | "output_type": "display_data" 1236 | } 1237 | ], 1238 | "source": [ 1239 | "sTest = np.linspace(1,50,50)\n", 1240 | "\n", 1241 | "CLb_obs = sTest.copy()\n", 1242 | "CLb_exp = sTest.copy()\n", 1243 | "CLs_obs = sTest.copy()\n", 1244 | "CLs_exp = sTest.copy()\n", 1245 | "\n", 1246 | "for i,s in enumerate(sTest):\n", 1247 | " qtest =fasimov.qmuBand(s, bExp=100., deltaB=10., sigmaBand=0.)\n", 1248 | " qtest_b =fasimov.qmuBand(s=0.1, bExp=100., deltaB=10., sigmaBand=0.)\n", 1249 | "\n", 1250 | " CLb_obs[i] = fasimov.CLbArgumentWrapper(qtest, s,n=120,m=100,tau=1.,sigmaBand=0.)\n", 1251 | " CLb_exp[i] = fasimov.CLbArgumentWrapper(qtest_b, s,n=100,m=100,tau=1.,sigmaBand=0.)\n", 1252 | " CLs_obs[i] = fasimov.CLsArgumentWrapper(s,n=120, m=100,tau=1)\n", 1253 | " CLs_exp[i] = fasimov.CLsArgumentWrapper(s,n=100+s, m=100,tau=1)\n", 1254 | "\n", 1255 | "plt.plot(sTest,CLb_obs, c='blue')\n", 1256 | "plt.plot(sTest,CLb_exp, c='green')\n", 1257 | "plt.plot(sTest,CLs_obs, c='black')\n", 1258 | "plt.plot(sTest,CLs_exp, c='r')\n", 1259 | "plt.ylim(0,1)" 1260 | ] 1261 | }, 1262 | { 1263 | "cell_type": "code", 1264 | "execution_count": null, 1265 | "metadata": { 1266 | "collapsed": true 1267 | }, 1268 | "outputs": [], 1269 | "source": [] 1270 | }, 1271 | { 1272 | "cell_type": "code", 1273 | "execution_count": null, 1274 | "metadata": { 1275 | "collapsed": true 1276 | }, 1277 | "outputs": [], 1278 | "source": [] 1279 | } 1280 | ], 1281 | "metadata": { 1282 | "celltoolbar": "Slideshow", 1283 | "kernelspec": { 1284 | "display_name": "Python 2", 1285 | "language": "python", 1286 | "name": "python2" 1287 | }, 1288 | "language_info": { 1289 | "codemirror_mode": { 1290 | "name": "ipython", 1291 | "version": 2 1292 | }, 1293 | "file_extension": ".py", 1294 | "mimetype": "text/x-python", 1295 | "name": "python", 1296 | "nbconvert_exporter": "python", 1297 | "pygments_lexer": "ipython2", 1298 | "version": "2.7.6" 1299 | } 1300 | }, 1301 | "nbformat": 4, 1302 | "nbformat_minor": 0 1303 | } 1304 | --------------------------------------------------------------------------------