33void assignSpan(std::span<T> &to, std::span<T>
const &from)
38std::map<RooFit::Detail::DataKey, std::span<const double>>
42 std::map<RooFit::Detail::DataKey, std::span<const double>>
dataSpans;
46 auto insert = [&](
const char *key, std::span<const double> span) {
47 const TNamed *namePtr =
nameReg.constPtr((prefix + key).c_str());
51 auto retrieve = [&](
const char *key) {
52 const TNamed *namePtr =
nameReg.constPtr((prefix + key).c_str());
56 std::size_t nEvents =
static_cast<size_t>(
data.numEntries());
58 auto weight =
data.getWeightBatch(0, nEvents,
false);
73 buffer.reserve(nEvents);
75 for (std::size_t i = 0; i < nEvents; ++i) {
78 buffer.push_back(1.0);
82 buffer.push_back(weight[i]);
91 insert(RooFit::Detail::RooNLLVarNew::weightVarName, weight);
92 insert(RooFit::Detail::RooNLLVarNew::weightVarNameSumW2,
weightSumW2);
99 auto binVolumes = dataHist->binVolumes(0,
static_cast<std::size_t
>(
data.numEntries()));
111 for (std::size_t i = 0; i < binVolumes.size(); ++i) {
130 for (
auto const &
item :
data.getBatches(0, nEvents)) {
132 std::span<const double> span{
item.second};
138 for (std::size_t i = 0; i < nEvents; ++i) {
140 buffer.push_back(span[i]);
143 insert(
item.first->GetName(), {buffer.data(), buffer.size()});
148 for (
auto const &
item :
data.getCategoryBatches(0, nEvents)) {
150 std::span<const RooAbsCategory::value_type>
intSpan{
item.second};
156 for (std::size_t i = 0; i < nEvents; ++i) {
158 buffer.push_back(
static_cast<double>(
intSpan[i]));
161 insert(
item.first->GetName(), {buffer.data(), buffer.size()});
169 std::vector<bool> isInRange(nEvents,
false);
184 nEvents = std::accumulate(isInRange.begin(), isInRange.end(), 0);
193 double *buffer =
buffers.top().data();
195 for (std::size_t i = 0; i < isInRange.size(); ++i) {
234std::map<RooFit::Detail::DataKey, std::span<const double>>
239 std::vector<std::pair<std::string, RooAbsData const *>> datasets;
240 std::vector<bool> isBinnedL;
254 datasets.emplace_back(std::string(
"_") +
d->GetName() +
"_",
d.get());
255 isBinnedL.emplace_back(
simComponent->getAttribute(
"BinnedLikelihoodActive"));
259 datasets.emplace_back(
"", &
data);
260 isBinnedL.emplace_back(
false);
263 std::map<RooFit::Detail::DataKey, std::span<const double>>
dataSpans;
278 buffer.reserve(
data.getGlobalObservables()->size());
280 buffer.push_back(arg->getVal());
297std::map<RooFit::Detail::DataKey, std::size_t>
301 std::map<RooFit::Detail::DataKey, std::size_t>
output;
310 if (inputSize != -1) {
316 std::size_t
size = 1;
320 if (!arg->isReducerNode()) {
322 if (
server->isValueServer(*arg)) {
324 if (inputSize != 1) {
ROOT::RRangeCast< T, true, Range_t > dynamic_range_cast(Range_t &&coll)
ROOT::RRangeCast< T, false, Range_t > static_range_cast(Range_t &&coll)
static void retrieve(const gsl_integration_workspace *workspace, double *a, double *b, double *r, double *e)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
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 that may appear on the left hand side of ...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Container class to hold N-dimensional binned data.
static RooNameReg & instance()
Return reference to singleton instance.
Variable that can be changed from the outside.
Facilitates simultaneous fitting of multiple PDFs to subsets of a given dataset.
The TNamed class is the base class for all named ROOT classes.
CoordSystem::Scalar get(DisplacementVector2D< CoordSystem, Tag > const &p)
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
std::string getRangeNameForSimComponent(std::string const &rangeName, bool splitRange, std::string const &catName)
void getSortedComputationGraph(RooAbsArg const &func, RooArgSet &out)