Go to the documentation of this file.00001
00002
00003
00004 #ifndef ROOSTATS_BATCalculator
00005 #define ROOSTATS_BATCalculator
00006
00007 #include <TNamed.h>
00008 #include <TH1D.h>
00009
00010 #include <RooStats/IntervalCalculator.h>
00011 #include <RooStats/SimpleInterval.h>
00012 #include <RooStats/ModelConfig.h>
00013
00014 #include <RooArgSet.h>
00015 #include <RooAbsData.h>
00016 #include <RooAbsPdf.h>
00017 #include <RooPlot.h>
00018 #include <RooAbsReal.h>
00019
00020 #include <BCRooInterface.h>
00021
00022 #include <map>
00023 #include <vector>
00024
00025
00026 namespace RooStats
00027 {
00028
00029 class BATCalculator : public IntervalCalculator, public TNamed
00030 {
00031
00032 public:
00033
00034
00035 BATCalculator( );
00036
00037 BATCalculator( RooAbsData & data,
00038 RooAbsPdf & pdf,
00039 RooArgSet & POI,
00040 RooAbsPdf & prior,
00041 RooArgSet * params = 0 );
00042
00043
00044 BATCalculator( RooAbsData & data,
00045 ModelConfig & model );
00046
00047
00048 virtual ~BATCalculator();
00049
00050 RooPlot * GetPosteriorPlot1D() const;
00051
00052
00053 RooAbsPdf * GetPosteriorPdf1D() const;
00054 RooAbsPdf * GetPosteriorPdf1D(const char * POIname) const;
00055
00056 virtual SimpleInterval * GetInterval() const;
00057 virtual SimpleInterval * GetInterval(const char * POIname) const;
00058
00059 SimpleInterval * GetShortestInterval1D() const;
00060 SimpleInterval * GetShortestInterval1D(const char * POIname, bool & checkConnected) const;
00061
00062
00063 Double_t GetOneSidedUperLim();
00064
00065 virtual void SetData( RooAbsData & data )
00066 { fData = &data; ClearAll(); }
00067
00068 virtual void SetModel( const ModelConfig & model );
00069
00070
00071 virtual void SetTestSize( Double_t size )
00072 { fSize = size; fValidInterval = false; }
00073
00074
00075 virtual void SetConfidenceLevel( Double_t cl )
00076 { SetTestSize(1.-cl); }
00077
00078
00079 virtual Double_t Size() const
00080 { return fSize; }
00081
00082
00083 virtual Double_t ConfidenceLevel() const
00084 { return 1.-fSize; }
00085
00086 void SetBrfPrecision( double precision )
00087 { fBrfPrecision = precision; }
00088
00089 double GetBrfPrecision()
00090 { return fBrfPrecision; }
00091
00092 void SetnMCMC(int nMCMC)
00093 { _nMCMC = nMCMC; }
00094
00095 int GetnMCMC()
00096 { return _nMCMC; }
00097
00098
00099 bool GetConnected()
00100 { return fConnectedInterval; }
00101
00102 vector<double> GetIntervalBorders1D()
00103 { return _intervalBorders1D; }
00104
00105
00106
00107
00108 void SetNbins(const char * parname, int nbins);
00109
00110
00111
00112
00113 void CleanCalculatorForNewData()
00114 { ClearAll(); }
00115
00116 protected:
00117
00118 void ClearAll() const;
00119
00120 private:
00121
00122
00123
00124 RooArgSet * GetMode( RooArgSet * parameters ) const;
00125
00126
00127
00128
00129 RooAbsData * fData;
00130 RooAbsPdf * fPdf;
00131 const RooArgSet fPOI;
00132 RooAbsPdf * fPrior;
00133 const RooArgSet * fparams;
00134 BCRooInterface * _myRooInterface;
00135 mutable TH1D * _posteriorTH1D;
00136
00137
00138 mutable RooAbsPdf * fProductPdf;
00139 mutable RooAbsReal * fLogLike;
00140 mutable RooAbsReal * fLikelihood;
00141 mutable RooAbsReal * fIntegratedLikelihood;
00142 mutable RooAbsPdf * fPosteriorPdf;
00143 mutable Double_t fLower;
00144 mutable Double_t fUpper;
00145 double fBrfPrecision;
00146 mutable Bool_t fValidInterval;
00147 mutable bool fConnectedInterval;
00148
00149 int _nMCMC;
00150 double fSize;
00151 mutable vector<double> _intervalBorders1D;
00152
00153 protected:
00154
00155 ClassDef(BATCalculator,1)
00156
00157 };
00158
00159 bool sortbyposterior(pair< Int_t,Double_t > pair1, pair< Int_t,Double_t > pair2);
00160 }
00161
00162 #endif