Logo ROOT  
Reference Guide
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 
17 #include "RooStats/ToyMCSampler.h"
18 
20 
21 #include "RooFitResult.h"
22 
23 namespace RooStats {
24 
26 
27  public:
29  const RooAbsData &data,
30  const ModelConfig &altModel,
31  const ModelConfig &nullModel,
32  TestStatSampler* sampler=0
33  ) :
34  HypoTestCalculatorGeneric(data, altModel, nullModel, sampler),
36  fConditionalMLEsAlt(NULL),
37  fNToysNull(-1),
38  fNToysAlt(-1),
39  fNToysNullTail(0),
40  fNToysAltTail(0),
41  fFitInfo(NULL),
42  fStoreFitInfo(false)
43  {
44  }
45 
49  if( fFitInfo ) delete fFitInfo;
50  }
51 
52 
53  /// set number of toys
54  void SetToys(int toysNull, int toysAlt) { fNToysNull = toysNull; fNToysAlt = toysAlt; }
55 
56  /// set least number of toys in tails
57  void SetNToysInTails(int toysNull, int toysAlt) { fNToysNullTail = toysNull; fNToysAltTail = toysAlt; }
58 
59  /// set given nuisance parameters to a specific value that will be used instead of their
60  /// profiled value for Null toys
63 
64  if( c ) fConditionalMLEsNull = (const RooArgSet*)c->snapshot();
65  else fConditionalMLEsNull = NULL;
66  }
67 
68  /// set given nuisance parameters to a specific value that will be used instead of their
69  /// profiled value for Alternate toys
72 
73  if( c ) fConditionalMLEsAlt = (const RooArgSet*)c->snapshot();
74  else fConditionalMLEsAlt = NULL;
75  }
76 
77  void StoreFitInfo(bool val = true) {
78  fStoreFitInfo = val;
79  }
80 
81  const RooArgSet* GetFitInfo() const {
82  return fFitInfo;
83  }
84 
85  protected:
86  /// configure TestStatSampler for the Null run
87  int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const;
88 
89  /// configure TestStatSampler for the Alt run
90  int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const;
91 
92  void PreHook() const;
93  void PostHook() const;
94 
95  protected:
96  // MLE inputs
99 
100  // different number of toys for null and alt
103 
104  // adaptive sampling
107 
108  private:
109  mutable RooArgSet* fFitInfo;
111 
112  protected:
114  };
115 }
116 
117 #endif
RooStats::FrequentistCalculator::fNToysNull
int fNToysNull
Definition: FrequentistCalculator.h:101
c
#define c(i)
Definition: RSha256.hxx:101
RooStats::FrequentistCalculator::fNToysAlt
int fNToysAlt
Definition: FrequentistCalculator.h:102
RooStats::FrequentistCalculator::PreAltHook
int PreAltHook(RooArgSet *parameterPoint, double obsTestStat) const
configure TestStatSampler for the Alt run
Definition: FrequentistCalculator.cxx:173
RooStats::FrequentistCalculator::PostHook
void PostHook() const
Definition: FrequentistCalculator.cxx:50
RooStats::TestStatSampler
TestStatSampler is an interface class for a tools which produce RooStats SamplingDistributions.
Definition: TestStatSampler.h:39
RooAbsData
RooAbsData is the common abstract base class for binned and unbinned datasets.
Definition: RooAbsData.h:46
RooStats::FrequentistCalculator::SetNToysInTails
void SetNToysInTails(int toysNull, int toysAlt)
set least number of toys in tails
Definition: FrequentistCalculator.h:57
RooStats::FrequentistCalculator::fNToysAltTail
int fNToysAltTail
Definition: FrequentistCalculator.h:106
RooStats::FrequentistCalculator::PreHook
void PreHook() const
Definition: FrequentistCalculator.cxx:38
DetailedOutputAggregator.h
RooStats::FrequentistCalculator::SetToys
void SetToys(int toysNull, int toysAlt)
set number of toys
Definition: FrequentistCalculator.h:54
ToyMCSampler.h
RooStats::FrequentistCalculator::~FrequentistCalculator
~FrequentistCalculator()
Definition: FrequentistCalculator.h:46
RooStats::FrequentistCalculator::fConditionalMLEsAlt
const RooArgSet * fConditionalMLEsAlt
Definition: FrequentistCalculator.h:98
RooStats::FrequentistCalculator::fStoreFitInfo
bool fStoreFitInfo
Definition: FrequentistCalculator.h:110
RooStats::FrequentistCalculator::fNToysNullTail
int fNToysNullTail
Definition: FrequentistCalculator.h:105
RooStats::FrequentistCalculator::SetConditionalMLEsNull
void SetConditionalMLEsNull(const RooArgSet *c)
set given nuisance parameters to a specific value that will be used instead of their profiled value f...
Definition: FrequentistCalculator.h:61
RooStats::FrequentistCalculator
Does a frequentist hypothesis test.
Definition: FrequentistCalculator.h:25
RooStats::FrequentistCalculator::SetConditionalMLEsAlt
void SetConditionalMLEsAlt(const RooArgSet *c)
set given nuisance parameters to a specific value that will be used instead of their profiled value f...
Definition: FrequentistCalculator.h:70
RooStats::FrequentistCalculator::fFitInfo
RooArgSet * fFitInfo
Definition: FrequentistCalculator.h:109
RooStats::FrequentistCalculator::fConditionalMLEsNull
const RooArgSet * fConditionalMLEsNull
Definition: FrequentistCalculator.h:97
RooStats::HypoTestCalculatorGeneric
Common base class for the Hypothesis Test Calculators.
Definition: HypoTestCalculatorGeneric.h:34
HypoTestCalculatorGeneric.h
RooFitResult.h
RooStats::FrequentistCalculator::PreNullHook
int PreNullHook(RooArgSet *parameterPoint, double obsTestStat) const
configure TestStatSampler for the Null run
Definition: FrequentistCalculator.cxx:55
RooStats
Namespace for the RooStats classes.
Definition: Asimov.h:19
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooStats::ModelConfig
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:30
RooStats::FrequentistCalculator::GetFitInfo
const RooArgSet * GetFitInfo() const
Definition: FrequentistCalculator.h:81
RooStats::FrequentistCalculator::FrequentistCalculator
FrequentistCalculator(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=0)
Definition: FrequentistCalculator.h:28
RooStats::FrequentistCalculator::StoreFitInfo
void StoreFitInfo(bool val=true)
Definition: FrequentistCalculator.h:77
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28