Logo ROOT  
Reference Guide
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 
16 #include "RooStats/ToyMCSampler.h"
17 
18 
19 
20 namespace RooStats {
21 
23 
24  public:
26  const RooAbsData &data,
27  const ModelConfig &altModel,
28  const ModelConfig &nullModel,
29  TestStatSampler* sampler=0
30  ) :
31  HypoTestCalculatorGeneric(data, altModel, nullModel, sampler),
32  fPriorNuisanceNull(MakeNuisancePdf(nullModel, "PriorNuisanceNull")),
33  fPriorNuisanceAlt(MakeNuisancePdf(altModel, "PriorNuisanceAlt")),
36  fNToysNull(-1),
37  fNToysAlt(-1),
38  fNToysNullTail(0),
39  fNToysAltTail(0)
40  {
41  }
42 
46  }
47 
48 
49  /// Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfig
50  virtual void ForcePriorNuisanceNull(RooAbsPdf& priorNuisance) {
52  fPriorNuisanceNull = &priorNuisance;
54  }
55  virtual void ForcePriorNuisanceAlt(RooAbsPdf& priorNuisance) {
57  fPriorNuisanceAlt = &priorNuisance;
59  }
60 
61  virtual void SetNullModel(const ModelConfig &nullModel) {
62  fNullModel = &nullModel;
64  fPriorNuisanceNull = MakeNuisancePdf(nullModel, "PriorNuisanceNull");
66  }
67 
68  virtual void SetAlternateModel(const ModelConfig &altModel) {
69  fAltModel = &altModel;
71  fPriorNuisanceAlt = MakeNuisancePdf(altModel, "PriorNuisanceAlt");
73  }
74 
75  /// set number of toys
76  void SetToys(int toysNull, int toysAlt) { fNToysNull = toysNull; fNToysAlt = toysAlt; }
77 
78  /// set least number of toys in tails
79  void SetNToysInTails(int toysNull, int toysAlt) { fNToysNullTail = toysNull; fNToysAltTail = toysAlt; }
80 
81  protected:
82  /// check whether all input is consistent
83  int CheckHook(void) const;
84 
85  /// configure TestStatSampler for the Null run
86  int PreNullHook(RooArgSet* /*parameterPoint*/, double obsTestStat) const;
87 
88  /// configure TestStatSampler for the Alt run
89  int PreAltHook(RooArgSet* /*parameterPoint*/, double obsTestStat) const;
90 
91  protected:
94 
95  // these flags tell us if the nuisance pdfs came from an external resource (via ForcePriorNuisance)
96  // or were created internally and should be deleted
99 
100  // different number of toys for null and alt
103 
104  // adaptive sampling
107 
108  protected:
110  };
111 }
112 
113 #endif
RooStats::HybridCalculator::SetAlternateModel
virtual void SetAlternateModel(const ModelConfig &altModel)
Set the model for the alternate hypothesis (S+B)
Definition: HybridCalculator.h:68
RooStats::HypoTestCalculatorGeneric::fNullModel
const ModelConfig * fNullModel
Definition: HypoTestCalculatorGeneric.h:84
RooStats::HybridCalculator::ForcePriorNuisanceNull
virtual void ForcePriorNuisanceNull(RooAbsPdf &priorNuisance)
Override the distribution used for marginalizing nuisance parameters that is inferred from ModelConfi...
Definition: HybridCalculator.h:50
RooStats::HybridCalculator
Same purpose as HybridCalculatorOriginal, but different implementation.
Definition: HybridCalculator.h:22
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::HybridCalculator::fPriorNuisanceNull
RooAbsPdf * fPriorNuisanceNull
Definition: HybridCalculator.h:92
RooStats::HybridCalculator::fNToysNullTail
int fNToysNullTail
Definition: HybridCalculator.h:105
ToyMCSampler.h
RooStats::HybridCalculator::fPriorNuisanceNullExternal
Bool_t fPriorNuisanceNullExternal
Definition: HybridCalculator.h:97
RooStats::HybridCalculator::PreAltHook
int PreAltHook(RooArgSet *, double obsTestStat) const
configure TestStatSampler for the Alt run
Definition: HybridCalculator.cxx:103
RooStats::HybridCalculator::fPriorNuisanceAltExternal
Bool_t fPriorNuisanceAltExternal
Definition: HybridCalculator.h:98
RooStats::HybridCalculator::PreNullHook
int PreNullHook(RooArgSet *, double obsTestStat) const
configure TestStatSampler for the Null run
Definition: HybridCalculator.cxx:53
bool
RooStats::HybridCalculator::fPriorNuisanceAlt
RooAbsPdf * fPriorNuisanceAlt
Definition: HybridCalculator.h:93
RooStats::HybridCalculator::SetNToysInTails
void SetNToysInTails(int toysNull, int toysAlt)
set least number of toys in tails
Definition: HybridCalculator.h:79
RooStats::HybridCalculator::HybridCalculator
HybridCalculator(const RooAbsData &data, const ModelConfig &altModel, const ModelConfig &nullModel, TestStatSampler *sampler=0)
Definition: HybridCalculator.h:25
RooStats::HybridCalculator::ForcePriorNuisanceAlt
virtual void ForcePriorNuisanceAlt(RooAbsPdf &priorNuisance)
Definition: HybridCalculator.h:55
RooStats::HypoTestCalculatorGeneric
Common base class for the Hypothesis Test Calculators.
Definition: HypoTestCalculatorGeneric.h:34
HypoTestCalculatorGeneric.h
RooStats::HybridCalculator::fNToysNull
int fNToysNull
Definition: HybridCalculator.h:101
RooStats::HybridCalculator::fNToysAltTail
int fNToysAltTail
Definition: HybridCalculator.h:106
RooStats::HybridCalculator::SetToys
void SetToys(int toysNull, int toysAlt)
set number of toys
Definition: HybridCalculator.h:76
RooStats::HybridCalculator::~HybridCalculator
~HybridCalculator()
Definition: HybridCalculator.h:43
RooStats
Namespace for the RooStats classes.
Definition: Asimov.h:19
RooStats::HybridCalculator::fNToysAlt
int fNToysAlt
Definition: HybridCalculator.h:102
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooAbsPdf
Definition: RooAbsPdf.h:40
RooStats::HypoTestCalculatorGeneric::fAltModel
const ModelConfig * fAltModel
Definition: HypoTestCalculatorGeneric.h:83
RooStats::ModelConfig
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
Definition: ModelConfig.h:30
RooStats::HybridCalculator::SetNullModel
virtual void SetNullModel(const ModelConfig &nullModel)
Definition: HybridCalculator.h:61
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooStats::MakeNuisancePdf
RooAbsPdf * MakeNuisancePdf(RooAbsPdf &pdf, const RooArgSet &observables, const char *name)
Definition: RooStatsUtils.cxx:118
RooStats::HybridCalculator::CheckHook
int CheckHook(void) const
check whether all input is consistent
Definition: HybridCalculator.cxx:37