88 fAdaptiveSampling(false),
89 fAdditionalNToysFactor(1.),
90 fSaveBeltToFile(false),
117 oocoutI(f,
Contents) <<
"NeymanConstruction saving ConfidenceBelt to file SamplingDistributions.root" << endl;
118 f =
new TFile(
"SamplingDistributions.root",
"recreate");
129 "points in interval",
158 Double_t upperEdgeOfAcceptance, upperEdgeMinusSigma, upperEdgePlusSigma;
159 Double_t lowerEdgeOfAcceptance, lowerEdgeMinusSigma, lowerEdgePlusSigma;
160 Int_t additionalMC=0;
178 totalMC = (
Int_t) tmc;
188 additionalMC = 2*totalMC;
194 oocoutE((
TObject*)0,
Eval) <<
"Neyman Construction: error generating sampling distribution" << endl;
197 totalMC=samplingDist->
GetSize();
203 upperEdgeOfAcceptance =
205 sigma, upperEdgePlusSigma);
208 sigma, upperEdgeMinusSigma);
211 lowerEdgeOfAcceptance =
213 sigma, lowerEdgePlusSigma);
216 sigma, lowerEdgeMinusSigma);
219 <<
"total MC = " << totalMC
220 <<
" this test stat = " << thisTestStatistic << endl
221 <<
" upper edge -1sigma = " << upperEdgeMinusSigma
222 <<
", upperEdge = "<<upperEdgeOfAcceptance
223 <<
", upper edge +1sigma = " << upperEdgePlusSigma << endl
224 <<
" lower edge -1sigma = " << lowerEdgeMinusSigma
225 <<
", lowerEdge = "<<lowerEdgeOfAcceptance
226 <<
", lower edge +1sigma = " << lowerEdgePlusSigma << endl;
228 (thisTestStatistic <= upperEdgeOfAcceptance &&
229 thisTestStatistic > upperEdgeMinusSigma)
230 || (thisTestStatistic >= upperEdgeOfAcceptance &&
231 thisTestStatistic < upperEdgePlusSigma)
232 || (thisTestStatistic <= lowerEdgeOfAcceptance &&
233 thisTestStatistic > lowerEdgeMinusSigma)
234 || (thisTestStatistic >= lowerEdgeOfAcceptance &&
235 thisTestStatistic < lowerEdgePlusSigma)
236 ) && (totalMC < 100./
fSize)
243 oocoutE((
TObject*)0,
Eval) <<
"Neyman Construction: error generating sampling distribution" << endl;
247 lowerEdgeOfAcceptance =
249 upperEdgeOfAcceptance =
257 lowerEdgeOfAcceptance,
258 upperEdgeOfAcceptance);
265 <<
" total MC = " << samplingDist->
GetSize()
266 <<
" this test stat = " << thisTestStatistic << endl;
271 ooccoutP(samplingDist,
Eval) <<
"[" << lowerEdgeOfAcceptance <<
", " 272 << upperEdgeOfAcceptance <<
"] " <<
" in interval = " <<
273 (thisTestStatistic >= lowerEdgeOfAcceptance && thisTestStatistic <= upperEdgeOfAcceptance)
277 if(thisTestStatistic >= lowerEdgeOfAcceptance && thisTestStatistic <= upperEdgeOfAcceptance) {
280 pointsInInterval->add(*point);
286 samplingDist->
Write();
287 string tmpName =
"hist_";
288 tmpName+=samplingDist->
GetName();
289 TH1F*
h =
new TH1F(tmpName.c_str(),
"",500,0.,5.);
290 for(
int ii=0; ii<samplingDist->
GetSize(); ++ii){
300 oocoutI(pointsInInterval,
Eval) << npass <<
" points in interval" << endl;
virtual const char * GetName() const
Returns name of object.
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
Write this object to the current directory.
virtual Int_t Fill(Double_t x)
Increment bin with abscissa X by 1.
TIterator * createIterator(Bool_t dir=kIterForward) const
const std::vector< Double_t > & GetSamplingDistribution() const
Get test statistics values.
ModelConfig is a simple class that holds configuration information specifying how a model should be u...
virtual void SetParametersForTestStat(const RooArgSet &)=0
virtual const RooArgSet * get() const
TestStatSampler * fTestStatSampler
Double_t getVal(const RooArgSet *set=0) const
virtual PointSetInterval * GetInterval() const
Main interface to get a ConfInterval (will be a PointSetInterval)
THist< 1, float, THistStatContent, THistStatUncertainty > TH1F
Double_t InverseCDF(Double_t pvalue)
get the inverse of the Cumulative distribution function
1-D histogram with a float per channel (see TH1 documentation)}
Short_t Min(Short_t a, Short_t b)
void AddAcceptanceRegion(RooArgSet &, AcceptanceRegion region, Double_t cl=-1., Double_t leftside=-1.)
virtual SamplingDistribution * AppendSamplingDistribution(RooArgSet &allParameters, SamplingDistribution *last, Int_t additionalMC)
Extended interface to append to sampling distribution more samples.
virtual SamplingDistribution * GetSamplingDistribution(RooArgSet ¶msOfInterest)=0
virtual ~NeymanConstruction()
default constructor if(fOwnsWorkspace && fWS) delete fWS; if(fConfBelt) delete fConfBelt; ...
RooAbsData & fData
size of the test (eg. specified rate of Type I error)
RooRealVar represents a fundamental (non-derived) real valued object.
ModelConfig & fModel
data set
Int_t GetSize() const
size of samples
RooAbsData is the common abstract base class for binned and unbinned datasets.
ToyMCSampler is an implementation of the TestStatSampler interface.
RooDataSet is a container class to hold unbinned data.
This class simply holds a sampling distribution of some test statistic.
Namespace for the RooStats classes.
const RooArgSet * GetParametersOfInterest() const
get RooArgSet containing the parameter of interest (return NULL if not existing)
PointSetInterval is a concrete implementation of the ConfInterval interface.
NeymanConstruction is a concrete implementation of the NeymanConstruction interface that...
Mother of all ROOT objects.
virtual Double_t EvaluateTestStatistic(RooAbsData &data, RooArgSet ¶msOfInterest)=0
Double_t fAdditionalNToysFactor
Double_t fLeftSideFraction
virtual Int_t numEntries() const
RooAbsData * fPointsToTest
ConfidenceBelt * fConfBelt