Logo ROOT  
Reference Guide
HypoTestCalculatorGeneric.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer, Sven Kreiss 23/05/10
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_HypoTestCalculatorGeneric
12 #define ROOSTATS_HypoTestCalculatorGeneric
13 
14 
15 #ifndef ROOT_Rtypes
16 #include "Rtypes.h" // necessary for TNamed
17 #endif
18 
20 
21 #include "RooStats/ModelConfig.h"
22 
23 #include "RooStats/TestStatistic.h"
24 
26 
28 
30 
31 
32 namespace RooStats {
33 
34  class HypoTestCalculatorGeneric : public HypoTestCalculator {
35 
36  public:
38  const RooAbsData &data,
39  const ModelConfig &altModel,
40  const ModelConfig &nullModel,
41  TestStatSampler* sampler=0
42  );
43 
44 
46 
47 
48  public:
49 
50  /// inherited methods from HypoTestCalculator interface
51  virtual HypoTestResult* GetHypoTest() const;
52 
53  // set the model for the null hypothesis (only B)
54  virtual void SetNullModel(const ModelConfig &nullModel) { fNullModel = &nullModel; }
55  const RooAbsData * GetData(void) const { return fData; }
56  const ModelConfig* GetNullModel(void) const { return fNullModel; }
57  virtual const RooArgSet* GetFitInfo() const { return NULL; }
58  /// Set the model for the alternate hypothesis (S+B)
59  virtual void SetAlternateModel(const ModelConfig &altModel) { fAltModel = &altModel; }
60  const ModelConfig* GetAlternateModel(void) const { return fAltModel; }
61  /// Set the DataSet
62  virtual void SetData(RooAbsData &data) { fData = &data; }
63 
64  /// Returns instance of TestStatSampler. Use to change properties of
65  /// TestStatSampler, e.g. GetTestStatSampler.SetTestSize(Double_t size);
67 
68  /// Set this for re-using always the same toys for alternate hypothesis in
69  /// case of calls at different null parameter points
70  /// This is useful to get more stable bands when running the HypoTest inversion
72 
73 
74  protected:
75  // should return zero (to be used later for conditional flow)
76  virtual int CheckHook(void) const { return 0; }
77  virtual int PreNullHook(RooArgSet* /*parameterPoint*/, double /*obsTestStat*/) const { return 0; }
78  virtual int PreAltHook(RooArgSet* /*parameterPoint*/, double /*obsTestStat*/) const { return 0; }
79  virtual void PreHook() const { }
80  virtual void PostHook() const { }
81 
82  protected:
83  const ModelConfig *fAltModel;
84  const ModelConfig *fNullModel;
85  const RooAbsData *fData;
86  TestStatSampler *fTestStatSampler;
87  TestStatSampler *fDefaultSampler;
89 
90  unsigned int fAltToysSeed; // to have same toys for alternate
91 
92  private:
93  void SetupSampler(const ModelConfig& model) const;
94  void SetAdaptiveLimits(Double_t obsTestStat, Bool_t forNull) const;
96  ModelConfig *thisModel,
97  double obsTestStat,
98  RooAbsPdf *impDens=NULL,
99  const RooArgSet *impSnapshot=NULL
100  ) const;
101 
102 
103  protected:
105 };
106 }
107 
108 #endif
RooStats::HypoTestCalculatorGeneric::fNullModel
const ModelConfig * fNullModel
Definition: HypoTestCalculatorGeneric.h:96
RooStats::HypoTestCalculatorGeneric::HypoTestCalculatorGeneric
HypoTestCalculatorGeneric(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=0)
Constructor.
Definition: HypoTestCalculatorGeneric.cxx:47
HypoTestCalculator.h
RooStats::TestStatSampler
Definition: TestStatSampler.h:39
RooStats::HypoTestCalculatorGeneric::PreAltHook
virtual int PreAltHook(RooArgSet *, double) const
Definition: HypoTestCalculatorGeneric.h:90
RooAbsData
Definition: RooAbsData.h:46
RooStats::SamplingDistribution
Definition: SamplingDistribution.h:39
RooStats::HypoTestCalculatorGeneric::GetNullModel
const ModelConfig * GetNullModel(void) const
Definition: HypoTestCalculatorGeneric.h:68
RooStats::HypoTestCalculatorGeneric::fDefaultSampler
TestStatSampler * fDefaultSampler
Definition: HypoTestCalculatorGeneric.h:99
RooStats::HypoTestCalculatorGeneric::fTestStatSampler
TestStatSampler * fTestStatSampler
Definition: HypoTestCalculatorGeneric.h:98
RooStats::HypoTestCalculatorGeneric::SetData
virtual void SetData(RooAbsData &data)
Set the DataSet.
Definition: HypoTestCalculatorGeneric.h:74
RooStats::HypoTestCalculatorGeneric::GenerateSamplingDistribution
SamplingDistribution * GenerateSamplingDistribution(ModelConfig *thisModel, double obsTestStat, RooAbsPdf *impDens=NULL, const RooArgSet *impSnapshot=NULL) const
RooStats::TestStatistic
Definition: TestStatistic.h:31
RooStats::HypoTestCalculatorGeneric::SetAlternateModel
virtual void SetAlternateModel(const ModelConfig &altModel)
Set the model for the alternate hypothesis (S+B)
Definition: HypoTestCalculatorGeneric.h:71
RooStats::HypoTestCalculatorGeneric::fData
const RooAbsData * fData
Definition: HypoTestCalculatorGeneric.h:97
RooStats::HypoTestCalculatorGeneric::fDefaultTestStat
TestStatistic * fDefaultTestStat
Definition: HypoTestCalculatorGeneric.h:100
HypoTestResult.h
bool
RooStats::HypoTestCalculatorGeneric::GetData
const RooAbsData * GetData(void) const
Definition: HypoTestCalculatorGeneric.h:67
TestStatSampler.h
RooStats::HypoTestCalculatorGeneric::SetupSampler
void SetupSampler(const ModelConfig &model) const
common setup for both models
Definition: HypoTestCalculatorGeneric.cxx:77
ModelConfig.h
RooStats::HypoTestCalculatorGeneric::~HypoTestCalculatorGeneric
~HypoTestCalculatorGeneric()
Definition: HypoTestCalculatorGeneric.cxx:93
TestStatistic.h
RooStats::HypoTestCalculatorGeneric::SetNullModel
virtual void SetNullModel(const ModelConfig &nullModel)
Definition: HypoTestCalculatorGeneric.h:66
RooStats::HypoTestCalculatorGeneric::GetHypoTest
virtual HypoTestResult * GetHypoTest() const
inherited methods from HypoTestCalculator interface
Definition: HypoTestCalculatorGeneric.cxx:106
RooStats::HypoTestCalculatorGeneric
Definition: HypoTestCalculatorGeneric.h:40
SamplingDistribution.h
RooStats::HypoTestCalculatorGeneric::GetFitInfo
virtual const RooArgSet * GetFitInfo() const
Definition: HypoTestCalculatorGeneric.h:69
RooStats::HypoTestCalculatorGeneric::PreHook
virtual void PreHook() const
Definition: HypoTestCalculatorGeneric.h:91
Double_t
double Double_t
Definition: RtypesCore.h:59
RooStats::HypoTestCalculatorGeneric::GetTestStatSampler
TestStatSampler * GetTestStatSampler(void) const
Returns instance of TestStatSampler.
Definition: HypoTestCalculatorGeneric.h:78
RooStats
Definition: Asimov.h:19
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooStats::HypoTestCalculatorGeneric::CheckHook
virtual int CheckHook(void) const
Definition: HypoTestCalculatorGeneric.h:88
RooStats::HypoTestResult
Definition: HypoTestResult.h:28
RooStats::HypoTestCalculatorGeneric::fAltToysSeed
unsigned int fAltToysSeed
Definition: HypoTestCalculatorGeneric.h:102
RooStats::HypoTestCalculatorGeneric::GetAlternateModel
const ModelConfig * GetAlternateModel(void) const
Definition: HypoTestCalculatorGeneric.h:72
make_cnn_model.model
model
Definition: make_cnn_model.py:6
RooAbsPdf
Definition: RooAbsPdf.h:40
RooStats::HypoTestCalculatorGeneric::SetAdaptiveLimits
void SetAdaptiveLimits(Double_t obsTestStat, Bool_t forNull) const
RooStats::HypoTestCalculatorGeneric::fAltModel
const ModelConfig * fAltModel
Definition: HypoTestCalculatorGeneric.h:95
RooStats::ModelConfig
Definition: ModelConfig.h:36
RooStats::HypoTestCalculatorGeneric::PreNullHook
virtual int PreNullHook(RooArgSet *, double) const
Definition: HypoTestCalculatorGeneric.h:89
Rtypes.h
RooStats::HypoTestCalculatorGeneric::UseSameAltToys
void UseSameAltToys()
Set this for re-using always the same toys for alternate hypothesis in case of calls at different nul...
Definition: HypoTestCalculatorGeneric.cxx:259
RooArgSet
Definition: RooArgSet.h:28
RooStats::HypoTestCalculatorGeneric::PostHook
virtual void PostHook() const
Definition: HypoTestCalculatorGeneric.h:92