#ifndef ROOT_THaVform
#define ROOT_THaVform
#include "THaFormula.h"
#include "THaOutput.h"
#include "TTree.h"
#include <string>
#include <vector>
#include <iostream>
using namespace std;
class THaVar;
class THaVarList;
class THaCut;
class THaCutList;
class THaVar;
class THaVform : public THaFormula {
public:
THaVform() : THaFormula() {}
THaVform( const char *type, const char* name, const char* formula,
const THaVarList* vlst=gHaVars, const THaCutList* clst=gHaCuts );
virtual ~THaVform();
THaVform(const THaVform& vform);
THaVform& operator=(const THaVform& vform);
Int_t DefinedGlobalVariable( const TString& variable );
void ShortPrint() const;
void LongPrint() const;
Int_t Init();
void ReAttach();
void ErrPrint(Int_t status) const;
Int_t SetOutput(TTree *tree);
Int_t Process();
Double_t GetData(Int_t index = 0) const;
Bool_t IsFormula() const { return (fType == kForm); }
Bool_t IsVarray() const { return (fVarPtr != NULL && fType == kVarArray); }
Bool_t IsCut() const { return (fType == kCut); }
Bool_t IsEye() const { return (fType == kEye); }
Int_t GetSize() const { return fObjSize; };
std::vector<string> GetVars() const;
protected:
enum FTy { kCut = 0, kForm, kEye, kVarArray, kUnknown };
enum FAr { kScaler = 0, kAElem, kFAType, kVAType };
enum FAp { kNoPrefix = 0, kAnd, kOr, kSum };
enum FEr { kOK = 0, kIllVar, kIllTyp, kNoGlo,
kIllMix, kArrZer, kArrSiz, kUnkPre, kIllPre};
Int_t fNvar, fObjSize;
Double_t fData;
FTy fType;
static const Int_t fgDebug = 0;
static const Int_t fgVFORM_HUGE = 10000;
string fgAndStr, fgOrStr, fgSumStr;
Int_t MakeFormula(Int_t flo, Int_t fhi);
string StripPrefix(const char* formula);
string StripBracket(const string& var) const;
void GetForm(Int_t size);
void Create(const THaVform& vf);
void Uncreate();
std::vector<string> fVarName;
std::vector<Int_t> fVarStat;
std::vector<THaFormula*> fFormula;
std::vector<THaCut*> fCut;
std::vector<string> fSarray;
std::vector<string> fVectSform;
string fStitle;
THaVar *fVarPtr;
THaOdata *fOdata;
Int_t fPrefix;
private:
ClassDef(THaVform,0)
};
inline
Double_t THaVform::GetData(Int_t index) const {
if (IsEye())
return (Double_t)index;
if (fOdata == 0)
return fData;
return (fObjSize > 1) ? fOdata->Get(index) : fOdata->Get();
}
#endif
Last change: Sat Nov 7 21:26:56 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.