34using std::numeric_limits;
95 if( dataSet.numEntries() == 0 || !dataSet.get()->first() ) {
105 columnName = dataSet.get()->first()->GetName();
116 for(
Int_t i=0; i < dataSet.numEntries(); i++) {
192 std::vector<unsigned int>
index(
n);
196 fSumW = std::vector<double>(
n );
197 fSumW2 = std::vector<double>(
n );
202 for(
unsigned int i=0; i <
n; i++) {
203 unsigned int j =
index[i];
232 error = numeric_limits<double>::infinity();
236 if (
int(
fSumW.size()) !=
n)
279 double norm =
fSumW.back();
289 error = std::sqrt(
sum2);
323 Warning(
"InverseCDF",
"Estimation of Quantiles (InverseCDF) for weighted events is not yet supported");
384 std::cout <<
"problem in SamplingDistribution::InverseCDF" << std::endl;
401 Warning(
"InverseCDFInterpolate",
"Estimation of Quantiles (InverseCDF) for weighted events is not yet supported.");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Container class to hold unbinned data.
static constexpr double infinity()
Return internal infinity representation.
This class simply holds a sampling distribution of some test statistic.
double Integral(double low, double high, bool normalize=true, bool lowClosed=true, bool highClosed=false) const
numerical integral in these limits
double CDF(double x) const
calculate CDF as a special case of Integral(...) with lower limit equal to -inf
~SamplingDistribution() override
Destructor of SamplingDistribution.
std::vector< double > fSumW2
! Cached vector with sum of the weight used to compute integral error
double InverseCDFInterpolate(double pvalue)
get the inverse of the Cumulative distribution function
std::vector< double > fSumW
! Cached vector with sum of the weight used to compute integral
SamplingDistribution()
Default constructor for SamplingDistribution.
std::vector< double > fSamplingDist
vector of points for the sampling distribution
double IntegralAndError(double &error, double low, double high, bool normalize=true, bool lowClosed=true, bool highClosed=false) const
numerical integral in these limits including error estimation
double InverseCDF(double pvalue)
get the inverse of the Cumulative distribution function
void Add(const SamplingDistribution *other)
merge two sampling distributions
const TString GetVarName() const
void SortValues() const
internal function to sort values
std::vector< double > fSampleWeights
vector of weights for the samples
The TNamed class is the base class for all named ROOT classes.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Namespace for the RooStats classes.
void SortItr(Iterator first, Iterator last, IndexIterator index, Bool_t down=kTRUE)
Sort the n1 elements of the Short_t array defined by its iterators.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
Comparing floating points.
static uint64_t sum(uint64_t i)