Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
HybridCalculator.h
Go to the documentation of this file.
1// @(#)root/roostats:$Id$
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_HybridCalculator
12#define ROOSTATS_HybridCalculator
13
15
17
18
19
20namespace RooStats {
21
23
24 public:
26 const RooAbsData &data,
27 const ModelConfig &altModel,
28 const ModelConfig &nullModel,
29 TestStatSampler* sampler=nullptr
30 ) :
31 HypoTestCalculatorGeneric(data, altModel, nullModel, sampler),
32 fPriorNuisanceNull(MakeNuisancePdf(nullModel, "PriorNuisanceNull")),
33 fPriorNuisanceAlt(MakeNuisancePdf(altModel, "PriorNuisanceAlt")),
34 fNToysNull(-1),
35 fNToysAlt(-1),
38 {
39 }
40
45
46
47 /// Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfig
48 virtual void ForcePriorNuisanceNull(RooAbsPdf& priorNuisance) {
50 fPriorNuisanceNull = &priorNuisance;
52 }
53 virtual void ForcePriorNuisanceAlt(RooAbsPdf& priorNuisance) {
55 fPriorNuisanceAlt = &priorNuisance;
57 }
58
59 void SetNullModel(const ModelConfig &nullModel) override {
60 fNullModel = &nullModel;
62 fPriorNuisanceNull = MakeNuisancePdf(nullModel, "PriorNuisanceNull");
64 }
65
66 void SetAlternateModel(const ModelConfig &altModel) override {
67 fAltModel = &altModel;
69 fPriorNuisanceAlt = MakeNuisancePdf(altModel, "PriorNuisanceAlt");
71 }
72
73 /// set number of toys
74 void SetToys(int toysNull, int toysAlt) { fNToysNull = toysNull; fNToysAlt = toysAlt; }
75
76 /// set least number of toys in tails
77 void SetNToysInTails(int toysNull, int toysAlt) { fNToysNullTail = toysNull; fNToysAltTail = toysAlt; }
78
79 protected:
80 /// check whether all input is consistent
81 int CheckHook(void) const override;
82
83 /// configure TestStatSampler for the Null run
84 int PreNullHook(RooArgSet* /*parameterPoint*/, double obsTestStat) const override;
85
86 /// configure TestStatSampler for the Alt run
87 int PreAltHook(RooArgSet* /*parameterPoint*/, double obsTestStat) const override;
88
89 protected:
92
93 // these flags tell us if the nuisance pdfs came from an external resource (via ForcePriorNuisance)
94 // or were created internally and should be deleted
97
98 // different number of toys for null and alt
101
102 // adaptive sampling
105
106 protected:
108 };
109}
110
111#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Abstract base class for binned and unbinned datasets.
Definition RooAbsData.h:56
Abstract interface for all probability density functions.
Definition RooAbsPdf.h:32
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
virtual void ForcePriorNuisanceNull(RooAbsPdf &priorNuisance)
Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfi...
void SetAlternateModel(const ModelConfig &altModel) override
Set the model for the alternate hypothesis.
int CheckHook(void) const override
check whether all input is consistent
virtual void ForcePriorNuisanceAlt(RooAbsPdf &priorNuisance)
void SetToys(int toysNull, int toysAlt)
set number of toys
void SetNullModel(const ModelConfig &nullModel) override
Set the model for the null hypothesis.
void SetNToysInTails(int toysNull, int toysAlt)
set least number of toys in tails
int PreAltHook(RooArgSet *, double obsTestStat) const override
configure TestStatSampler for the Alt run
HybridCalculator(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=nullptr)
int PreNullHook(RooArgSet *, double obsTestStat) const override
configure TestStatSampler for the Null run
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
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
extract constraint terms from pdf