SamplingDistribution.h

Go to the documentation of this file.
00001 // @(#)root/roostats:$Id: SamplingDistribution.h 38101 2011-02-16 16:52:00Z moneta $
00002 
00003 /*************************************************************************
00004  * Project: RooStats                                                     *
00005  * Package: RooFit/RooStats                                              *
00006  * Authors:                                                              *
00007  *   Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke       *
00008  *************************************************************************
00009  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
00010  * All rights reserved.                                                  *
00011  *                                                                       *
00012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00014  *************************************************************************/
00015 
00016 #ifndef ROOSTATS_SamplingDistribution
00017 #define ROOSTATS_SamplingDistribution
00018 
00019 #ifndef ROOT_TNamed
00020 #include "TNamed.h"
00021 #endif
00022 
00023 #include "Rtypes.h"
00024 #include "RooDataSet.h"
00025 
00026 
00027 #include <vector>
00028 
00029 
00030 namespace RooStats {
00031 
00032  class SamplingDistribution : public TNamed {
00033 
00034    public:
00035 
00036     // Constructor for SamplingDistribution
00037     SamplingDistribution(const char *name,const char *title, std::vector<Double_t>& samplingDist, const char * varName = 0);
00038     SamplingDistribution(const char *name,const char *title,
00039                          std::vector<Double_t>& samplingDist, std::vector<Double_t>& sampleWeights, const char * varName = 0);
00040 
00041 
00042     SamplingDistribution(const char *name,const char *title, const char * varName = 0);
00043 
00044     SamplingDistribution(const char *name,const char *title, RooDataSet& dataSet, const char * varName = 0);
00045 
00046     // Default constructor for SamplingDistribution
00047     SamplingDistribution();
00048     
00049     // Destructor of SamplingDistribution
00050     virtual ~SamplingDistribution();
00051     
00052     // get the inverse of the Cumulative distribution function
00053     Double_t InverseCDF(Double_t pvalue);
00054 
00055     // get the inverse of the Cumulative distribution function
00056     Double_t InverseCDFInterpolate(Double_t pvalue);
00057 
00058     // get the inverse of the Cumulative distribution function
00059     // together with the inverse based on sampling variation
00060     Double_t InverseCDF(Double_t pvalue, Double_t sigmaVariaton, Double_t& inverseVariation);
00061   
00062     // merge two sampling distributions
00063     void Add(const SamplingDistribution* other);
00064     
00065     // size of samples
00066     Int_t GetSize() const{return fSamplingDist.size();}
00067 
00068     // Get test statistics values
00069     const std::vector<Double_t> & GetSamplingDistribution() const {return fSamplingDist;}
00070     // Get the sampling weights 
00071     const std::vector<Double_t> & GetSampleWeights() const {return fSampleWeights;}
00072 
00073     const TString GetVarName() const {return fVarName;}
00074     
00075     // numerical integral in these limits
00076     Double_t Integral(Double_t low, Double_t high, Bool_t normalize = kTRUE, Bool_t lowClosed = kTRUE, Bool_t highClosed = kFALSE) const;
00077 
00078     // calculate CDF as a special case of Integral(...) with lower limit equal to -inf
00079     Double_t CDF(Double_t x) const;
00080 
00081   private:
00082     std::vector<Double_t> fSamplingDist; // vector of points for the sampling distribution
00083     std::vector<Double_t> fSampleWeights; // vector of weights for the samples
00084     // store a RooRealVar that this distribution corresponds to?
00085 
00086     TString fVarName;
00087     
00088   protected:
00089     
00090     ClassDef(SamplingDistribution,1)  // Class containing the results of the HybridCalculator
00091   };
00092 }
00093 
00094 #endif

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