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
22Abstract base class for a data collection.
23**/
24
25#include "RooAbsDataStore.h"
26
27#include "TClass.h"
28
29
30////////////////////////////////////////////////////////////////////////////////
31/// Print class name of dataset
32void RooAbsDataStore::printClassName(std::ostream& os) const { os << ClassName() ; }
33
34
35////////////////////////////////////////////////////////////////////////////////
36/// Print argument of dataset, i.e. the observable names
37void RooAbsDataStore::printArgs(std::ostream& os) const { _vars.printValue(os); }
38
39
40////////////////////////////////////////////////////////////////////////////////
41/// Detailed printing interface
42void RooAbsDataStore::printMultiline(std::ostream& os, Int_t /*content*/, bool verbose, TString indent) const
43{
44 os << indent << "DataStore " << GetName() << " (" << GetTitle() << ")" << std::endl ;
45 os << indent << " Contains " << numEntries() << " entries" << std::endl;
46
47 if (!verbose) {
48 os << indent << " Observables " << _vars << std::endl ;
49 } else {
50 os << indent << " Observables: " << std::endl ;
52 }
53
54 if(verbose && !_cachedVars.empty()) {
55 os << indent << " Caches " << _cachedVars << std::endl ;
56 }
57}
58
59
61{
62 auto * holderSet = new RooArgSet{};
63 for(RooAbsArg * var : varList) {
64 holderSet->add(*addColumn(*var));
65 }
66 return holderSet;
67}
static void indent(ostringstream &buf, int indent_level)
Common abstract base class for objects that represent a value and a "shape" in RooFit.
Definition RooAbsArg.h:77
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