# class RooNonCentralChiSquare: public RooAbsPdf

```

```
The PDF of the Non-Central Chi Square distribution for n degrees of freedom. It is the asymptotic distribution of the profile likeihood ratio test q_mu when a different mu' is true. It is Wald's generalization of Wilks' Theorem. See: Asymptotic formulae for likelihood-based tests of new physics By Glen Cowan, Kyle Cranmer, Eilam Gross, Ofer Vitells http://arXiv.org/abs/arXiv:1007.1727 Wikipedia: http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution#Approximation It requires MathMore to evaluate for non-integer degrees of freedom, k. When the Mathmore library is available we can use the MathMore libraries impelmented using GSL. It makes use of the modified Bessel function of the first kind (for k > 2). For k < 2 it uses the hypergeometric function 0F1. When is not available we use explicit summation of normal chi-squared distributions The usage of the sum can be forced by calling SetForceSum(true); This implementation could be improved. BOOST has a nice implementation: http://live.boost.org/doc/libs/1_42_0/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/nc_chi_squared_dist.html http://wesnoth.repositoryhosting.com/trac/wesnoth_wesnoth/browser/trunk/include/boost/math/distributions/non_central_chi_squared.hpp?rev=6
```
```

## Function Members (Methods)

public:
protected:
 void RooAbsArg::attachToStore(RooAbsDataStore& store) virtual void RooAbsReal::attachToTree(TTree& t, Int_t bufSize = 32000) virtual void RooAbsReal::attachToVStore(RooVectorDataStore& vstore) virtual RooAbsGenContext* RooAbsPdf::autoGenContext(const RooArgSet& vars, const RooDataSet* prototype = 0, const RooArgSet* auxProto = 0, Bool_t verbose = kFALSE, Bool_t autoBinned = kTRUE, const char* binnedTag = "") const virtual RooAbsGenContext* RooAbsPdf::binnedGenContext(const RooArgSet& vars, Bool_t verbose = kFALSE) const RooFitResult* RooAbsReal::chi2FitDriver(RooAbsReal& fcn, RooLinkedList& cmdList) TString RooAbsArg::cleanBranchName() const virtual void RooAbsReal::copyCache(const RooAbsArg* source, Bool_t valueOnly = kFALSE, Bool_t setValDirty = kTRUE) RooAbsReal* RooAbsReal::createIntObj(const RooArgSet& iset, const RooArgSet* nset, const RooNumIntConfig* cfg, const char* rangeName) const virtual void TObject::DoError(int level, const char* location, const char* fmt, va_list va) const virtual Double_t evaluate() const virtual void RooAbsReal::fillTreeBranch(TTree& t) void RooAbsReal::findInnerMostIntegration(const RooArgSet& allObs, RooArgSet& innerObs, const char* rangeName) const virtual RooAbsGenContext* RooAbsPdf::genContext(const RooArgSet& vars, const RooDataSet* prototype = 0, const RooArgSet* auxProto = 0, Bool_t verbose = kFALSE) const RooDataSet* RooAbsPdf::generate(RooAbsGenContext& context, const RooArgSet& whatVars, const RooDataSet* prototype, Double_t nEvents, Bool_t verbose, Bool_t randProtoOrder, Bool_t resampleProto, Bool_t skipInit = kFALSE, Bool_t extended = kFALSE) const virtual void RooAbsArg::getObservablesHook(const RooArgSet*, RooArgSet*) const virtual void RooAbsArg::getParametersHook(const RooArgSet*, RooArgSet*, Bool_t) const RooAbsProxy* RooAbsArg::getProxy(Int_t index) const static void RooAbsReal::globalSelectComp(Bool_t flag) void RooAbsArg::graphVizAddConnections(set >&) Bool_t RooAbsArg::inhibitDirty() const TString RooAbsReal::integralNameSuffix(const RooArgSet& iset, const RooArgSet* nset = 0, const char* rangeName = 0, Bool_t omitEmpty = kFALSE) const Bool_t RooAbsReal::isSelectedComp() const virtual Bool_t RooAbsReal::isValid() const virtual Bool_t RooAbsReal::isValidReal(Double_t value, Bool_t printError = kFALSE) const void RooAbsReal::makeProjectionSet(const RooAbsArg* plotVar, const RooArgSet* allVars, RooArgSet& projectedVars, Bool_t silent) const void TObject::MakeZombie() Bool_t RooAbsReal::matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps, const RooArgProxy& a) const Bool_t RooAbsReal::matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps, const RooArgSet& set) const Bool_t RooAbsReal::matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps, const RooArgProxy& a, const RooArgProxy& b) const Bool_t RooAbsReal::matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps, const RooArgProxy& a, const RooArgProxy& b, const RooArgProxy& c) const Bool_t RooAbsReal::matchArgs(const RooArgSet& allDeps, RooArgSet& numDeps, const RooArgProxy& a, const RooArgProxy& b, const RooArgProxy& c, const RooArgProxy& d) const Int_t RooAbsArg::numProxies() const virtual void RooAbsArg::operModeHook() virtual void RooAbsArg::optimizeDirtyHook(const RooArgSet*) virtual RooPlot* RooAbsPdf::paramOn(RooPlot* frame, const RooArgSet& params, Bool_t showConstants = kFALSE, const char* label = "", Int_t sigDigits = 2, Option_t* options = "NELU", Double_t xmin = 0.65000000000000002, Double_t xmax = 0.98999999999999999, Double_t ymax = 0.94999999999999996, const RooCmdArg* formatCmd = 0) virtual RooPlot* RooAbsReal::plotAsymOn(RooPlot* frame, const RooAbsCategoryLValue& asymCat, RooAbsReal::PlotOpt o) const virtual RooPlot* RooAbsPdf::plotOn(RooPlot* frame, RooAbsReal::PlotOpt o) const void RooAbsReal::plotOnCompSelect(RooArgSet* selNodes) const RooPlot* RooAbsReal::plotOnWithErrorBand(RooPlot* frame, const RooFitResult& fr, Double_t Z, const RooArgSet* params, const RooLinkedList& argList, Bool_t method1) const Bool_t RooAbsReal::plotSanityChecks(RooPlot* frame) const void RooAbsArg::printAttribList(ostream& os) const static void RooAbsPdf::raiseEvalError() Int_t* RooAbsPdf::randomizeProtoOrder(Int_t nProto, Int_t nGen, Bool_t resample = kFALSE) const virtual Bool_t RooAbsPdf::redirectServersHook(const RooAbsCollection&, Bool_t, Bool_t, Bool_t) void RooAbsArg::registerProxy(RooArgProxy& proxy) void RooAbsArg::registerProxy(RooSetProxy& proxy) void RooAbsArg::registerProxy(RooListProxy& proxy) void RooAbsReal::selectComp(Bool_t flag) virtual void RooAbsReal::selectNormalization(const RooArgSet* depSet = 0, Bool_t force = kFALSE) virtual void RooAbsReal::selectNormalizationRange(const char* rangeName = 0, Bool_t force = kFALSE) void RooAbsArg::setProxyNormSet(const RooArgSet* nset) void RooAbsArg::setShapeDirty(const RooAbsArg* source) const virtual void RooAbsReal::setTreeBranchStatus(TTree& t, Bool_t active) void RooAbsArg::setValueDirty(const RooAbsArg* source) const virtual void RooAbsReal::syncCache(const RooArgSet* set = 0) virtual Bool_t RooAbsPdf::syncNormalization(const RooArgSet* dset, Bool_t adjustProxies = kTRUE) const Double_t RooAbsReal::traceEval(const RooArgSet* set) const void RooAbsArg::unRegisterProxy(RooArgProxy& proxy) void RooAbsArg::unRegisterProxy(RooSetProxy& proxy) void RooAbsArg::unRegisterProxy(RooListProxy& proxy)

## Data Members

public:
 static RooAbsArg::OperMode RooAbsArg::AClean static RooAbsArg::OperMode RooAbsArg::ADirty static RooAbsArg::ConstOpCode RooAbsArg::Activate static RooAbsArg::CacheMode RooAbsArg::Always static RooAbsArg::OperMode RooAbsArg::Auto static RooAbsPdf::ExtendMode RooAbsPdf::CanBeExtended static RooAbsPdf::ExtendMode RooAbsPdf::CanNotBeExtended static RooAbsReal::ErrorLoggingMode RooAbsReal::CollectErrors static RooAbsArg::ConstOpCode RooAbsArg::ConfigChange static RooAbsReal::ErrorLoggingMode RooAbsReal::CountErrors static RooAbsArg::ConstOpCode RooAbsArg::DeActivate static RooAbsReal::ErrorLoggingMode RooAbsReal::Ignore static RooAbsPdf::ExtendMode RooAbsPdf::MustBeExtended static RooAbsArg::CacheMode RooAbsArg::Never static RooAbsArg::CacheMode RooAbsArg::NotAdvised static RooAbsReal::ScaleType RooAbsReal::NumEvent static RooAbsReal::ErrorLoggingMode RooAbsReal::PrintErrors static RooAbsReal::ScaleType RooAbsReal::Raw static RooAbsReal::ScaleType RooAbsReal::Relative static RooAbsReal::ScaleType RooAbsReal::RelativeExpected static RooAbsArg::ConstOpCode RooAbsArg::ValueChange static map RooAbsArg::_ioEvoList temporary holding list for proxies needed in schema evolution static stack RooAbsArg::_ioReadStack reading stack static const UInt_t RooAbsArg::fnv1a32start static const ULong64_t RooAbsArg::fnv1a64start static RooPrintable::ContentsOption RooPrintable::kAddress static RooPrintable::ContentsOption RooPrintable::kArgs static TObject::(anonymous) TObject::kBitMask static TObject::EStatusBits TObject::kCanDelete static TObject::EStatusBits TObject::kCannotPick static RooPrintable::ContentsOption RooPrintable::kClassName static RooPrintable::ContentsOption RooPrintable::kCollectionHeader static RooPrintable::ContentsOption RooPrintable::kExtras static TObject::EStatusBits TObject::kHasUUID static RooPrintable::StyleOption RooPrintable::kInline static TObject::EStatusBits TObject::kInvalidObject static TObject::(anonymous) TObject::kIsOnHeap static TObject::EStatusBits TObject::kIsReferenced static TObject::EStatusBits TObject::kMustCleanup static RooPrintable::ContentsOption RooPrintable::kName static TObject::EStatusBits TObject::kNoContextMenu static TObject::(anonymous) TObject::kNotDeleted static TObject::EStatusBits TObject::kObjInCanvas static TObject::(anonymous) TObject::kOverwrite static TObject::(anonymous) TObject::kSingleKey static RooPrintable::StyleOption RooPrintable::kSingleLine static RooPrintable::StyleOption RooPrintable::kStandard static RooPrintable::ContentsOption RooPrintable::kTitle static RooPrintable::StyleOption RooPrintable::kTreeStructure static RooPrintable::ContentsOption RooPrintable::kValue static RooPrintable::StyleOption RooPrintable::kVerbose static TObject::(anonymous) TObject::kWriteDelete static TObject::(anonymous) TObject::kZombie
protected:
 set RooAbsArg::_boolAttrib Boolean attributes set RooAbsArg::_boolAttribTransient ! Transient boolean attributes (not copied in ctor) Bool_t RooAbsReal::_boolValue ! Transient cache for bool values from tree branches UChar_t RooAbsReal::_byteValue ! Transient cache for byte values from tree branches static Bool_t RooAbsReal::_cacheCheck If true, always validate contents of clean which outcome of evaluate() deque RooAbsArg::_cacheList list of caches RooRefCountList RooAbsArg::_clientList list of client objects RooRefCountList RooAbsArg::_clientListShape subset of clients that requested shape dirty flag propagation RooRefCountList RooAbsArg::_clientListValue subset of clients that requested value dirty flag propagation TIterator* RooAbsArg::_clientShapeIter ! Iterator over _clientListShape TIterator* RooAbsArg::_clientValueIter ! Iterator over _clientListValue Bool_t RooAbsArg::_deleteWatch ! Delete watch flag RooExpensiveObjectCache* RooAbsArg::_eocache Pointer to global cache manager for any expensive components created by this object Int_t RooAbsPdf::_errorCount Number of errors remaining to print static Bool_t RooAbsPdf::_evalError Bool_t RooAbsArg::_fast Allow fast access mode in getVal() and proxies Float_t RooAbsReal::_floatValue ! Transient cache for floating point values from tree branches Bool_t RooAbsReal::_forceNumInt Force numerical integration if flag set static Bool_t RooAbsReal::_globalSelectComp Global activation switch for component selection static Bool_t RooAbsReal::_hideOffset Offset hiding flag static Bool_t RooAbsArg::_inhibitDirty Static flag controlling global inhibit of dirty state propagation Int_t RooAbsReal::_intValue ! Transient cache for integer values from tree branches Bool_t RooAbsArg::_isConstant ! Cached isConstant status TString RooAbsReal::_label Plot label for objects value RooArgSet* RooAbsReal::_lastNSet ! Bool_t RooAbsArg::_localNoInhibitDirty ! Prevent 'AlwaysDirty' mode for this node static Int_t RooPrintable::_nameLength TNamed* RooAbsArg::_namePtr ! Do not persist. Pointer to global instance of string that matches object named Int_t RooAbsPdf::_negCount Number of negative probablities remaining to print RooAbsReal* RooAbsPdf::_norm ! Normalization integral (owned by _normMgr) RooObjCacheManager RooAbsPdf::_normMgr The cache manager TString RooAbsPdf::_normRange Normalization range static TString RooAbsPdf::_normRangeOverride RooArgSet* RooAbsPdf::_normSet ! Normalization set with for above integral RooAbsArg::OperMode RooAbsArg::_operMode Dirty state propagation mode RooArgSet* RooAbsArg::_ownedComponents ! Set of owned component Int_t RooAbsReal::_plotBins Number of plot bins Double_t RooAbsReal::_plotMax Maximum of plot range Double_t RooAbsReal::_plotMin Minimum of plot range Bool_t RooAbsArg::_prohibitServerRedirect ! Prohibit server redirects -- Debugging tool RooRefArray RooAbsArg::_proxyList list of proxies Double_t RooAbsPdf::_rawValue Char_t RooAbsReal::_sbyteValue ! Transient cache for signed byte values from tree branches Bool_t RooAbsPdf::_selectComp Component selection flag for RooAbsPdf::plotCompOn Bool_t RooAbsReal::_selectComp ! Component selection flag for RooAbsPdf::plotCompOn RooRefCountList RooAbsArg::_serverList list of server objects Bool_t RooAbsArg::_shapeDirty Flag set if value needs recalculating because input shapes modified RooNumGenConfig* RooAbsPdf::_specGeneratorConfig ! MC generator configuration specific for this object RooNumIntConfig* RooAbsReal::_specIntegratorConfig Numeric integrator configuration specific for this object map RooAbsArg::_stringAttrib String attributes Int_t RooAbsPdf::_traceCount Number of traces remaining to print Bool_t RooAbsReal::_treeVar !do not persist UInt_t RooAbsReal::_uintValue ! Transient cache for unsigned integer values from tree branches TString RooAbsReal::_unit Unit for objects value Double_t RooAbsReal::_value Cache for current value of object Bool_t RooAbsArg::_valueDirty Flag set if value needs recalculating because input values modified static Bool_t RooAbsArg::_verboseDirty Static flag controlling verbose messaging for dirty state changes static Int_t RooAbsPdf::_verboseEval Double_t fErrorTol Bool_t fForceSum Bool_t fHasIssuedConvWarning Bool_t fHasIssuedSumWarning Int_t fMaxIters TString TNamed::fName object identifier TString TNamed::fTitle object title RooRealProxy k RooRealProxy lambda RooRealProxy x

## Function documentation

RooNonCentralChiSquare(const char* name, const char* title, RooAbsReal& _x, RooAbsReal& _k, RooAbsReal& _lambda)
RooNonCentralChiSquare(const RooNonCentralChiSquare& other, const char* name = 0)
void SetForceSum(Bool_t flag)
Double_t evaluate() const
``` ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE
```
Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName = 0) const
Double_t analyticalIntegral(Int_t code, const char* rangeName = 0) const

`{}`
TObject* clone(const char* newname) const
`{ return new RooNonCentralChiSquare(*this,newname); }`
virtual ~RooNonCentralChiSquare()
`{ }`
void SetErrorTolerance(Double_t t)
`{fErrorTol = t;}`
void SetMaxIters(Int_t mi)
`{fMaxIters = mi;}`