Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsDataStore.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16
17/**
18\file RooAbsDataStore.cxx
19\class RooAbsDataStore
20\ingroup Roofitcore
21
22RooAbsDataStore is the abstract base class for data collection that
23use a TTree as internal storage mechanism
24**/
25
26#include "RooAbsDataStore.h"
27
28#include "TClass.h"
29
30
31////////////////////////////////////////////////////////////////////////////////
32/// Print class name of dataset
33void RooAbsDataStore::printClassName(std::ostream& os) const { os << ClassName() ; }
34
35
36////////////////////////////////////////////////////////////////////////////////
37/// Print argument of dataset, i.e. the observable names
38void RooAbsDataStore::printArgs(std::ostream& os) const { _vars.printValue(os); }
39
40
41////////////////////////////////////////////////////////////////////////////////
42/// Detailed printing interface
43void RooAbsDataStore::printMultiline(std::ostream& os, Int_t /*content*/, bool verbose, TString indent) const
44{
45 os << indent << "DataStore " << GetName() << " (" << GetTitle() << ")" << std::endl ;
46 os << indent << " Contains " << numEntries() << " entries" << std::endl;
47
48 if (!verbose) {
49 os << indent << " Observables " << _vars << std::endl ;
50 } else {
51 os << indent << " Observables: " << std::endl ;
53 }
54
55 if(verbose && !_cachedVars.empty()) {
56 os << indent << " Caches " << _cachedVars << std::endl ;
57 }
58}
59
60
62{
63 auto * holderSet = new RooArgSet{};
64 for(RooAbsArg * var : varList) {
65 holderSet->add(*addColumn(*var));
66 }
67 return holderSet;
68}
static void indent(ostringstream &buf, int indent_level)
RooAbsArg is the common abstract base class for objects that represent a value and a "shape" in RooFi...
Definition RooAbsArg.h:74
void printValue(std::ostream &os) const override
Print value of collection, i.e.
virtual bool add(const RooAbsArg &var, bool silent=false)
Add the specified argument to list.
void printArgs(std::ostream &os) const override
Print argument of dataset, i.e. the observable names.
RooArgSet * addColumns(const RooArgList &varList)
virtual RooAbsArg * addColumn(RooAbsArg &var, bool adjustRange=true)=0
void printMultiline(std::ostream &os, Int_t content, bool verbose, TString indent) const override
Detailed printing interface.
virtual Int_t numEntries() const =0
void printClassName(std::ostream &os) const override
Print class name of dataset.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer,...
const char * GetName() const override
Returns name of object.
Definition TNamed.h:47
const char * GetTitle() const override
Returns title of object.
Definition TNamed.h:48
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Definition TObject.cxx:207
Basic string class.
Definition TString.h:139