TTreeFormula
class description - source file - inheritance tree
protected:
void DefineDimensions(Int_t code, Int_t size, Int_t& virt_dim)
void DefineDimensions(Int_t code, TBranchElement* branch, Int_t& virt_dim)
void DefineDimensions(Int_t code, TFormLeafInfo* info, Int_t& virt_dim)
void DefineDimensions(const char* size, Int_t code, Int_t& virt_dim)
Int_t GetRealInstance(Int_t instance, Int_t codeindex)
virtual Double_t GetValueFromMethod(Int_t i, TLeaf* leaf) const
public:
TTreeFormula TTreeFormula()
TTreeFormula TTreeFormula(const char* name, const char* formula, TTree* tree)
TTreeFormula TTreeFormula(TTreeFormula&)
virtual void ~TTreeFormula()
static TClass* Class()
virtual Int_t DefinedVariable(TString& variable)
virtual Double_t EvalInstance(Int_t i = 0)
virtual TLeaf* GetLeaf(Int_t n) const
TFormLeafInfo* GetLeafInfo(Int_t code) const
TMethodCall* GetMethodCall(Int_t code) const
virtual Int_t GetMultiplicity() const
virtual Int_t GetNcodes() const
virtual Int_t GetNdata()
virtual TClass* IsA() const
virtual Bool_t IsInteger(Int_t code = 0) const
virtual Bool_t IsString(Int_t code = 0) const
virtual char* PrintValue(Int_t mode = 0) const
virtual void SetTree(TTree* tree)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
virtual void UpdateFormulaLeaves()
private:
protected:
TTree* fTree ! pointer to Tree
Short_t fCodes[200] List of leaf numbers referenced in formula
Int_t fNdata[200] ! This caches the physical number of element in the leaf or datamember.
Int_t fNcodes Number of leaves referenced in formula
Int_t fMultiplicity Number of array elements in leaves in case of a TClonesArray
Bool_t fMultiVarDim True if one of the variable has 2 variable size dimensions.
Int_t fInstance Instance number for GetValue
Int_t fNindex Size of fIndex
Int_t* fLookupType [fNindex] array indicating how each leaf should be looked-up
TObjArray fLeaves ! List of leaf used in this formula.
TObjArray fDataMembers ! List of leaf data members
TObjArray fMethods ! List of leaf method calls
TObjArray fNames List of TNamed describing leaves
Int_t fNdimensions[200] Number of array dimensions in each leaf
Int_t fFixedSizes[200][5] Physical sizes of lower dimensions for each leaf
Int_t fCumulSizes[200][5] Accumulated sizes of lower dimensions for each leaf after variable dimensions has been calculated
Int_t fUsedSizes[6] Actual size of the dimensions as seen for this entry.
Int_t fCumulUsedSizes[6] Accumulated size of lower dimensions as seen for this entry.
Int_t fVirtUsedSizes[6] Virtual size of lower dimensions as seen for this formula
Int_t fIndexes[200][5] Index of array selected by user for each leaf
TTreeFormula* fVarIndexes[200][5] Pointer to a variable index.
TArrayI* fVarDims[6] List of variable sizes dimensions.
TArrayI* fCumulUsedVarDims fCumulUsedSizes(1) for multi variable dimensions case
public:
static const enum TObject:: kIsCharacter
static const enum TObject:: kDirect
static const enum TObject:: kDataMember
static const enum TObject:: kMethod
TTreeFormula now relies on a variety of TFormLeafInfo classes to handle the
reading of the information. Here is the list of theses classes:
TFormLeafInfo
TFormLeafInfoDirect
TFormLeafInfoClones
TFormLeafInfoPointer
TFormLeafInfoMethod
TFormLeafInfoMultiVarDim
The following method are available from the TFormLeafInfo interface:
AddOffset(Int_t offset, TStreamerElement* element)
GetCounterValue(TLeaf* leaf) : return the size of the array pointed to.
GetObjectAddress(TLeafElement* leaf) : Returns the the location of the object pointed to.
GetMultiplicity() : Returns info on the variability of the number of elements
GetNdata(TLeaf* leaf) : Returns the number of elements
GetNdata() : Used by GetNdata(TLeaf* leaf)
GetValue(TLeaf *leaf, Int_t instance = 0) : Return the value
GetValuePointer(TLeaf *leaf, Int_t instance = 0) : Returns the address of the value
IsString()
ReadValue(char *where, Int_t instance = 0) : Internal function to interpret the location 'where'
Update() : react to the possible loading of a shared library.
TTreeFormula(): TFormula(),fMultiVarDim(kFALSE)
*-*-*-*-*-*-*-*-*-*-*Tree Formula default constructor*-*-*-*-*-*-*-*-*-*
*-* ================================
TTreeFormula(const char *name,const char *expression, TTree *tree)
:TFormula(),fMultiVarDim(kFALSE),fCumulUsedVarDims(0)
*-*-*-*-*-*-*-*-*-*-*Normal Tree Formula constructor*-*-*-*-*-*-*-*-*-*-*
*-* ===============================
~TTreeFormula()
*-*-*-*-*-*-*-*-*-*-*Tree Formula default destructor*-*-*-*-*-*-*-*-*-*-*
*-* =================================
void DefineDimensions(const char *info, Int_t code, Int_t& virt_dim)
This method is used internally to decode the dimensions of the variables
void DefineDimensions(Int_t code, Int_t size, Int_t& virt_dim)
This method is used internally to decode the dimensions of the variables
void DefineDimensions(Int_t code, TFormLeafInfo *leafinfo, Int_t& virt_dim)
This method is used internally to decode the dimensions of the variables
void DefineDimensions(Int_t code, TBranchElement *branch, Int_t& virt_dim)
This method is used internally to decode the dimensions of the variables
Int_t DefinedVariable(TString &name)
*-*-*-*-*-*Check if name is in the list of Tree/Branch leaves*-*-*-*-*
*-* ==================================================
This member function redefines the function in TFormula
If a leaf has a name corresponding to the argument name, then
returns a new code.
A TTreeFormula may contain more than one variable.
For each variable referenced, the pointers to the corresponding
branch and leaf is stored in the object arrays fBranches and fLeaves.
name can be :
- Leaf_Name (simple variable or data member of a ClonesArray)
- Branch_Name.Leaf_Name
- Branch_Name.Method_Name
- Leaf_Name[index]
- Branch_Name.Leaf_Name[index]
- Branch_Name.Leaf_Name[index1]
- Branch_Name.Leaf_Name[][index2]
- Branch_Name.Leaf_Name[index1][index2]
New additions:
- Branch_Name.Leaf_Name[OtherLeaf_Name]
- Branch_Name.Datamember_Name
- '.' can be replaced by '->'
and
- Branch_Name[index1].Leaf_Name[index2]
- Leaf_name[index].Action().OtherAction(param)
- Leaf_name[index].Action()[val].OtherAction(param)
Int_t GetRealInstance(Int_t instance, Int_t codeindex)
Double_t EvalInstance(Int_t instance)
*-*-*-*-*-*-*-*-*-*-*Evaluate this treeformula*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
*-* =========================
TFormLeafInfo* GetLeafInfo(Int_t code) const
*-*-*-*-*-*-*-*Return DataMember corresponding to code*-*-*-*-*-*
*-* =======================================
function called by TLeafObject::GetValue
with the value of fLookupType computed in TTreeFormula::DefinedVariable
TLeaf* GetLeaf(Int_t n) const
*-*-*-*-*-*-*-*Return leaf corresponding to serial number n*-*-*-*-*-*
*-* ============================================
TMethodCall* GetMethodCall(Int_t code) const
*-*-*-*-*-*-*-*Return methodcall corresponding to code*-*-*-*-*-*
*-* =======================================
function called by TLeafObject::GetValue
with the value of fLookupType computed in TTreeFormula::DefinedVariable
Int_t GetNdata()
*-*-*-*-*-*-*-*Return number of data words in the leaf*-*-*-*-*-*-*-*
*-*-*-*-*-*-*-*Changed to Return number of available instances in the formula*-*-*-*-*-*-*-*
*-* =======================================
Double_t GetValueFromMethod(Int_t i, TLeaf *leaf) const
*-*-*-*-*-*-*-*Return result of a leafobject method*-*-*-*-*-*-*-*
*-* ====================================
Bool_t IsInteger(Int_t code) const
return TRUE if the formula corresponds to one single Tree leaf
and this leaf is short, int or unsigned short, int
When a leaf is of type integer, the generated histogram is forced
to have an integer bin width
Bool_t IsString(Int_t code) const
return TRUE if the leaf or data member corresponding to code is a string
char* PrintValue(Int_t mode) const
*-*-*-*-*-*-*-*Return value of variable as a string*-*-*-*-*-*-*-*
*-* ====================================
mode = -2 : Print line with ***
mode = -1 : Print column names
mode = 0 : Print column values
void Streamer(TBuffer &R__b)
Stream an object of class TTreeFormula.
void UpdateFormulaLeaves()
this function is called TTreePlayer::UpdateFormulaLeaves, itself
called by TChain::LoadTree when a new Tree is loaded.
Because Trees in a TChain may have a different list of leaves, one
must update the leaves numbers in the TTreeFormula used by the TreePlayer.
Inline Functions
Int_t GetMultiplicity() const
Int_t GetNcodes() const
void SetTree(TTree* tree)
TClass* Class()
TClass* IsA() const
void ShowMembers(TMemberInspector& insp, char* parent)
void StreamerNVirtual(TBuffer& b)
TTreeFormula TTreeFormula(TTreeFormula&)
Author: Rene Brun 19/01/96
Last update: root/treeplayer:$Name: $:$Id: TTreeFormula.cxx,v 1.62 2001/08/14 06:54:55 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Top of the page
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.