Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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) ;
64  virtual void attachToVStore(RooVectorDataStore&) {}
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