49using std::string, std::vector, std::list;
69 arg->attachToVStore(*
this) ;
107 ret.remove(*
wgt,
true,
true) ;
136 _varsww(
other._varsww),
137 _wgtVar(
other._wgtVar),
138 _sumWeight(
other._sumWeight),
139 _sumWeightCarry(
other._sumWeightCarry),
140 _extWgtArray(
other._extWgtArray),
141 _extWgtErrLoArray(
other._extWgtErrLoArray),
142 _extWgtErrHiArray(
other._extWgtErrHiArray),
143 _extSumW2Array(
other._extSumW2Array),
144 _currentWeightIndex(
other._currentWeightIndex)
168 _wgtVar(weightVar(vars,
other._wgtVar?
other._wgtVar->GetName():nullptr))
170 for (
const auto arg :
_varsww) {
171 arg->attachToVStore(*
this) ;
178 for (
Int_t i=0 ; i<
other.numEntries() ; i++) {
193 _wgtVar(
other._wgtVar?weightVar(vars,
other._wgtVar->GetName()):nullptr),
194 _sumWeight(
other._sumWeight),
195 _sumWeightCarry(
other._sumWeightCarry),
196 _extWgtArray(
other._extWgtArray),
197 _extWgtErrLoArray(
other._extWgtErrLoArray),
198 _extWgtErrHiArray(
other._extWgtErrHiArray),
199 _extSumW2Array(
other._extSumW2Array),
200 _currentWeightIndex(
other._currentWeightIndex)
208 real->attachToVStore(*
this) ;
219 real->attachToVStore(*
this) ;
223 vector<CatVector*>::const_iterator
citer =
other._catStoreList.
begin() ;
262 for (
const auto arg :
_varsww) {
263 arg->attachToVStore(*
this) ;
269 std::unique_ptr<RooFormulaVar> cloneVar;
272 cloneVar->attachDataStore(
tds) ;
335 if (
index < 0 ||
static_cast<std::size_t
>(
index) >=
size())
return nullptr;
351 for (
auto var :
_vars) {
352 var->setValueDirty();
411 throw string(
Form(
"RooDataHist::weightError(%s) error type Auto not allowed here",
GetName())) ;
415 throw string(
Form(
"RooDataHist::weightError(%s) error type Expected not allowed here",
GetName())) ;
489 const auto numEntr =
static_cast<std::size_t
>(
ads->numEntries());
510 std::vector<std::string> ranges;
516 for(
auto i=
nStart; i < nevent ; ++i) {
547 allValid &= std::any_of(ranges.begin(), ranges.end(), [arg](
const std::string&
range){
548 return arg->inRange(range.c_str());});
603 auto valHolder = std::unique_ptr<RooAbsArg>{
newVar.createFundamental()}.release();
606 coutE(InputArguments) <<
GetName() <<
"::addColumn: holder argument is not fundamental: \""
607 <<
valHolder->GetName() <<
"\"" << std::endl;
635 for (std::size_t i=0; i <
numEvt; i++) {
641 if (
rv)
rv->write(i) ;
642 if (
cv)
cv->write(i) ;
660 const auto nevt =
dstoreList.front()->numEntries();
662 for (
int i=0 ; i<nevt ; i++) {
701 for (
int i=0 ; i<nevt ; i++) {
740 extArg->attachToVStore(*
this) ;
752 arg->attachToVStore(*
this);
762 std::cout <<
"RooVectorDataStor::dump()" << std::endl ;
764 std::cout <<
"_varsww = " << std::endl ;
_varsww.
Print(
"v") ;
765 std::cout <<
"realVector list is" << std::endl ;
768 std::cout <<
"RealVector " <<
elm <<
" _nativeReal = " <<
elm->_nativeReal <<
" = " <<
elm->_nativeReal->GetName() <<
" bufptr = " <<
elm->_buf << std::endl ;
769 std::cout <<
" values : " ;
772 std::cout <<
elm->_vec[i] <<
" " ;
774 std::cout << std::endl ;
778 std::cout <<
"RealFullVector " <<
elm <<
" _nativeReal = " <<
elm->_nativeReal <<
" = " <<
elm->_nativeReal->GetName()
779 <<
" bufptr = " <<
elm->_buf <<
" errbufptr = " <<
elm->bufE() << std::endl ;
781 std::cout <<
" values : " ;
784 std::cout <<
elm->_vec[i] <<
" " ;
786 std::cout << std::endl ;
788 std::cout <<
" errors : " ;
790 std::cout <<
elm->dataE()[i] <<
" " ;
792 std::cout << std::endl ;
804 if (
R__b.IsReading()) {
835 auto span =
realVec->getRange(first, first +
len);
839 coutE(DataHandling) <<
"A batch of data for '" <<
realVec->_nativeReal->GetName()
840 <<
"' was requested from " << first <<
" to " << first+
len
841 <<
", but only the events [" << first <<
", " << first +
size <<
") are available." << std::endl;
865 auto span =
catVec->getRange(first, first +
len);
869 coutE(DataHandling) <<
"A batch of data for '" <<
catVec->_cat->GetName()
870 <<
"' was requested from " << first <<
" to " << first+
len
871 <<
", but only the events [" << first <<
", " << first +
size <<
") are available." << std::endl;
901 return (*storageIter)->getRange(first, first +
len);
905 return (*fstorageIter)->getRange(first, first +
len);
907 throw std::logic_error(
"RooVectorDataStore::getWeightBatch(): Could not retrieve data for _wgtVar.");
917 if (std::string(
catVec->bufArg()->GetName())==cat->
GetName()) {
933 if (
realVec->bufArg()->namePtr()==
real->namePtr()) {
940 if (
fullVec->bufArg()->namePtr()==
real->namePtr()) {
957 if (std::string(
fullVec->bufArg()->GetName())==
real->GetName()) {
969 if (std::string(
fullVec->bufArg()->GetName())==
real->GetName()) {
981 if (std::string(
fullVec->bufArg()->GetName())==
real->GetName()) {
993 if (std::string(
fullVec->bufArg()->GetName())==
real->GetName()) {
1000 if (std::string(
realVec->bufArg()->GetName())==
real->GetName()) {
1024 double const*
arr =
nullptr;
1039 if(
arr ==
nullptr) {
1056 out.
reals.emplace_back(
real->_nativeReal->GetName(),
real->_vec.data());
1059 std::string
name =
realf->_nativeReal->GetName();
1066 out.
cats.emplace_back(cat->_cat->GetName(), cat->_vec.data());
int Int_t
Signed integer 4 bytes (int)
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 char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
static KahanSum< T, N > Accumulate(Iterator begin, Iterator end, T initialValue=T{})
Iterate over a range and return an instance of a KahanSum.
const_iterator begin() const
const_iterator end() const
Common abstract base class for objects that represent a value and a "shape" in RooFit.
bool getAttribute(const Text_t *name) const
Check if a named attribute is set. By default, all attributes are unset.
virtual void attachToVStore(RooVectorDataStore &vstore)=0
A space to attach TBranches.
void attachToVStore(RooVectorDataStore &vstore) override
Attach the category index and label to as branches to the given vector store.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void assign(const RooAbsCollection &other) const
Sets the value, cache and constant attribute of any argument in our set that also appears in the othe...
RooAbsArg * find(const char *name) const
Find object with given name in list.
void Print(Option_t *options=nullptr) const override
This method must be overridden when a class wants to print itself.
Abstract base class for a data collection.
bool _doDirtyProp
Switch do (de)activate dirty state propagation when loading a data point.
std::map< RooFit::Detail::DataKey, std::span< const double > > RealSpans
std::map< RooFit::Detail::DataKey, std::span< const RooAbsCategory::value_type > > CategorySpans
Abstract base class for objects that represent a real value and implements functionality common to al...
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
static const RooHistError & instance()
Return a reference to a singleton object that is created the first time this method is called.
Variable that can be changed from the outside.
void setVal(double value) override
Set value of variable to 'value'.
bool hasError(bool allowZero=true) const
bool hasAsymError(bool allowZero=true) const
double getAsymErrorHi() const
double getAsymErrorLo() const
The RooStringView is a wrapper around a C-style string that can also be constructed from a std::strin...
TTree-backed data storage.
Uses std::vector to store data columns.
std::vector< RealFullVector * > _realfStoreList
Int_t numEntries() const override
RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true) override
Add a new column to the data set which holds the pre-calculated values of 'newVar'.
const double * _extWgtErrHiArray
! External weight array - high error
std::span< const double > getWeightBatch(std::size_t first, std::size_t len) const override
Return the weights of all events in the range [first, first+len).
~RooVectorDataStore() override
Destructor.
void resetBuffers() override
RooRealVar * weightVar(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return pointer to weight variable if it is defined.
RooRealVar * _wgtVar
Pointer to weight variable (if set)
std::vector< RealVector * > _realStoreList
CatVector * addCategory(RooAbsCategory *cat)
void loadValues(const RooAbsDataStore *tds, const RooFormulaVar *select=nullptr, const char *rangeName=nullptr, std::size_t nStart=0, std::size_t nStop=std::numeric_limits< std::size_t >::max()) override
RealFullVector * addRealFull(RooAbsReal *real)
double weight() const override
Return the weight of the last-retrieved data point.
RooAbsData::RealSpans getBatches(std::size_t first, std::size_t len) const override
Return batches of the data columns for the requested events.
ULong64_t _currentWeightIndex
bool isFullReal(RooAbsReal *real)
Int_t fill() override
Interface function to TTree::Fill.
const double * _extWgtErrLoArray
! External weight array - low error
void append(RooAbsDataStore &other) override
bool hasError(RooAbsReal *real)
std::vector< CatVector * > _catStoreList
void setAllBuffersNative()
double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const override
Return the error of the current weight.
void attachBuffers(const RooArgSet &extObs) override
ArraysStruct getArrays() const
Exports all arrays in this RooVectorDataStore into a simple datastructure to be used by RooFit intern...
RooAbsData::CategorySpans getCategoryBatches(std::size_t, std::size_t len) const override
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList) override
Merge columns of supplied data set(s) with this data set.
RealVector * addReal(RooAbsReal *real)
bool hasAsymError(RooAbsReal *real)
bool changeObservableName(const char *from, const char *to) override
const double * _extSumW2Array
! External sum of weights array
void recomputeSumWeight()
Trigger a recomputation of the cached weight sums.
std::size_t size() const
Get size of stored dataset.
std::unique_ptr< RooAbsDataStore > reduce(RooStringView name, RooStringView title, const RooArgSet &vars, const RooFormulaVar *cutVar, const char *cutRange, std::size_t nStart, std::size_t nStop) override
virtual const RooArgSet * get() const
const double * _extWgtArray
! External weight array
void Streamer(TBuffer &) override
Stream an object of class RooVectorDataStore.
RooArgSet varsNoWeight(const RooArgSet &allVars, const char *wgtName)
Utility function for constructors Return RooArgSet that is copy of allVars minus variable matching wg...
Buffer base class used for serializing objects.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
const char * GetName() const override
Returns name of object.
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
Output struct for the RooVectorDataStore::getArrays() helper function.
std::vector< ArrayInfo< double > > reals
std::vector< ArrayInfo< RooAbsCategory::value_type > > cats