Logo ROOT  
Reference Guide
RooNameSet.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooNameSet.h,v 1.16 2007/05/11 09:11:30 verkerke Exp $
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#ifndef ROO_NAME_SET
17#define ROO_NAME_SET
18
19#include "TString.h"
20#include "TObject.h"
21#include "RooPrintable.h"
22class RooArgSet ;
23
24class RooNameSet : public TObject, public RooPrintable {
25public:
26
27 // Constructors, assignment etc.
28 RooNameSet();
29 RooNameSet(const RooArgSet& argSet);
30 RooNameSet(const RooNameSet& other) ;
31 virtual TObject* Clone(const char*) const { return new RooNameSet(*this) ; }
32 virtual ~RooNameSet() ;
33
34 void refill(const RooArgSet& argSet) ;
35 RooArgSet* select(const RooArgSet& list) const ;
36 Bool_t operator==(const RooNameSet& other) const;
38 Bool_t operator<(const RooNameSet& other) const ;
39
40 virtual void printName(std::ostream& os) const ;
41 virtual void printTitle(std::ostream& os) const ;
42 virtual void printClassName(std::ostream& os) const ;
43 virtual void printValue(std::ostream& os) const ;
44
45 inline virtual void Print(Option_t *options= 0) const {
47 }
48
49 void setNameList(const char* givenList) ;
50 const char* content() const { return _nameList ? _nameList : ""; }
51
52private:
54 char* _nameList ; //[_len]
55
56protected:
57
58 void extendBuffer(Int_t inc) ;
59 static void strdup(Int_t& dstlen, char* &dstbuf, const char* str);
60
61 ClassDef(RooNameSet,1) // A sterile version of RooArgSet, containing only the names of the contained RooAbsArgs
62};
63
64#endif
int Int_t
Definition: RtypesCore.h:43
bool Bool_t
Definition: RtypesCore.h:61
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooNameSet is a utility class that stores the names the objects in a RooArget.
Definition: RooNameSet.h:24
virtual void printValue(std::ostream &os) const
Print value of nameset, i.e the list of names.
Definition: RooNameSet.cxx:233
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
Definition: RooNameSet.cxx:185
static void strdup(Int_t &dstlen, char *&dstbuf, const char *str)
copy src to dst, keep dstlen up to date, make sure zero length strings do not take memory
Definition: RooNameSet.cxx:45
virtual TObject * Clone(const char *) const
Make a clone of an object using the Streamer facility.
Definition: RooNameSet.h:31
virtual void printTitle(std::ostream &os) const
Print title of nameset.
Definition: RooNameSet.cxx:217
Bool_t operator<(const RooNameSet &other) const
Definition: RooNameSet.cxx:114
void setNameList(const char *givenList)
Definition: RooNameSet.cxx:142
void refill(const RooArgSet &argSet)
Refill internal contents from names in given argSet.
Definition: RooNameSet.cxx:150
virtual void printName(std::ostream &os) const
Print name of nameset.
Definition: RooNameSet.cxx:209
RooNameSet()
Default constructor.
Definition: RooNameSet.cxx:58
const char * content() const
Definition: RooNameSet.h:50
void extendBuffer(Int_t inc)
Definition: RooNameSet.cxx:124
virtual void printClassName(std::ostream &os) const
Print class name of nameset.
Definition: RooNameSet.cxx:225
Int_t _len
Definition: RooNameSet.h:53
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
Definition: RooNameSet.h:45
char * _nameList
Definition: RooNameSet.h:54
RooNameSet & operator=(const RooNameSet &)
Assignment operator.
Definition: RooNameSet.cxx:90
Bool_t operator==(const RooNameSet &other) const
Comparison operator.
Definition: RooNameSet.cxx:103
virtual ~RooNameSet()
Destructor.
Definition: RooNameSet.cxx:82
RooPlotable is a 'mix-in' base class that define the standard RooFit plotting and printing methods.
Definition: RooPrintable.h:25
virtual StyleOption defaultPrintStyle(Option_t *opt) const
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
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,...
Mother of all ROOT objects.
Definition: TObject.h:37