Logo ROOT   6.08/07
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 
21 class RooArgSet ;
22 class RooVectorDataStore ;
23 class TH1F ;
24 
25 class RooAbsString : public RooAbsArg {
26 public:
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 
50 protected:
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
virtual void setTreeBranchStatus(TTree &t, Bool_t active)
(De)Activate associated tree branch
virtual Bool_t isValidString(const char *, Bool_t printError=kFALSE) const
Check if given string value is valid.
Basic string class.
Definition: TString.h:137
tomato 1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:575
virtual Bool_t readFromStream(std::istream &is, Bool_t compact, Bool_t verbose=kFALSE)
Read object contents from stream (dummy for now)
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
void copyCache(const RooAbsArg *source, Bool_t valueOnly=kFALSE, Bool_t setValDiry=kTRUE)
Copy cache of another RooAbsArg to our cache.
virtual TString evaluate() const
Definition: RooAbsString.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Bool_t isIdentical(const RooAbsArg &other, Bool_t assumeSameType=kFALSE)
RooVectorDataStore is the abstract base class for data collection that use a TTree as internal storag...
virtual void fillTreeBranch(TTree &t)
Fill tree branch associated with this object.
virtual void attachToTree(TTree &t, Int_t bufSize=32000)
Attach object to a branch of given TTree.
char * _value
Definition: RooAbsString.h:68
virtual void syncCache(const RooArgSet *nset=0)
Forcibly bring internal cache up-to-date.
bool verbose
RooAbsString()
Default constructor.
virtual ~RooAbsString()
Destructor.
Bool_t operator==(const char *) const
Equality operator comparing with a TString.
virtual Bool_t traceEvalHook(const char *value) const
Hook function for trace evaluation.
virtual const char * getVal() const
Return value of object. Calculated if dirty, otherwise cached value is returned.
RooAbsString is the common abstract base class for objects that represent a string value...
Definition: RooAbsString.h:25
virtual void writeToStream(std::ostream &os, Bool_t compact) const
Write object contents to stream (dummy for now)
virtual void attachToVStore(RooVectorDataStore &)
Definition: RooAbsString.h:64
A TTree object has a header with a name and a title.
Definition: TTree.h:98
TString traceEval() const
Calculate current value of object, with error tracing wrapper.
RooAbsArg is the common abstract base class for objects that represent a value (of arbitrary type) an...
Definition: RooAbsArg.h:66
virtual void printValue(std::ostream &os) const
Print value.
const Bool_t kTRUE
Definition: Rtypes.h:91
RooAbsArg * createFundamental(const char *newname=0) const
Create a RooStringVar fundamental object with our properties.
virtual Bool_t isValid() const
Check if current value is valid.
char name[80]
Definition: TGX11.cxx:109