HypoTestInverter.h

Go to the documentation of this file.
00001 // @(#)root/roostats:$Id: HypoTestInverter.h 31798 2009-12-10 14:57:15Z moneta $
00002 // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke
00003 /*************************************************************************
00004  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
00005  * All rights reserved.                                                  *
00006  *                                                                       *
00007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00009  *************************************************************************/
00010 
00011 #ifndef ROOSTATS_HypoTestInverter
00012 #define ROOSTATS_HypoTestInverter
00013 
00014 
00015 
00016 #ifndef ROOSTATS_IntervalCalculator
00017 #include "RooStats/IntervalCalculator.h"
00018 #endif
00019 
00020 #ifndef ROOSTATS_HypoTestCalculator
00021 #include "RooStats/HypoTestCalculator.h"
00022 #endif
00023 
00024 #ifndef  ROOSTATS_HypoTestInverterResult
00025 #include "RooStats/HypoTestInverterResult.h"
00026 #endif
00027 
00028 class RooRealVar;
00029 
00030 
00031 namespace RooStats {
00032 
00033   class HypoTestInverter : public IntervalCalculator, public TNamed {
00034 
00035   public:
00036 
00037     // default constructor (used only for I/O)
00038     HypoTestInverter();
00039 
00040 
00041     // constructor
00042     HypoTestInverter( HypoTestCalculator& myhc0,
00043                       RooRealVar& scannedVariable, 
00044                       double size = 0.05) ;
00045 
00046      
00047 
00048     virtual HypoTestInverterResult* GetInterval() const { return fResults; } ;
00049 
00050     bool RunAutoScan( double xMin, double xMax, double target, double epsilon=0.005, unsigned int numAlgorithm=0 );
00051 
00052     bool RunFixedScan( int nBins, double xMin, double xMax );
00053 
00054     bool RunOnePoint( double thisX );
00055 
00056     void UseCLs( bool on = true) { fUseCLs = on; if (fResults) fResults->UseCLs(on);   }
00057 
00058     virtual void  SetData(RooAbsData &) { } // not needed
00059 
00060     virtual void SetModel(const ModelConfig &) { } // not needed 
00061 
00062     // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 95% Confidence Interval)
00063      virtual void SetTestSize(Double_t size) {fSize = size; if (fResults) fResults->SetTestSize(size); }
00064     // set the confidence level for the interval (eg. 0.95 for a 95% Confidence Interval)
00065     virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;  if (fResults) fResults->SetConfidenceLevel(cl); }
00066     // Get the size of the test (eg. rate of Type I error)
00067     virtual Double_t Size() const {return fSize;}
00068     // Get the Confidence level for the test
00069     virtual Double_t ConfidenceLevel()  const {return 1.-fSize;}
00070  
00071     // destructor
00072     virtual ~HypoTestInverter() ;
00073 
00074   private:
00075 
00076     void CreateResults(); 
00077 
00078     HypoTestCalculator* fCalculator0;   // pointer to the calculator passed in the constructor
00079     RooRealVar* fScannedVariable;     // pointer to the constrained variable
00080     HypoTestInverterResult* fResults;
00081 
00082     bool fUseCLs;
00083     double fSize;
00084 
00085   protected:
00086 
00087     ClassDef(HypoTestInverter,1)  // HypoTestInverter class
00088 
00089   };
00090 }
00091 
00092 #endif

Generated on Tue Jul 5 14:26:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1