59using std::endl, std::ostream;
105 const RooArgSet& projDeps, RooAbsTestStatistic::Configuration
const& cfg) :
107 _paramSet(
"paramSet",
"Set of parameters",
this),
117 _nEvents{
data.numEntries()},
123 _paramSet.add(*std::unique_ptr<RooArgSet>{
real.getParameters(&
data)});
133 _paramSet(
"paramSet",
"Set of parameters",
this),
137 _rangeName(
other._rangeName),
140 _verbose(
other._verbose),
144 _nEvents{_data->numEntries()},
148 _takeGlobalObservablesFromData{
other._takeGlobalObservablesFromData},
149 _offset(
other._offset),
153 _paramSet.add(
other._paramSet) ;
161RooAbsTestStatistic::~RooAbsTestStatistic()
180double RooAbsTestStatistic::evaluate()
const
199 double y =
gof->getValV();
200 carry +=
gof->getCarry();
202 const double t =
sum +
y;
203 carry = (t -
sum) -
y;
214 const double norm = globalNormalization();
232 const double t =
sum +
y;
233 carry = (t -
sum) -
y;
240 const double norm = globalNormalization();
273 throw std::logic_error(
"this should never happen");
280 const double norm = globalNormalization();
297bool RooAbsTestStatistic::initialize()
299 if (_init)
return false;
340void RooAbsTestStatistic::printCompactTreeHook(ostream& os,
const char*
indent)
344 os <<
indent <<
"RooAbsTestStatistic begin GOF contents" << std::endl ;
345 for (std::size_t i = 0; i <
_gofArray.size(); ++i) {
347 indent2 +=
"[" + std::to_string(i) +
"] ";
350 os <<
indent <<
"RooAbsTestStatistic end GOF contents" << std::endl;
391 cfg.verbose = _verbose;
393 cfg.takeGlobalObservablesFromData = _takeGlobalObservablesFromData;
401 gof->recursiveRedirectServers(_paramSet);
405 gof->SetName(
Form(
"%s_GOF%d",GetName(),i));
406 gof->SetTitle(
Form(
"%s_GOF%d",GetTitle(),i));
408 ccoutD(Eval) <<
"RooAbsTestStatistic::initMPMode: starting remote server process #" << i << std::endl;
409 _mpfeArray[i] =
new RooRealMPFE(
Form(
"%s_%zx_MPFE%d",GetName(),
reinterpret_cast<size_t>(
this),i),
Form(
"%s_%zx_MPFE%d",GetTitle(),
reinterpret_cast<size_t>(
this),i),*
gof,
false);
417 coutI(Eval) <<
"RooAbsTestStatistic::initMPMode: started " <<
_nCPU <<
" remote server process." << std::endl;
458 return catName == item->GetName();
463 ccoutI(Fitting) <<
"RooAbsTestStatistic::initSimMode: creating slave calculator #" <<
_gofArray.size() <<
" for state " <<
catName
464 <<
" (" <<
dset->numEntries() <<
" dataset entries)" << std::endl;
477 cfg.verbose = _verbose;
480 cfg.takeGlobalObservablesFromData = _takeGlobalObservablesFromData;
510 coutI(Fitting) <<
"RooAbsTestStatistic::initSimMode: created " <<
_gofArray.size() <<
" slave calculators." << std::endl;
522 if (isOffsetting()) {
523 enableOffsetting(
false);
524 enableOffsetting(
true);
533 if (
indata.canSplitFast()) {
538 }
else if (0 ==
indata.numEntries()) {
548 return strcmp(gof->GetName(), item->GetName()) == 0;
554 coutE(DataHandling) <<
"RooAbsTestStatistic::setData(" << GetName() <<
") ERROR: Cannot find component data for state " <<
gof->GetName() << std::endl;
561 coutF(DataHandling) <<
"RooAbsTestStatistic::setData(" << GetName() <<
") FATAL: setData() is not supported in multi-processor mode" << std::endl;
562 throw std::runtime_error(
"RooAbsTestStatistic::setData is not supported in MPMaster mode");
571void RooAbsTestStatistic::enableOffsetting(
bool flag)
603double RooAbsTestStatistic::getCarry()
const
int Int_t
Signed integer 4 bytes (int)
static void indent(ostringstream &buf, int indent_level)
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 data
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
const_iterator begin() const
const_iterator end() const
Abstract base class for objects that represent a discrete value that can be set from the outside,...
Abstract container object that can hold multiple RooAbsArg objects.
Abstract base class for binned and unbinned datasets.
Abstract interface for all probability density functions.
Abstract base class for objects that represent a real value and implements functionality common to al...
bool redirectServersHook(const RooAbsCollection &newServerList, bool mustReplaceAll, bool nameChange, bool isRecursiveStep) override
Function that is called at the end of redirectServers().
RooArgSet is a container object that can hold multiple RooAbsArg objects.
RooArgSet * selectCommon(const RooAbsCollection &refColl) const
Use RooAbsCollection::selecCommon(), but return as RooArgSet.
Object to represent discrete states.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
std::string getRangeNameForSimComponent(std::string const &rangeName, bool splitRange, std::string const &catName)
BinnedLOutput getBinnedL(RooAbsPdf const &pdf)
void initialize(typename Architecture_t::Matrix_t &A, EInitialization m)
static uint64_t sum(uint64_t i)