63using std::endl, std::list, std::string;
 
  159  std::unique_ptr<RooFormulaVar> cloneVar;
 
  162    cloneVar->attachDataStore(
tds) ;
 
 
  200      ret.remove(*
wgt,
true,
true) ;
 
 
  249  _varsww(
other._varsww),
 
  250  _wgtVar(
other._wgtVar),
 
  251  _extWgtArray(
other._extWgtArray),
 
  252  _extWgtErrLoArray(
other._extWgtErrLoArray),
 
  253  _extWgtErrHiArray(
other._extWgtErrHiArray),
 
  254  _extSumW2Array(
other._extSumW2Array),
 
  255  _curWgt(
other._curWgt),
 
  256  _curWgtErrLo(
other._curWgtErrLo),
 
  257  _curWgtErrHi(
other._curWgtErrHi),
 
  258  _curWgtErr(
other._curWgtErr)
 
 
  270  _wgtVar(
other._wgtVar?weightVar(vars,
other._wgtVar->GetName()):nullptr),
 
  271  _extWgtArray(
other._extWgtArray),
 
  272  _extWgtErrLoArray(
other._extWgtErrLoArray),
 
  273  _extWgtErrHiArray(
other._extWgtErrHiArray),
 
  274  _extSumW2Array(
other._extSumW2Array),
 
  275  _curWgt(
other._curWgt),
 
  276  _curWgtErrLo(
other._curWgtErrLo),
 
  277  _curWgtErrHi(
other._curWgtErrHi),
 
  278  _curWgtErr(
other._curWgtErr)
 
 
  382     if (!
tClone->GetBranch(var->GetName())) {
 
  384        coutE(InputArguments) << 
"Didn't find a branch in Tree '" << 
tClone->GetName() << 
"' to read variable '" 
  385                              << var->GetName() << 
"' from." 
  386                              << 
"\n\tNote: Name the RooFit variable the same as the branch." << std::endl;
 
  390     coutE(InputArguments) << 
"Cannot import data from TTree '" << 
tClone->GetName()
 
  391                           << 
"' because some branches are missing !" << std::endl;
 
  411  for(
Long64_t i=0; i < nevent; ++i) {
 
  428          auto& log = 
coutI(DataHandling);
 
  429          log << 
"RooTreeDataStore::loadValues(" << 
GetName() << 
") Skipping event #" << i << 
" because " << 
destArg->GetName()
 
  430              << 
" cannot accommodate the value ";
 
  438          coutI(DataHandling) << 
"RooTreeDataStore::loadValues(" << 
GetName() << 
") Skipping ..." << std::endl;
 
  453    coutW(DataHandling) << 
"RooTreeDataStore::loadValues(" << 
GetName() << 
") Ignored " << 
numInvalid << 
" out-of-range events" << std::endl ;
 
 
  484  const auto numEntr = 
static_cast<std::size_t
>(
ads->numEntries());
 
  492  std::vector<std::string> ranges;
 
  497  for (
auto i=
nStart; i < nevent ; ++i) {
 
  514    for (
const auto arg : 
_varsww) {
 
  515      allValid = arg->isValid() && (ranges.empty() || std::any_of(ranges.begin(), ranges.end(),
 
  516          [arg](
const std::string& 
range){return arg->inRange(range.c_str());}) );
 
 
  559  if(!
ret) 
return nullptr;
 
  563    for (
auto var : 
_vars) {
 
  564      var->setValueDirty(); 
 
  568      var->setValueDirty(); 
 
  569      var->clearValueDirty();
 
 
  654      throw string(
Form(
"RooDataHist::weightError(%s) error type Auto not allowed here",
GetName())) ;
 
  658      throw string(
Form(
"RooDataHist::weightError(%s) error type Expected not allowed here",
GetName())) ;
 
 
  719    coutE(InputArguments) << 
"RooTreeDataStore::changeObservableName(" << 
GetName() << 
" no observable " << from << 
" in this dataset" << std::endl ;
 
 
  787  auto valHolder = std::unique_ptr<RooAbsArg>{
newVar.createFundamental()}.release();
 
  790    coutE(InputArguments) << 
GetName() << 
"::addColumn: holder argument is not fundamental: \"" 
  791    << 
valHolder->GetName() << 
"\"" << std::endl;
 
 
  845  for (
int i=0 ; i<nevt ; i++) {
 
 
  870  for (
int i=0 ; i<nevt ; i++) {
 
 
  890    for (
int i=0 ; i<nevt ; i++) {
 
  895      carry = (t - 
sum) - 
y;
 
  905    for (
int i=0 ; i<nevt ; i++) {
 
  909      carry = (t - 
sum) - 
y;
 
 
  976      arg->setValueDirty() ;
 
  977      arg->syncCache(nset) ;
 
 
 1004      coutE(InputArguments) << 
"RooTreeDataStore::setArgStatus(" << 
GetName()
 
 1005             << 
") dataset doesn't contain variable " << arg->GetName() << std::endl ;
 
 
 1039  for (
const auto arg : 
_varsww) {
 
 1042      if (arg->getAttribute(
"StoreError")) {
 
 1043   extArg->setAttribute(
"StoreError") ;
 
 1045      if (arg->getAttribute(
"StoreAsymError")) {
 
 1046   extArg->setAttribute(
"StoreAsymError") ;
 
 
 1061    arg->attachToTree(*
_tree) ;
 
 
 1072    arg->attachToTree(*
_tree) ;
 
 
 1093  if (
R__b.IsReading()) {
 
 1114    if (
_tree && parent) {
 
 
 1137  std::replace(title.begin(), title.end(), 
' ', 
'_');
 
 1138  std::replace(title.begin(), title.end(), 
'-', 
'_');
 
 1139  return std::string(
"RooTreeDataStore_") + 
GetName() + 
"_" + title;
 
 
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 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.
 
const_iterator begin() const
 
const_iterator end() const
 
Common abstract base class for objects that represent a value and a "shape" in RooFit.
 
void SetName(const char *name) override
Set the name of the TNamed.
 
TString cleanBranchName() const
Construct a mangled name from the actual name that is free of any math symbols that might be interpre...
 
virtual void removeAll()
Remove all arguments from our set, deleting them if we own them.
 
RooAbsCollection & assignValueOnly(const RooAbsCollection &other, bool forceIfSizeOne=false)
Sets the value of any argument in our set that also appears in the other set.
 
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.
 
Abstract base class for a data collection.
 
bool _doDirtyProp
Switch do (de)activate dirty state propagation when loading a data point.
 
double getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
 
RooArgSet is a container object that can hold multiple RooAbsArg objects.
 
RooArgSet * snapshot(bool deepCopy=true) const
Use RooAbsCollection::snapshot(), but return as RooArgSet.
 
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 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...
 
const char * c_str() const
 
TTree-backed data storage.
 
void initialize()
One-time initialization common to all constructor forms.
 
double _curWgtErr
Weight of current event.
 
double weightError(RooAbsData::ErrorType etype=RooAbsData::Poisson) const override
 
void resetBuffers() override
 
double _curWgt
Buffer for weights in case a batch of values is requested.
 
void attachCache(const RooAbsArg *newOwner, const RooArgSet &cachedVars) override
Initialize cache of dataset: attach variables of cache ArgSet to the corresponding TTree branches.
 
double _curWgtErrHi
Weight of current event.
 
Int_t numEntries() const override
 
std::string makeTreeName() const
Generate a name for the storage tree from the name and title of this instance.
 
RooArgSet varsNoWeight(const RooArgSet &allVars, const char *wgtName=nullptr)
Utility function for constructors Return RooArgSet that is copy of allVars minus variable matching wg...
 
~RooTreeDataStore() override
Destructor.
 
void createTree(RooStringView name, RooStringView title)
Create TTree object that lives in memory, independent of current location of gDirectory.
 
const double * _extWgtErrHiArray
! External weight array - high error
 
void attachBuffers(const RooArgSet &extObs) override
 
RooAbsDataStore * merge(const RooArgSet &allvars, std::list< RooAbsDataStore * > dstoreList) override
Merge columns of supplied data set(s) with this data set.
 
static Int_t _defTreeBufSize
 
RooArgSet _attachedBuffers
! Currently attached buffers (if different from _varsww)
 
Int_t fill() override
Interface function to TTree::Fill.
 
double sumEntries() const override
 
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
 
bool _defCtor
Object owning cache contents.
 
RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true) override
Add a new column to the data set which holds the pre-calculated values of 'newVar'.
 
double weight() const override
Return the weight of the n-th data point (n='index') in memory.
 
void restoreAlternateBuffers()
 
void loadValues(const TTree *t, const RooFormulaVar *select=nullptr, const char *rangeName=nullptr, Int_t nStart=0, Int_t nStop=2000000000)
Load values from tree 't' into this data collection, optionally selecting events using the RooFormula...
 
void append(RooAbsDataStore &other) override
 
std::span< const double > getWeightBatch(std::size_t first, std::size_t len) const override
Get the weights of the events in the range [first, first+len).
 
const double * _extWgtErrLoArray
! External weight array - low error
 
void checkInit() const override
 
std::unique_ptr< std::vector< double > > _weightBuffer
 
const double * _extSumW2Array
! External sum of weights array
 
void Streamer(TBuffer &) override
Stream an object of class RooTreeDataStore.
 
RooRealVar * weightVar(const RooArgSet &allVars, const char *wgtName=nullptr)
Utility function for constructors Return pointer to weight variable if it is defined.
 
const double * _extWgtArray
! External weight array
 
double _curWgtErrLo
Weight of current event.
 
bool changeObservableName(const char *from, const char *to) override
Change name of internal observable named 'from' into 'to'.
 
void resetCache() override
Remove tree with values of cached observables and clear list of cached observables.
 
void setArgStatus(const RooArgSet &set, bool active) override
Activate or deactivate the branch status of the TTree branch associated with the given set of dataset...
 
void cacheArgs(const RooAbsArg *owner, RooArgSet &varSet, const RooArgSet *nset=nullptr, bool skipZeroWeights=false) override
Cache given RooAbsArgs with this tree: The tree is given direct write access of the args internal cac...
 
virtual const RooArgSet * get() const
 
const RooAbsArg * _cacheOwner
TTree holding the cached function values.
 
RooArgSet _varsww
Was object constructed with default ctor?
 
Buffer base class used for serializing objects.
 
Describe directory structure in memory.
 
void GetObject(const char *namecycle, T *&ptr)
Get an object with proper type checking.
 
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
 
TObject * Clone(const char *newname="") const override
Make a clone of an object using the Streamer facility.
 
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
 
const char * GetName() const override
Returns name of object.
 
const char * GetTitle() const override
Returns title of object.
 
@ kCanDelete
if object in a list can be deleted
 
@ kMustCleanup
if object destructor must call RecursiveRemove()
 
const char * Data() const
 
A TTree represents a columnar dataset.
 
virtual Int_t Fill()
Fill all branches.
 
virtual TBranch * GetBranch(const char *name)
Return pointer to the branch with the given name in this tree or its friends.
 
virtual Int_t FlushBaskets(bool create_cluster=true) const
Write to disk all the basket that have not yet been individually written and create an event cluster ...
 
virtual Int_t GetEntry(Long64_t entry, Int_t getall=0)
Read all branches of entry and return total number of bytes read.
 
TDirectory * GetDirectory() const
 
virtual void SetDirectory(TDirectory *dir)
Change the tree's directory.
 
virtual Long64_t GetEntries() const
 
virtual void Reset(Option_t *option="")
Reset baskets, buffers and entries count in all branches and leaves.
 
virtual Long64_t CopyEntries(TTree *tree, Long64_t nentries=-1, Option_t *option="", bool needCopyAddresses=false)
Copy nentries from given tree to this tree.
 
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
 
static uint64_t sum(uint64_t i)