#ifndef ROOT_THaFormula
#define ROOT_THaFormula
#include "TFormula.h"
#include "THaGlobals.h"
#include "RVersion.h"
class THaVarList;
class THaCutList;
class THaVar;
class THaFormula : public TFormula {
public:
static const Option_t* const kPRINTFULL;
static const Option_t* const kPRINTBRIEF;
THaFormula() : TFormula(), fNcodes(0), fVarDef(NULL), fVarList(NULL),
fCutList(NULL), fError(kFALSE), fRegister(kTRUE) {}
THaFormula( const char* name, const char* formula,
const THaVarList* vlst=gHaVars, const THaCutList* clst=gHaCuts );
THaFormula( const THaFormula& rhs );
THaFormula& operator=( const THaFormula& rhs );
virtual ~THaFormula();
virtual Int_t Compile( const char* expression="" );
virtual char* DefinedString( Int_t i );
virtual Double_t DefinedValue( Int_t i );
#if ROOT_VERSION_CODE >= 262144 // 4.00/00
virtual Int_t DefinedVariable( TString& variable, Int_t& action );
#else
virtual Int_t DefinedVariable( TString& variable );
#endif
virtual Int_t DefinedCut( const TString& variable );
virtual Int_t DefinedGlobalVariable( const TString& variable );
virtual Double_t Eval();
#if ROOT_VERSION_CODE > 262660 // 4.02/04 Dumb rootcint chokes on ROOT_VERSION macro
virtual Double_t Eval( Double_t , Double_t =0.0,
Double_t =0.0, Double_t =0.0 ) const
{ return const_cast<THaFormula*>(this)->Eval(); }
#else
#if ROOT_VERSION_CODE >= 197632 // 3.04/00
virtual Double_t Eval( Double_t , Double_t =0.0,
Double_t =0.0, Double_t =0.0 )
#else
virtual Double_t Eval( Double_t , Double_t =0.0,
Double_t =0.0 )
#endif
{ return Eval(); }
#endif
Bool_t IsError() const { return fError; }
#if ROOT_VERSION_CODE >= 197895 // 3.05/07
#if ROOT_VERSION_CODE >= 331776 // 5.16/00
virtual TString GetExpFormula( Option_t* opt="" ) const;
#else
virtual TString GetExpFormula() const;
#endif
#endif
virtual void Print( Option_t* option="" ) const;
void SetList( const THaVarList* lst ) { fVarList = lst; }
void SetCutList( const THaCutList* lst ) { fCutList = lst; }
protected:
enum { kMAXCODES = kMAXFOUND };
enum EVariableType { kUndefined, kVariable, kCut, kString };
struct FVarDef_t;
friend struct FVarDef_t;
struct FVarDef_t {
EVariableType type;
const void* code;
Int_t index;
};
Int_t fNcodes;
FVarDef_t* fVarDef;
const THaVarList* fVarList;
const THaCutList* fCutList;
Bool_t fError;
Bool_t fRegister;
virtual Bool_t IsString( Int_t oper ) const;
ClassDef(THaFormula,0)
};
#endif
Last change: Sat Nov 7 21:26:46 2009
Last generated: 2009-11-07 21:26
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.