Logo ROOT  
Reference Guide
RooAbsString.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsString.h,v 1.26 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_ABS_STRING
17#define ROO_ABS_STRING
18
19#include "RooAbsArg.h"
20
21class RooArgSet ;
23class TH1F ;
24
25class RooAbsString : public RooAbsArg {
26public:
27
28 // Constructors, assignment etc
29 RooAbsString() ;
30 RooAbsString(const char *name, const char *title, Int_t size=128) ;
31 RooAbsString(const RooAbsString& other, const char* name=0);
32 virtual ~RooAbsString();
33
34 // Return value and unit accessors
35 virtual const char* getVal() const ;
36 Bool_t operator==(const char*) const ;
37 virtual Bool_t operator==(const RooAbsArg& other) ;
38 virtual Bool_t isIdentical(const RooAbsArg& other, Bool_t assumeSameType=kFALSE) ;
39
40 // I/O streaming interface (machine readable)
41 virtual Bool_t readFromStream(std::istream& is, Bool_t compact, Bool_t verbose=kFALSE) ;
42 virtual void writeToStream(std::ostream& os, Bool_t compact) const ;
43
44 // Printing interface (human readable)
45 virtual void printValue(std::ostream& os) const ;
46
47
48 RooAbsArg *createFundamental(const char* newname=0) const;
49
50protected:
51
52 // Function evaluation and error tracing
53 TString traceEval() const ;
54 virtual Bool_t traceEvalHook(const char* value) const ;
55 virtual TString evaluate() const { return "" ; }
56
57 // Internal consistency checking (needed by RooDataSet)
58 virtual Bool_t isValid() const ;
59 virtual Bool_t isValidString(const char*, Bool_t printError=kFALSE) const ;
60
61 virtual void syncCache(const RooArgSet* nset=0) ;
62 void copyCache(const RooAbsArg* source, Bool_t valueOnly=kFALSE, Bool_t setValDiry=kTRUE) ;
63 virtual void attachToTree(TTree& t, Int_t bufSize=32000) ;
65 virtual void fillTreeBranch(TTree& t) ;
66 virtual void setTreeBranchStatus(TTree& t, Bool_t active) ;
67 Int_t _len ; // Length of _value
68 mutable char *_value ; //[_len] Value
69
70 ClassDef(RooAbsString,1) // Abstract string-valued variable
71};
72
73#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:71
RooAbsString is the common abstract base class for objects that represent a string value.
Definition: RooAbsString.h:25
Bool_t operator==(const char *) const
Equality operator comparing with a TString.
TString traceEval() const
Calculate current value of object, with error tracing wrapper.
virtual void setTreeBranchStatus(TTree &t, Bool_t active)
(De)Activate associated tree branch
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach object to a branch of given TTree.
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)
virtual ~RooAbsString()
Destructor.
virtual Bool_t traceEvalHook(const char *value) const
Hook function for trace evaluation.
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream (dummy for now)
void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDiry=kTRUE)
Copy cache of another RooAbsArg to our cache.
virtual void attachToVStore(RooVectorDataStore &)
Definition: RooAbsString.h:64
virtual Bool_t isValid() const
Check if current value is valid.
virtual void printValue(std::ostream &os) const
Print value.
virtual void fillTreeBranch(TTree &t)
Fill tree branch associated with this object.
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
virtual void syncCache(const RooArgSet *nset=0)
Forcibly bring internal cache up-to-date.
virtual TString evaluate() const
Definition: RooAbsString.h:55
virtual Bool_t isValidString(const char *, Bool_t printError=kFALSE) const
Check if given string value is valid.
RooAbsString()
Default constructor.
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooStringVar fundamental object with our properties.
char * _value
Definition: RooAbsString.h:68
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream (dummy for now)
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:28
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
Basic string class.
Definition: TString.h:131
A TTree represents a columnar dataset.
Definition: TTree.h:72