59using std::endl, std::ostream;
90 const RooArgSet& projDeps, RooAbsTestStatistic::Configuration
const& cfg) :
92 _paramSet(
"paramSet",
"Set of parameters",
this),
102 _nEvents{
data.numEntries()},
108 _paramSet.add(*std::unique_ptr<RooArgSet>{
real.getParameters(&
data)});
118 _paramSet(
"paramSet",
"Set of parameters",
this),
122 _rangeName(
other._rangeName),
125 _verbose(
other._verbose),
128 _nEvents{_data->numEntries()},
132 _takeGlobalObservablesFromData{
other._takeGlobalObservablesFromData},
133 _offset(
other._offset),
137 _paramSet.add(
other._paramSet) ;
145RooAbsTestStatistic::~RooAbsTestStatistic()
164double RooAbsTestStatistic::evaluate()
const
183 double y =
gof->getValV();
184 carry +=
gof->getCarry();
186 const double t =
sum +
y;
187 carry = (t -
sum) -
y;
198 const double norm = globalNormalization();
216 const double t =
sum +
y;
217 carry = (t -
sum) -
y;
224 const double norm = globalNormalization();
257 throw std::logic_error(
"this should never happen");
265 const double norm = globalNormalization();
282bool RooAbsTestStatistic::initialize()
284 if (_init)
return false;
325void RooAbsTestStatistic::printCompactTreeHook(ostream& os,
const char*
indent)
329 os <<
indent <<
"RooAbsTestStatistic begin GOF contents" << std::endl ;
330 for (std::size_t i = 0; i <
_gofArray.size(); ++i) {
332 indent2 +=
"[" + std::to_string(i) +
"] ";
335 os <<
indent <<
"RooAbsTestStatistic end GOF contents" << std::endl;
347void RooAbsTestStatistic::constOptimizeTestStatistic(ConstOpCode opcode,
bool doAlsoTrackingOpt)
403 cfg.verbose = _verbose;
405 cfg.takeGlobalObservablesFromData = _takeGlobalObservablesFromData;
413 gof->recursiveRedirectServers(_paramSet);
417 gof->SetName(
Form(
"%s_GOF%d",GetName(),i));
418 gof->SetTitle(
Form(
"%s_GOF%d",GetTitle(),i));
420 ccoutD(Eval) <<
"RooAbsTestStatistic::initMPMode: starting remote server process #" << i << std::endl;
421 _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);
429 coutI(Eval) <<
"RooAbsTestStatistic::initMPMode: started " <<
_nCPU <<
" remote server process." << std::endl;
470 return catName == item->GetName();
475 ccoutI(Fitting) <<
"RooAbsTestStatistic::initSimMode: creating slave calculator #" <<
_gofArray.size() <<
" for state " <<
catName
476 <<
" (" <<
dset->numEntries() <<
" dataset entries)" << std::endl;
489 cfg.verbose = _verbose;
492 cfg.takeGlobalObservablesFromData = _takeGlobalObservablesFromData;
522 coutI(Fitting) <<
"RooAbsTestStatistic::initSimMode: created " <<
_gofArray.size() <<
" slave calculators." << std::endl;
534 if (isOffsetting()) {
535 enableOffsetting(
false);
536 enableOffsetting(
true);
545 if (
indata.canSplitFast()) {
550 }
else if (0 ==
indata.numEntries()) {
560 return strcmp(gof->GetName(), item->GetName()) == 0;
566 coutE(DataHandling) <<
"RooAbsTestStatistic::setData(" << GetName() <<
") ERROR: Cannot find component data for state " <<
gof->GetName() << std::endl;
573 coutF(DataHandling) <<
"RooAbsTestStatistic::setData(" << GetName() <<
") FATAL: setData() is not supported in multi-processor mode" << std::endl;
574 throw std::runtime_error(
"RooAbsTestStatistic::setData is not supported in MPMaster mode");
583void RooAbsTestStatistic::enableOffsetting(
bool flag)
615double 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)