61 _chi2 = std::make_unique<RooRealVar>(
"chi2",
"chi^2", 0);
62 _ndof = std::make_unique<RooRealVar>(
"ndof",
"number of degrees of freedom", 0);
63 _chi2red = std::make_unique<RooRealVar>(
"chi2red",
"reduced chi^2", 0);
64 _prob = std::make_unique<RooRealVar>(
"prob",
"prob(chi2,ndof)", 0);
67 _data = std::make_unique<RooDataSet>(
"Chi2Data",
"Additional data for Chi2 study",
98 std::unique_ptr<RooDataHist> binnedDataOwned;
101 binnedDataOwned = std::unique_ptr<RooDataHist>{
static_cast<RooDataSet*
>(
data)->binnedClone()};
102 binnedData = binnedDataOwned.
get();
109 _chi2->setVal(chi2Var->getVal()) ;
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
Abstract base class for binned and unbinned datasets.
virtual Int_t numEntries() const
Return number of entries in dataset, i.e., count unweighted entries.
Base class for add-on modules to RooMCStudy that can perform additional calculations on each generate...
bool extendedGen()
If true extended mode generation is requested.
RooAbsData * genSample()
Return generate sample.
RooAbsPdf * fitModel()
Return fit model.
RooArgSet * fitParams()
Return current value of parameters of fit model.
virtual RooFit::OwningPtr< RooAbsReal > createChi2(RooDataHist &data, const RooLinkedList &cmdList)
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * selectByAttrib(const char *name, bool value) const
Use RooAbsCollection::selectByAttrib(), but return as RooArgSet.
RooChi2MCSModule is an add-on module to RooMCStudy that calculates the chi-squared of fitted p....
~RooChi2MCSModule() override
Destructor.
std::unique_ptr< RooRealVar > _prob
bool processAfterFit(Int_t) override
Bin dataset and calculate chi2 of p.d.f w.r.t binned dataset.
std::unique_ptr< RooRealVar > _ndof
bool initializeRun(Int_t) override
Initialize module at beginning of RooCMStudy run.
std::unique_ptr< RooDataSet > _data
std::unique_ptr< RooRealVar > _chi2
bool initializeInstance() override
Initialize module after attachment to RooMCStudy object.
RooDataSet * finalizeRun() override
Return auxiliary dataset with results of chi2 analysis calculations of this module so that it is merg...
std::unique_ptr< RooRealVar > _chi2red
Container class to hold N-dimensional binned data.
const RooArgSet * get() const override
Get bin centre of current bin.
Container class to hold unbinned data.
const RooArgSet * get(Int_t index) const override
Return RooArgSet with coordinates of event 'index'.
RooCmdArg DataError(Int_t)
RooCmdArg Extended(bool flag=true)
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...