Logo ROOT   6.10/09
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"
22 class RooArgSet ;
23 
24 class RooNameSet : public TObject, public RooPrintable {
25 public:
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 
52 private:
54  char* _nameList ; //[_len]
55 
56 protected:
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
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:49
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, which is interpreted as an OR of &#39;enum ContentsOptions&#39; values and in the style given by &#39;enum StyleOption&#39;.
virtual void printName(std::ostream &os) const
Print name of nameset.
Definition: RooNameSet.cxx:213
RooNameSet()
Default constructor.
Definition: RooNameSet.cxx:62
const char Option_t
Definition: RtypesCore.h:62
char * _nameList
Definition: RooNameSet.h:54
virtual void printTitle(std::ostream &os) const
Print title of nameset.
Definition: RooNameSet.cxx:221
virtual void printValue(std::ostream &os) const
Print value of nameset, i.e the list of names.
Definition: RooNameSet.cxx:237
void setNameList(const char *givenList)
Definition: RooNameSet.cxx:146
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char * content() const
Definition: RooNameSet.h:50
RooNameSet & operator=(const RooNameSet &)
Assignment operator.
Definition: RooNameSet.cxx:94
#define ClassDef(name, id)
Definition: Rtypes.h:297
RooPlotable is a &#39;mix-in&#39; base class that define the standard RooFit plotting and printing methods...
Definition: RooPrintable.h:25
virtual void printClassName(std::ostream &os) const
Print class name of nameset.
Definition: RooNameSet.cxx:229
void extendBuffer(Int_t inc)
Definition: RooNameSet.cxx:128
virtual ~RooNameSet()
Destructor.
Definition: RooNameSet.cxx:86
RooNameSet is a utility class that stores the names the objects in a RooArget.
Definition: RooNameSet.h:24
Int_t _len
Definition: RooNameSet.h:53
Bool_t operator<(const RooNameSet &other) const
Definition: RooNameSet.cxx:118
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
void refill(const RooArgSet &argSet)
Refill internal contents from names in given argSet.
Definition: RooNameSet.cxx:154
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual StyleOption defaultPrintStyle(Option_t *opt) const
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input &#39;list&#39; whose names match to those in the internal name list...
Definition: RooNameSet.cxx:189
Bool_t operator==(const RooNameSet &other) const
Comparison operator.
Definition: RooNameSet.cxx:107
Mother of all ROOT objects.
Definition: TObject.h:37
virtual TObject * Clone(const char *) const
Make a clone of an object using the Streamer facility.
Definition: RooNameSet.h:31
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
Definition: RooNameSet.h:45