Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
DataMap.cxx
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Garima Singh, CERN 2023
5 * Jonas Rembser, CERN 2023
6 *
7 * Copyright (c) 2023, CERN
8 *
9 * Redistribution and use in source and binary forms,
10 * with or without modification, are permitted according to the terms
11 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
12 */
13
15
16#include <RooRealVar.h>
17
18namespace RooFit {
19namespace Detail {
20
22{
23 if (!arg->hasDataToken()) {
24 auto var = static_cast<RooRealVar const *>(arg);
25 return {&var->_value, 1};
26 }
27 std::size_t idx = arg->dataToken();
28 return _dataMap[idx];
29}
30
31
32} // namespace Detail
33} // namespace RooFit
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:74
bool hasDataToken() const
Definition RooAbsArg.h:702
std::size_t dataToken() const
Returns the token for retrieving results in the BatchMode. For internal use only.
Definition RooAbsArg.h:701
double _value
Cache for current value of object.
Definition RooAbsReal.h:509
std::vector< RooSpan< const double > > _dataMap
Definition DataMap.h:116
RooSpan< const double > at(RooAbsArg const *arg, RooAbsArg const *caller=nullptr)
Definition DataMap.cxx:21
RooRealVar represents a variable that can be changed from the outside.
Definition RooRealVar.h:40
A simple container to hold a batch of data values.
Definition RooSpan.h:34
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition Common.h:18