Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
FrequentistCalculator.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id: FrequentistCalculator.h 37084 2010-11-29 21:37:13Z moneta $
2// Author: Sven Kreiss, Kyle Cranmer Nov 2010
3/*************************************************************************
4 * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOSTATS_FrequentistCalculator
12#define ROOSTATS_FrequentistCalculator
13
14
16
18
20
21#include "RooFitResult.h"
22
23namespace RooStats {
24
26
27 public:
29 const RooAbsData &data,
30 const ModelConfig &altModel,
31 const ModelConfig &nullModel,
32 TestStatSampler* sampler=nullptr
33 ) :
34 HypoTestCalculatorGeneric(data, altModel, nullModel, sampler),
35 fNToysNull(-1),
36 fNToysAlt(-1),
39 fFitInfo(nullptr),
40 fStoreFitInfo(false)
41 {
42 }
43
49
50
51 /// set number of toys
52 void SetToys(int toysNull, int toysAlt) { fNToysNull = toysNull; fNToysAlt = toysAlt; }
53
54 /// set least number of toys in tails
55 void SetNToysInTails(int toysNull, int toysAlt) { fNToysNullTail = toysNull; fNToysAltTail = toysAlt; }
56
57 /// set given nuisance parameters to a specific value that will be used instead of their
58 /// profiled value for Null toys
61
62 if( c ) fConditionalMLEsNull = (const RooArgSet*)c->snapshot();
63 else fConditionalMLEsNull = nullptr;
64 }
65
66 /// set given nuisance parameters to a specific value that will be used instead of their
67 /// profiled value for Alternate toys
70
71 if( c ) fConditionalMLEsAlt = (const RooArgSet*)c->snapshot();
72 else fConditionalMLEsAlt = nullptr;
73 }
74
75 void StoreFitInfo(bool val = true) {
76 fStoreFitInfo = val;
77 }
78
79 const RooArgSet* GetFitInfo() const override {
80 return fFitInfo;
81 }
82
83 protected:
84 /// configure TestStatSampler for the Null run
85 int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const override;
86
87 /// configure TestStatSampler for the Alt run
88 int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const override;
89
90 void PreHook() const override;
91 void PostHook() const override;
92
93 protected:
94 // MLE inputs
97
98 // different number of toys for null and alt
101
102 // adaptive sampling
105
106 private:
109
110 protected:
112 };
113}
114
115#endif
#define c(i)
Definition RSha256.hxx:101
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:56
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
void SetConditionalMLEsNull(const RooArgSet *c)
set given nuisance parameters to a specific value that will be used instead of their profiled value f...
void SetConditionalMLEsAlt(const RooArgSet *c)
set given nuisance parameters to a specific value that will be used instead of their profiled value f...
void SetNToysInTails(int toysNull, int toysAlt)
set least number of toys in tails
int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const override
configure TestStatSampler for the Null run
int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const override
configure TestStatSampler for the Alt run
FrequentistCalculator(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=nullptr)
const RooArgSet * GetFitInfo() const override
void SetToys(int toysNull, int toysAlt)
set number of toys
HypoTestCalculatorGeneric(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=nullptr)
Constructor.
< A class that holds configuration information for a model using a workspace as a store
Definition ModelConfig.h:34
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
Namespace for the RooStats classes.
Definition CodegenImpl.h:66