RooStats_RooStatsTutorialsJune2013
上传者:莫德敏|上传时间:2015-04-15|密次下载
RooStats_RooStatsTutorialsJune2013
Table of Contents
RooFit/RooStats tutorials for INFN School of Statistics 2013.......................................................................1
Introduction.............................................................................................................................................1
Getting started with the software......................................................................................................1
Terminology and Conventions.........................................................................................................2
RooFit Exercises: Create and fitting a model..................................................................................................3
Exercise 1: Gaussian model and fit it to random generated data............................................................3
Exercise 2: Fit of a Signal over an Exponential Background.................................................................5
Exercise 3: Fit to a Combined model......................................................................................................8
RooStats Exercises...........................................................................................................................................13
Exercise 1: Create aModelConfig from the Gaussian plus Exponential Model used in the RooFit
Exercise 2..............................................................................................................................................13
Exercise 2: Profile Likelihood Calculator.............................................................................................14
Exercise 3a: Bayesian MCMC Calculator............................................................................................16
Exercise 3b: Bayesian Numerical Calculator.......................................................................................19
Exercise 4: Create a Poisson Counting Model......................................................................................22
Exercise 5: Compute a 95% Upper Limit with the Counting Model....................................................24
Exercise 6: Compute the significance (Hypothesis Test).....................................................................25
Exercise 6b: Compute significance (p-value) as function of the signal mass.......................................29
Exercise 7: Compute Limits using Hypothesis Test Inversion (CLs Limits).......................................31
Exercise 7b: Using theStandardHypoTestInvDemo.C tutorial............................................................35
RooFit/RooStats tutorials for INFN School of
Statistics 2013
This is a set of RooFit/RooStats tutorials given at INFN school of statistics (3-7 June 2013) , see the schoolagenda.
The required materials used during the RooFit/RooStats tutorials is described. The materials consist ofexercises that can be solved from what has been presented in the lecture. Two levels of help are provided: ahint and a full solution.
Hint Hide
Here the hint is shown.
Solution Hide
Here the solution is shown.
The hint allows to create the ROOT macro required to complete the exercise step by step, while the solutionprovides the full running code. The hint consists of code snippets, which can be combined to write a fullROOT macro to solve the exercise. If you are not able to write the macro yourself, because you find toodifficult or because the time is not sufficient, you can go directly to the solution, which will contain therunning code and (hopefully) you will be able to run the macro and get the result of the tutorial exercise.You can find the single code attached (links at the end of the page) or you can use the provided tar file. Somepoints linked to the exercises are optional and marked with a icon: they are useful to scrutinise in moredetail some aspects. Try to solve or look at them if you have the time.
Additional material can be found on:
the ROOT Web page;
the RooFit Web page and User Guide,Quick Start Guide;
the RooStats Twiki WebHome where you find links also to past tutorials;
the lecture slides (see Timetable for June 7);
RooFit and RooStats tutorials available in $ROOTSYS/tutorials/roofit and
$ROOTSYS/tutorials/roostats.
Introduction
Getting started with the software
A few advice words before starting. The tutorials are based on the ROOT version 5.34, possibly the latest one,
5.34.07 which is also installed in the Virtual Machine available for the school.
See the computer setup instructions if you need to install the virtual machine.
If you are going to use your installed version of ROOT, make sure you have configured with RooFit (./configure --enable-roofit). You can check if roofit is installed in your version of
ROOT by typing the command root-config --has-roofit. The answer must be yes. If not,you must re-configure ROOT and rebuild it or install a new binary version. See again the computersetup instructions for a detailed description on how to install and configure ROOT.
A basic knowledge of ROOT is assumed, in particular how to run a ROOT macro in interpreted mode(CINT) and in compiled mode (ACLIC)
root> .x myMacro.C // interpreted
root> .x myMacro.C+ // compiled
内容需要下载文档才能查看
RooStatsTutorialsJune2013 < RooStats < TWiki
It is recommended to add the following lines at the beginning of your ROOT macro, that will load
automatically the Roofit and Roostats libraries (note that the RooStats calculator are defined in the
RooStats namespace):
using namespace RooFit;
using namespace RooStats;
Avoid running a macro multiple times in the same ROOT CINT sessions (it might unfortunately crash
sometimes if you do it, because some objects might not be properly deleted in the macro)
Note that Roostats methods start with capital letter (as in ROOT) while Roofit ones start with lower
letter
The Roostats calculator are quite verbose, you can suppress the output by doing:
RooMsgService::instance().setGlobalKillBelow(RooFit::WARNING) ;
Some links to documentation:
ROOT reference guide: http://root.cern.ch/drupal/content/reference-guide
Roofit user's manual: http://root.cern.ch/drupal/content/users-guide
ROOT, Roofit, Roostats tutorials: http://root.cern.ch/root/html/tutorials/ or within the local ROOT
installation under $ROOTSYS/tutorials
Terminology and Conventions
Here we give pragmatic definitions for a few basic concepts that we will use.
observable - something you measure in an experiment, for example a particle's momentum. Often, a
function of measured quantities, for example an invariant mass of several particles
global observable or auxiliary observable - an observable from another measurement, for example,
the integrated luminosity
model - a set of probability density functions (PDFs), which describe distributions of the observables
or functions of observables
model parameter - any variable in your PDF expression, which is not an observable
parameter of interest (POI) - a model parameter that you study, for example a cross section of your
signal process
nuisance parameter - every other model parameter, which is not your parameter of interest
data or dataset - a set of values of observables, either measured in an experiment, or simulated
likelihood - a model computed for a particular dataset
hypothesis - a particular model, with specified observables, POI, nuisance parameters, and prior
PDFs (in case of Bayesian inference)
prior PDF - a probability density for an observable or a model parameter, which is known a priori,
i.e. before a measurement is considered. This is a Bayesian concept exclusively. Prior has no meaning
or place in a frequentist type of inference
Bayesian - a type of statistical inference that usually produces probability of the hypothesis given the
data. Requires a prior.
frequentist - a type of statistical inference that usually produces probability of the data given the
hypothesis.
RooFit Exercises: Create and fitting a model
The aim of the RooFit exercises is to learn how to build a RooFit model, how to fit the model on a set of datathat we will generate and how to plot the result. We will also learn how to save the full RooFit workspace
containing the model and data in a file which we can read back later, for example when we will do the
RooStats exercises. We will learn also how to generate the data from the model. The same generated data wewill then use to fit the model
Using the snippets of code, one can build a full ROOT macro which can be run interactively in ROOT or
compiled using ACLIC.
Exercise 1: Gaussian model and fit it to random generated
data
We will start with a very simple exercise. If you already know a bit of RooFit you might skip this exercise andgo directly to the next one. The aim of this exercise is to show and make you practise the basic functionalityof RooFit.
We will create a Gaussian model from which we will generate a pseudo-data set and then we will fit this dataset. After fitting, we will plot the result. You can find the instruction for each steps in the lecture slides.
Start creating the Gaussian model using the workspace factory, with the syntax introduced in the
lecture slides.
Use the generate(...) method of the RooAbsPdf class to generate a data set with 1000 events.
Plot the data set using RooPlot in a ROOT Canvas.
Fit the generate data using the fitTo(...) method of the RooAbsPdf class
Plot the resulting fit function on top of the data
Hint Hide
Creating the model
Use the syntax of the RooWorkspace factory to create first the Gaussian p.d.f. function with the
variables (observables and parameters).
Every variable in RooFit, needs to be created with a defined range [xmin,xmax]. Use very large value
if you don't know the range. If you provided only a value, the variable is considered constant. If you
provide only the minimum and the maximum, the initial value will be taken in the middle of the
range. It is important, to avoid undesired side effect, to have the initial value within the given range.
Note one can create using the workspace factory syntax any existing RooFit pdf class by using the Pdf
class name stripped by the Roo suffix. The exact signature required (variables to be passed) is defined
in the Pdf class constructor (You can browse the reference documentation here.
You need to define the [value, min, max] of a variable only the first time you create in the factory.
Afterwards you can reference the variable by its name.
// create Gaussian Pdf
RooWorkspace w("w");
w.factory("Gaussian:pdf(x[-10,10],mu[1,-1000,1000],s[2,0,1000])");
Retrieving objects from the workspace.
After you have created the variable and p.d.f in the workspace, you can access their pointers, by using
RooWorkspace::var for variables or RooWorkspace::pdf for p.d.f. Example:
// retrieving model components
RooAbsPdf * pdf = w.pdf("pdf"); // access object from workspace
内容需要下载文档才能查看
RooStatsTutorialsJune2013 < RooStats < TWiki
RooRealVar * x = w.var("x"); // access object from workspace
Generating a dataset:
We need to pass the observable we want to generate the data on (x) and the number of events
Note that we can generate also binned data sets. In that case we have two options:
use a RooDataHist and generateBinned: RooDataHist * binData =
pdf->generateBinned(*x, 1000);.
use the option AllBinned() which will generate a weighted data set: RooDataSet *
data = pdf->generate(*x, NumEvents(1000), AllBinned());.
// generate an unbinned dataset of 1000 events
RooDataSet * data = pdf->generate( *x, 1000);
Plot the data:
// create a RooPlot object and plot the data
RooPlot * plot = x->frame();
data->plotOn(plot);
Fit the data: you need to call the RooAbsPdf::fitTo.
// fit the data and save its result. Use the optional =Minuit2= minimiser
RooFitResult * res = pdf->fitTo(*data, Minimizer("Minuit2","Migrad"), Save(true) );
Plot the resulting fit function in the same plot
pdf->plotOn(plot);
plot->Draw(); // to show the RooPlot in the current ROOT Canvas
Solution Hide
<span class='twikiAlert'>
Failed to include URL https://twiki.cern.ch/twiki/pub/RooStats/RooStatsTutorialsJune2013/Ga</span>
Gaussian Fit Result:
Fit of the Gaussian model using RooFit
下载文档
热门试卷
- 2016年四川省内江市中考化学试卷
- 广西钦州市高新区2017届高三11月月考政治试卷
- 浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
- 浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
- 辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
- 广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
- 广西钦州市钦州港区2017届高三11月月考政治试卷
- 广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
- 广西钦州市高新区2016-2017学年高二11月月考政治试卷
- 广西钦州市高新区2016-2017学年高一11月月考政治试卷
- 山东省滨州市三校2017届第一学期阶段测试初三英语试题
- 四川省成都七中2017届高三一诊模拟考试文科综合试卷
- 2017届普通高等学校招生全国统一考试模拟试题(附答案)
- 重庆市永川中学高2017级上期12月月考语文试题
- 江西宜春三中2017届高三第一学期第二次月考文科综合试题
- 内蒙古赤峰二中2017届高三上学期第三次月考英语试题
- 2017年六年级(上)数学期末考试卷
- 2017人教版小学英语三年级上期末笔试题
- 江苏省常州西藏民族中学2016-2017学年九年级思想品德第一学期第二次阶段测试试卷
- 重庆市九龙坡区七校2016-2017学年上期八年级素质测查(二)语文学科试题卷
- 江苏省无锡市钱桥中学2016年12月八年级语文阶段性测试卷
- 江苏省无锡市钱桥中学2016-2017学年七年级英语12月阶段检测试卷
- 山东省邹城市第八中学2016-2017学年八年级12月物理第4章试题(无答案)
- 【人教版】河北省2015-2016学年度九年级上期末语文试题卷(附答案)
- 四川省简阳市阳安中学2016年12月高二月考英语试卷
- 四川省成都龙泉中学高三上学期2016年12月月考试题文科综合能力测试
- 安徽省滁州中学2016—2017学年度第一学期12月月考高三英语试卷
- 山东省武城县第二中学2016.12高一年级上学期第二次月考历史试题(必修一第四、五单元)
- 福建省四地六校联考2016-2017学年上学期第三次月考高三化学试卷
- 甘肃省武威第二十三中学2016—2017学年度八年级第一学期12月月考生物试卷
网友关注
- 标准个人借款合同范本
- 测试你在哪方面最有动力
- 护士妇科护理带教个人工作总结
- 雨夜,纵心言志赋倔强
- 菩提千年,繁华三千
- 节能新技术在建筑节能中的运用
- 测你能当上扛把子吗
- LOL英雄联盟无限火力模式4月29日火力全开
- LOL英雄联盟中单卡萨丁天赋出装
- 繁华三千,我只取一朵
- 似水流年,过往风化成霜
- 王者荣耀君临天下活动汇总
- 揭秘:明朝为何成为中国历史上最大的太监帝国
- 《春雨》
- LOL英雄联盟元素巨龙(小龙)改动
- 雅思要考多少分才可以去到梦想的国家留学
- 感恩母爱
- 秋日之悟
- 雅思经验分享:满分是“精心准备”出来的
- 浅谈《诗经》的艺术成就及影响
- 2015年全国高考地理试题及答案-海南卷
- 2016年房屋租赁居间合同范本
- 古代官员"福利"到底有多好?雨雪天也可以放假
- 自古红颜多痴情:中国古代的名妓哪位最痴情
- LOL英雄联盟最新英雄改动
- 测啥事是你爱情转折
- 教育实习总结范文
- 武侠小说叙事元素的历史研究
- 钟声敲响
- LOL英雄联盟最新装备改动
网友关注视频
- 沪教版牛津小学英语(深圳用) 四年级下册 Unit 12
- 二年级下册数学第二课
- 沪教版八年级下册数学练习册21.3(2)分式方程P15
- 外研版英语三起6年级下册(14版)Module3 Unit1
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,辽宁省
- 沪教版牛津小学英语(深圳用)五年级下册 Unit 1
- 外研版英语三起5年级下册(14版)Module3 Unit2
- 精品·同步课程 历史 八年级 上册 第15集 近代科学技术与思想文化
- 【部编】人教版语文七年级下册《过松源晨炊漆公店(其五)》优质课教学视频+PPT课件+教案,辽宁省
- 人教版历史八年级下册第一课《中华人民共和国成立》
- 每天日常投篮练习第一天森哥打卡上脚 Nike PG 2 如何调整运球跳投手感?
- 三年级英语单词记忆下册(沪教版)第一二单元复习
- 苏科版数学七年级下册7.2《探索平行线的性质》
- 北师大版数学 四年级下册 第三单元 第二节 小数点搬家
- 人教版二年级下册数学
- 【部编】人教版语文七年级下册《老山界》优质课教学视频+PPT课件+教案,安徽省
- 冀教版小学英语五年级下册lesson2教学视频(2)
- 沪教版牛津小学英语(深圳用) 五年级下册 Unit 12
- 北师大版小学数学四年级下册第15课小数乘小数一
- 3.2 数学二年级下册第二单元 表内除法(一)整理和复习 李菲菲
- 外研版英语三起6年级下册(14版)Module3 Unit2
- 沪教版八年级下册数学练习册21.4(1)无理方程P18
- 【部编】人教版语文七年级下册《逢入京使》优质课教学视频+PPT课件+教案,安徽省
- 第五单元 民族艺术的瑰宝_15. 多姿多彩的民族服饰_第二课时(市一等奖)(岭南版六年级上册)_T129830
- 第4章 幂函数、指数函数和对数函数(下)_六 指数方程和对数方程_4.7 简单的指数方程_第一课时(沪教版高一下册)_T1566237
- 沪教版八年级下册数学练习册21.3(3)分式方程P17
- 冀教版小学数学二年级下册第二单元《有余数除法的整理与复习》
- 《空中课堂》二年级下册 数学第一单元第1课时
- 冀教版小学数学二年级下册第二单元《有余数除法的竖式计算》
- 冀教版小学数学二年级下册第二单元《租船问题》
精品推荐
- 2016-2017学年高一语文人教版必修一+模块学业水平检测试题(含答案)
- 广西钦州市高新区2017届高三11月月考政治试卷
- 浙江省湖州市2016-2017学年高一上学期期中考试政治试卷
- 浙江省湖州市2016-2017学年高二上学期期中考试政治试卷
- 辽宁省铁岭市协作体2017届高三上学期第三次联考政治试卷
- 广西钦州市钦州港区2016-2017学年高二11月月考政治试卷
- 广西钦州市钦州港区2017届高三11月月考政治试卷
- 广西钦州市钦州港区2016-2017学年高一11月月考政治试卷
- 广西钦州市高新区2016-2017学年高二11月月考政治试卷
- 广西钦州市高新区2016-2017学年高一11月月考政治试卷
分类导航
- 互联网
- 电脑基础知识
- 计算机软件及应用
- 计算机硬件及网络
- 计算机应用/办公自动化
- .NET
- 数据结构与算法
- Java
- SEO
- C/C++资料
- linux/Unix相关
- 手机开发
- UML理论/建模
- 并行计算/云计算
- 嵌入式开发
- windows相关
- 软件工程
- 管理信息系统
- 开发文档
- 图形图像
- 网络与通信
- 网络信息安全
- 电子支付
- Labview
- matlab
- 网络资源
- Python
- Delphi/Perl
- 评测
- Flash/Flex
- CSS/Script
- 计算机原理
- PHP资料
- 数据挖掘与模式识别
- Web服务
- 数据库
- Visual Basic
- 电子商务
- 服务器
- 搜索引擎优化
- 存储
- 架构
- 行业软件
- 人工智能
- 计算机辅助设计
- 多媒体
- 软件测试
- 计算机硬件与维护
- 网站策划/UE
- 网页设计/UI
- 网吧管理